drag'n'drop-support everywhere

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@38 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2005-12-19 12:17:23 +00:00
parent f700c16c33
commit 5e6a719b7c
51 changed files with 2492 additions and 1534 deletions

View File

@@ -82,6 +82,8 @@ public:
void FASTCALL swapBB( csize _bb1, csize _bb2 );
void updateBBTrack( trackContentObject * _tco );
protected:
virtual void closeEvent( QCloseEvent * _ce );

View File

@@ -101,7 +101,7 @@ public:
bbTrack( trackContainer * _tc );
virtual ~bbTrack();
virtual trackTypes trackType( void ) const;
virtual trackTypes type( void ) const;
virtual bool FASTCALL play( const midiTime & _start,
Uint32 _start_frame, Uint32 _frames,
Uint32 _frame_base,

View File

@@ -48,10 +48,12 @@
#include "settings.h"
#include "types.h"
#include "spc_bg_hndl_widget.h"
#include "sample_buffer.h"
class QPaintEvent;
class QPixmap;
class envelopeTabWidget;
class knob;
class ledCheckBox;
@@ -59,6 +61,7 @@ class pixmapButton;
class tempoSyncKnob;
class envelopeAndLFOWidget : public QWidget, public settings,
public specialBgHandlingWidget
{
@@ -97,8 +100,10 @@ public slots:
protected:
void paintEvent( QPaintEvent * _pe );
void mousePressEvent( QMouseEvent * _me );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
float FASTCALL lfoLevel( Uint32 _frame, Uint32 _frame_offset ) const;
@@ -109,10 +114,14 @@ protected slots:
void lfoTriangleWaveCh( bool );
void lfoSawWaveCh( bool );
void lfoSquareWaveCh( bool );
void lfoUserWaveCh( bool );
void x100Toggled( bool );
private:
static QPixmap * s_envGraph;
static QPixmap * s_lfoGraph;
static Uint32 s_lfoFrame;
bool m_used;
@@ -125,7 +134,6 @@ private:
knob * m_sustainKnob;
knob * m_releaseKnob;
knob * m_amountKnob;
static QPixmap * s_envGraph;
float m_sustainLevel;
float m_amount;
@@ -145,7 +153,7 @@ private:
pixmapButton * m_triangleLfoBtn;
pixmapButton * m_sawLfoBtn;
pixmapButton * m_sqrLfoBtn;
static QPixmap * s_lfoGraph;
pixmapButton * m_usrLfoBtn;
ledCheckBox * m_x100Cb;
ledCheckBox * m_controlEnvAmountCb;
@@ -156,13 +164,15 @@ private:
float m_lfoAmount;
bool m_lfoAmountIsZero;
float * m_lfoShapeData;
sampleBuffer m_userWave;
enum lfoShapes
{
SIN,
TRIANGLE,
SAW,
SQUARE
SQUARE,
USER
} m_lfoShape;
volatile bool m_busy;

View File

@@ -50,9 +50,11 @@
class fileItem;
class trackContainer;
class QPixmap;
class listView;
class playHandle;
class QPixmap;
class trackContainer;
class fileBrowser : public sideBarWidget
@@ -69,52 +71,61 @@ public slots:
void reloadTree( void );
protected:
void keyPressEvent( QKeyEvent * _ke );
protected slots:
#ifdef QT4
void itemPressed( int btn, Q3ListViewItem * _i, const QPoint & _pos,
int _col );
void itemReleased( int btn, Q3ListViewItem * _i, const QPoint & _pos,
int _col );
void itemDoubleClicked( Q3ListViewItem * _i, const QPoint & _pos,
int _col );
void contextMenuRequest( Q3ListViewItem * _i, const QPoint & _pos,
int _col );
#else
void itemPressed( int btn, QListViewItem * _i, const QPoint & _pos,
int _col );
void itemReleased( int btn, QListViewItem * _i, const QPoint & _pos,
int _col );
void itemDoubleClicked( QListViewItem * _i, const QPoint & _pos,
int _col );
void contextMenuRequest( QListViewItem * _i, const QPoint & _pos,
int _col );
#endif
void selectionChanged( void );
void sendToActiveChannel( void );
void openInNewChannelSE( void );
void openInNewChannelBBE( void );
void renameItem( void );
private:
virtual void keyPressEvent( QKeyEvent * _ke );
void openInNewChannel( trackContainer * _tc );
Q3ListView * m_l;
listView * m_l;
fileItem * m_contextMenuItem;
QString m_path;
QString m_filter;
} ;
class listView : public Q3ListView
{
Q_OBJECT
public:
listView( QWidget * _parent );
~listView();
protected:
virtual void contentsMouseDoubleClickEvent( QMouseEvent * _me );
virtual void contentsMousePressEvent( QMouseEvent * _me );
virtual void contentsMouseMoveEvent( QMouseEvent * _me );
virtual void contentsMouseReleaseEvent( QMouseEvent * _me );
private:
bool m_mousePressed;
QPoint m_pressPos;
playHandle * m_previewPlayHandle;
} ;
class directory : public Q3ListViewItem
{
public:
@@ -159,6 +170,7 @@ private:
class fileItem : public Q3ListViewItem
{
public:
@@ -178,7 +190,7 @@ public:
enum fileTypes
{
SONG_FILE, PRESET_FILE, SAMPLE_FILE, UNKNOWN
PROJECT_FILE, PRESET_FILE, SAMPLE_FILE, MIDI_FILE, UNKNOWN
} ;
inline fileTypes type( void )
@@ -191,9 +203,10 @@ private:
void initPixmapStuff( void );
void determineFileType( void );
static QPixmap * s_songFilePixmap;
static QPixmap * s_projectFilePixmap;
static QPixmap * s_presetFilePixmap;
static QPixmap * s_sampleFilePixmap;
static QPixmap * s_midiFilePixmap;
static QPixmap * s_unknownFilePixmap;
QPixmap * m_pix;

View File

@@ -34,7 +34,6 @@ class KMultiTabBarTab;
#include <QWidget>
#include <QMenu>
//#include <QVBoxWidget>
#include <QString>
#include <QBoxLayout>
#include <QList>

View File

@@ -87,90 +87,89 @@ public:
}
return( s_instanceOfMe );
}
/* This identifier can be used as a unique, case-sensitive
identifier for the plugin type within the plugin file. Plugin
types should be identified by file and label rather than by index
or plugin name, which may be changed in new plugin
versions. Labels must not contain white-space characters. */
QString FASTCALL getLabel( const ladspaKey & _plugin );
/* Indicates that the plugin has a real-time dependency
(e.g. listens to a MIDI device) and so its output must not
be cached or subject to significant latency. */
bool FASTCALL hasRealTimeDependency( const ladspaKey & _plugin );
/* Indicates that the plugin may cease to work correctly if the
host elects to use the same data location for both input and output
(see connectPort). */
bool FASTCALL isInplaceBroken( const ladspaKey & _plugin );
/* Indicates that the plugin is capable of running not only in a
conventional host but also in a 'hard real-time' environment. */
bool FASTCALL isRealTimeCapable( const ladspaKey & _plugin );
/* Returns the name of the plug-in */
QString FASTCALL getName( const ladspaKey & _plugin );
/* Returns the the plug-in's author */
QString FASTCALL getMaker( const ladspaKey & _plugin );
/* Returns the copyright for the plug-in */
QString FASTCALL getCopyright( const ladspaKey & _plugin );
/* This indicates the number of ports (input AND output) present on
the plugin. */
Uint32 FASTCALL getPortCount( const ladspaKey & _plugin );
/* Indicates that the port is an input. */
bool FASTCALL isPortInput( const ladspaKey & _plugin, Uint32 _port );
/* Indicates that the port is an output. */
bool FASTCALL isPortOutput( const ladspaKey & _plugin, Uint32 _port );
/* Indicates that the port is an audio. */
bool FASTCALL isPortAudio( const ladspaKey & _plugin, Uint32 _port );
/* Indicates that the port is an control. */
bool FASTCALL isPortControl( const ladspaKey & _plugin, Uint32 _port );
/* Indicates that any bounds specified should be interpreted as
multiples of the sample rate. For instance, a frequency range from
0Hz to the Nyquist frequency (half the sample rate) could be requested
by this hint in conjunction with LowerBound = 0 and UpperBound = 0.5.
Hosts that support bounds at all must support this hint to retain meaning. */
Hosts that support bounds at all must support this hint to retain
meaning. */
bool FASTCALL areHintsSampleRateDependent( const ladspaKey & _plugin,
Uint32 _port );
Uint32 _port );
/* Returns the lower boundary value for the given port. If
no lower bound is provided by the plug-in, returns -999e-99. When
areHintsSampleRateDependent() is also true then this value should be
multiplied by the relevant sample rate. */
float FASTCALL getLowerBound( const ladspaKey & _plugin, Uint32 _port );
/* Returns the upper boundary value for the given port. If
no upper bound is provided by the plug-in, returns -999e-99. When
areHintsSampleRateDependent() is also true then this value should be
multiplied by the relevant sample rate. */
float FASTCALL getUpperBound( const ladspaKey & _plugin, Uint32 _port );
/* Indicates whether the given port should be considered 0 or 1
boolean switch. */
bool FASTCALL isPortToggled( const ladspaKey & _plugin, Uint32 _port );
/* Retrieves any default setting hints offered by the plug-in for
the given port. */
float FASTCALL getDefaultSetting( const ladspaKey & _plugin,
Uint32 _port );
Uint32 _port );
/* Indicates that it is likely that the user will find it more
intuitive to view values using a logarithmic scale. This is
particularly useful for frequencies and gains. */
bool FASTCALL isLogarithmic( const ladspaKey & _plugin, Uint32 _port );
/* Indicates that a user interface would probably wish to provide a
stepped control taking only integer values. Any bounds set should be
slightly wider than the actual integer range required to avoid floating
@@ -187,12 +186,14 @@ public:
or interpreted by the host. It is expected that most plugin
writers will not use this facility as LADSPA_Handle should be
used to hold instance data. */
const void * FASTCALL getImplementationData( const ladspaKey & _plugin );
const void * FASTCALL getImplementationData(
const ladspaKey & _plugin );
/* Returns a pointer to the plug-in's descriptor from which control
of the plug-in is accessible */
const LADSPA_Descriptor * FASTCALL getDescriptor( const ladspaKey & _plugin );
const LADSPA_Descriptor * FASTCALL getDescriptor(
const ladspaKey & _plugin );
/* The following methods are convenience functions for use during
@@ -246,8 +247,9 @@ public:
called again unless deactivate() is called first. Note that
connectPort() may be called before or after a call to
activate(). */
void FASTCALL activate( const ladspaKey & _plugin, LADSPA_Handle _instance );
void FASTCALL activate( const ladspaKey & _plugin,
LADSPA_Handle _instance );
/* This method calls a function pointer that runs an instance of a
plugin for a block. Two parameters are required: the first is a
handle to the particular instance to be run and the second
@@ -260,7 +262,7 @@ public:
activate() has been called again. */
void FASTCALL run( const ladspaKey & _plugin, LADSPA_Handle _instance,
Uint32 _sample_count );
/* This method calls a function pointer that runs an instance of a
plugin for a block. This has identical behaviour to run() except
in the way data is output from the plugin. When run() is used,
@@ -274,9 +276,10 @@ public:
runAdding() is optional. When it is not provided by a plugin,
this function pointer must be set to NULL. When it is provided,
the function setRunAddingGain() must be provided also. */
void FASTCALL runAdding( const ladspaKey & _plugin, LADSPA_Handle _instance,
Uint32 _sample_count );
void FASTCALL runAdding( const ladspaKey & _plugin,
LADSPA_Handle _instance,
Uint32 _sample_count );
/* This method calls a function pointer that sets the output gain for
use when runAdding() is called (see above). If this function is
never called the gain is assumed to default to 1. Gain
@@ -286,9 +289,10 @@ public:
This function should be provided by the plugin if and only if the
runAdding() function is provided. When it is absent this
function pointer must be set to NULL. */
void FASTCALL setRunAddingGain( const ladspaKey & _plugin, LADSPA_Handle _instance,
LADSPA_Data _gain );
void FASTCALL setRunAddingGain( const ladspaKey & _plugin,
LADSPA_Handle _instance,
LADSPA_Data _gain );
/* This is the counterpart to activate() (see above). If there is
nothing for deactivate() to do then the plugin writer may provide
a NULL rather than an empty function.
@@ -302,8 +306,9 @@ public:
Deactivation is not similar to pausing as the plugin instance
will be reinitialised when activate() is called to reuse it. */
void FASTCALL deactivate( const ladspaKey & _plugin, LADSPA_Handle _instance );
void FASTCALL deactivate( const ladspaKey & _plugin,
LADSPA_Handle _instance );
/* Once an instance of a plugin has been finished with it can be
deleted using the following function. The instance handle passed
ceases to be valid after this call.
@@ -311,29 +316,29 @@ public:
If activate() was called for a plugin instance then a
corresponding call to deactivate() must be made before cleanup()
is called. */
void FASTCALL cleanup( const ladspaKey & _plugin, LADSPA_Handle _instance );
void FASTCALL cleanup( const ladspaKey & _plugin,
LADSPA_Handle _instance );
private:
void FASTCALL addPlugins( void * _plugin_handle,
LADSPA_Descriptor_Function _descriptor_func,
const QString & _file );
void FASTCALL addPlugins( LADSPA_Descriptor_Function _descriptor_func,
const QString & _file );
ladspaManager( void );
~ladspaManager();
static ladspaManager * s_instanceOfMe;
typedef struct ladspaManagerStorage
{
void * pluginHandle;
LADSPA_Descriptor_Function descriptorFunction;
Uint32 index;
} ladspaManagerDescription;
typedef QMap<ladspaKey, ladspaManagerDescription *> ladspaManagerMapType;
ladspaManagerMapType m_ladspaManagerMap;
};
} ;
#endif

