Merge branch 'master' into refac/memory
This commit is contained in:
@@ -80,10 +80,10 @@ public:
|
||||
static DeviceInfoCollection getAvailableDevices();
|
||||
|
||||
private:
|
||||
virtual void startProcessing();
|
||||
virtual void stopProcessing();
|
||||
virtual void applyQualitySettings();
|
||||
virtual void run();
|
||||
void startProcessing() override;
|
||||
void stopProcessing() override;
|
||||
void applyQualitySettings() override;
|
||||
void run() override;
|
||||
|
||||
int setHWParams( const ch_cnt_t _channels, snd_pcm_access_t _access );
|
||||
int setSWParams();
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
AudioAlsaSetupWidget( QWidget * _parent );
|
||||
virtual ~AudioAlsaSetupWidget();
|
||||
|
||||
virtual void saveSettings();
|
||||
void saveSettings() override;
|
||||
|
||||
public slots:
|
||||
void onCurrentIndexChanged(int index);
|
||||
|
||||
@@ -64,11 +64,11 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void saveSettings()
|
||||
void saveSettings() override
|
||||
{
|
||||
}
|
||||
|
||||
virtual void show()
|
||||
void show() override
|
||||
{
|
||||
parentWidget()->hide();
|
||||
QWidget::show();
|
||||
@@ -78,17 +78,17 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
virtual void startProcessing()
|
||||
void startProcessing() override
|
||||
{
|
||||
start();
|
||||
}
|
||||
|
||||
virtual void stopProcessing()
|
||||
void stopProcessing() override
|
||||
{
|
||||
stopProcessingThread( this );
|
||||
}
|
||||
|
||||
virtual void run()
|
||||
void run() override
|
||||
{
|
||||
MicroTimer timer;
|
||||
while( true )
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
protected:
|
||||
virtual void writeBuffer( const surroundSampleFrame * /* _buf*/,
|
||||
const fpp_t /*_frames*/,
|
||||
const float /*_master_gain*/ );
|
||||
const float /*_master_gain*/ ) override;
|
||||
|
||||
private:
|
||||
void flushRemainingBuffers();
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
private:
|
||||
virtual void writeBuffer( const surroundSampleFrame * _ab,
|
||||
const fpp_t _frames,
|
||||
const float _master_gain );
|
||||
const float _master_gain ) override;
|
||||
|
||||
bool startEncoding();
|
||||
void finishEncoding();
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
private:
|
||||
virtual void writeBuffer( const surroundSampleFrame * _ab,
|
||||
const fpp_t _frames,
|
||||
float _master_gain );
|
||||
float _master_gain ) override;
|
||||
|
||||
bool startEncoding();
|
||||
void finishEncoding();
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
setupWidget( QWidget * _parent );
|
||||
virtual ~setupWidget();
|
||||
|
||||
virtual void saveSettings();
|
||||
void saveSettings() override;
|
||||
|
||||
private:
|
||||
QLineEdit * m_device;
|
||||
@@ -70,10 +70,10 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
virtual void startProcessing();
|
||||
virtual void stopProcessing();
|
||||
virtual void applyQualitySettings();
|
||||
virtual void run();
|
||||
void startProcessing() override;
|
||||
void stopProcessing() override;
|
||||
void applyQualitySettings() override;
|
||||
void run() override;
|
||||
|
||||
int m_audioFD;
|
||||
|
||||
|
||||
@@ -100,8 +100,8 @@ public:
|
||||
bool processEffects();
|
||||
|
||||
// ThreadableJob stuff
|
||||
virtual void doProcessing();
|
||||
virtual bool requiresProcessing() const
|
||||
void doProcessing() override;
|
||||
bool requiresProcessing() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
setupWidget( QWidget * _parent );
|
||||
virtual ~setupWidget();
|
||||
|
||||
virtual void saveSettings();
|
||||
void saveSettings() override;
|
||||
|
||||
private:
|
||||
QLineEdit * m_device;
|
||||
@@ -80,10 +80,10 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
virtual void startProcessing();
|
||||
virtual void stopProcessing();
|
||||
virtual void applyQualitySettings();
|
||||
virtual void run();
|
||||
void startProcessing() override;
|
||||
void stopProcessing() override;
|
||||
void applyQualitySettings() override;
|
||||
void run() override;
|
||||
|
||||
volatile bool m_quit;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
private:
|
||||
virtual void writeBuffer( const surroundSampleFrame * _ab,
|
||||
const fpp_t _frames,
|
||||
const float _master_gain );
|
||||
const float _master_gain ) override;
|
||||
|
||||
typedef QList<QPair<sampleFrame *, fpp_t> > BufferList;
|
||||
BufferList m_buffers;
|
||||
|
||||
@@ -60,9 +60,9 @@ public:
|
||||
{
|
||||
public:
|
||||
setupWidget( QWidget * _parent );
|
||||
virtual ~setupWidget();
|
||||
~setupWidget() override;
|
||||
|
||||
virtual void saveSettings();
|
||||
void saveSettings() override;
|
||||
|
||||
private:
|
||||
QLineEdit * m_device;
|
||||
@@ -71,9 +71,9 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
virtual void startProcessing();
|
||||
virtual void stopProcessing();
|
||||
virtual void applyQualitySettings();
|
||||
void startProcessing() override;
|
||||
void stopProcessing() override;
|
||||
void applyQualitySettings() override;
|
||||
|
||||
static void sdlAudioCallback( void * _udata, Uint8 * _buf, int _len );
|
||||
void sdlAudioCallback( Uint8 * _buf, int _len );
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
setupWidget( QWidget * _parent );
|
||||
virtual ~setupWidget();
|
||||
|
||||
virtual void saveSettings( void );
|
||||
void saveSettings( void ) override;
|
||||
|
||||
private:
|
||||
QLineEdit * m_device;
|
||||
@@ -66,10 +66,10 @@ public:
|
||||
} ;
|
||||
|
||||
private:
|
||||
virtual void startProcessing( void );
|
||||
virtual void stopProcessing( void );
|
||||
virtual void applyQualitySettings( void );
|
||||
virtual void run( void );
|
||||
void startProcessing( void ) override;
|
||||
void stopProcessing( void ) override;
|
||||
void applyQualitySettings( void ) override;
|
||||
void run( void ) override;
|
||||
|
||||
struct sio_hdl *m_hdl;
|
||||
struct sio_par m_par;
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
model()->setJournalling( _on );
|
||||
}
|
||||
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
|
||||
public slots:
|
||||
@@ -62,9 +62,9 @@ public slots:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _me );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
void contextMenuEvent( QContextMenuEvent * _me ) override;
|
||||
void mousePressEvent( QMouseEvent * _me ) override;
|
||||
void mouseReleaseEvent( QMouseEvent * _me ) override;
|
||||
|
||||
|
||||
private:
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
|
||||
void activateButton( AutomatableButton * _btn );
|
||||
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -236,6 +236,7 @@ public:
|
||||
m_centerValue = centerVal;
|
||||
}
|
||||
|
||||
//! link @p m1 and @p m2, let @p m1 take the values of @p m2
|
||||
static void linkModels( AutomatableModel* m1, AutomatableModel* m2 );
|
||||
static void unlinkModels( AutomatableModel* m1, AutomatableModel* m2 );
|
||||
|
||||
@@ -255,7 +256,7 @@ public:
|
||||
specified DOM element using <name> as attribute/node name */
|
||||
virtual void loadSettings( const QDomElement& element, const QString& name );
|
||||
|
||||
virtual QString nodeName() const
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "automatablemodel";
|
||||
}
|
||||
@@ -337,12 +338,12 @@ private:
|
||||
|
||||
static bool mustQuoteName(const QString &name);
|
||||
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& element )
|
||||
void saveSettings( QDomDocument& doc, QDomElement& element ) override
|
||||
{
|
||||
saveSettings( doc, element, "value" );
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement& element )
|
||||
void loadSettings( const QDomElement& element ) override
|
||||
{
|
||||
loadSettings( element, "value" );
|
||||
}
|
||||
@@ -359,7 +360,7 @@ private:
|
||||
template<class T> void roundAt( T &value, const T &where ) const;
|
||||
|
||||
|
||||
ScaleType m_scaleType; //! scale type, linear by default
|
||||
ScaleType m_scaleType; //!< scale type, linear by default
|
||||
float m_value;
|
||||
float m_initValue;
|
||||
float m_minValue;
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
return castModel<AutomatableModel>();
|
||||
}
|
||||
|
||||
virtual void setModel( Model* model, bool isOldModelValid = true );
|
||||
void setModel( Model* model, bool isOldModelValid = true ) override;
|
||||
|
||||
template<typename T>
|
||||
inline T value() const
|
||||
|
||||
@@ -51,12 +51,12 @@ signals:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _me );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void wheelEvent( QWheelEvent * _me );
|
||||
void contextMenuEvent( QContextMenuEvent * _me ) override;
|
||||
void mousePressEvent( QMouseEvent * _me ) override;
|
||||
void mouseReleaseEvent( QMouseEvent * _me ) override;
|
||||
void wheelEvent( QWheelEvent * _me ) override;
|
||||
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -73,9 +73,9 @@ public:
|
||||
return m_pattern != nullptr;
|
||||
}
|
||||
|
||||
virtual void saveSettings(QDomDocument & doc, QDomElement & parent);
|
||||
virtual void loadSettings(const QDomElement & parent);
|
||||
QString nodeName() const
|
||||
void saveSettings(QDomDocument & doc, QDomElement & parent) override;
|
||||
void loadSettings(const QDomElement & parent) override;
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "automationeditor";
|
||||
}
|
||||
@@ -114,14 +114,14 @@ public slots:
|
||||
protected:
|
||||
typedef AutomationPattern::timeMap timeMap;
|
||||
|
||||
virtual void keyPressEvent(QKeyEvent * ke);
|
||||
virtual void leaveEvent(QEvent * e);
|
||||
virtual void mousePressEvent(QMouseEvent * mouseEvent);
|
||||
virtual void mouseReleaseEvent(QMouseEvent * mouseEvent);
|
||||
virtual void mouseMoveEvent(QMouseEvent * mouseEvent);
|
||||
virtual void paintEvent(QPaintEvent * pe);
|
||||
virtual void resizeEvent(QResizeEvent * re);
|
||||
virtual void wheelEvent(QWheelEvent * we);
|
||||
void keyPressEvent(QKeyEvent * ke) override;
|
||||
void leaveEvent(QEvent * e) override;
|
||||
void mousePressEvent(QMouseEvent * mouseEvent) override;
|
||||
void mouseReleaseEvent(QMouseEvent * mouseEvent) override;
|
||||
void mouseMoveEvent(QMouseEvent * mouseEvent) override;
|
||||
void paintEvent(QPaintEvent * pe) override;
|
||||
void resizeEvent(QResizeEvent * re) override;
|
||||
void wheelEvent(QWheelEvent * we) override;
|
||||
|
||||
float getLevel( int y );
|
||||
int xCoordOfTick( int tick );
|
||||
@@ -176,8 +176,8 @@ private:
|
||||
static const int TOP_MARGIN = 16;
|
||||
|
||||
static const int DEFAULT_Y_DELTA = 6;
|
||||
static const int DEFAULT_STEPS_PER_TACT = 16;
|
||||
static const int DEFAULT_PPT = 12 * DEFAULT_STEPS_PER_TACT;
|
||||
static const int DEFAULT_STEPS_PER_BAR = 16;
|
||||
static const int DEFAULT_PPB = 12 * DEFAULT_STEPS_PER_BAR;
|
||||
|
||||
static const int VALUES_WIDTH = 64;
|
||||
|
||||
@@ -230,7 +230,7 @@ private:
|
||||
float m_drawLastLevel;
|
||||
tick_t m_drawLastTick;
|
||||
|
||||
int m_ppt;
|
||||
int m_ppb;
|
||||
int m_y_delta;
|
||||
bool m_y_auto;
|
||||
|
||||
@@ -240,6 +240,7 @@ private:
|
||||
|
||||
EditModes m_editMode;
|
||||
|
||||
bool m_mouseDownLeft;
|
||||
bool m_mouseDownRight; //true if right click is being held down
|
||||
|
||||
TimeLineWidget * m_timeLine;
|
||||
@@ -282,14 +283,14 @@ public:
|
||||
void setCurrentPattern(AutomationPattern* pattern);
|
||||
const AutomationPattern* currentPattern();
|
||||
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
void dropEvent( QDropEvent * _de ) override;
|
||||
void dragEnterEvent( QDragEnterEvent * _dee ) override;
|
||||
|
||||
void open(AutomationPattern* pattern);
|
||||
|
||||
AutomationEditor* m_editor;
|
||||
|
||||
QSize sizeHint() const;
|
||||
QSize sizeHint() const override;
|
||||
|
||||
public slots:
|
||||
void clearCurrentPattern();
|
||||
@@ -297,9 +298,12 @@ public slots:
|
||||
signals:
|
||||
void currentPatternChanged();
|
||||
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent * event) override;
|
||||
|
||||
protected slots:
|
||||
void play();
|
||||
void stop();
|
||||
void play() override;
|
||||
void stop() override;
|
||||
|
||||
private slots:
|
||||
void updateWindowTitle();
|
||||
|
||||
@@ -140,13 +140,13 @@ public:
|
||||
const QString name() const;
|
||||
|
||||
// settings-management
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
static const QString classNodeName() { return "automationpattern"; }
|
||||
QString nodeName() const { return classNodeName(); }
|
||||
QString nodeName() const override { return classNodeName(); }
|
||||
|
||||
virtual TrackContentObjectView * createView( TrackView * _tv );
|
||||
TrackContentObjectView * createView( TrackView * _tv ) override;
|
||||
|
||||
|
||||
static bool isAutomated( const AutomatableModel * _m );
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
public slots:
|
||||
/// Opens this view's pattern in the global automation editor
|
||||
void openInAutomationEditor();
|
||||
virtual void update();
|
||||
void update() override;
|
||||
|
||||
|
||||
protected slots:
|
||||
@@ -56,11 +56,11 @@ protected slots:
|
||||
void flipX();
|
||||
|
||||
protected:
|
||||
virtual void constructContextMenu( QMenu * );
|
||||
virtual void mouseDoubleClickEvent(QMouseEvent * me );
|
||||
virtual void paintEvent( QPaintEvent * pe );
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
void constructContextMenu( QMenu * ) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent * me ) override;
|
||||
void paintEvent( QPaintEvent * pe ) override;
|
||||
void dragEnterEvent( QDragEnterEvent * _dee ) override;
|
||||
void dropEvent( QDropEvent * _de ) override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -38,19 +38,19 @@ public:
|
||||
virtual ~AutomationTrack() = default;
|
||||
|
||||
virtual bool play( const MidiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 ) override;
|
||||
|
||||
virtual QString nodeName() const
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "automationtrack";
|
||||
}
|
||||
|
||||
virtual TrackView * createView( TrackContainerView* );
|
||||
virtual TrackContentObject * createTCO( const MidiTime & _pos );
|
||||
TrackView * createView( TrackContainerView* ) override;
|
||||
TrackContentObject * createTCO( const MidiTime & _pos ) override;
|
||||
|
||||
virtual void saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void loadTrackSpecificSettings( const QDomElement & _this );
|
||||
QDomElement & _parent ) override;
|
||||
void loadTrackSpecificSettings( const QDomElement & _this ) override;
|
||||
|
||||
private:
|
||||
friend class AutomationTrackView;
|
||||
@@ -65,8 +65,8 @@ public:
|
||||
AutomationTrackView( AutomationTrack* at, TrackContainerView* tcv );
|
||||
virtual ~AutomationTrackView() = default;
|
||||
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
void dragEnterEvent( QDragEnterEvent * _dee ) override;
|
||||
void dropEvent( QDropEvent * _de ) override;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
BBEditor( BBTrackContainer * _tc );
|
||||
~BBEditor();
|
||||
|
||||
QSize sizeHint() const;
|
||||
QSize sizeHint() const override;
|
||||
|
||||
const BBTrackContainerView* trackContainerView() const {
|
||||
return m_trackContainerView;
|
||||
@@ -54,8 +54,8 @@ public:
|
||||
void removeBBView( int bb );
|
||||
|
||||
public slots:
|
||||
void play();
|
||||
void stop();
|
||||
void play() override;
|
||||
void stop() override;
|
||||
|
||||
private:
|
||||
BBTrackContainerView* m_trackContainerView;
|
||||
@@ -70,15 +70,15 @@ class BBTrackContainerView : public TrackContainerView
|
||||
public:
|
||||
BBTrackContainerView(BBTrackContainer* tc);
|
||||
|
||||
bool fixedTCOs() const
|
||||
bool fixedTCOs() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void removeBBView(int bb);
|
||||
|
||||
void saveSettings(QDomDocument& doc, QDomElement& element);
|
||||
void loadSettings(const QDomElement& element);
|
||||
void saveSettings(QDomDocument& doc, QDomElement& element) override;
|
||||
void loadSettings(const QDomElement& element) override;
|
||||
|
||||
public slots:
|
||||
void addSteps();
|
||||
@@ -88,7 +88,7 @@ public slots:
|
||||
void addAutomationTrack();
|
||||
|
||||
protected slots:
|
||||
void dropEvent(QDropEvent * de );
|
||||
void dropEvent(QDropEvent * de ) override;
|
||||
void updatePosition();
|
||||
|
||||
private:
|
||||
|
||||
@@ -43,9 +43,9 @@ public:
|
||||
BBTCO( Track * _track );
|
||||
virtual ~BBTCO() = default;
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName() const
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return( "bbtco" );
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
int bbTrackIndex();
|
||||
|
||||
virtual TrackContentObjectView * createView( TrackView * _tv );
|
||||
TrackContentObjectView * createView( TrackView * _tv ) override;
|
||||
|
||||
private:
|
||||
QColor m_color;
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
void setColor( QColor _new_color );
|
||||
|
||||
public slots:
|
||||
virtual void update();
|
||||
void update() override;
|
||||
|
||||
protected slots:
|
||||
void openInBBEditor();
|
||||
@@ -110,9 +110,9 @@ protected slots:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * pe );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void constructContextMenu( QMenu * );
|
||||
void paintEvent( QPaintEvent * pe ) override;
|
||||
void mouseDoubleClickEvent( QMouseEvent * _me ) override;
|
||||
void constructContextMenu( QMenu * ) override;
|
||||
|
||||
|
||||
private:
|
||||
@@ -133,13 +133,13 @@ public:
|
||||
virtual ~BBTrack();
|
||||
|
||||
virtual bool play( const MidiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
virtual TrackView * createView( TrackContainerView* tcv );
|
||||
virtual TrackContentObject * createTCO( const MidiTime & _pos );
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 ) override;
|
||||
TrackView * createView( TrackContainerView* tcv ) override;
|
||||
TrackContentObject * createTCO( const MidiTime & _pos ) override;
|
||||
|
||||
virtual void saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void loadTrackSpecificSettings( const QDomElement & _this );
|
||||
QDomElement & _parent ) override;
|
||||
void loadTrackSpecificSettings( const QDomElement & _this ) override;
|
||||
|
||||
static BBTrack * findBBTrack( int _bb_num );
|
||||
static void swapBBTracks( Track * _track1, Track * _track2 );
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
inline virtual QString nodeName() const
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return( "bbtrack" );
|
||||
}
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
BBTrackView( BBTrack* bbt, TrackContainerView* tcv );
|
||||
virtual ~BBTrackView();
|
||||
|
||||
virtual bool close();
|
||||
bool close() override;
|
||||
|
||||
const BBTrack * getBBTrack() const
|
||||
{
|
||||
|
||||
@@ -41,15 +41,15 @@ public:
|
||||
virtual bool play( MidiTime _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
|
||||
virtual void updateAfterTrackAdd() override;
|
||||
void updateAfterTrackAdd() override;
|
||||
|
||||
inline virtual QString nodeName() const override
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return "bbtrackcontainer";
|
||||
}
|
||||
|
||||
tact_t lengthOfBB( int _bb ) const;
|
||||
inline tact_t lengthOfCurrentBB()
|
||||
bar_t lengthOfBB( int _bb ) const;
|
||||
inline bar_t lengthOfCurrentBB()
|
||||
{
|
||||
return lengthOfBB( currentBB() );
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _ev );
|
||||
void paintEvent( QPaintEvent * _ev ) override;
|
||||
|
||||
|
||||
protected slots:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* update_event.h - signal GUI updates
|
||||
/* ColorChooser.h - declaration and definition of ColorChooser class.
|
||||
*
|
||||
* Copyright (c) 2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
* Copyright (c) 2019 CYBERDEViLNL <cyberdevilnl/at/protonmail/dot/ch>
|
||||
*
|
||||
* This file is part of LMMS - https://lmms.io
|
||||
*
|
||||
@@ -22,23 +21,21 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QColorDialog>
|
||||
#include <QApplication>
|
||||
#include <QKeyEvent>
|
||||
|
||||
#ifndef UPDATE_EVENT_H
|
||||
#define UPDATE_EVENT_H
|
||||
|
||||
#include "custom_events.h"
|
||||
|
||||
|
||||
|
||||
class updateEvent : public QEvent
|
||||
class ColorChooser: public QColorDialog
|
||||
{
|
||||
public:
|
||||
updateEvent() :
|
||||
QEvent( (QEvent::Type)customEvents::GUI_UPDATE )
|
||||
ColorChooser(const QColor &initial, QWidget *parent): QColorDialog(initial, parent) {};
|
||||
ColorChooser(QWidget *parent): QColorDialog(parent) {};
|
||||
|
||||
protected:
|
||||
// Forward key events to the parent to prevent stuck notes when the dialog gets focus
|
||||
void keyReleaseEvent(QKeyEvent *event) override
|
||||
{
|
||||
QKeyEvent ke(*event);
|
||||
QApplication::sendEvent(parentWidget(), &ke);
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
};
|
||||
@@ -57,10 +57,10 @@ public slots:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent* event );
|
||||
virtual void mousePressEvent( QMouseEvent* event );
|
||||
virtual void paintEvent( QPaintEvent* event );
|
||||
virtual void wheelEvent( QWheelEvent* event );
|
||||
void contextMenuEvent( QContextMenuEvent* event ) override;
|
||||
void mousePressEvent( QMouseEvent* event ) override;
|
||||
void paintEvent( QPaintEvent* event ) override;
|
||||
void wheelEvent( QWheelEvent* event ) override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "lmms_export.h"
|
||||
|
||||
|
||||
class LmmsCore;
|
||||
|
||||
|
||||
@@ -57,61 +58,22 @@ class LMMS_EXPORT ConfigManager : public QObject
|
||||
public:
|
||||
static inline ConfigManager * inst()
|
||||
{
|
||||
if( s_instanceOfMe == NULL )
|
||||
if(s_instanceOfMe == NULL )
|
||||
{
|
||||
s_instanceOfMe = new ConfigManager();
|
||||
}
|
||||
return s_instanceOfMe;
|
||||
}
|
||||
|
||||
const QString & dataDir() const
|
||||
{
|
||||
return m_dataDir;
|
||||
}
|
||||
|
||||
const QString & workingDir() const
|
||||
{
|
||||
return m_workingDir;
|
||||
}
|
||||
|
||||
QString userProjectsDir() const
|
||||
const QString & dataDir() const
|
||||
{
|
||||
return workingDir() + PROJECTS_PATH;
|
||||
}
|
||||
|
||||
QString userTemplateDir() const
|
||||
{
|
||||
return workingDir() + TEMPLATE_PATH;
|
||||
}
|
||||
|
||||
QString userPresetsDir() const
|
||||
{
|
||||
return workingDir() + PRESETS_PATH;
|
||||
}
|
||||
|
||||
QString userSamplesDir() const
|
||||
{
|
||||
return workingDir() + SAMPLES_PATH;
|
||||
}
|
||||
|
||||
QString userGigDir() const
|
||||
{
|
||||
return workingDir() + GIG_PATH;
|
||||
}
|
||||
|
||||
QString userSf2Dir() const
|
||||
{
|
||||
return workingDir() + SF2_PATH;
|
||||
}
|
||||
|
||||
QString userLadspaDir() const
|
||||
{
|
||||
return workingDir() + LADSPA_PATH;
|
||||
}
|
||||
|
||||
QString userVstDir() const
|
||||
{
|
||||
return m_vstDir;
|
||||
return m_dataDir;
|
||||
}
|
||||
|
||||
QString factoryProjectsDir() const
|
||||
@@ -134,37 +96,27 @@ public:
|
||||
return dataDir() + SAMPLES_PATH;
|
||||
}
|
||||
|
||||
QString defaultVersion() const;
|
||||
|
||||
QString defaultArtworkDir() const
|
||||
QString userProjectsDir() const
|
||||
{
|
||||
return m_dataDir + DEFAULT_THEME_PATH;
|
||||
return workingDir() + PROJECTS_PATH;
|
||||
}
|
||||
|
||||
QString artworkDir() const
|
||||
QString userTemplateDir() const
|
||||
{
|
||||
return m_artworkDir;
|
||||
return workingDir() + TEMPLATE_PATH;
|
||||
}
|
||||
|
||||
QString trackIconsDir() const
|
||||
QString userPresetsDir() const
|
||||
{
|
||||
return m_dataDir + TRACK_ICON_PATH;
|
||||
return workingDir() + PRESETS_PATH;
|
||||
}
|
||||
|
||||
QString localeDir() const
|
||||
QString userSamplesDir() const
|
||||
{
|
||||
return m_dataDir + LOCALE_PATH;
|
||||
return workingDir() + SAMPLES_PATH;
|
||||
}
|
||||
|
||||
const QString & gigDir() const
|
||||
{
|
||||
return m_gigDir;
|
||||
}
|
||||
|
||||
const QString & sf2Dir() const
|
||||
{
|
||||
return m_sf2Dir;
|
||||
}
|
||||
|
||||
const QString & vstDir() const
|
||||
{
|
||||
@@ -173,18 +125,20 @@ public:
|
||||
|
||||
const QString & ladspaDir() const
|
||||
{
|
||||
return m_ladDir;
|
||||
return m_ladspaDir;
|
||||
}
|
||||
|
||||
const QString recoveryFile() const
|
||||
const QString & sf2Dir() const
|
||||
{
|
||||
return m_workingDir + "recover.mmp";
|
||||
return m_sf2Dir;
|
||||
}
|
||||
|
||||
const QString & version() const
|
||||
|
||||
#ifdef LMMS_HAVE_FLUIDSYNTH
|
||||
const QString & sf2File() const
|
||||
{
|
||||
return m_version;
|
||||
return m_sf2File;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STK
|
||||
const QString & stkDir() const
|
||||
@@ -193,16 +147,55 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_FLUIDSYNTH
|
||||
const QString & defaultSoundfont() const
|
||||
const QString & gigDir() const
|
||||
{
|
||||
return m_defaultSoundfont;
|
||||
return m_gigDir;
|
||||
}
|
||||
#endif
|
||||
|
||||
const QString & backgroundArtwork() const
|
||||
|
||||
QString userVstDir() const
|
||||
{
|
||||
return m_backgroundArtwork;
|
||||
return m_vstDir;
|
||||
}
|
||||
|
||||
QString userLadspaDir() const
|
||||
{
|
||||
return workingDir() + LADSPA_PATH;
|
||||
}
|
||||
|
||||
QString userSf2Dir() const
|
||||
{
|
||||
return workingDir() + SF2_PATH;
|
||||
}
|
||||
|
||||
QString userGigDir() const
|
||||
{
|
||||
return workingDir() + GIG_PATH;
|
||||
}
|
||||
|
||||
QString defaultThemeDir() const
|
||||
{
|
||||
return m_dataDir + DEFAULT_THEME_PATH;
|
||||
}
|
||||
|
||||
QString themeDir() const
|
||||
{
|
||||
return m_themeDir;
|
||||
}
|
||||
|
||||
const QString & backgroundPicFile() const
|
||||
{
|
||||
return m_backgroundPicFile;
|
||||
}
|
||||
|
||||
QString trackIconsDir() const
|
||||
{
|
||||
return m_dataDir + TRACK_ICON_PATH;
|
||||
}
|
||||
|
||||
const QString recoveryFile() const
|
||||
{
|
||||
return m_workingDir + "recover.mmp";
|
||||
}
|
||||
|
||||
inline const QStringList & recentlyOpenedProjects() const
|
||||
@@ -210,39 +203,51 @@ public:
|
||||
return m_recentlyOpenedProjects;
|
||||
}
|
||||
|
||||
QString localeDir() const
|
||||
{
|
||||
return m_dataDir + LOCALE_PATH;
|
||||
}
|
||||
|
||||
const QString & version() const
|
||||
{
|
||||
return m_version;
|
||||
}
|
||||
|
||||
QString defaultVersion() const;
|
||||
|
||||
|
||||
static QStringList availabeVstEmbedMethods();
|
||||
QString vstEmbedMethod() const;
|
||||
|
||||
// returns true if the working dir (e.g. ~/lmms) exists on disk
|
||||
// Returns true if the working dir (e.g. ~/lmms) exists on disk.
|
||||
bool hasWorkingDir() const;
|
||||
|
||||
void addRecentlyOpenedProject( const QString & _file );
|
||||
void addRecentlyOpenedProject(const QString & _file);
|
||||
|
||||
const QString & value( const QString & cls,
|
||||
const QString & attribute ) const;
|
||||
const QString & value( const QString & cls,
|
||||
const QString & value(const QString & cls,
|
||||
const QString & attribute) const;
|
||||
const QString & value(const QString & cls,
|
||||
const QString & attribute,
|
||||
const QString & defaultVal ) const;
|
||||
void setValue( const QString & cls, const QString & attribute,
|
||||
const QString & value );
|
||||
void deleteValue( const QString & cls, const QString & attribute);
|
||||
const QString & defaultVal) const;
|
||||
void setValue(const QString & cls, const QString & attribute,
|
||||
const QString & value);
|
||||
void deleteValue(const QString & cls, const QString & attribute);
|
||||
|
||||
void loadConfigFile( const QString & configFile = "" );
|
||||
void loadConfigFile(const QString & configFile = "");
|
||||
void saveConfigFile();
|
||||
|
||||
|
||||
void setWorkingDir( const QString & _wd );
|
||||
void setVSTDir( const QString & _vd );
|
||||
void setArtworkDir( const QString & _ad );
|
||||
void setLADSPADir( const QString & _fd );
|
||||
void setVersion( const QString & _cv );
|
||||
void setSTKDir( const QString & _fd );
|
||||
void setDefaultSoundfont( const QString & _sf );
|
||||
void setBackgroundArtwork( const QString & _ba );
|
||||
void setGIGDir( const QString & gd );
|
||||
void setSF2Dir( const QString & sfd );
|
||||
void setWorkingDir(const QString & workingDir);
|
||||
void setVSTDir(const QString & vstDir);
|
||||
void setLADSPADir(const QString & ladspaDir);
|
||||
void setSF2Dir(const QString & sf2Dir);
|
||||
void setSF2File(const QString & sf2File);
|
||||
void setSTKDir(const QString & stkDir);
|
||||
void setGIGDir(const QString & gigDir);
|
||||
void setThemeDir(const QString & themeDir);
|
||||
void setBackgroundPicFile(const QString & backgroundPicFile);
|
||||
|
||||
// creates the working directory & subdirectories on disk.
|
||||
// Creates the working directory & subdirectories on disk.
|
||||
void createWorkingDir();
|
||||
|
||||
signals:
|
||||
@@ -252,29 +257,29 @@ private:
|
||||
static ConfigManager * s_instanceOfMe;
|
||||
|
||||
ConfigManager();
|
||||
ConfigManager( const ConfigManager & _c );
|
||||
ConfigManager(const ConfigManager & _c);
|
||||
~ConfigManager();
|
||||
|
||||
void upgrade_1_1_90();
|
||||
void upgrade_1_1_91();
|
||||
void upgrade();
|
||||
|
||||
QString m_lmmsRcFile;
|
||||
QString m_workingDir;
|
||||
QString m_dataDir;
|
||||
QString m_artworkDir;
|
||||
QString m_vstDir;
|
||||
QString m_ladDir;
|
||||
QString m_gigDir;
|
||||
QString m_ladspaDir;
|
||||
QString m_sf2Dir;
|
||||
QString m_version;
|
||||
#ifdef LMMS_HAVE_FLUIDSYNTH
|
||||
QString m_sf2File;
|
||||
#endif
|
||||
#ifdef LMMS_HAVE_STK
|
||||
QString m_stkDir;
|
||||
#endif
|
||||
#ifdef LMMS_HAVE_FLUIDSYNTH
|
||||
QString m_defaultSoundfont;
|
||||
#endif
|
||||
QString m_backgroundArtwork;
|
||||
QString m_gigDir;
|
||||
QString m_themeDir;
|
||||
QString m_backgroundPicFile;
|
||||
QString m_lmmsRcFile;
|
||||
QString m_version;
|
||||
QStringList m_recentlyOpenedProjects;
|
||||
|
||||
typedef QVector<QPair<QString, QString> > stringPairVector;
|
||||
@@ -283,7 +288,5 @@ private:
|
||||
|
||||
|
||||
friend class LmmsCore;
|
||||
|
||||
} ;
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
133
include/ControlLayout.h
Normal file
133
include/ControlLayout.h
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* ControlLayout.h - layout for controls
|
||||
*
|
||||
* Copyright (c) 2019-2019 Johannes Lorenz <j.git$$$lorenz-ho.me, $$$=@>
|
||||
*
|
||||
* This file is part of LMMS - https://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** BSD License Usage
|
||||
** Alternatively, you may use this file under the terms of the BSD license
|
||||
** as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||
** contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONTROLLAYOUT_H
|
||||
#define CONTROLLAYOUT_H
|
||||
|
||||
#include <QLayout>
|
||||
#include <QMultiMap>
|
||||
#include <QStyle>
|
||||
class QLayoutItem;
|
||||
class QRect;
|
||||
class QString;
|
||||
|
||||
/**
|
||||
Layout for controls (models)
|
||||
|
||||
Originally token from Qt's FlowLayout example. Modified.
|
||||
|
||||
Features a search bar, as well as looking up widgets with string keys
|
||||
Keys have to be provided in the widgets' objectNames
|
||||
*/
|
||||
class ControlLayout : public QLayout
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ControlLayout(QWidget *parent,
|
||||
int margin = -1, int hSpacing = -1, int vSpacing = -1);
|
||||
~ControlLayout() override;
|
||||
|
||||
void addItem(QLayoutItem *item) override;
|
||||
int horizontalSpacing() const;
|
||||
int verticalSpacing() const;
|
||||
Qt::Orientations expandingDirections() const override;
|
||||
bool hasHeightForWidth() const override;
|
||||
int heightForWidth(int) const override;
|
||||
int count() const override;
|
||||
QLayoutItem *itemAt(int index) const override;
|
||||
QLayoutItem *itemByString(const QString& key) const;
|
||||
QSize minimumSize() const override;
|
||||
void setGeometry(const QRect &rect) override;
|
||||
QSize sizeHint() const override;
|
||||
QLayoutItem *takeAt(int index) override;
|
||||
|
||||
private slots:
|
||||
void onTextChanged(const QString&);
|
||||
|
||||
private:
|
||||
int doLayout(const QRect &rect, bool testOnly) const;
|
||||
int smartSpacing(QStyle::PixelMetric pm) const;
|
||||
QMap<QString, QLayoutItem *>::const_iterator pairAt(int index) const;
|
||||
|
||||
QMultiMap<QString, QLayoutItem *> m_itemMap;
|
||||
int m_hSpace;
|
||||
int m_vSpace;
|
||||
// relevant dimension is width, as later, heightForWidth() will be called
|
||||
// 400 looks good and is ~4 knobs in a row
|
||||
constexpr const static int m_minWidth = 400;
|
||||
class QLineEdit* m_searchBar;
|
||||
//! name of search bar, must be ASCII sorted before any alpha numerics
|
||||
static constexpr const char* s_searchBarName = "!!searchBar!!";
|
||||
};
|
||||
|
||||
#endif // CONTROLLAYOUT_H
|
||||
@@ -101,9 +101,9 @@ public:
|
||||
}
|
||||
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
virtual QString nodeName() const;
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
QString nodeName() const override;
|
||||
|
||||
static Controller * create( ControllerTypes _tt, Model * _parent );
|
||||
static Controller * create( const QDomElement & _this,
|
||||
|
||||
@@ -85,15 +85,15 @@ public:
|
||||
|
||||
static void finalizeConnections();
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
static inline const QString classNodeName()
|
||||
{
|
||||
return "connection";
|
||||
}
|
||||
|
||||
virtual QString nodeName() const
|
||||
QString nodeName() const override
|
||||
{
|
||||
return classNodeName();
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ signals:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
void closeEvent( QCloseEvent * _ce ) override;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -47,10 +47,10 @@ public:
|
||||
ControllerRackView();
|
||||
virtual ~ControllerRackView();
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
inline virtual QString nodeName() const
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return "ControllerRackView";
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public slots:
|
||||
void onControllerRemoved( Controller * );
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
void closeEvent( QCloseEvent * _ce ) override;
|
||||
|
||||
private slots:
|
||||
void addController();
|
||||
|
||||
@@ -68,9 +68,9 @@ signals:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _me );
|
||||
virtual void modelChanged();
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * event );
|
||||
void contextMenuEvent( QContextMenuEvent * _me ) override;
|
||||
void modelChanged() override;
|
||||
void mouseDoubleClickEvent( QMouseEvent * event ) override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
134
include/Controls.h
Normal file
134
include/Controls.h
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Controls.h - labeled control widgets
|
||||
*
|
||||
* Copyright (c) 2019-2019 Johannes Lorenz <j.git$$$lorenz-ho.me, $$$=@>
|
||||
*
|
||||
* This file is part of LMMS - https://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CONTROLS_H
|
||||
#define CONTROLS_H
|
||||
|
||||
|
||||
#include "Model.h"
|
||||
|
||||
// headers only required for covariance
|
||||
#include "AutomatableModel.h"
|
||||
#include "ComboBoxModel.h"
|
||||
|
||||
|
||||
class QString;
|
||||
class QWidget;
|
||||
class AutomatableModel;
|
||||
|
||||
|
||||
/**
|
||||
These classes provide
|
||||
- a control with a text label
|
||||
- a type safe way to set a model
|
||||
(justification: setting the wrong typed model to a widget will cause
|
||||
hard-to-find runtime errors)
|
||||
*/
|
||||
class Control
|
||||
{
|
||||
public:
|
||||
virtual QWidget* topWidget() = 0;
|
||||
virtual void setText(const QString& text) = 0;
|
||||
|
||||
virtual void setModel(AutomatableModel* model) = 0;
|
||||
virtual AutomatableModel* model() = 0;
|
||||
virtual class AutomatableModelView* modelView() = 0;
|
||||
|
||||
virtual ~Control();
|
||||
};
|
||||
|
||||
|
||||
class KnobControl : public Control
|
||||
{
|
||||
class Knob* m_knob;
|
||||
|
||||
public:
|
||||
void setText(const QString& text) override;
|
||||
QWidget* topWidget() override;
|
||||
|
||||
void setModel(AutomatableModel* model) override;
|
||||
FloatModel* model() override;
|
||||
class AutomatableModelView* modelView() override;
|
||||
|
||||
KnobControl(QWidget* parent = nullptr);
|
||||
~KnobControl() override;
|
||||
};
|
||||
|
||||
|
||||
class ComboControl : public Control
|
||||
{
|
||||
QWidget* m_widget;
|
||||
class ComboBox* m_combo;
|
||||
class QLabel* m_label;
|
||||
|
||||
public:
|
||||
void setText(const QString& text) override;
|
||||
QWidget* topWidget() override { return m_widget; }
|
||||
|
||||
void setModel(AutomatableModel* model) override;
|
||||
ComboBoxModel* model() override;
|
||||
class AutomatableModelView* modelView() override;
|
||||
|
||||
ComboControl(QWidget* parent = nullptr);
|
||||
~ComboControl() override;
|
||||
};
|
||||
|
||||
|
||||
class LcdControl : public Control
|
||||
{
|
||||
class LcdSpinBox* m_lcd;
|
||||
|
||||
public:
|
||||
void setText(const QString& text) override;
|
||||
QWidget* topWidget() override;
|
||||
|
||||
void setModel(AutomatableModel* model) override;
|
||||
IntModel* model() override;
|
||||
class AutomatableModelView* modelView() override;
|
||||
|
||||
LcdControl(int numDigits, QWidget* parent = nullptr);
|
||||
~LcdControl() override;
|
||||
};
|
||||
|
||||
|
||||
class CheckControl : public Control
|
||||
{
|
||||
QWidget* m_widget;
|
||||
class LedCheckBox* m_checkBox;
|
||||
QLabel* m_label;
|
||||
|
||||
public:
|
||||
void setText(const QString& text) override;
|
||||
QWidget* topWidget() override;
|
||||
|
||||
void setModel(AutomatableModel* model) override;
|
||||
BoolModel *model() override;
|
||||
class AutomatableModelView* modelView() override;
|
||||
|
||||
CheckControl(QWidget* parent = nullptr);
|
||||
~CheckControl() override;
|
||||
};
|
||||
|
||||
|
||||
#endif // CONTROLS_H
|
||||
@@ -43,17 +43,17 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual float defaultValue() const
|
||||
float defaultValue() const override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual QString displayName() const
|
||||
QString displayName() const override
|
||||
{
|
||||
return tr( "Note detuning" );
|
||||
}
|
||||
|
||||
inline virtual QString nodeName() const
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return "detuning";
|
||||
}
|
||||
|
||||
@@ -53,25 +53,25 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual int controlCount()
|
||||
int controlCount() override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument &, QDomElement & )
|
||||
void saveSettings( QDomDocument &, QDomElement & ) override
|
||||
{
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement & )
|
||||
void loadSettings( const QDomElement & ) override
|
||||
{
|
||||
}
|
||||
|
||||
virtual QString nodeName() const
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "DummyControls";
|
||||
}
|
||||
|
||||
virtual EffectControlDialog * createView()
|
||||
EffectControlDialog * createView() override
|
||||
{
|
||||
return new DummyEffectControlDialog( this );
|
||||
}
|
||||
@@ -95,12 +95,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual EffectControls * controls()
|
||||
EffectControls * controls() override
|
||||
{
|
||||
return &m_controls;
|
||||
}
|
||||
|
||||
bool processAudioBuffer( sampleFrame *, const fpp_t )
|
||||
bool processAudioBuffer( sampleFrame *, const fpp_t ) override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -47,26 +47,26 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void playNote( NotePlayHandle *, sampleFrame * buffer )
|
||||
void playNote( NotePlayHandle *, sampleFrame * buffer ) override
|
||||
{
|
||||
memset( buffer, 0, sizeof( sampleFrame ) *
|
||||
Engine::mixer()->framesPerPeriod() );
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument &, QDomElement & )
|
||||
void saveSettings( QDomDocument &, QDomElement & ) override
|
||||
{
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement & )
|
||||
void loadSettings( const QDomElement & ) override
|
||||
{
|
||||
}
|
||||
|
||||
virtual QString nodeName() const
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "dummyinstrument";
|
||||
}
|
||||
|
||||
virtual PluginView * instantiateView( QWidget * _parent )
|
||||
PluginView * instantiateView( QWidget * _parent ) override
|
||||
{
|
||||
return new InstrumentViewFixedSize( this, _parent );
|
||||
}
|
||||
|
||||
@@ -42,22 +42,22 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument &, QDomElement & )
|
||||
void saveSettings( QDomDocument &, QDomElement & ) override
|
||||
{
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement & )
|
||||
void loadSettings( const QDomElement & ) override
|
||||
{
|
||||
}
|
||||
|
||||
virtual QString nodeName() const
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "DummyPlugin";
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
virtual PluginView * instantiateView( QWidget * _parent )
|
||||
PluginView * instantiateView( QWidget * _parent ) override
|
||||
{
|
||||
return new PluginView( this, _parent );
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ protected:
|
||||
DropToolBar * addDropToolBar(Qt::ToolBarArea whereToAdd, QString const & windowTitle);
|
||||
DropToolBar * addDropToolBar(QWidget * parent, Qt::ToolBarArea whereToAdd, QString const & windowTitle);
|
||||
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
void closeEvent( QCloseEvent * _ce ) override;
|
||||
protected slots:
|
||||
virtual void play() {}
|
||||
virtual void record() {}
|
||||
@@ -92,8 +92,8 @@ signals:
|
||||
void dropped(QDropEvent* event);
|
||||
|
||||
protected:
|
||||
void dragEnterEvent(QDragEnterEvent* event);
|
||||
void dropEvent(QDropEvent* event);
|
||||
void dragEnterEvent(QDragEnterEvent* event) override;
|
||||
void dropEvent(QDropEvent* event) override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -47,10 +47,10 @@ public:
|
||||
const Descriptor::SubPluginFeatures::Key * _key );
|
||||
virtual ~Effect();
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
inline virtual QString nodeName() const
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return "effect";
|
||||
}
|
||||
@@ -170,7 +170,7 @@ protected:
|
||||
*/
|
||||
void checkGate( double _out_sum );
|
||||
|
||||
virtual PluginView * instantiateView( QWidget * );
|
||||
PluginView * instantiateView( QWidget * ) override;
|
||||
|
||||
// some effects might not be capable of higher sample-rates so they can
|
||||
// sample it down before processing and back after processing
|
||||
|
||||
@@ -40,10 +40,10 @@ public:
|
||||
EffectChain( Model * _parent );
|
||||
virtual ~EffectChain();
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
inline virtual QString nodeName() const
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return "fxchain";
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ signals:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
void closeEvent( QCloseEvent * _ce ) override;
|
||||
|
||||
EffectControls * m_effectControls;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ private slots:
|
||||
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
inline EffectChain* fxChain()
|
||||
{
|
||||
|
||||
@@ -73,9 +73,9 @@ signals:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void modelChanged();
|
||||
void contextMenuEvent( QContextMenuEvent * _me ) override;
|
||||
void paintEvent( QPaintEvent * _pe ) override;
|
||||
void modelChanged() override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -91,9 +91,9 @@ public:
|
||||
}
|
||||
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
virtual QString nodeName() const
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "el";
|
||||
}
|
||||
|
||||
@@ -52,12 +52,12 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
void dragEnterEvent( QDragEnterEvent * _dee ) override;
|
||||
void dropEvent( QDropEvent * _de ) override;
|
||||
void mousePressEvent( QMouseEvent * _me ) override;
|
||||
void paintEvent( QPaintEvent * _pe ) override;
|
||||
|
||||
|
||||
protected slots:
|
||||
|
||||
@@ -44,15 +44,15 @@ public:
|
||||
int tempo, int masterPitch, const QString &filename ) = 0;
|
||||
protected:
|
||||
|
||||
virtual void saveSettings( QDomDocument &, QDomElement & )
|
||||
void saveSettings( QDomDocument &, QDomElement & ) override
|
||||
{
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement & )
|
||||
void loadSettings( const QDomElement & ) override
|
||||
{
|
||||
}
|
||||
|
||||
virtual QString nodeName() const
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "import_filter";
|
||||
}
|
||||
|
||||
@@ -41,14 +41,14 @@ public:
|
||||
ExportProjectDialog( const QString & _file_name, QWidget * _parent, bool multi_export );
|
||||
|
||||
protected:
|
||||
virtual void reject( void );
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
void reject( void ) override;
|
||||
void closeEvent( QCloseEvent * _ce ) override;
|
||||
|
||||
|
||||
private slots:
|
||||
void startBtnClicked( void );
|
||||
void updateTitleBar( int );
|
||||
void accept();
|
||||
void accept() override;
|
||||
void startExport();
|
||||
|
||||
void onFileFormatChanged(int);
|
||||
|
||||
@@ -46,12 +46,12 @@ public:
|
||||
|
||||
public slots:
|
||||
void activate();
|
||||
void activateOnce();
|
||||
void noteEnd();
|
||||
|
||||
|
||||
protected:
|
||||
virtual void customEvent( QEvent * );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
void paintEvent( QPaintEvent * _pe ) override;
|
||||
|
||||
|
||||
private:
|
||||
@@ -66,7 +66,6 @@ private:
|
||||
QColor m_holdColor;
|
||||
int activeNotes;
|
||||
|
||||
void signalUpdate();
|
||||
QColor fadeToColor(QColor, QColor, QTime, float);
|
||||
|
||||
} ;
|
||||
|
||||
@@ -109,13 +109,13 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _me );
|
||||
virtual void mousePressEvent( QMouseEvent *ev );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent* mouseEvent );
|
||||
virtual void mouseMoveEvent( QMouseEvent *ev );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void wheelEvent( QWheelEvent *ev );
|
||||
virtual void paintEvent( QPaintEvent *ev );
|
||||
void contextMenuEvent( QContextMenuEvent * _me ) override;
|
||||
void mousePressEvent( QMouseEvent *ev ) override;
|
||||
void mouseDoubleClickEvent( QMouseEvent* mouseEvent ) override;
|
||||
void mouseMoveEvent( QMouseEvent *ev ) override;
|
||||
void mouseReleaseEvent( QMouseEvent * _me ) override;
|
||||
void wheelEvent( QWheelEvent *ev ) override;
|
||||
void paintEvent( QPaintEvent *ev ) override;
|
||||
|
||||
inline bool clips(float const & value) const { return value >= 1.0f; }
|
||||
|
||||
|
||||
@@ -48,6 +48,14 @@ class FileBrowser : public SideBarWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
Create a file browser side bar widget
|
||||
@param directories '*'-separated list of directories to search for.
|
||||
If a directory of factory files should be in the list it
|
||||
must be the last one (for the factory files delimiter to work)
|
||||
@param filter Filter as used in QDir::match
|
||||
@param recurse *to be documented*
|
||||
*/
|
||||
FileBrowser( const QString & directories, const QString & filter,
|
||||
const QString & title, const QPixmap & pm,
|
||||
QWidget * parent, bool dirs_as_items = false, bool recurse = false );
|
||||
@@ -61,7 +69,7 @@ private slots:
|
||||
void giveFocusToFilter();
|
||||
|
||||
private:
|
||||
virtual void keyPressEvent( QKeyEvent * ke );
|
||||
void keyPressEvent( QKeyEvent * ke ) override;
|
||||
|
||||
void addItems( const QString & path );
|
||||
|
||||
@@ -69,8 +77,8 @@ private:
|
||||
|
||||
QLineEdit * m_filterEdit;
|
||||
|
||||
QString m_directories;
|
||||
QString m_filter;
|
||||
QString m_directories; //!< Directories to search, split with '*'
|
||||
QString m_filter; //!< Filter as used in QDir::match()
|
||||
|
||||
bool m_dirsAsItems;
|
||||
bool m_recurse;
|
||||
@@ -93,10 +101,10 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent * e );
|
||||
virtual void mousePressEvent( QMouseEvent * me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * me );
|
||||
void contextMenuEvent( QContextMenuEvent * e ) override;
|
||||
void mousePressEvent( QMouseEvent * me ) override;
|
||||
void mouseMoveEvent( QMouseEvent * me ) override;
|
||||
void mouseReleaseEvent( QMouseEvent * me ) override;
|
||||
|
||||
|
||||
private:
|
||||
@@ -119,6 +127,7 @@ private slots:
|
||||
void openInNewInstrumentTrackSE( void );
|
||||
void sendToActiveInstrumentTrack( void );
|
||||
void updateDirectory( QTreeWidgetItem * item );
|
||||
void openContainingFolder();
|
||||
|
||||
} ;
|
||||
|
||||
@@ -163,7 +172,14 @@ private:
|
||||
static QPixmap * s_folderOpenedPixmap;
|
||||
static QPixmap * s_folderLockedPixmap;
|
||||
|
||||
//! Directories that lead here
|
||||
//! Initially, this is just set to the current path of a directory
|
||||
//! If, however, you have e.g. 'TripleOscillator/xyz' in two of the
|
||||
//! file browser's search directories 'a' and 'b', this will have two
|
||||
//! entries 'a/TripleOscillator' and 'b/TripleOscillator'
|
||||
//! and 'xyz' in the tree widget
|
||||
QStringList m_directories;
|
||||
//! Filter as used in QDir::match()
|
||||
QString m_filter;
|
||||
|
||||
int m_dirCount;
|
||||
|
||||
@@ -51,10 +51,10 @@ public:
|
||||
FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex);
|
||||
~FxLine();
|
||||
|
||||
virtual void paintEvent( QPaintEvent * );
|
||||
virtual void mousePressEvent( QMouseEvent * );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * );
|
||||
virtual void contextMenuEvent( QContextMenuEvent * );
|
||||
void paintEvent( QPaintEvent * ) override;
|
||||
void mousePressEvent( QMouseEvent * ) override;
|
||||
void mouseDoubleClickEvent( QMouseEvent * ) override;
|
||||
void contextMenuEvent( QContextMenuEvent * ) override;
|
||||
|
||||
inline int channelIndex() { return m_channelIndex; }
|
||||
void setChannelIndex(int index);
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
|
||||
static const int FxLineHeight;
|
||||
|
||||
bool eventFilter (QObject *dist, QEvent *event);
|
||||
bool eventFilter (QObject *dist, QEvent *event) override;
|
||||
|
||||
private:
|
||||
void drawFxLine( QPainter* p, const FxLine *fxLine, bool isActive, bool sendToThis, bool receiveFromThis );
|
||||
|
||||
@@ -42,8 +42,8 @@ public:
|
||||
void setTrackView(TrackView * tv);
|
||||
|
||||
protected:
|
||||
virtual void mouseDoubleClickEvent(QMouseEvent* event);
|
||||
virtual void contextMenuEvent(QContextMenuEvent* event);
|
||||
void mouseDoubleClickEvent(QMouseEvent* event) override;
|
||||
void contextMenuEvent(QContextMenuEvent* event) override;
|
||||
|
||||
private:
|
||||
TrackView * m_tv;
|
||||
|
||||
@@ -67,7 +67,7 @@ class FxChannel : public ThreadableJob
|
||||
// pointers to other channels that send to this one
|
||||
FxRouteVector m_receives;
|
||||
|
||||
virtual bool requiresProcessing() const { return true; }
|
||||
bool requiresProcessing() const override { return true; }
|
||||
void unmuteForSolo();
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class FxChannel : public ThreadableJob
|
||||
void processed();
|
||||
|
||||
private:
|
||||
virtual void doProcessing();
|
||||
void doProcessing() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -133,10 +133,10 @@ public:
|
||||
void prepareMasterMix();
|
||||
void masterMix( sampleFrame * _buf );
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
virtual QString nodeName() const
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "fxmixer";
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ public:
|
||||
FxMixerView();
|
||||
virtual ~FxMixerView();
|
||||
|
||||
virtual void keyPressEvent(QKeyEvent * e);
|
||||
void keyPressEvent(QKeyEvent * e) override;
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
inline FxLine * currentFxLine()
|
||||
{
|
||||
@@ -110,7 +110,7 @@ public slots:
|
||||
int addNewChannel();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
void closeEvent( QCloseEvent * _ce ) override;
|
||||
|
||||
private slots:
|
||||
void updateFaders();
|
||||
|
||||
@@ -87,19 +87,19 @@ public:
|
||||
signals:
|
||||
void drawn();
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
void paintEvent( QPaintEvent * _pe ) override;
|
||||
void dropEvent( QDropEvent * _de ) override;
|
||||
void dragEnterEvent( QDragEnterEvent * _dee ) override;
|
||||
void mousePressEvent( QMouseEvent * _me ) override;
|
||||
void mouseMoveEvent( QMouseEvent * _me ) override;
|
||||
void mouseReleaseEvent( QMouseEvent * _me ) override;
|
||||
|
||||
protected slots:
|
||||
void updateGraph( int _startPos, int _endPos );
|
||||
void updateGraph();
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
void changeSampleAt( int _x, int _y );
|
||||
void drawLineAt( int _x, int _y, int _lastx );
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
GroupBox( const QString & _caption, QWidget * _parent = NULL );
|
||||
virtual ~GroupBox();
|
||||
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
PixmapButton * ledButton()
|
||||
{
|
||||
@@ -56,8 +56,8 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
void mousePressEvent( QMouseEvent * _me ) override;
|
||||
void paintEvent( QPaintEvent * _pe ) override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -89,15 +89,15 @@ protected:
|
||||
m_file.ungetChar( _ch );
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument &, QDomElement & )
|
||||
void saveSettings( QDomDocument &, QDomElement & ) override
|
||||
{
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement & )
|
||||
void loadSettings( const QDomElement & ) override
|
||||
{
|
||||
}
|
||||
|
||||
virtual QString nodeName() const
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "import_filter";
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ public:
|
||||
return m_autoPattern;
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual QString fullDisplayName() const;
|
||||
QString fullDisplayName() const override;
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// provided functions:
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
InstrumentFunctionNoteStacking * m_cc;
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
InstrumentFunctionArpeggio * m_a;
|
||||
GroupBox * m_arpGroupBox;
|
||||
|
||||
@@ -54,10 +54,10 @@ public:
|
||||
void processNote( NotePlayHandle* n );
|
||||
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
inline virtual QString nodeName() const
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return "chordcreator";
|
||||
}
|
||||
@@ -176,10 +176,10 @@ public:
|
||||
void processNote( NotePlayHandle* n );
|
||||
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
inline virtual QString nodeName() const
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return "arpeggiator";
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
GroupBox * m_midiInputGroupBox;
|
||||
LcdSpinBox * m_inputChannelSpinBox;
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
virtual void play( sampleFrame * _working_buffer )
|
||||
void play( sampleFrame * _working_buffer ) override
|
||||
{
|
||||
// ensure that all our nph's have been processed first
|
||||
ConstNotePlayHandleList nphv = NotePlayHandle::nphsOfInstrumentTrack( m_instrument->instrumentTrack(), true );
|
||||
@@ -65,12 +65,12 @@ public:
|
||||
m_instrument->play( _working_buffer );
|
||||
}
|
||||
|
||||
virtual bool isFinished() const
|
||||
bool isFinished() const override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool isFromTrack( const Track* _track ) const
|
||||
bool isFromTrack( const Track* _track ) const override
|
||||
{
|
||||
return m_instrument->isFromTrack( _track );
|
||||
}
|
||||
|
||||
@@ -57,9 +57,9 @@ public:
|
||||
float volumeLevel( NotePlayHandle * _n, const f_cnt_t _frame );
|
||||
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName() const
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return "eldata";
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
|
||||
InstrumentSoundShaping * m_ss;
|
||||
|
||||
@@ -80,8 +80,8 @@ public:
|
||||
|
||||
MidiEvent applyMasterKey( const MidiEvent& event );
|
||||
|
||||
virtual void processInEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 );
|
||||
virtual void processOutEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 );
|
||||
void processInEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 ) override;
|
||||
void processOutEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 ) override;
|
||||
// silence all running notes played by this track
|
||||
void silenceAllNotes( bool removeIPH = false );
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
void deleteNotePluginData( NotePlayHandle * _n );
|
||||
|
||||
// name-stuff
|
||||
virtual void setName( const QString & _new_name );
|
||||
void setName( const QString & _new_name ) override;
|
||||
|
||||
// translate given key of a note-event to absolute key (i.e.
|
||||
// add global master-pitch and base-note of this instrument track)
|
||||
@@ -131,18 +131,18 @@ public:
|
||||
|
||||
// play everything in given frame-range - creates note-play-handles
|
||||
virtual bool play( const MidiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 ) override;
|
||||
// create new view for me
|
||||
virtual TrackView * createView( TrackContainerView* tcv );
|
||||
TrackView * createView( TrackContainerView* tcv ) override;
|
||||
|
||||
// create new track-content-object = pattern
|
||||
virtual TrackContentObject * createTCO( const MidiTime & _pos );
|
||||
TrackContentObject * createTCO( const MidiTime & _pos ) override;
|
||||
|
||||
|
||||
// called by track
|
||||
virtual void saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void loadTrackSpecificSettings( const QDomElement & _this );
|
||||
QDomElement & _parent ) override;
|
||||
void loadTrackSpecificSettings( const QDomElement & _this ) override;
|
||||
|
||||
using Track::setJournalling;
|
||||
|
||||
@@ -225,7 +225,7 @@ signals:
|
||||
|
||||
|
||||
protected:
|
||||
virtual QString nodeName() const
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "instrumenttrack";
|
||||
}
|
||||
@@ -317,12 +317,12 @@ public:
|
||||
static void cleanupWindowCache();
|
||||
|
||||
// Create a menu for assigning/creating channels for this track
|
||||
QMenu * createFxMenu( QString title, QString newFxLabel );
|
||||
QMenu * createFxMenu( QString title, QString newFxLabel ) override;
|
||||
|
||||
|
||||
protected:
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
void dragEnterEvent( QDragEnterEvent * _dee ) override;
|
||||
void dropEvent( QDropEvent * _de ) override;
|
||||
|
||||
|
||||
private slots:
|
||||
@@ -333,7 +333,6 @@ private slots:
|
||||
void midiInSelected();
|
||||
void midiOutSelected();
|
||||
void midiConfigChanged();
|
||||
void muteChanged();
|
||||
|
||||
void assignFxLine( int channelIndex );
|
||||
void createFxLine();
|
||||
@@ -357,6 +356,10 @@ private:
|
||||
|
||||
QPoint m_lastPos;
|
||||
|
||||
FadeButton * getActivityIndicator()
|
||||
{
|
||||
return m_activityIndicator;
|
||||
}
|
||||
|
||||
friend class InstrumentTrackWindow;
|
||||
|
||||
@@ -404,8 +407,8 @@ public:
|
||||
|
||||
static void dragEnterEventGeneric( QDragEnterEvent * _dee );
|
||||
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
void dragEnterEvent( QDragEnterEvent * _dee ) override;
|
||||
void dropEvent( QDropEvent * _de ) override;
|
||||
|
||||
|
||||
public slots:
|
||||
@@ -417,11 +420,11 @@ public slots:
|
||||
|
||||
protected:
|
||||
// capture close-events for toggling instrument-track-button
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
virtual void focusInEvent( QFocusEvent * _fe );
|
||||
void closeEvent( QCloseEvent * _ce ) override;
|
||||
void focusInEvent( QFocusEvent * _fe ) override;
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
|
||||
protected slots:
|
||||
@@ -430,7 +433,7 @@ protected slots:
|
||||
void viewPrevInstrument();
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
void viewInstrumentInDirection(int d);
|
||||
//! adjust size of any child widget of the main tab
|
||||
//! required to keep the old look when using a variable sized tab widget
|
||||
|
||||
@@ -59,9 +59,9 @@ public:
|
||||
void addJournalCheckPoint();
|
||||
|
||||
virtual QDomElement saveState( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
QDomElement & _parent ) override;
|
||||
|
||||
virtual void restoreState( const QDomElement & _this );
|
||||
void restoreState( const QDomElement & _this ) override;
|
||||
|
||||
inline bool isJournalling() const
|
||||
{
|
||||
|
||||
@@ -124,16 +124,16 @@ signals:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _me );
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void focusOutEvent( QFocusEvent * _fe );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _me );
|
||||
virtual void wheelEvent( QWheelEvent * _me );
|
||||
void contextMenuEvent( QContextMenuEvent * _me ) override;
|
||||
void dragEnterEvent( QDragEnterEvent * _dee ) override;
|
||||
void dropEvent( QDropEvent * _de ) override;
|
||||
void focusOutEvent( QFocusEvent * _fe ) override;
|
||||
void mousePressEvent( QMouseEvent * _me ) override;
|
||||
void mouseReleaseEvent( QMouseEvent * _me ) override;
|
||||
void mouseMoveEvent( QMouseEvent * _me ) override;
|
||||
void mouseDoubleClickEvent( QMouseEvent * _me ) override;
|
||||
void paintEvent( QPaintEvent * _me ) override;
|
||||
void wheelEvent( QWheelEvent * _me ) override;
|
||||
|
||||
virtual float getValue( const QPoint & _p );
|
||||
|
||||
@@ -145,7 +145,7 @@ private slots:
|
||||
private:
|
||||
QString displayValue() const;
|
||||
|
||||
virtual void doConnections();
|
||||
void doConnections() override;
|
||||
|
||||
QLineF calculateLine( const QPointF & _mid, float _radius,
|
||||
float _innerRadius = 1) const;
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent, const QString & _name );
|
||||
virtual void loadSettings( const QDomElement & _this, const QString & _name );
|
||||
inline virtual QString nodeName() const
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return "port";
|
||||
}
|
||||
@@ -92,13 +92,13 @@ protected slots:
|
||||
void linkStateChanged();
|
||||
|
||||
protected:
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& element )
|
||||
void saveSettings( QDomDocument& doc, QDomElement& element ) override
|
||||
{
|
||||
Q_UNUSED(doc)
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
virtual void loadSettings( const QDomElement& element )
|
||||
void loadSettings( const QDomElement& element ) override
|
||||
{
|
||||
Q_UNUSED(element)
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
|
||||
virtual ~LcdSpinBox() = default;
|
||||
|
||||
virtual void modelChanged()
|
||||
void modelChanged() override
|
||||
{
|
||||
ModelView::modelChanged();
|
||||
update();
|
||||
@@ -65,12 +65,12 @@ public slots:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _me );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
void contextMenuEvent( QContextMenuEvent * _me ) override;
|
||||
void mousePressEvent( QMouseEvent * _me ) override;
|
||||
void mouseMoveEvent( QMouseEvent * _me ) override;
|
||||
void mouseReleaseEvent( QMouseEvent * _me ) override;
|
||||
void wheelEvent( QWheelEvent * _we ) override;
|
||||
void mouseDoubleClickEvent( QMouseEvent * _me ) override;
|
||||
|
||||
private:
|
||||
bool m_mouseMoving;
|
||||
|
||||
@@ -71,7 +71,7 @@ public slots:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * pe );
|
||||
void paintEvent( QPaintEvent * pe ) override;
|
||||
|
||||
virtual void updateSize();
|
||||
|
||||
@@ -100,7 +100,7 @@ private:
|
||||
int m_numDigits;
|
||||
int m_marginWidth;
|
||||
|
||||
void initUi( const QString& name, const QString &style = QString("19green") ); //!< to be called by ctors
|
||||
void initUi( const QString& name, const QString &style ); //!< to be called by ctors
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
Q_PROPERTY( QString text READ text WRITE setText )
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
void paintEvent( QPaintEvent * _pe ) override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -49,18 +49,18 @@ public:
|
||||
|
||||
virtual ~LfoController();
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
virtual QString nodeName() const;
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
QString nodeName() const override;
|
||||
|
||||
|
||||
public slots:
|
||||
virtual ControllerDialog * createDialog( QWidget * _parent );
|
||||
ControllerDialog * createDialog( QWidget * _parent ) override;
|
||||
|
||||
|
||||
protected:
|
||||
// The internal per-controller value updating function
|
||||
virtual void updateValueBuffer();
|
||||
void updateValueBuffer() override;
|
||||
|
||||
FloatModel m_baseModel;
|
||||
TempoSyncKnobModel m_speedModel;
|
||||
@@ -98,8 +98,8 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _me );
|
||||
virtual void modelChanged();
|
||||
void contextMenuEvent( QContextMenuEvent * _me ) override;
|
||||
void modelChanged() override;
|
||||
|
||||
LfoController * m_lfo;
|
||||
|
||||
|
||||
105
include/LinkedModelGroupViews.h
Normal file
105
include/LinkedModelGroupViews.h
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* LinkedModelGroupViews.h - view for groups of linkable models
|
||||
*
|
||||
* Copyright (c) 2019-2019 Johannes Lorenz <j.git$$$lorenz-ho.me, $$$=@>
|
||||
*
|
||||
* This file is part of LMMS - https://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LINKEDMODELGROUPVIEWS_H
|
||||
#define LINKEDMODELGROUPVIEWS_H
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
/**
|
||||
@file LinkedModelGroupViews.h
|
||||
See Lv2ViewBase.h for example usage
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
View for a representative processor
|
||||
|
||||
Features:
|
||||
* Remove button for removable models
|
||||
* Simple handling of adding, removing and model changing
|
||||
|
||||
@note Neither this class, nor any inheriting classes, shall inherit
|
||||
ModelView. The "view" in the name is just for consistency
|
||||
with LinkedModelGroupsView.
|
||||
*/
|
||||
class LinkedModelGroupView : public QWidget
|
||||
{
|
||||
public:
|
||||
/**
|
||||
@param colNum numbers of columns for the controls
|
||||
(link LEDs not counted)
|
||||
*/
|
||||
LinkedModelGroupView(QWidget *parent, class LinkedModelGroup* model,
|
||||
std::size_t colNum);
|
||||
~LinkedModelGroupView();
|
||||
|
||||
//! Reconnect models if model changed
|
||||
void modelChanged(class LinkedModelGroup *linkedModelGroup);
|
||||
|
||||
protected:
|
||||
//! Add a control to this widget
|
||||
//! @warning This widget will own this control, do not free it
|
||||
void addControl(class Control *ctrl, const std::string &id,
|
||||
const std::string& display, bool removable);
|
||||
|
||||
void removeControl(const QString &key);
|
||||
|
||||
private:
|
||||
class LinkedModelGroup* m_model;
|
||||
|
||||
//! column number in surrounding grid in LinkedModelGroupsView
|
||||
std::size_t m_colNum;
|
||||
class ControlLayout* m_layout;
|
||||
std::map<std::string, std::unique_ptr<class Control>> m_widgets;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Container class for one LinkedModelGroupView
|
||||
|
||||
@note It's intended this class does not inherit from ModelView.
|
||||
Inheriting classes need to do that, see e.g. Lv2Instrument.h
|
||||
*/
|
||||
class LinkedModelGroupsView
|
||||
{
|
||||
protected:
|
||||
~LinkedModelGroupsView() = default;
|
||||
|
||||
//! Reconnect models if model changed; to be called by child virtuals
|
||||
void modelChanged(class LinkedModelGroups* ctrlBase);
|
||||
|
||||
private:
|
||||
//! The base class must return the adressed group view,
|
||||
//! which has the same value as "this"
|
||||
virtual LinkedModelGroupView* getGroupView() = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // LINKEDMODELGROUPVIEWS_H
|
||||
175
include/LinkedModelGroups.h
Normal file
175
include/LinkedModelGroups.h
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* LinkedModelGroups.h - base classes for groups of linked models
|
||||
*
|
||||
* Copyright (c) 2019-2019 Johannes Lorenz <j.git$$$lorenz-ho.me, $$$=@>
|
||||
*
|
||||
* This file is part of LMMS - https://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LINKEDMODELGROUPS_H
|
||||
#define LINKEDMODELGROUPS_H
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "Model.h"
|
||||
|
||||
|
||||
/**
|
||||
@file LinkedModelGroups.h
|
||||
See Lv2ControlBase.h and Lv2Proc.h for example usage
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
Base class for a group of linked models
|
||||
|
||||
See the LinkedModelGroup class for explenations
|
||||
|
||||
Features:
|
||||
* Models are stored by their QObject::objectName
|
||||
* Models are linked automatically
|
||||
*/
|
||||
class LinkedModelGroup : public Model
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/*
|
||||
Initialization
|
||||
*/
|
||||
//! @param parent model of the LinkedModelGroups class
|
||||
LinkedModelGroup(Model* parent) : Model(parent) {}
|
||||
|
||||
/*
|
||||
Linking (initially only)
|
||||
*/
|
||||
void linkControls(LinkedModelGroup *other);
|
||||
|
||||
/*
|
||||
Models
|
||||
*/
|
||||
struct ModelInfo
|
||||
{
|
||||
QString m_name;
|
||||
class AutomatableModel* m_model;
|
||||
ModelInfo() { /* hopefully no one will use this */ } // TODO: remove?
|
||||
ModelInfo(const QString& name, AutomatableModel* model)
|
||||
: m_name(name), m_model(model) {}
|
||||
};
|
||||
|
||||
// TODO: refactor those 2
|
||||
template<class Functor>
|
||||
void foreach_model(const Functor& ftor)
|
||||
{
|
||||
for (auto itr = m_models.begin(); itr != m_models.end(); ++itr)
|
||||
{
|
||||
ftor(itr->first, itr->second);
|
||||
}
|
||||
}
|
||||
|
||||
template<class Functor>
|
||||
void foreach_model(const Functor& ftor) const
|
||||
{
|
||||
for (auto itr = m_models.cbegin(); itr != m_models.cend(); ++itr)
|
||||
{
|
||||
ftor(itr->first, itr->second);
|
||||
}
|
||||
}
|
||||
|
||||
std::size_t modelNum() const { return m_models.size(); }
|
||||
bool containsModel(const QString& name) const;
|
||||
void removeControl(AutomatableModel *);
|
||||
|
||||
/*
|
||||
Load/Save
|
||||
*/
|
||||
void saveValues(class QDomDocument& doc, class QDomElement& that);
|
||||
void loadValues(const class QDomElement& that);
|
||||
|
||||
signals:
|
||||
// NOTE: when separating core from UI, this will need to be removed
|
||||
// (who would kno if the client is Qt, i.e. it may not have slots at all)
|
||||
// In this case you'd e.g. send the UI something like
|
||||
// "/added <model meta info>"
|
||||
void modelAdded(AutomatableModel* added);
|
||||
void modelRemoved(AutomatableModel* removed);
|
||||
|
||||
public:
|
||||
AutomatableModel* getModel(const std::string& s)
|
||||
{
|
||||
auto itr = m_models.find(s);
|
||||
return (itr == m_models.end()) ? nullptr : itr->second.m_model;
|
||||
}
|
||||
|
||||
//! Register a further model
|
||||
void addModel(class AutomatableModel* model, const QString& name);
|
||||
//! Unregister a model, return true if a model was erased
|
||||
bool eraseModel(const QString& name);
|
||||
|
||||
//! Remove all models
|
||||
void clearModels();
|
||||
|
||||
private:
|
||||
//! models for the controls
|
||||
std::map<std::string, ModelInfo> m_models;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Container for a group of linked models
|
||||
|
||||
Each group contains the same models and model types. The models are
|
||||
numbered, and equal numbered models are associated and always linked.
|
||||
|
||||
A typical application are two mono plugins making a stereo plugin.
|
||||
|
||||
@note Though this class can contain multiple model groups, a corresponding
|
||||
view ("LinkedModelGroupViews") will only display one group, as they all have
|
||||
the same values
|
||||
|
||||
@note Though called "container", this class does not contain, but only
|
||||
know the single groups. The inheriting classes are responsible for storage.
|
||||
*/
|
||||
class LinkedModelGroups
|
||||
{
|
||||
public:
|
||||
virtual ~LinkedModelGroups();
|
||||
|
||||
void linkAllModels();
|
||||
|
||||
/*
|
||||
Load/Save
|
||||
*/
|
||||
void saveSettings(class QDomDocument& doc, class QDomElement& that);
|
||||
void loadSettings(const class QDomElement& that);
|
||||
|
||||
/*
|
||||
General
|
||||
*/
|
||||
//! Derived classes must return the group with index @p idx,
|
||||
//! or nullptr if @p is out of range
|
||||
virtual LinkedModelGroup* getGroup(std::size_t idx) = 0;
|
||||
//! @see getGroup
|
||||
virtual const LinkedModelGroup* getGroup(std::size_t idx) const = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // LINKEDMODELGROUPS_H
|
||||
@@ -43,8 +43,6 @@ class LMMS_EXPORT LmmsPalette : public QWidget
|
||||
Q_PROPERTY( QColor brightText READ brightText WRITE setBrightText )
|
||||
Q_PROPERTY( QColor highlight READ highlight WRITE setHighlight )
|
||||
Q_PROPERTY( QColor highlightedText READ highlightedText WRITE setHighlightedText )
|
||||
Q_PROPERTY( QColor toolTipText READ toolTipText WRITE setToolTipText )
|
||||
Q_PROPERTY( QColor toolTipBase READ toolTipBase WRITE setToolTipBase )
|
||||
|
||||
public:
|
||||
LmmsPalette( QWidget * parent, QStyle * stylearg );
|
||||
@@ -65,8 +63,6 @@ public:
|
||||
ACCESSMET( brightText, setBrightText )
|
||||
ACCESSMET( highlight, setHighlight )
|
||||
ACCESSMET( highlightedText, setHighlightedText )
|
||||
ACCESSMET( toolTipText, setToolTipText )
|
||||
ACCESSMET( toolTipBase, setToolTipBase )
|
||||
|
||||
#undef ACCESSMET
|
||||
|
||||
@@ -83,8 +79,6 @@ private:
|
||||
QColor m_brightText;
|
||||
QColor m_highlight;
|
||||
QColor m_highlightedText;
|
||||
QColor m_toolTipText;
|
||||
QColor m_toolTipBase;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -67,21 +67,21 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual QPalette standardPalette( void ) const;
|
||||
QPalette standardPalette( void ) const override;
|
||||
|
||||
virtual void drawComplexControl(
|
||||
ComplexControl control,
|
||||
const QStyleOptionComplex * option,
|
||||
QPainter *painter,
|
||||
const QWidget *widget ) const;
|
||||
const QWidget *widget ) const override;
|
||||
virtual void drawPrimitive( PrimitiveElement element,
|
||||
const QStyleOption *option,
|
||||
QPainter *painter,
|
||||
const QWidget *widget = 0 ) const;
|
||||
const QWidget *widget = 0 ) const override;
|
||||
|
||||
virtual int pixelMetric( PixelMetric metric,
|
||||
const QStyleOption * option = 0,
|
||||
const QWidget * widget = 0 ) const;
|
||||
const QWidget * widget = 0 ) const override;
|
||||
|
||||
static QPalette * s_palette;
|
||||
|
||||
|
||||
133
include/LocklessRingBuffer.h
Normal file
133
include/LocklessRingBuffer.h
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* LocklessRingBuffer.h - LMMS wrapper for a lockless ringbuffer library
|
||||
*
|
||||
* Copyright (c) 2019 Martin Pavelek <he29/dot/HS/at/gmail/dot/com>
|
||||
*
|
||||
* This file is part of LMMS - https://lmms.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LOCKLESSRINGBUFFER_H
|
||||
#define LOCKLESSRINGBUFFER_H
|
||||
|
||||
#include <QMutex>
|
||||
#include <QWaitCondition>
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "lmms_export.h"
|
||||
#include "../src/3rdparty/ringbuffer/include/ringbuffer/ringbuffer.h"
|
||||
|
||||
|
||||
//! A convenience layer for a realtime-safe and thread-safe multi-reader ring buffer library.
|
||||
template <class T>
|
||||
class LocklessRingBufferBase
|
||||
{
|
||||
template<class _T>
|
||||
friend class LocklessRingBufferReader;
|
||||
public:
|
||||
LocklessRingBufferBase(std::size_t sz) : m_buffer(sz)
|
||||
{
|
||||
m_buffer.touch(); // reserve storage space before realtime operation starts
|
||||
}
|
||||
~LocklessRingBufferBase() {};
|
||||
|
||||
std::size_t capacity() const {return m_buffer.maximum_eventual_write_space();}
|
||||
std::size_t free() const {return m_buffer.write_space();}
|
||||
void wakeAll() {m_notifier.wakeAll();}
|
||||
|
||||
protected:
|
||||
ringbuffer_t<T> m_buffer;
|
||||
QWaitCondition m_notifier;
|
||||
};
|
||||
|
||||
|
||||
// The SampleFrameCopier is required because sampleFrame is just a two-element
|
||||
// array and therefore does not have a copy constructor needed by std::copy.
|
||||
class SampleFrameCopier
|
||||
{
|
||||
const sampleFrame* m_src;
|
||||
public:
|
||||
SampleFrameCopier(const sampleFrame* src) : m_src(src) {}
|
||||
void operator()(std::size_t src_offset, std::size_t count, sampleFrame* dest)
|
||||
{
|
||||
for (std::size_t i = src_offset; i < src_offset + count; i++, dest++)
|
||||
{
|
||||
(*dest)[0] = m_src[i][0];
|
||||
(*dest)[1] = m_src[i][1];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//! Standard ring buffer template for data types with copy constructor.
|
||||
template <class T>
|
||||
class LocklessRingBuffer : public LocklessRingBufferBase<T>
|
||||
{
|
||||
public:
|
||||
LocklessRingBuffer(std::size_t sz) : LocklessRingBufferBase<T>(sz) {};
|
||||
|
||||
std::size_t write(const sampleFrame *src, std::size_t cnt, bool notify = false)
|
||||
{
|
||||
std::size_t written = LocklessRingBufferBase<T>::m_buffer.write(src, cnt);
|
||||
// Let all waiting readers know new data are available.
|
||||
if (notify) {LocklessRingBufferBase<T>::m_notifier.wakeAll();}
|
||||
return written;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//! Specialized ring buffer template with write function modified to support sampleFrame.
|
||||
template <>
|
||||
class LocklessRingBuffer<sampleFrame> : public LocklessRingBufferBase<sampleFrame>
|
||||
{
|
||||
public:
|
||||
LocklessRingBuffer(std::size_t sz) : LocklessRingBufferBase<sampleFrame>(sz) {};
|
||||
|
||||
std::size_t write(const sampleFrame *src, std::size_t cnt, bool notify = false)
|
||||
{
|
||||
SampleFrameCopier copier(src);
|
||||
std::size_t written = LocklessRingBufferBase<sampleFrame>::m_buffer.write_func<SampleFrameCopier>(copier, cnt);
|
||||
// Let all waiting readers know new data are available.
|
||||
if (notify) {LocklessRingBufferBase<sampleFrame>::m_notifier.wakeAll();}
|
||||
return written;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//! Wrapper for lockless ringbuffer reader
|
||||
template <class T>
|
||||
class LocklessRingBufferReader : public ringbuffer_reader_t<T>
|
||||
{
|
||||
public:
|
||||
LocklessRingBufferReader(LocklessRingBuffer<T> &rb) :
|
||||
ringbuffer_reader_t<T>(rb.m_buffer),
|
||||
m_notifier(&rb.m_notifier) {};
|
||||
|
||||
bool empty() const {return !this->read_space();}
|
||||
void waitForData()
|
||||
{
|
||||
QMutex useless_lock;
|
||||
useless_lock.lock();
|
||||
m_notifier->wait(&useless_lock);
|
||||
useless_lock.unlock();
|
||||
}
|
||||
private:
|
||||
QWaitCondition *m_notifier;
|
||||
};
|
||||
|
||||
#endif //LOCKLESSRINGBUFFER_H
|
||||
@@ -42,7 +42,7 @@ class MainApplication : public QApplication
|
||||
{
|
||||
public:
|
||||
MainApplication(int& argc, char** argv);
|
||||
bool event(QEvent* event);
|
||||
bool event(QEvent* event) override;
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
bool winEventFilter(MSG* msg, long* result);
|
||||
bool nativeEventFilter(const QByteArray& eventType, void* message,
|
||||
|
||||
@@ -125,21 +125,13 @@ public:
|
||||
|
||||
void clearKeyModifiers();
|
||||
|
||||
bool isCtrlPressed()
|
||||
{
|
||||
return m_keyMods.m_ctrl;
|
||||
}
|
||||
|
||||
// TODO Remove this function, since m_shift can get stuck down.
|
||||
// [[deprecated]]
|
||||
bool isShiftPressed()
|
||||
{
|
||||
return m_keyMods.m_shift;
|
||||
}
|
||||
|
||||
bool isAltPressed()
|
||||
{
|
||||
return m_keyMods.m_alt;
|
||||
}
|
||||
|
||||
static void saveWidgetState( QWidget * _w, QDomElement & _de );
|
||||
static void restoreWidgetState( QWidget * _w, const QDomElement & _de );
|
||||
|
||||
@@ -176,11 +168,11 @@ private slots:
|
||||
void onExportProjectMidi();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
virtual void focusOutEvent( QFocusEvent * _fe );
|
||||
virtual void keyPressEvent( QKeyEvent * _ke );
|
||||
virtual void keyReleaseEvent( QKeyEvent * _ke );
|
||||
virtual void timerEvent( QTimerEvent * _ev );
|
||||
void closeEvent( QCloseEvent * _ce ) override;
|
||||
void focusOutEvent( QFocusEvent * _fe ) override;
|
||||
void keyPressEvent( QKeyEvent * _ke ) override;
|
||||
void keyReleaseEvent( QKeyEvent * _ke ) override;
|
||||
void timerEvent( QTimerEvent * _ev ) override;
|
||||
|
||||
|
||||
private:
|
||||
@@ -203,8 +195,6 @@ private:
|
||||
QWidget * m_toolBar;
|
||||
QGridLayout * m_toolBarLayout;
|
||||
|
||||
QMenu * m_recentlyOpenedProjectsMenu;
|
||||
|
||||
struct keyModifiers
|
||||
{
|
||||
keyModifiers() :
|
||||
@@ -237,9 +227,7 @@ private:
|
||||
|
||||
private slots:
|
||||
void browseHelp();
|
||||
void openRecentlyOpenedProject( QAction * _action );
|
||||
void showTool( QAction * _idx );
|
||||
void updateRecentlyOpenedProjectsMenu();
|
||||
void updateViewMenu( void );
|
||||
void updateConfig( QAction * _who );
|
||||
void onToggleMetronome();
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
MeterDialog( QWidget * _parent, bool _simple = false );
|
||||
virtual ~MeterDialog();
|
||||
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -62,8 +62,8 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void sendByte( const unsigned char c );
|
||||
virtual void run();
|
||||
void sendByte( const unsigned char c ) override;
|
||||
void run() override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -67,44 +67,44 @@ public:
|
||||
|
||||
virtual void processOutEvent( const MidiEvent & _me,
|
||||
const MidiTime & _time,
|
||||
const MidiPort * _port );
|
||||
const MidiPort * _port ) override;
|
||||
|
||||
virtual void applyPortMode( MidiPort * _port );
|
||||
virtual void applyPortName( MidiPort * _port );
|
||||
void applyPortMode( MidiPort * _port ) override;
|
||||
void applyPortName( MidiPort * _port ) override;
|
||||
|
||||
virtual void removePort( MidiPort * _port );
|
||||
void removePort( MidiPort * _port ) override;
|
||||
|
||||
|
||||
// list seq-ports from ALSA
|
||||
virtual QStringList readablePorts() const
|
||||
QStringList readablePorts() const override
|
||||
{
|
||||
return m_readablePorts;
|
||||
}
|
||||
|
||||
virtual QStringList writablePorts() const
|
||||
QStringList writablePorts() const override
|
||||
{
|
||||
return m_writablePorts;
|
||||
}
|
||||
|
||||
// return name of port which specified MIDI event came from
|
||||
virtual QString sourcePortName( const MidiEvent & ) const;
|
||||
QString sourcePortName( const MidiEvent & ) const override;
|
||||
|
||||
// (un)subscribe given MidiPort to/from destination-port
|
||||
virtual void subscribeReadablePort( MidiPort * _port,
|
||||
const QString & _dest,
|
||||
bool _subscribe = true );
|
||||
bool _subscribe = true ) override;
|
||||
virtual void subscribeWritablePort( MidiPort * _port,
|
||||
const QString & _dest,
|
||||
bool _subscribe = true );
|
||||
bool _subscribe = true ) override;
|
||||
virtual void connectRPChanged( QObject * _receiver,
|
||||
const char * _member )
|
||||
const char * _member ) override
|
||||
{
|
||||
connect( this, SIGNAL( readablePortsChanged() ),
|
||||
_receiver, _member );
|
||||
}
|
||||
|
||||
virtual void connectWPChanged( QObject * _receiver,
|
||||
const char * _member )
|
||||
const char * _member ) override
|
||||
{
|
||||
connect( this, SIGNAL( writablePortsChanged() ),
|
||||
_receiver, _member );
|
||||
@@ -117,7 +117,7 @@ private slots:
|
||||
|
||||
|
||||
private:
|
||||
virtual void run();
|
||||
void run() override;
|
||||
|
||||
#ifdef LMMS_HAVE_ALSA
|
||||
QMutex m_seqMutex;
|
||||
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
virtual ~MidiClientRaw();
|
||||
|
||||
// we are raw-clients for sure!
|
||||
virtual bool isRaw() const
|
||||
bool isRaw() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ protected:
|
||||
private:
|
||||
// this does MIDI-event-process
|
||||
void processParsedEvent();
|
||||
virtual void processOutEvent( const MidiEvent& event, const MidiTime& time, const MidiPort* port );
|
||||
void processOutEvent( const MidiEvent& event, const MidiTime& time, const MidiPort* port ) override;
|
||||
|
||||
// small helper function returning length of a certain event - this
|
||||
// is necessary for parsing raw-MIDI-data
|
||||
|
||||
@@ -44,30 +44,30 @@ public:
|
||||
virtual ~MidiController();
|
||||
|
||||
virtual void processInEvent( const MidiEvent & _me,
|
||||
const MidiTime & _time, f_cnt_t offset = 0 );
|
||||
const MidiTime & _time, f_cnt_t offset = 0 ) override;
|
||||
|
||||
virtual void processOutEvent( const MidiEvent& _me,
|
||||
const MidiTime & _time, f_cnt_t offset = 0 )
|
||||
const MidiTime & _time, f_cnt_t offset = 0 ) override
|
||||
{
|
||||
// No output yet
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
virtual QString nodeName() const;
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
QString nodeName() const override;
|
||||
|
||||
// Used by controllerConnectionDialog to copy
|
||||
void subscribeReadablePorts( const MidiPort::Map & _map );
|
||||
|
||||
|
||||
public slots:
|
||||
virtual ControllerDialog * createDialog( QWidget * _parent );
|
||||
ControllerDialog * createDialog( QWidget * _parent ) override;
|
||||
void updateName();
|
||||
|
||||
|
||||
protected:
|
||||
// The internal per-controller get-value function
|
||||
virtual void updateValueBuffer();
|
||||
void updateValueBuffer() override;
|
||||
|
||||
|
||||
MidiPort m_midiPort;
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void sendByte( const unsigned char )
|
||||
void sendByte( const unsigned char ) override
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void sendByte( const unsigned char c );
|
||||
virtual void run();
|
||||
void sendByte( const unsigned char c ) override;
|
||||
void run() override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -103,10 +103,10 @@ public:
|
||||
void processOutEvent( const MidiEvent& event, const MidiTime& time = MidiTime() );
|
||||
|
||||
|
||||
virtual void saveSettings( QDomDocument& doc, QDomElement& thisElement );
|
||||
virtual void loadSettings( const QDomElement& thisElement );
|
||||
void saveSettings( QDomDocument& doc, QDomElement& thisElement ) override;
|
||||
void loadSettings( const QDomElement& thisElement ) override;
|
||||
|
||||
virtual QString nodeName() const
|
||||
QString nodeName() const override
|
||||
{
|
||||
return "midiport";
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ protected slots:
|
||||
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
void modelChanged() override;
|
||||
|
||||
MidiPort::Modes m_mode;
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void sendByte(const unsigned char c);
|
||||
virtual void run(void);
|
||||
void sendByte(const unsigned char c) override;
|
||||
void run(void) override;
|
||||
|
||||
private:
|
||||
struct mio_hdl *m_hdl;
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
#include "lmms_export.h"
|
||||
#include "lmms_basics.h"
|
||||
|
||||
// note: 1 "Tact" = 1 Measure
|
||||
const int DefaultTicksPerTact = 192;
|
||||
const int DefaultStepsPerTact = 16;
|
||||
const int DefaultBeatsPerTact = DefaultTicksPerTact / DefaultStepsPerTact;
|
||||
// note: a bar was erroneously called "tact" in older versions of LMMS
|
||||
const int DefaultTicksPerBar = 192;
|
||||
const int DefaultStepsPerBar = 16;
|
||||
const int DefaultBeatsPerBar = DefaultTicksPerBar / DefaultStepsPerBar;
|
||||
|
||||
|
||||
class MeterModel;
|
||||
@@ -60,19 +60,19 @@ private:
|
||||
class LMMS_EXPORT MidiTime
|
||||
{
|
||||
public:
|
||||
MidiTime( const tact_t tact, const tick_t ticks );
|
||||
MidiTime( const bar_t bar, const tick_t ticks );
|
||||
MidiTime( const tick_t ticks = 0 );
|
||||
|
||||
MidiTime quantize(float) const;
|
||||
MidiTime toAbsoluteTact() const;
|
||||
MidiTime toAbsoluteBar() const;
|
||||
|
||||
MidiTime& operator+=( const MidiTime& time );
|
||||
MidiTime& operator-=( const MidiTime& time );
|
||||
|
||||
// return the tact, rounded down and 0-based
|
||||
tact_t getTact() const;
|
||||
// return the tact, rounded up and 0-based
|
||||
tact_t nextFullTact() const;
|
||||
// return the bar, rounded down and 0-based
|
||||
bar_t getBar() const;
|
||||
// return the bar, rounded up and 0-based
|
||||
bar_t nextFullBar() const;
|
||||
|
||||
void setTicks( tick_t ticks );
|
||||
tick_t getTicks() const;
|
||||
@@ -90,21 +90,21 @@ public:
|
||||
// calculate number of frame that are needed this time
|
||||
f_cnt_t frames( const float framesPerTick ) const;
|
||||
|
||||
double getTimeInMilliseconds(bpm_t beatsPerMinute) const;
|
||||
double getTimeInMilliseconds( bpm_t beatsPerMinute ) const;
|
||||
|
||||
static MidiTime fromFrames( const f_cnt_t frames, const float framesPerTick );
|
||||
static tick_t ticksPerTact();
|
||||
static tick_t ticksPerTact( const TimeSig &sig );
|
||||
static int stepsPerTact();
|
||||
static void setTicksPerTact( tick_t tpt );
|
||||
static tick_t ticksPerBar();
|
||||
static tick_t ticksPerBar( const TimeSig &sig );
|
||||
static int stepsPerBar();
|
||||
static void setTicksPerBar( tick_t tpt );
|
||||
static MidiTime stepPosition( int step );
|
||||
static double ticksToMilliseconds(tick_t ticks, bpm_t beatsPerMinute);
|
||||
static double ticksToMilliseconds(double ticks, bpm_t beatsPerMinute);
|
||||
static double ticksToMilliseconds( tick_t ticks, bpm_t beatsPerMinute );
|
||||
static double ticksToMilliseconds( double ticks, bpm_t beatsPerMinute );
|
||||
|
||||
private:
|
||||
tick_t m_ticks;
|
||||
|
||||
static tick_t s_ticksPerTact;
|
||||
static tick_t s_ticksPerBar;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ private:
|
||||
fifo * m_fifo;
|
||||
volatile bool m_writing;
|
||||
|
||||
virtual void run();
|
||||
void run() override;
|
||||
|
||||
void write( surroundSampleFrame * buffer );
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
virtual void run();
|
||||
void run() override;
|
||||
|
||||
static JobQueue globalJobQueue;
|
||||
static QWaitCondition * queueReadyWaitCond;
|
||||
|
||||
@@ -61,7 +61,7 @@ signals:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
void mousePressEvent( QMouseEvent * _me ) override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -200,7 +200,7 @@ public:
|
||||
return "note";
|
||||
}
|
||||
|
||||
inline virtual QString nodeName() const
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return classNodeName();
|
||||
}
|
||||
@@ -218,8 +218,8 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void saveSettings( QDomDocument & doc, QDomElement & parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
void saveSettings( QDomDocument & doc, QDomElement & parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -73,8 +73,8 @@ public:
|
||||
return p;
|
||||
}
|
||||
|
||||
virtual void setVolume( volume_t volume );
|
||||
virtual void setPanning( panning_t panning );
|
||||
void setVolume( volume_t volume ) override;
|
||||
void setPanning( panning_t panning ) override;
|
||||
|
||||
int midiKey() const;
|
||||
int midiChannel() const
|
||||
@@ -104,10 +104,10 @@ public:
|
||||
}
|
||||
|
||||
/*! Renders one chunk using the attached instrument into the buffer */
|
||||
virtual void play( sampleFrame* buffer );
|
||||
void play( sampleFrame* buffer ) override;
|
||||
|
||||
/*! Returns whether playback of note is finished and thus handle can be deleted */
|
||||
virtual bool isFinished() const
|
||||
bool isFinished() const override
|
||||
{
|
||||
return m_released && framesLeft() <= 0;
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
fpp_t framesLeftForCurrentPeriod() const;
|
||||
|
||||
/*! Returns whether the play handle plays on a certain track */
|
||||
virtual bool isFromTrack( const Track* _track ) const;
|
||||
bool isFromTrack( const Track* _track ) const override;
|
||||
|
||||
/*! Releases the note (and plays release frames */
|
||||
void noteOff( const f_cnt_t offset = 0 );
|
||||
|
||||
@@ -94,9 +94,9 @@ public:
|
||||
Pattern * nextPattern() const;
|
||||
|
||||
// settings-management
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName() const
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return "pattern";
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
bool empty();
|
||||
|
||||
|
||||
virtual TrackContentObjectView * createView( TrackView * _tv );
|
||||
TrackContentObjectView * createView( TrackView * _tv ) override;
|
||||
|
||||
|
||||
using Model::dataChanged;
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
void setMutedNoteBorderColor(QColor const & color) { m_mutedNoteBorderColor = color; }
|
||||
|
||||
public slots:
|
||||
virtual void update();
|
||||
void update() override;
|
||||
|
||||
|
||||
protected slots:
|
||||
@@ -194,11 +194,11 @@ protected slots:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void constructContextMenu( QMenu * );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * pe );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
void constructContextMenu( QMenu * ) override;
|
||||
void mousePressEvent( QMouseEvent * _me ) override;
|
||||
void mouseDoubleClickEvent( QMouseEvent * _me ) override;
|
||||
void paintEvent( QPaintEvent * pe ) override;
|
||||
void wheelEvent( QWheelEvent * _we ) override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -46,9 +46,9 @@ public:
|
||||
|
||||
virtual ~PeakController();
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _this );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
virtual QString nodeName() const;
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this ) override;
|
||||
void loadSettings( const QDomElement & _this ) override;
|
||||
QString nodeName() const override;
|
||||
|
||||
static void initGetControllerBySetting();
|
||||
static PeakController * getControllerBySetting( const QDomElement & _this );
|
||||
@@ -57,13 +57,13 @@ public:
|
||||
|
||||
|
||||
public slots:
|
||||
virtual ControllerDialog * createDialog( QWidget * _parent );
|
||||
ControllerDialog * createDialog( QWidget * _parent ) override;
|
||||
void handleDestroyedEffect( );
|
||||
void updateCoeffs();
|
||||
|
||||
protected:
|
||||
// The internal per-controller get-value function
|
||||
virtual void updateValueBuffer();
|
||||
void updateValueBuffer() override;
|
||||
|
||||
PeakControllerEffect * m_peakEffect;
|
||||
|
||||
@@ -91,9 +91,9 @@ public:
|
||||
virtual ~PeakControllerDialog();
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void modelChanged();
|
||||
void contextMenuEvent( QContextMenuEvent * _me ) override;
|
||||
void paintEvent( QPaintEvent * _pe ) override;
|
||||
void modelChanged() override;
|
||||
|
||||
PeakController * m_peakController;
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ class QPixmap;
|
||||
class QScrollBar;
|
||||
class QString;
|
||||
class QMenu;
|
||||
class QSignalMapper;
|
||||
|
||||
class ComboBox;
|
||||
class NotePlayHandle;
|
||||
@@ -95,6 +94,7 @@ public:
|
||||
void setCurrentPattern( Pattern* newPattern );
|
||||
void setGhostPattern( Pattern* newPattern );
|
||||
void loadGhostNotes( const QDomElement & de );
|
||||
void loadMarkedSemiTones(const QDomElement & de);
|
||||
|
||||
inline void stopRecording()
|
||||
{
|
||||
@@ -167,20 +167,20 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent( QKeyEvent * ke );
|
||||
virtual void keyReleaseEvent( QKeyEvent * ke );
|
||||
virtual void leaveEvent( QEvent * e );
|
||||
virtual void mousePressEvent( QMouseEvent * me );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * me );
|
||||
virtual void paintEvent( QPaintEvent * pe );
|
||||
virtual void resizeEvent( QResizeEvent * re );
|
||||
virtual void wheelEvent( QWheelEvent * we );
|
||||
virtual void focusOutEvent( QFocusEvent * );
|
||||
void keyPressEvent( QKeyEvent * ke ) override;
|
||||
void keyReleaseEvent( QKeyEvent * ke ) override;
|
||||
void leaveEvent( QEvent * e ) override;
|
||||
void mousePressEvent( QMouseEvent * me ) override;
|
||||
void mouseDoubleClickEvent( QMouseEvent * me ) override;
|
||||
void mouseReleaseEvent( QMouseEvent * me ) override;
|
||||
void mouseMoveEvent( QMouseEvent * me ) override;
|
||||
void paintEvent( QPaintEvent * pe ) override;
|
||||
void resizeEvent( QResizeEvent * re ) override;
|
||||
void wheelEvent( QWheelEvent * we ) override;
|
||||
void focusOutEvent( QFocusEvent * ) override;
|
||||
|
||||
int getKey( int y ) const;
|
||||
static void drawNoteRect( QPainter & p, int x, int y,
|
||||
void drawNoteRect( QPainter & p, int x, int y,
|
||||
int width, const Note * n, const QColor & noteCol, const QColor & noteTextColor,
|
||||
const QColor & selCol, const int noteOpc, const bool borderless, bool drawNoteName );
|
||||
void removeSelection();
|
||||
@@ -192,6 +192,8 @@ protected:
|
||||
// for entering values with dblclick in the vol/pan bars
|
||||
void enterValue( NoteVector* nv );
|
||||
|
||||
void updateYScroll();
|
||||
|
||||
protected slots:
|
||||
void play();
|
||||
void record();
|
||||
@@ -217,6 +219,7 @@ protected slots:
|
||||
void updatePositionStepRecording(const MidiTime & t );
|
||||
|
||||
void zoomingChanged();
|
||||
void zoomingYChanged();
|
||||
void quantizeChanged();
|
||||
void noteLengthChanged();
|
||||
void quantizeNotes();
|
||||
@@ -330,12 +333,14 @@ private:
|
||||
static TextFloat * s_textFloat;
|
||||
|
||||
ComboBoxModel m_zoomingModel;
|
||||
ComboBoxModel m_zoomingYModel;
|
||||
ComboBoxModel m_quantizeModel;
|
||||
ComboBoxModel m_noteLenModel;
|
||||
ComboBoxModel m_scaleModel;
|
||||
ComboBoxModel m_chordModel;
|
||||
|
||||
static const QVector<double> m_zoomLevels;
|
||||
static const QVector<double> m_zoomYLevels;
|
||||
|
||||
Pattern* m_pattern;
|
||||
NoteVector m_ghostNotes;
|
||||
@@ -382,9 +387,15 @@ private:
|
||||
|
||||
int m_oldNotesEditHeight;
|
||||
int m_notesEditHeight;
|
||||
int m_ppt; // pixels per tact
|
||||
int m_ppb; // pixels per bar
|
||||
int m_totalKeysToScroll;
|
||||
|
||||
int m_keyLineHeight;
|
||||
int m_octaveHeight;
|
||||
int m_whiteKeySmallHeight;
|
||||
int m_whiteKeyBigHeight;
|
||||
int m_blackKeyHeight;
|
||||
|
||||
// remember these values to use them
|
||||
// for the next note that is set
|
||||
MidiTime m_lenOfNewNotes;
|
||||
@@ -460,11 +471,11 @@ public:
|
||||
|
||||
int quantization() const;
|
||||
|
||||
void play();
|
||||
void stop();
|
||||
void record();
|
||||
void recordAccompany();
|
||||
void toggleStepRecording();
|
||||
void play() override;
|
||||
void stop() override;
|
||||
void record() override;
|
||||
void recordAccompany() override;
|
||||
void toggleStepRecording() override;
|
||||
void stopRecording();
|
||||
|
||||
bool isRecording() const;
|
||||
@@ -474,15 +485,15 @@ public:
|
||||
|
||||
using SerializingObject::saveState;
|
||||
using SerializingObject::restoreState;
|
||||
virtual void saveSettings(QDomDocument & doc, QDomElement & de );
|
||||
virtual void loadSettings( const QDomElement & de );
|
||||
void saveSettings(QDomDocument & doc, QDomElement & de ) override;
|
||||
void loadSettings( const QDomElement & de ) override;
|
||||
|
||||
inline virtual QString nodeName() const
|
||||
inline QString nodeName() const override
|
||||
{
|
||||
return "pianoroll";
|
||||
}
|
||||
|
||||
QSize sizeHint() const;
|
||||
QSize sizeHint() const override;
|
||||
|
||||
signals:
|
||||
void currentPatternChanged();
|
||||
@@ -494,13 +505,14 @@ private slots:
|
||||
|
||||
private:
|
||||
void patternRenamed();
|
||||
void focusInEvent(QFocusEvent * event);
|
||||
void focusInEvent(QFocusEvent * event) override;
|
||||
void stopStepRecording();
|
||||
void updateStepRecordingIcon();
|
||||
|
||||
PianoRoll* m_editor;
|
||||
|
||||
ComboBox * m_zoomingComboBox;
|
||||
ComboBox * m_zoomingYComboBox;
|
||||
ComboBox * m_quantizeComboBox;
|
||||
ComboBox * m_noteLenComboBox;
|
||||
ComboBox * m_scaleComboBox;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user