unified track-view appearence and behaviour

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1303 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-07-12 12:47:34 +00:00
parent 3d0a8e95a2
commit c08cc778fd
31 changed files with 242 additions and 300 deletions

View File

@@ -31,9 +31,6 @@
#include "track.h"
class nameLabel;
class automationTrack : public track
{
public:
@@ -72,14 +69,7 @@ public:
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
private:
bbTrack * m_bbTrack;
nameLabel * m_trackLabel;
} ;
#endif

View File

@@ -32,7 +32,7 @@
#include "track.h"
class nameLabel;
class trackLabelButton;
class trackContainer;
@@ -165,11 +165,6 @@ public:
bbTrackView( bbTrack * _bbt, trackContainerView * _tcv );
virtual ~bbTrackView();
inline nameLabel * trackLabel( void )
{
return( m_trackLabel );
}
virtual bool close( void );
const bbTrack * getBBTrack( void ) const
@@ -184,7 +179,7 @@ public slots:
private:
bbTrack * m_bbTrack;
nameLabel * m_trackLabel;
trackLabelButton * m_trackLabel;
} ;

View File

@@ -43,7 +43,7 @@ class effectRackView : public QWidget, public modelView
{
Q_OBJECT
public:
effectRackView( effectChain * _model, QWidget * _parent );
effectRackView( effectChain * _model, QWidget * _parent = NULL );
virtual ~effectRackView();
void clear( void );

View File

@@ -46,7 +46,6 @@ class effectRackView;
class instrumentSoundShapingView;
class fadeButton;
class instrument;
class instrumentTrackButton;
class instrumentTrackWindow;
class instrumentMidiIOView;
class lcdSpinBox;
@@ -55,6 +54,7 @@ class notePlayHandle;
class pluginView;
class presetPreviewPlayHandle;
class tabWidget;
class trackLabelButton;
class EXPORT instrumentTrack : public track, public midiEventProcessor
@@ -225,13 +225,23 @@ public:
}
QMenu * midiMenu( void )
{
return( m_midiMenu );
}
void freeInstrumentTrackWindow( void );
static void cleanupWindowPool( void );
protected:
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
private slots:
void toggledInstrumentTrackButton( bool _on );
void toggleInstrumentWindow( bool _on );
void activityIndicatorPressed( void );
void activityIndicatorReleased( void );
@@ -246,18 +256,17 @@ private:
static QQueue<instrumentTrackWindow *> s_windows;
// widgets in track-settings-widget
knob * m_tswVolumeKnob;
knob * m_tswPanningKnob;
fadeButton * m_tswActivityIndicator;
instrumentTrackButton * m_tswInstrumentTrackButton;
trackLabelButton * m_tlb;
knob * m_volumeKnob;
knob * m_panningKnob;
fadeButton * m_activityIndicator;
QMenu * m_tswMidiMenu;
QMenu * m_midiMenu;
QAction * m_midiInputAction;
QAction * m_midiOutputAction;
friend class instrumentTrackButton;
friend class instrumentTrackWindow;
} ;
@@ -294,10 +303,13 @@ public:
m_itv = _tv;
}
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
public slots:
void textChanged( const QString & _new_name );
void toggledInstrumentTrackButton( bool _on );
void toggleVisibility( bool _on );
void updateName( void );
void updateInstrumentView( void );
@@ -305,8 +317,6 @@ public slots:
protected:
// capture close-events for toggling instrument-track-button
virtual void closeEvent( QCloseEvent * _ce );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void focusInEvent( QFocusEvent * _fe );
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
@@ -345,36 +355,10 @@ private:
// test-piano at the bottom of every instrument-settings-window
pianoView * m_pianoView;
friend class instrumentTrackButton;
friend class instrumentView;
} ;
class instrumentTrackButton : public QPushButton
{
public:
instrumentTrackButton( instrumentTrackView * _instrument_track_view );
virtual ~instrumentTrackButton();
protected:
// since we want to draw a special label (instrument- and instrument-
// name) on our button, we have to re-implement this for doing so
virtual void paintEvent( QPaintEvent * _pe );
// allow drops on this button - we simply forward them to
// instrument-track
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
private:
instrumentTrackView * m_instrumentTrackView;
} ;
#endif

View File

@@ -1,6 +1,5 @@
/*
* name_label.h - class nameLabel, a label which is renamable by
* double-clicking it
* name_label.h - class trackLabelButton
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -27,16 +26,18 @@
#ifndef _NAME_LABEL_H
#define _NAME_LABEL_H
#include <QtGui/QLabel>
#include <QtGui/QPixmap>
#include <QtGui/QToolButton>
class nameLabel : public QLabel
class trackView;
class trackLabelButton : public QToolButton
{
Q_OBJECT
public:
nameLabel( const QString & _initial_name, QWidget * _parent );
virtual ~nameLabel();
trackLabelButton( trackView * _tv, QWidget * _parent );
virtual ~trackLabelButton();
const QPixmap & pixmap( void ) const
{
@@ -52,23 +53,25 @@ public:
public slots:
void setPixmap( const QPixmap & _pixmap );
void setPixmapFile( const QString & _file );
void rename( void );
void selectPixmap( void );
void rename( void );
void updateName( void );
signals:
void clicked( void );
void nameChanged( const QString & _new_name );
void nameChanged( void );
void pixmapChanged( void );
protected:
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
private:
trackView * m_trackView;
QPixmap m_pixmap;
QString m_pixmapFile;

View File

@@ -32,9 +32,9 @@
#include "audio_port.h"
#include "track.h"
class effectLabel;
class sampleBuffer;
class effectRackView;
class knob;
class sampleBuffer;
class sampleTCO : public trackContentObject
@@ -152,14 +152,19 @@ private:
class sampleTrackView : public trackView
{
Q_OBJECT
public:
sampleTrackView( sampleTrack * _track, trackContainerView * _tcv );
virtual ~sampleTrackView();
private:
effectLabel * m_trackLabel;
public slots:
void showEffects( void );
private:
effectRackView * m_effectRack;
QWidget * m_effWindow;
knob * m_volumeKnob;
} ;

View File

@@ -553,6 +553,9 @@ private:
Actions m_action;
friend class trackLabelButton;
private slots:
void createTCOView( trackContentObject * _tco );