View File

@@ -51,6 +51,7 @@ public:
SONG_PROJECT,
SONG_PROJECT_TEMPLATE,
CHANNEL_SETTINGS,
DRAG_N_DROP_DATA,
EFFECT_SETTINGS,
VIDEO_PROJECT, // will come later...
BURN_PROJECT, // will come later...
@@ -59,7 +60,8 @@ public:
} ;
multimediaProject( const QString & _in_file_name );
multimediaProject( const QString & _in_file_name,
bool _is_filename = TRUE );
multimediaProject( projectTypes _project_type );
~multimediaProject();

View File

@@ -98,7 +98,7 @@ public:
// phase (otherwise we'll get clicks in the audio-stream)
const float v = m_sample * m_oscCoeff;
m_freq = _new_freq;
recalcOscCoeff( phase( v ) );
recalcOscCoeff( fraction( v ) );
}
static oscillator * FASTCALL createOsc( waveShapes _wave_shape,
@@ -112,14 +112,14 @@ public:
// check whether v2 is in next period
return( floorf( v2 ) > floorf( v1 ) );
}
#define FLOAT_TO_INT(in,out) \
/*#define FLOAT_TO_INT(in,out) \
register const float round_const = -0.5f; \
__asm__ __volatile__ ("fadd %%st,%%st(0)\n" \
"fadd %2\n" \
"fistpl %0\n" \
"shrl $1,%0" : "=m" (out) : "t" (in),"m"(round_const) : "st") ;
"shrl $1,%0" : "=m" (out) : "t" (in),"m"(round_const) : "st") ;*/
static inline float phase( const float _sample )
static inline float fraction( const float _sample )
{
return( _sample - static_cast<int>( _sample ) );
}
@@ -134,7 +134,7 @@ public:
static inline sampleType triangleSample( float _sample )
{
const float ph = phase( _sample );
const float ph = fraction( _sample );
if( ph <= 0.25f )
{
return( ph * 4.0f );
@@ -148,17 +148,17 @@ public:
static inline sampleType sawSample( float _sample )
{
return( -1.0f + phase( _sample ) * 2.0f );
return( -1.0f + fraction( _sample ) * 2.0f );
}
static inline sampleType squareSample( float _sample )
{
return( ( phase( _sample ) > 0.5f ) ? -1.0f : 1.0f );
return( ( fraction( _sample ) > 0.5f ) ? -1.0f : 1.0f );
}
static inline sampleType moogSawSample( float _sample )
{
const float ph = phase( _sample );
const float ph = fraction( _sample );
if( ph < 0.5f )
{
return( -1.0f + ph * 4.0f );
@@ -168,7 +168,7 @@ public:
static inline sampleType expSample( float _sample )
{
float ph = phase( _sample );
float ph = fraction( _sample );
if( ph > 0.5f )
{
ph = 1.0f - ph;
@@ -181,14 +181,20 @@ public:
return( 1.0f - 2.0f * ( ( float )rand() * ( 1.0f /
RAND_MAX ) ) );
}
static inline sampleType userWaveSample( float _sample,
const sampleFrame * _user_wave, Uint32 _user_wave_frames )
{
const float frame = fraction( _sample ) * _user_wave_frames;
const Uint32 f1 = static_cast<Uint32>( frame );
const Uint32 f2 = ( f1 + 1 ) % _user_wave_frames;
return( linearInterpolate( _user_wave[f1][0],
_user_wave[f2][0],
fraction( frame ) ) );
}
inline sampleType userWaveSample( float _sample )
{
const float frame = phase( _sample ) * m_userWaveFrames;
const Uint32 f1 = static_cast<Uint32>( frame );
const Uint32 f2 = ( f1 + 1 ) % m_userWaveFrames;
return( linearInterpolate( m_userWaveData[f1][0],
m_userWaveData[f2][0],
frame - floorf( frame ) ) );
return( userWaveSample( _sample, m_userWaveData,
m_userWaveFrames ) );
}

View File

@@ -102,13 +102,20 @@ public:
return( m_notes );
}
note * FASTCALL noteAt( int _note_num );
void FASTCALL setNoteAt( int _note_num, note _new_note );
// pattern-type stuff
inline patternTypes type( void ) const
{
return( m_patternType );
}
void FASTCALL setType( patternTypes _new_pattern_type );
void checkType( void );
// pattern-name functions
inline const QString & name( void ) const
{
return( m_name );
@@ -121,12 +128,6 @@ public:
}
inline channelTrack * getChannelTrack( void )
{
return( m_channelTrack );
}
// functions which are part of freezing-feature
inline bool freezing( void ) const
{
@@ -143,11 +144,7 @@ public:
void FASTCALL playFrozenData( sampleFrame * _ab, Uint32 _start_frame,
Uint32 _frames );
note * FASTCALL noteAt( int _note_num );
void FASTCALL setNoteAt( int _note_num, note _new_note );
void checkType( void );
// settings-management
virtual void FASTCALL saveSettings( QDomDocument & _doc,
QDomElement & _parent );
virtual void FASTCALL loadSettings( const QDomElement & _this );
@@ -156,6 +153,11 @@ public:
return( "pattern" );
}
inline channelTrack * getChannelTrack( void )
{
return( m_channelTrack );
}
protected slots:
void openInPianoRoll( bool _c );
@@ -175,12 +177,13 @@ protected slots:
protected:
void paintEvent( QPaintEvent * _pe );
void mousePressEvent( QMouseEvent * _me );
void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void constructContextMenu( QMenu * );
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
void ensureBeatNotes( void );
void updateBBTrack( void );
private:

View File

@@ -90,7 +90,6 @@ protected:
void mouseReleaseEvent( QMouseEvent * _me );
void mouseMoveEvent( QMouseEvent * _me );
void keyPressEvent( QKeyEvent * _ke );
void keyReleaseEvent( QKeyEvent * _ke );
void wheelEvent( QWheelEvent * _we );
int FASTCALL getKey( int _y );
@@ -211,9 +210,6 @@ private:
midiTime m_lenOfNewNotes;
bool m_shiftPressed;
bool m_controlPressed;
int m_startKey; // first key when drawing
int m_keyMouseOver;
int m_lastKey;

View File

@@ -52,10 +52,16 @@ class pixmapButton : public QPushButton
public:
pixmapButton( QWidget * _parent );
virtual ~pixmapButton();
virtual void FASTCALL setActiveGraphic( const QPixmap & _pm );
virtual void FASTCALL setInactiveGraphic( const QPixmap & _pm,
void FASTCALL setActiveGraphic( const QPixmap & _pm );
void FASTCALL setInactiveGraphic( const QPixmap & _pm,
bool _update = TRUE );
void FASTCALL setBgGraphic( const QPixmap & _pm );
#ifndef QT4
inline void setChecked( bool _on )
{
setOn( _on );
}
#endif
signals:

View File

@@ -67,7 +67,10 @@ public:
DOTS
} ;
sampleBuffer( const QString & _audio_file = "" );
// constructor which either loads sample _audio_file or decodes
// base64-data out of string
sampleBuffer( const QString & _audio_file = "",
bool _is_base64_data = FALSE );
sampleBuffer( const sampleFrame * _data, Uint32 _frames );
~sampleBuffer();
@@ -112,10 +115,12 @@ public:
QString openAudioFile( void ) const;
QString toBase64( void ) const;
public slots:
void setAudioFile( const QString & _audio_file );
void loadFromBase64( const QString & _data );
void setStartFrame( Uint32 _s );
void setEndFrame( Uint32 _e );
void setAmplification( float _a );

View File

@@ -77,8 +77,11 @@ public slots:
protected:
void paintEvent( QPaintEvent * );
void mouseDoubleClickEvent( QMouseEvent * );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void mouseDoubleClickEvent( QMouseEvent * );
virtual void paintEvent( QPaintEvent * );
midiTime getSampleLength( void ) const;
@@ -122,7 +125,7 @@ public:
sampleTrack( trackContainer * _tc );
virtual ~sampleTrack();
virtual trackTypes trackType( void ) const;
virtual trackTypes type( void ) const;
virtual bool FASTCALL play( const midiTime & _start,
Uint32 _start_frame, Uint32 _frames,
Uint32 _frame_base,

View File

@@ -27,26 +27,12 @@
#ifndef _SONG_EDITOR_H
#define _SONG_EDITOR_H
#include "qt3support.h"
#ifdef QT4
#include <QMap>
#else
#include <qmap.h>
#endif
#include "track_container.h"
#include "types.h"
class QComboBox;
class QLabel;
class QPixmap;
class QScrollBar;
class QSlider;
@@ -301,6 +287,8 @@ private:
volatile bool m_playing;
volatile bool m_paused;
bool m_loadingProject;
playModes m_playMode;
playPos m_playPos[PLAY_MODE_CNT];
@@ -325,11 +313,6 @@ private:
void doActions( void );
bool m_shiftPressed;
bool m_controlPressed;
friend class lmmsMainWin;

View File

@@ -54,7 +54,7 @@ public:
const QPixmap & _icon, QWidget * _w );
~stringPairDrag();
static void processDragEnterEvent( QDragEnterEvent * _dee,
static bool processDragEnterEvent( QDragEnterEvent * _dee,
const QString & _allowed_keys );
static QString decodeKey( QDropEvent * _de );
static QString decodeValue( QDropEvent * _de );

View File

@@ -76,6 +76,8 @@ protected:
private:
void updateSize( void );
QString m_title;
QString m_text;
QPixmap m_pixmap;

View File

@@ -44,6 +44,7 @@
class QPixmap;
class nStateButton;
class textFloat;
class timeLine : public QWidget
@@ -90,6 +91,7 @@ public:
return( ( m_loopPos[0] < m_loopPos[1] ) ?
m_loopPos[0] : m_loopPos[1] );
}
inline const midiTime & loopEnd( void ) const
{
return( ( m_loopPos[0] > m_loopPos[1] ) ?
@@ -136,6 +138,7 @@ private:
m_ppt / 64.0f ) );
}
static QPixmap * s_timeLinePixmap;
static QPixmap * s_posMarkerPixmap;
static QPixmap * s_loopPointPixmap;
@@ -157,6 +160,9 @@ private:
midiTime m_savedPos;
textFloat * m_hint;
enum actions
{
NONE, MOVE_POS_MARKER, MOVE_LOOP_BEGIN, MOVE_LOOP_END

View File

@@ -57,14 +57,15 @@
#include "settings.h"
class QMenu;
class pixmapButton;
class textFloat;
class track;
class trackContainer;
class trackContentWidget;
class trackWidget;
class pixmapButton;
class QMenu;
typedef QWidget trackSettingsWidget;
typedef QWidget trackOperationsWidget;
@@ -107,13 +108,17 @@ public slots:
protected:
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseMoveEvent( QMouseEvent * _me );
virtual void mouseReleaseEvent( QMouseEvent * _me );
virtual void contextMenuEvent( QContextMenuEvent * _cme );
virtual void constructContextMenu( QMenu * )
{
}
virtual void contextMenuEvent( QContextMenuEvent * _cme );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void leaveEvent( QEvent * _e );
virtual void mouseMoveEvent( QMouseEvent * _me );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseReleaseEvent( QMouseEvent * _me );
void setAutoResizeEnabled( bool _e = FALSE );
float pixelsPerTact( void );
@@ -125,6 +130,8 @@ protected slots:
private:
static textFloat * s_textFloat;
track * m_track;
midiTime m_startPosition;
midiTime m_length;
@@ -172,6 +179,8 @@ public slots:
protected:
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseMoveEvent( QMouseEvent * _me );
virtual void mouseReleaseEvent( QMouseEvent * _me );
@@ -179,6 +188,9 @@ protected:
private:
track * getTrack( void );
midiTime getPosition( int _mouse_x );
typedef vvector<trackContentObject *> tcoVector;
tcoVector m_trackContentObjects;
@@ -190,6 +202,28 @@ private:
class trackSettingsWidget : public QWidget
{
public:
trackSettingsWidget( trackWidget * _parent );
~trackSettingsWidget();
protected:
virtual void mousePressEvent( QMouseEvent * _me );
private:
trackWidget * m_trackWidget;
} ;
// actual widget shown in trackContainer
class trackWidget : public QWidget
{
@@ -202,26 +236,32 @@ public:
{
return( m_track );
}
inline track * getTrack( void )
{
return( m_track );
}
inline const trackSettingsWidget & getTrackSettingsWidget( void ) const
{
return( m_trackSettingsWidget );
}
inline const trackContentWidget & getTrackContentWidget( void ) const
{
return( m_trackContentWidget );
}
inline trackSettingsWidget & getTrackSettingsWidget( void )
{
return( m_trackSettingsWidget );
}
inline trackContentWidget & getTrackContentWidget( void )
{
return( m_trackContentWidget );
}
bool muted( void ) const;
@@ -236,8 +276,11 @@ public slots:
protected:
virtual void resizeEvent( QResizeEvent * _re );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re );
midiTime FASTCALL endPosition( const midiTime & _pos_start );
@@ -285,7 +328,7 @@ public:
}
// pure virtual functions
virtual trackTypes trackType( void ) const = 0;
virtual trackTypes type( void ) const = 0;
virtual bool FASTCALL play( const midiTime & _start,
Uint32 _start_frame,
@@ -322,22 +365,27 @@ public:
{
return( m_trackWidget );
}
inline trackContainer * getTrackContainer( void )
{
return( m_trackContainer );
}
inline const trackSettingsWidget * getTrackSettingsWidget( void ) const
{
return( &m_trackWidget->getTrackSettingsWidget() );
}
inline const trackContentWidget * getTrackContentWidget( void ) const
{
return( &m_trackWidget->getTrackContentWidget() );
}
inline trackSettingsWidget * getTrackSettingsWidget( void )
{
return( &m_trackWidget->getTrackSettingsWidget() );
}
inline trackContentWidget * getTrackContentWidget( void )
{
return( &m_trackWidget->getTrackContentWidget() );

View File

@@ -94,9 +94,9 @@ public:
protected:
virtual void resizeEvent( QResizeEvent * );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void resizeEvent( QResizeEvent * );
constTrackVector tracks( void ) const;
trackVector tracks( void );