diff --git a/include/AudioPort.h b/include/AudioPort.h index f6da9b64e..5cfcbef53 100644 --- a/include/AudioPort.h +++ b/include/AudioPort.h @@ -31,7 +31,7 @@ #include "mixer.h" -class effectChain; +class EffectChain; class AudioPort { @@ -88,7 +88,7 @@ public: return m_nextFxChannel; } - inline effectChain * getEffects() + inline EffectChain * effects() { return m_effects; } @@ -131,7 +131,7 @@ private: QString m_name; - effectChain * m_effects; + EffectChain * m_effects; friend class mixer; diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index f7d35cd21..85d2880cd 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -28,7 +28,7 @@ #include #include "lmmsconfig.h" -#include "combobox_model.h" +#include "ComboBoxModel.h" class AudioPortAudioSetupUtil : public QObject { @@ -38,8 +38,8 @@ public slots: void updateChannels(); public: - comboBoxModel m_backendModel; - comboBoxModel m_deviceModel; + ComboBoxModel m_backendModel; + ComboBoxModel m_deviceModel; } ; diff --git a/include/automatable_model.h b/include/AutomatableModel.h similarity index 54% rename from include/automatable_model.h rename to include/AutomatableModel.h index 5a70318bb..b9b436f2b 100644 --- a/include/automatable_model.h +++ b/include/AutomatableModel.h @@ -1,8 +1,8 @@ /* - * automatable_model.h - declaration of class automatableModel + * AutomatableModel.h - declaration of class AutomatableModel + * + * Copyright (c) 2007-2009 Tobias Doerffel * - * Copyright (c) 2007-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,39 +22,38 @@ * */ - #ifndef _AUTOMATABLE_MODEL_H #define _AUTOMATABLE_MODEL_H #include -#include "journalling_object.h" -#include "mv_base.h" +#include "JournallingObject.h" +#include "Model.h" // simple way to map a property of a view to a model -#define mapPropertyFromModelPtr(type,getfunc,setfunc,modelname) \ - public: \ - inline type getfunc( void ) const \ - { \ - return (type) modelname->value(); \ - } \ - public slots: \ - inline void setfunc( const type _val ) \ - { \ - modelname->setValue( _val ); \ +#define mapPropertyFromModelPtr(type,getfunc,setfunc,modelname) \ + public: \ + inline type getfunc() const \ + { \ + return (type) modelname->value(); \ + } \ + public slots: \ + inline void setfunc( const type _val ) \ + { \ + modelname->setValue( _val ); \ } -#define mapPropertyFromModel(type,getfunc,setfunc,modelname) \ - public: \ - inline type getfunc( void ) const \ - { \ - return (type) modelname.value(); \ - } \ - public slots: \ - inline void setfunc( const type _val ) \ - { \ - modelname.setValue( (float) _val ); \ +#define mapPropertyFromModel(type,getfunc,setfunc,modelname) \ + public: \ + inline type getfunc() const \ + { \ + return (type) modelname.value(); \ + } \ + public slots: \ + inline void setfunc( const type _val ) \ + { \ + modelname.setValue( (float) _val ); \ } @@ -62,11 +61,11 @@ class ControllerConnection; -class EXPORT automatableModel : public model, public journallingObject +class EXPORT AutomatableModel : public Model, public JournallingObject { Q_OBJECT public: - typedef QVector autoModelVector; + typedef QVector AutoModelVector; enum DataType { @@ -75,26 +74,26 @@ public: Bool } ; - automatableModel( DataType _type, + AutomatableModel( DataType _type, const float _val = 0, const float _min = 0, const float _max = 0, const float _step = 0, - ::model * _parent = NULL, + ::Model * _parent = NULL, const QString & _display_name = QString(), - bool _default_constructed = FALSE ); + bool _default_constructed = false ); - virtual ~automatableModel(); + virtual ~AutomatableModel(); - static inline float copiedValue( void ) + static inline float copiedValue() { return __copiedValue; } - bool isAutomated( void ) const; + bool isAutomated() const; - inline ControllerConnection * getControllerConnection( void ) const + inline ControllerConnection * getControllerConnection() const { return m_controllerConnection; } @@ -132,25 +131,25 @@ public: template - inline T initValue( void ) const + inline T initValue() const { return castValue( m_initValue ); } template - inline T minValue( void ) const + inline T minValue() const { return castValue( m_minValue ); } template - inline T maxValue( void ) const + inline T maxValue() const { return castValue( m_maxValue ); } template - inline T step( void ) const + inline T step() const { return castValue( m_step ); } @@ -166,7 +165,7 @@ public: setValue( m_value + _steps * m_step ); } - inline float range( void ) const + inline float range() const { return m_range; } @@ -176,10 +175,10 @@ public: void setStep( const float _step ); - static void linkModels( automatableModel * _m1, - automatableModel * _m2 ); - static void unlinkModels( automatableModel * _m1, - automatableModel * _m2 ); + static void linkModels( AutomatableModel * _m1, + AutomatableModel * _m2 ); + static void unlinkModels( AutomatableModel * _m1, + AutomatableModel * _m2 ); virtual void saveSettings( QDomDocument & _doc, QDomElement & _this, @@ -188,48 +187,45 @@ public: virtual void loadSettings( const QDomElement & _this, const QString & _name = QString( "value" ) ); - virtual QString nodeName( void ) const + virtual QString nodeName() const { return "automatablemodel"; } - void prepareJournalEntryFromOldVal( void ); + void prepareJournalEntryFromOldVal(); - void addJournalEntryFromOldToCurVal( void ); + void addJournalEntryFromOldToCurVal(); QString displayValue( const float _val ) const { switch( m_dataType ) { - case Float: return QString::number( - castValue( _val ) ); - case Integer: return QString::number( - castValue( _val ) ); - case Bool: return QString::number( - castValue( _val ) ); + case Float: return QString::number( castValue( _val ) ); + case Integer: return QString::number( castValue( _val ) ); + case Bool: return QString::number( castValue( _val ) ); } return "0"; } public slots: - virtual void reset( void ); - virtual void copyValue( void ); - virtual void pasteValue( void ); - void unlinkControllerConnection( void ); + virtual void reset(); + virtual void copyValue(); + virtual void pasteValue(); + void unlinkControllerConnection(); protected: - virtual void redoStep( journalEntry & _je ); - virtual void undoStep( journalEntry & _je ); + virtual void redoStep( JournalEntry & _je ); + virtual void undoStep( JournalEntry & _je ); float fittedValue( float _value ) const; private: - void linkModel( automatableModel * _model ); - void unlinkModel( automatableModel * _model ); + void linkModel( AutomatableModel * _model ); + void unlinkModel( AutomatableModel * _model ); DataType m_dataType; @@ -246,7 +242,7 @@ private: bool m_journalEntryReady; int m_setValueDepth; - autoModelVector m_linkedModels; + AutoModelVector m_linkedModels; bool m_hasLinkedModels; @@ -266,33 +262,33 @@ signals: -#define defaultTypedMethods(type) \ - inline type value( int _frameOffset = 0 ) const \ - { \ - return automatableModel::value( _frameOffset ); \ - } \ - \ - inline type minValue( void ) const \ - { \ - return automatableModel::minValue(); \ - } \ - \ - inline type maxValue( void ) const \ - { \ - return automatableModel::maxValue(); \ - } \ +#define defaultTypedMethods(type) \ + inline type value( int _frameOffset = 0 ) const \ + { \ + return AutomatableModel::value( _frameOffset ); \ + } \ + \ + inline type minValue() const \ + { \ + return AutomatableModel::minValue(); \ + } \ + \ + inline type maxValue() const \ + { \ + return AutomatableModel::maxValue(); \ + } \ -// some typed automatableModel-definitions +// some typed AutomatableModel-definitions -class floatModel : public automatableModel +class FloatModel : public AutomatableModel { public: - floatModel( float _val = 0, float _min = 0, float _max = 0, - float _step = 0, ::model * _parent = NULL, + FloatModel( float _val = 0, float _min = 0, float _max = 0, + float _step = 0, ::Model * _parent = NULL, const QString & _display_name = QString(), - bool _default_constructed = FALSE ) : - automatableModel( Float, _val, _min, _max, _step, + bool _default_constructed = false ) : + AutomatableModel( Float, _val, _min, _max, _step, _parent, _display_name, _default_constructed ) { } @@ -302,14 +298,14 @@ public: } ; -class intModel : public automatableModel +class IntModel : public AutomatableModel { public: - intModel( int _val = 0, int _min = 0, int _max = 0, - ::model * _parent = NULL, + IntModel( int _val = 0, int _min = 0, int _max = 0, + ::Model * _parent = NULL, const QString & _display_name = QString(), - bool _default_constructed = FALSE ) : - automatableModel( Integer, _val, _min, _max, 1, + bool _default_constructed = false ) : + AutomatableModel( Integer, _val, _min, _max, 1, _parent, _display_name, _default_constructed ) { } @@ -319,13 +315,13 @@ public: } ; -class boolModel : public automatableModel +class BoolModel : public AutomatableModel { public: - boolModel( const bool _val = FALSE, ::model * _parent = NULL, + BoolModel( const bool _val = false, ::Model * _parent = NULL, const QString & _display_name = QString(), - bool _default_constructed = FALSE ) : - automatableModel( Bool, _val, FALSE, TRUE, 1, + bool _default_constructed = false ) : + AutomatableModel( Bool, _val, false, true, 1, _parent, _display_name, _default_constructed ) { } diff --git a/include/automatable_model_view.h b/include/AutomatableModelView.h similarity index 51% rename from include/automatable_model_view.h rename to include/AutomatableModelView.h index 04311ea3e..b7c3579e7 100644 --- a/include/automatable_model_view.h +++ b/include/AutomatableModelView.h @@ -1,8 +1,8 @@ /* - * automatable_model_view.h - class automatableModelView + * AutomatableModelView.h - class AutomatableModelView + * + * Copyright (c) 2008-2009 Tobias Doerffel * - * Copyright (c) 2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,39 +22,36 @@ * */ - #ifndef _AUTOMATABLE_MODEL_VIEW_H #define _AUTOMATABLE_MODEL_VIEW_H -#include "mv_base.h" -#include "automatable_model.h" - +#include "ModelView.h" +#include "AutomatableModel.h" class QMenu; - -class EXPORT automatableModelView : public modelView +class EXPORT AutomatableModelView : public ModelView { public: - automatableModelView( ::model * _model, QWidget * _this ); - virtual ~automatableModelView(); + AutomatableModelView( Model * _model, QWidget * _this ); + virtual ~AutomatableModelView(); // some basic functions for convenience - automatableModel * modelUntyped( void ) + AutomatableModel * modelUntyped() { - return( castModel() ); + return( castModel() ); } - const automatableModel * modelUntyped( void ) const + const AutomatableModel * modelUntyped() const { - return( castModel() ); + return( castModel() ); } - virtual void setModel( model * _model, bool _old_model_valid = TRUE ); + virtual void setModel( Model * _model, bool _old_model_valid = true ); template - inline T value( void ) const + inline T value() const { return( modelUntyped() ? modelUntyped()->value() : 0 ); } @@ -92,52 +89,52 @@ protected: -class automatableModelViewSlots : public QObject +class AutomatableModelViewSlots : public QObject { Q_OBJECT public: - automatableModelViewSlots( - automatableModelView * _amv, + AutomatableModelViewSlots( + AutomatableModelView * _amv, QObject * _parent ); public slots: - void execConnectionDialog( void ); - void removeConnection( void ); - void editSongGlobalAutomation( void ); + void execConnectionDialog(); + void removeConnection(); + void editSongGlobalAutomation(); protected: - automatableModelView * amv; + AutomatableModelView * amv; } ; -#define generateTypedModelView(type) \ -class EXPORT type##ModelView : public automatableModelView \ -{ \ -public: \ - type##ModelView( ::model * _model, QWidget * _this ) : \ - automatableModelView( _model, _this ) \ - { \ - } \ - \ - type##Model * model( void ) \ - { \ - return( castModel() ); \ - } \ - \ - const type##Model * model( void ) const \ - { \ - return( castModel() ); \ - } \ +#define generateTypedModelView(type) \ +class EXPORT type##ModelView : public AutomatableModelView \ +{ \ +public: \ + type##ModelView( Model * _model, QWidget * _this ) : \ + AutomatableModelView( _model, _this ) \ + { \ + } \ + \ + type##Model * model() \ + { \ + return( castModel() ); \ + } \ + \ + const type##Model * model() const \ + { \ + return( castModel() ); \ + } \ } -generateTypedModelView(float); -generateTypedModelView(int); -generateTypedModelView(bool); +generateTypedModelView(Float); +generateTypedModelView(Int); +generateTypedModelView(Bool); #endif diff --git a/include/clipboard.h b/include/Clipboard.h similarity index 77% rename from include/clipboard.h rename to include/Clipboard.h index 3563f948a..58d9a5828 100644 --- a/include/clipboard.h +++ b/include/Clipboard.h @@ -1,8 +1,8 @@ /* - * clipboard.h - the clipboard for patterns, notes etc. + * Clipboard.h - the clipboard for patterns, notes etc. + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ * */ - #ifndef _CLIPBOARD_H #define _CLIPBOARD_H @@ -30,24 +29,24 @@ #include -class journallingObject; +class JournallingObject; -class clipboard +class Clipboard { public: - typedef QMap map; + typedef QMap Map; - static void copy( journallingObject * _object ); + static void copy( JournallingObject * _object ); static const QDomElement * getContent( const QString & _node_name ); - static const char * mimeType( void ) + static const char * mimeType() { return( "application/x-lmms-clipboard" ); } private: - static map content; + static Map content; } ; diff --git a/include/combobox_model.h b/include/ComboBoxModel.h similarity index 57% rename from include/combobox_model.h rename to include/ComboBoxModel.h index b9b7c0ff5..1bd30dcef 100644 --- a/include/combobox_model.h +++ b/include/ComboBoxModel.h @@ -1,8 +1,8 @@ /* - * combobox_model.h - class comboBoxModel + * ComboBoxModel.h - declaration of class ComboBoxModel + * + * Copyright (c) 2008-2009 Tobias Doerffel * - * Copyright (c) 2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,73 +22,70 @@ * */ - #ifndef _COMBOBOX_MODEL_H #define _COMBOBOX_MODEL_H #include #include -#include "automatable_model.h" +#include "AutomatableModel.h" #include "templates.h" -class pixmapLoader; +class PixmapLoader; -class EXPORT comboBoxModel : public intModel +class EXPORT ComboBoxModel : public IntModel { Q_OBJECT public: - comboBoxModel( ::model * _parent = NULL, + ComboBoxModel( Model * _parent = NULL, const QString & _display_name = QString(), bool _default_constructed = false ) : - intModel( 0, 0, 0, _parent, _display_name, + IntModel( 0, 0, 0, _parent, _display_name, _default_constructed ) { } - virtual ~comboBoxModel() + virtual ~ComboBoxModel() { clear(); } - void addItem( const QString & _item, pixmapLoader * _loader = NULL ); + void addItem( const QString & _item, PixmapLoader * _loader = NULL ); - void clear( void ); + void clear(); int findText( const QString & _txt ) const; - inline const QString & currentText( void ) const + inline const QString & currentText() const { - return( m_items[value()].first ); + return m_items[value()].first; } - inline const pixmapLoader * currentData( void ) const + inline const PixmapLoader * currentData() const { - return( m_items[value()].second ); + return m_items[value()].second; } inline const QString & itemText( int _i ) const { - return( m_items[tLimit( _i, minValue(), maxValue() )]. - first ); + return m_items[tLimit( _i, minValue(), maxValue() )].first; } - inline const pixmapLoader * itemPixmap( int _i ) const + inline const PixmapLoader * itemPixmap( int _i ) const { - return( m_items[tLimit( _i, minValue(), maxValue() )]. - second ); + return m_items[tLimit( _i, minValue(), maxValue() )].second; } - inline int size( void ) const + inline int size() const { - return( m_items.size() ); + return m_items.size(); } private: - typedef QPair item; + typedef QPair Item; - QVector m_items; + QVector m_items; } ; diff --git a/include/Controller.h b/include/Controller.h index d8af9b47a..e411dc0b5 100644 --- a/include/Controller.h +++ b/include/Controller.h @@ -29,8 +29,8 @@ #include "engine.h" #include "mixer.h" -#include "mv_base.h" -#include "journalling_object.h" +#include "Model.h" +#include "JournallingObject.h" class ControllerDialog; class Controller; @@ -38,7 +38,7 @@ class Controller; typedef QVector ControllerVector; -class Controller : public model, public journallingObject +class Controller : public Model, public JournallingObject { Q_OBJECT public: @@ -55,7 +55,7 @@ public: NumControllerTypes } ; - Controller( ControllerTypes _type, model * _parent, + Controller( ControllerTypes _type, Model * _parent, const QString & _display_name ); virtual ~Controller(); @@ -103,9 +103,9 @@ public: virtual void loadSettings( const QDomElement & _this ); virtual QString nodeName( void ) const; - static Controller * create( ControllerTypes _tt, model * _parent ); + static Controller * create( ControllerTypes _tt, Model * _parent ); static Controller * create( const QDomElement & _this, - model * _parent ); + Model * _parent ); inline static float fittedValue( float _val ) { @@ -127,7 +127,7 @@ public slots: m_name = _new_name; } - bool hasModel( const model * m ); + bool hasModel( const Model * m ); protected: diff --git a/include/ControllerConnection.h b/include/ControllerConnection.h index 27fd02bc4..f879e3174 100644 --- a/include/ControllerConnection.h +++ b/include/ControllerConnection.h @@ -33,14 +33,14 @@ #include #include "Controller.h" -#include "journalling_object.h" +#include "JournallingObject.h" class ControllerConnection; typedef QVector ControllerConnectionVector; -class EXPORT ControllerConnection : public QObject, public journallingObject +class EXPORT ControllerConnection : public QObject, public JournallingObject { Q_OBJECT public: diff --git a/include/ControllerConnectionDialog.h b/include/ControllerConnectionDialog.h index 5e80ea94a..d4881fb3f 100644 --- a/include/ControllerConnectionDialog.h +++ b/include/ControllerConnectionDialog.h @@ -32,7 +32,7 @@ #include #include "Controller.h" -#include "automatable_model.h" +#include "AutomatableModel.h" class QLineEdit; @@ -53,7 +53,7 @@ class ControllerConnectionDialog : public QDialog Q_OBJECT public: ControllerConnectionDialog( QWidget * _parent, - const automatableModel * _target_model ); + const AutomatableModel * _target_model ); virtual ~ControllerConnectionDialog(); Controller * chosenController( void ) @@ -81,7 +81,7 @@ private: lcdSpinBox * m_midiControllerSpinBox; ledCheckBox * m_midiAutoDetectCheckBox; MidiPortMenu * m_readablePorts; - boolModel m_midiAutoDetect; + BoolModel m_midiAutoDetect; // User groupBox * m_userGroupBox; @@ -92,7 +92,7 @@ private: QLineEdit * m_mappingFunction; Controller * m_controller; - const automatableModel * m_targetModel; + const AutomatableModel * m_targetModel; // Temporary midiController AutoDetectMidiController * m_midiController; diff --git a/include/ControllerDialog.h b/include/ControllerDialog.h index cb6a59bd5..3c82ccf6f 100644 --- a/include/ControllerDialog.h +++ b/include/ControllerDialog.h @@ -1,9 +1,9 @@ /* * ControllerDialog.h - per-controller-specific view for changing a - * controller's settings + * controller's settings * * Copyright (c) 2008-2009 Paul Giblock - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -28,12 +28,12 @@ #include -#include "mv_base.h" +#include "ModelView.h" class Controller; -class ControllerDialog : public QWidget, public modelView +class ControllerDialog : public QWidget, public ModelView { Q_OBJECT public: @@ -41,6 +41,7 @@ public: virtual ~ControllerDialog(); + signals: void closed(); diff --git a/include/ControllerRackView.h b/include/ControllerRackView.h index 174b1b06e..43d047177 100644 --- a/include/ControllerRackView.h +++ b/include/ControllerRackView.h @@ -27,7 +27,7 @@ #include -#include "serializing_object.h" +#include "SerializingObject.h" #include "lmms_basics.h" @@ -37,7 +37,7 @@ class QScrollArea; class ControllerView; -class ControllerRackView : public QWidget, public serializingObject +class ControllerRackView : public QWidget, public SerializingObject { Q_OBJECT public: @@ -47,9 +47,9 @@ public: virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { - return( "ControllerRackView" ); + return "ControllerRackView"; } @@ -58,8 +58,8 @@ public slots: private slots: - virtual void update( void ); - void addController( void ); + virtual void update(); + void addController(); private: diff --git a/include/ControllerView.h b/include/ControllerView.h index f25299eab..0e69834f0 100644 --- a/include/ControllerView.h +++ b/include/ControllerView.h @@ -27,9 +27,9 @@ #include -#include "automatable_model.h" +#include "AutomatableModel.h" #include "Controller.h" -#include "mv_base.h" +#include "ModelView.h" class QGroupBox; class QLabel; @@ -39,7 +39,7 @@ class QMdiSubWindow; class ledCheckBox; -class ControllerView : public QWidget, public modelView +class ControllerView : public QWidget, public ModelView { Q_OBJECT public: diff --git a/include/dummy_effect.h b/include/DummyEffect.h similarity index 56% rename from include/dummy_effect.h rename to include/DummyEffect.h index 75dfcddc5..33cff9a3a 100644 --- a/include/dummy_effect.h +++ b/include/DummyEffect.h @@ -1,8 +1,8 @@ /* - * dummy_effect.h - effect used as fallback if an effect couldn't be loaded + * DummyEffect.h - effect used as fallback if an effect couldn't be loaded + * + * Copyright (c) 2006-2009 Tobias Doerffel * - * Copyright (c) 2006-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,41 +22,40 @@ * */ - #ifndef _DUMMY_EFFECT_H #define _DUMMY_EFFECT_H -#include "effect.h" -#include "effect_controls.h" -#include "effect_control_dialog.h" +#include "Effect.h" +#include "EffectControls.h" +#include "EffectControlDialog.h" -class dummyEffectControlDialog : public effectControlDialog +class DummyEffectControlDialog : public EffectControlDialog { public: - dummyEffectControlDialog( effectControls * _controls ) : - effectControlDialog( _controls ) + DummyEffectControlDialog( EffectControls * _controls ) : + EffectControlDialog( _controls ) { } } ; -class dummyEffectControls : public effectControls +class DummyEffectControls : public EffectControls { public: - dummyEffectControls( effect * _eff ) : - effectControls( _eff ) + DummyEffectControls( Effect * _eff ) : + EffectControls( _eff ) { } - virtual ~dummyEffectControls() + virtual ~DummyEffectControls() { } - virtual int getControlCount( void ) + virtual int controlCount() { - return( 0 ); + return 0; } inline virtual void saveSettings( QDomDocument &, QDomElement & ) @@ -67,33 +66,33 @@ public: { } - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { - return( "dummycontrols" ); + return "DummyControls"; } - virtual effectControlDialog * createView( void ) + virtual EffectControlDialog * createView() { - return( new dummyEffectControlDialog( this ) ); + return new DummyEffectControlDialog( this ); } } ; -class dummyEffect : public effect +class DummyEffect : public Effect { public: - inline dummyEffect( model * _parent ) : - effect( NULL, _parent, NULL ), + inline DummyEffect( Model * _parent ) : + Effect( NULL, _parent, NULL ), m_controls( this ) { } - inline virtual ~dummyEffect() + inline virtual ~DummyEffect() { } - inline virtual effectControls * getControls( void ) + inline virtual EffectControls * controls() { return &m_controls; } @@ -105,7 +104,7 @@ public: private: - dummyEffectControls m_controls; + DummyEffectControls m_controls; } ; diff --git a/include/dummy_instrument.h b/include/DummyInstrument.h similarity index 66% rename from include/dummy_instrument.h rename to include/DummyInstrument.h index 068467b5b..f5ef60d0c 100644 --- a/include/dummy_instrument.h +++ b/include/DummyInstrument.h @@ -1,8 +1,8 @@ /* - * dummy_instrument.h - instrument used as fallback if an instrument couldn't - * be loaded + * DummyInstrument.h - instrument used as fallback if an instrument couldn't + * be loaded * - * Copyright (c) 2005-2008 Tobias Doerffel + * Copyright (c) 2005-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -23,23 +23,22 @@ * */ - #ifndef _DUMMY_INSTRUMENT_H #define _DUMMY_INSTRUMENT_H -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" -class dummyInstrument : public instrument +class DummyInstrument : public Instrument { public: - dummyInstrument( instrumentTrack * _instrument_track ) : - instrument( _instrument_track, NULL ) + DummyInstrument( InstrumentTrack * _instrument_track ) : + Instrument( _instrument_track, NULL ) { } - virtual ~dummyInstrument() + virtual ~DummyInstrument() { } @@ -55,14 +54,14 @@ public: { } - virtual QString nodeName( void ) const + virtual QString nodeName() const { - return( "dummyinstrument" ); + return "dummyinstrument"; } - virtual pluginView * instantiateView( QWidget * _parent ) + virtual PluginView * instantiateView( QWidget * _parent ) { - return( new instrumentView( this, _parent ) ); + return new InstrumentView( this, _parent ); } } ; diff --git a/include/dummy_plugin.h b/include/DummyPlugin.h similarity index 60% rename from include/dummy_plugin.h rename to include/DummyPlugin.h index 1bdc58967..d0cf0b9d9 100644 --- a/include/dummy_plugin.h +++ b/include/DummyPlugin.h @@ -1,9 +1,9 @@ /* - * dummy_plugin.h - empty plugin which is used as fallback if a plugin couldn't - * be found + * DummyPlugin.h - empty plugin which is used as fallback if a plugin couldn't + * be found + * + * Copyright (c) 2005-2009 Tobias Doerffel * - * Copyright (c) 2005-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,44 +23,43 @@ * */ - #ifndef _DUMMY_PLUGIN_H #define _DUMMY_PLUGIN_H -#include "plugin.h" -#include "plugin_view.h" +#include "Plugin.h" +#include "PluginView.h" -class dummyPlugin : public plugin +class DummyPlugin : public Plugin { public: - inline dummyPlugin( void ) : - plugin( NULL, NULL ) + DummyPlugin() : + Plugin( NULL, NULL ) { } - inline virtual ~dummyPlugin() + virtual ~DummyPlugin() { } - - inline virtual void saveSettings( QDomDocument &, QDomElement & ) + virtual void saveSettings( QDomDocument &, QDomElement & ) { } - inline virtual void loadSettings( const QDomElement & ) + virtual void loadSettings( const QDomElement & ) { } - inline virtual QString nodeName( void ) const + virtual QString nodeName() const { - return( "dummyplugin" ); + return "DummyPlugin"; } + protected: - virtual pluginView * instantiateView( QWidget * _parent ) + virtual PluginView * instantiateView( QWidget * _parent ) { - return( new pluginView( this, _parent ) ); + return new PluginView( this, _parent ); } } ; diff --git a/include/effect.h b/include/Effect.h similarity index 53% rename from include/effect.h rename to include/Effect.h index 7c6d10bc6..4fff6b178 100644 --- a/include/effect.h +++ b/include/Effect.h @@ -1,9 +1,9 @@ /* - * effect.h - base class for effects + * Effect.h - base class for effects * * Copyright (c) 2006-2007 Danny McRae - * Copyright (c) 2006-2008 Tobias Doerffel - * + * Copyright (c) 2006-2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,44 +23,43 @@ * */ - #ifndef _EFFECT_H #define _EFFECT_H -#include "plugin.h" +#include "Plugin.h" #include "engine.h" #include "mixer.h" -#include "automatable_model.h" -#include "tempo_sync_knob.h" +#include "AutomatableModel.h" +#include "TempoSyncKnobModel.h" -class effectChain; -class effectControls; +class EffectChain; +class EffectControls; -class EXPORT effect : public plugin +class EXPORT Effect : public Plugin { public: - effect( const plugin::descriptor * _desc, - model * _parent, - const descriptor::subPluginFeatures::key * _key ); - virtual ~effect(); + Effect( const Plugin::Descriptor * _desc, + Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ); + virtual ~Effect(); virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { - return( "effect" ); + return "effect"; } virtual bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) = 0; - inline ch_cnt_t getProcessorCount( void ) const + inline ch_cnt_t processorCount() const { - return( m_processors ); + return m_processors; } inline void setProcessorCount( ch_cnt_t _processors ) @@ -68,9 +67,9 @@ public: m_processors = _processors; } - inline bool isOkay( void ) const + inline bool isOkay() const { - return( m_okay ); + return m_okay; } inline void setOkay( bool _state ) @@ -79,71 +78,71 @@ public: } - inline bool isRunning( void ) const + inline bool isRunning() const { - return( m_running ); + return m_running; } - inline void startRunning( void ) + inline void startRunning() { m_bufferCount = 0; - m_running = TRUE; + m_running = true; } - inline void stopRunning( void ) + inline void stopRunning() { - m_running = FALSE; + m_running = false; } - inline bool isEnabled( void ) const + inline bool isEnabled() const { - return( m_enabledModel.value() ); + return m_enabledModel.value(); } - inline f_cnt_t getTimeout( void ) const + inline f_cnt_t timeout() const { const float samples = engine::getMixer()->processingSampleRate() * m_autoQuitModel.value() / 1000.0f; - return( 1 + ( static_cast( samples ) / - engine::getMixer()->framesPerPeriod() ) ); + return 1 + ( static_cast( samples ) / + engine::getMixer()->framesPerPeriod() ); } - inline float getWetLevel( void ) const + inline float wetLevel() const { - return( m_wetDryModel.value() ); + return m_wetDryModel.value(); } - inline float getDryLevel( void ) const + inline float dryLevel() const { - return( 1.0f - m_wetDryModel.value() ); + return 1.0f - m_wetDryModel.value(); } - inline float getGate( void ) const + inline float gate() const { const float level = m_gateModel.value(); - return( level*level * m_processors * - engine::getMixer()->framesPerPeriod() ); + return level*level * m_processors * + engine::getMixer()->framesPerPeriod(); } - inline f_cnt_t getBufferCount( void ) const + inline f_cnt_t bufferCount() const { - return( m_bufferCount ); + return m_bufferCount; } - inline void resetBufferCount( void ) + inline void resetBufferCount() { m_bufferCount = 0; } - inline void incrementBufferCount( void ) + inline void incrementBufferCount() { ++m_bufferCount; } - inline bool dontRun( void ) const + inline bool dontRun() const { - return( m_noRun ); + return m_noRun; } inline void setDontRun( bool _state ) @@ -151,28 +150,28 @@ public: m_noRun = _state; } - inline const descriptor::subPluginFeatures::key & getKey( void ) const + inline const Descriptor::SubPluginFeatures::Key & key() const { - return( m_key ); + return m_key; } - virtual effectControls * getControls( void ) = 0; + virtual EffectControls * controls() = 0; - static effect * instantiate( const QString & _plugin_name, - model * _parent, - descriptor::subPluginFeatures::key * _key ); + static Effect * instantiate( const QString & _plugin_name, + Model * _parent, + Descriptor::SubPluginFeatures::Key * _key ); protected: void checkGate( double _out_sum ); - virtual pluginView * instantiateView( QWidget * ); + virtual PluginView * instantiateView( QWidget * ); // some effects might not be capable of higher sample-rates so they can // sample it down before processing and back after processing inline void sampleDown( const sampleFrame * _src_buf, - sampleFrame * _dst_buf, - sample_rate_t _dst_sr ) + sampleFrame * _dst_buf, + sample_rate_t _dst_sr ) { resample( 0, _src_buf, engine::getMixer()->processingSampleRate(), @@ -181,24 +180,24 @@ protected: } inline void sampleBack( const sampleFrame * _src_buf, - sampleFrame * _dst_buf, - sample_rate_t _src_sr ) + sampleFrame * _dst_buf, + sample_rate_t _src_sr ) { resample( 1, _src_buf, _src_sr, _dst_buf, engine::getMixer()->processingSampleRate(), engine::getMixer()->framesPerPeriod() * _src_sr / engine::getMixer()->processingSampleRate() ); } - void reinitSRC( void ); + void reinitSRC(); private: void resample( int _i, const sampleFrame * _src_buf, - sample_rate_t _src_sr, - sampleFrame * _dst_buf, sample_rate_t _dst_sr, + sample_rate_t _src_sr, + sampleFrame * _dst_buf, sample_rate_t _dst_sr, const f_cnt_t _frames ); - descriptor::subPluginFeatures::key m_key; + Descriptor::SubPluginFeatures::Key m_key; ch_cnt_t m_processors; @@ -207,23 +206,23 @@ private: bool m_running; f_cnt_t m_bufferCount; - boolModel m_enabledModel; - floatModel m_wetDryModel; - floatModel m_gateModel; - tempoSyncKnobModel m_autoQuitModel; + BoolModel m_enabledModel; + FloatModel m_wetDryModel; + FloatModel m_gateModel; + TempoSyncKnobModel m_autoQuitModel; SRC_DATA m_srcData[2]; SRC_STATE * m_srcState[2]; - friend class effectView; - friend class effectChain; + friend class EffectView; + friend class EffectChain; } ; -typedef effect::descriptor::subPluginFeatures::key effectKey; -typedef effect::descriptor::subPluginFeatures::keyList effectKeyList; +typedef Effect::Descriptor::SubPluginFeatures::Key EffectKey; +typedef Effect::Descriptor::SubPluginFeatures::KeyList EffectKeyList; #endif diff --git a/include/effect_chain.h b/include/EffectChain.h similarity index 63% rename from include/effect_chain.h rename to include/EffectChain.h index 4d30daf40..bf949f2bd 100644 --- a/include/effect_chain.h +++ b/include/EffectChain.h @@ -1,9 +1,9 @@ /* - * effect_chain.h - class for processing and effects chain + * EffectChain.h - class for processing and effects chain * * Copyright (c) 2006-2008 Danny McRae - * Copyright (c) 2008 Tobias Doerffel - * + * Copyright (c) 2008-2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -26,38 +26,38 @@ #ifndef _EFFECT_CHAIN_H #define _EFFECT_CHAIN_H -#include "mv_base.h" -#include "serializing_object.h" +#include "Model.h" +#include "SerializingObject.h" #include "mixer.h" -#include "automatable_model.h" +#include "AutomatableModel.h" -class effect; +class Effect; -class EXPORT effectChain : public model, public serializingObject +class EXPORT EffectChain : public Model, public SerializingObject { Q_OBJECT public: - effectChain( model * _parent ); - virtual ~effectChain(); + EffectChain( Model * _parent ); + virtual ~EffectChain(); virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { return "fxchain"; } - void appendEffect( effect * _effect ); - void removeEffect( effect * _effect ); - void moveDown( effect * _effect ); - void moveUp( effect * _effect ); + void appendEffect( Effect * _effect ); + void removeEffect( Effect * _effect ); + void moveDown( Effect * _effect ); + void moveUp( Effect * _effect ); bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ); - void startRunning( void ); - bool isRunning( void ); + void startRunning(); + bool isRunning(); - void clear( void ); + void clear(); void setEnabled( bool _on ) { @@ -66,17 +66,17 @@ public: private: - typedef QVector effectList; - effectList m_effects; + typedef QVector EffectList; + EffectList m_effects; - boolModel m_enabledModel; + BoolModel m_enabledModel; - friend class effectRackView; + friend class EffectRackView; signals: - void aboutToClear( void ); + void aboutToClear(); } ; diff --git a/include/effect_control_dialog.h b/include/EffectControlDialog.h similarity index 71% rename from include/effect_control_dialog.h rename to include/EffectControlDialog.h index ffeacb08b..65a0ff60d 100644 --- a/include/effect_control_dialog.h +++ b/include/EffectControlDialog.h @@ -1,9 +1,9 @@ /* - * effect_control_dialog.h - base-class for effect-dialogs for displaying and - * editing control port values + * EffectControlDialog.h - base-class for effect-dialogs for displaying and + * editing control port values + * + * Copyright (c) 2006-2009 Tobias Doerffel * - * Copyright (c) 2006-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -28,18 +28,17 @@ #include -#include "mv_base.h" +#include "ModelView.h" + +class EffectControls; -class effectControls; - - -class EXPORT effectControlDialog : public QWidget, public modelView +class EXPORT EffectControlDialog : public QWidget, public ModelView { Q_OBJECT public: - effectControlDialog( effectControls * _controls ); - virtual ~effectControlDialog(); + EffectControlDialog( EffectControls * _controls ); + virtual ~EffectControlDialog(); signals: @@ -49,7 +48,7 @@ signals: protected: virtual void closeEvent( QCloseEvent * _ce ); - effectControls * m_effectControls; + EffectControls * m_effectControls; } ; diff --git a/include/effect_controls.h b/include/EffectControls.h similarity index 65% rename from include/effect_controls.h rename to include/EffectControls.h index 28cf35bc4..71e58f0a7 100644 --- a/include/effect_controls.h +++ b/include/EffectControls.h @@ -1,5 +1,5 @@ /* - * effect_controls.h - model for effect-controls + * EffectControls.h - model for effect-controls * * Copyright (c) 2008 Tobias Doerffel * @@ -25,42 +25,39 @@ #ifndef _EFFECT_CONTROLS_H #define _EFFECT_CONTROLS_H -#include "mv_base.h" -#include "journalling_object.h" -#include "effect.h" +#include "Model.h" +#include "JournallingObject.h" +#include "Effect.h" + +class EffectControlDialog; -class effectControlDialog; - - -class effectControls : public journallingObject, public model +class EffectControls : public JournallingObject, public Model { public: - effectControls( effect * _eff ) : - journallingObject(), - model( _eff ), + EffectControls( Effect * _eff ) : + JournallingObject(), + Model( _eff ), m_effect( _eff ) { } - virtual ~effectControls() + virtual ~EffectControls() { } - virtual int getControlCount( void ) = 0; - virtual effectControlDialog * createView( void ) = 0; + virtual int controlCount() = 0; + virtual EffectControlDialog * createView() = 0; -// template - effect * getEffect( void ) + Effect * effect() { - return( m_effect ); - //return( dynamic_cast( m_effect ) ); + return m_effect; } private: - effect * m_effect; + Effect * m_effect; } ; diff --git a/include/effect_rack_view.h b/include/EffectRackView.h similarity index 68% rename from include/effect_rack_view.h rename to include/EffectRackView.h index edd12469f..b760f2ffe 100644 --- a/include/effect_rack_view.h +++ b/include/EffectRackView.h @@ -28,51 +28,52 @@ #include -#include "effect_chain.h" +#include "EffectChain.h" +#include "ModelView.h" #include "lmms_basics.h" class QScrollArea; class QVBoxLayout; -class effectView; +class EffectView; class groupBox; -class effectRackView : public QWidget, public modelView +class EffectRackView : public QWidget, public ModelView { Q_OBJECT public: - effectRackView( effectChain * _model, QWidget * _parent = NULL ); - virtual ~effectRackView(); + EffectRackView( EffectChain * _model, QWidget * _parent = NULL ); + virtual ~EffectRackView(); public slots: - void clearViews( void ); - void moveUp( effectView * _view ); - void moveDown( effectView * _view ); - void deletePlugin( effectView * _view ); + void clearViews(); + void moveUp( EffectView * _view ); + void moveDown( EffectView * _view ); + void deletePlugin( EffectView * _view ); private slots: - virtual void update( void ); - void addEffect( void ); + virtual void update(); + void addEffect(); private: - virtual void modelChanged( void ); + virtual void modelChanged(); - inline effectChain * fxChain( void ) + inline EffectChain * fxChain() { - return( castModel() ); + return castModel(); } - inline const effectChain * fxChain( void ) const + inline const EffectChain * fxChain() const { - return( castModel() ); + return castModel(); } - QVector m_effectViews; + QVector m_effectViews; QVBoxLayout * m_mainLayout; groupBox * m_effectsGroupBox; diff --git a/include/effect_select_dialog.h b/include/EffectSelectDialog.h similarity index 64% rename from include/effect_select_dialog.h rename to include/EffectSelectDialog.h index 966247985..506e86f16 100644 --- a/include/effect_select_dialog.h +++ b/include/EffectSelectDialog.h @@ -1,8 +1,8 @@ /* - * effect_select_dialog.h - dialog to choose effect plugin + * EffectSelectDialog.h - dialog to choose effect plugin + * + * Copyright (c) 2006-2009 Tobias Doerffel * - * Copyright (c) 2006-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ * */ - #ifndef _EFFECT_SELECT_DIALOG_H #define _EFFECT_SELECT_DIALOG_H @@ -30,8 +29,8 @@ #include #include -#include "effect_chain.h" -#include "effect.h" +#include "EffectChain.h" +#include "Effect.h" class QLineEdit; @@ -39,56 +38,56 @@ class QListView; class QScrollArea; -class effectSelectDialog : public QDialog +class EffectSelectDialog : public QDialog { Q_OBJECT public: - effectSelectDialog( QWidget * _parent ); - virtual ~effectSelectDialog(); + EffectSelectDialog( QWidget * _parent ); + virtual ~EffectSelectDialog(); - effect * instantiateSelectedPlugin( effectChain * _parent ); + Effect * instantiateSelectedPlugin( EffectChain * _parent ); public slots: - void setSelection( const effectKey & _selection ); - void selectPlugin( void ); + void setSelection( const EffectKey & _selection ); + void selectPlugin(); private: - effectKey m_currentSelection; + EffectKey m_currentSelection; } ; -class effectListWidget : public QWidget +class EffectListWidget : public QWidget { Q_OBJECT public: - effectListWidget( QWidget * _parent ); + EffectListWidget( QWidget * _parent ); - virtual ~effectListWidget(); + virtual ~EffectListWidget(); - inline effectKey getSelected( void ) + inline EffectKey getSelected() { return( m_currentSelection ); } signals: - void highlighted( const effectKey & _key ); - void doubleClicked( const effectKey & _key ); + void highlighted( const EffectKey & _key ); + void doubleClicked( const EffectKey & _key ); protected slots: void rowChanged( const QModelIndex &, const QModelIndex & ); void onDoubleClicked( const QModelIndex & ); - void updateSelection( void ); + void updateSelection(); private: - QVector m_pluginDescriptors; - effectKeyList m_effectKeys; - effectKey m_currentSelection; + QVector m_pluginDescriptors; + EffectKeyList m_effectKeys; + EffectKey m_currentSelection; QLineEdit * m_filterEdit; QListView * m_pluginList; diff --git a/include/effect_view.h b/include/EffectView.h similarity index 60% rename from include/effect_view.h rename to include/EffectView.h index 99c42ad8a..172574379 100644 --- a/include/effect_view.h +++ b/include/EffectView.h @@ -1,9 +1,9 @@ /* - * effect_view.h - view-component for an effect + * EffectView.h - view-component for an effect * * Copyright (c) 2006-2007 Danny McRae - * Copyright (c) 2007-2008 Tobias Doerffel - * + * Copyright (c) 2007-2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -26,68 +26,67 @@ #ifndef _EFFECT_VIEW_H #define _EFFECT_VIEW_H -#include "automatable_model.h" -#include "plugin_view.h" -#include "effect.h" +#include "AutomatableModel.h" +#include "PluginView.h" +#include "Effect.h" class QGroupBox; class QLabel; class QPushButton; class QMdiSubWindow; -class audioPort; -class effectControlDialog; +class EffectControlDialog; class knob; class ledCheckBox; -class tempoSyncKnob; +class TempoSyncKnob; -class effectView : public pluginView +class EffectView : public PluginView { Q_OBJECT public: - effectView( effect * _model, QWidget * _parent ); - virtual ~effectView(); + EffectView( Effect * _model, QWidget * _parent ); + virtual ~EffectView(); - inline effect * getEffect( void ) + inline Effect * effect() { - return( castModel() ); + return castModel(); } - inline const effect * getEffect( void ) const + inline const Effect * effect() const { - return( castModel() ); + return castModel(); } public slots: - void editControls( void ); - void moveUp( void ); - void moveDown( void ); - void deletePlugin( void ); - void displayHelp( void ); - void closeEffects( void ); + void editControls(); + void moveUp(); + void moveDown(); + void deletePlugin(); + void displayHelp(); + void closeEffects(); signals: - void moveUp( effectView * _plugin ); - void moveDown( effectView * _plugin ); - void deletePlugin( effectView * _plugin ); + void moveUp( EffectView * _plugin ); + void moveDown( EffectView * _plugin ); + void deletePlugin( EffectView * _plugin ); protected: virtual void contextMenuEvent( QContextMenuEvent * _me ); virtual void paintEvent( QPaintEvent * _pe ); - virtual void modelChanged( void ); + virtual void modelChanged(); private: QPixmap m_bg; ledCheckBox * m_bypass; knob * m_wetDry; - tempoSyncKnob * m_autoQuit; + TempoSyncKnob * m_autoQuit; knob * m_gate; QMdiSubWindow * m_subWindow; - effectControlDialog * m_controlView; + EffectControlDialog * m_controlView; bool m_show; } ; diff --git a/include/envelope_and_lfo_parameters.h b/include/EnvelopeAndLfoParameters.h similarity index 58% rename from include/envelope_and_lfo_parameters.h rename to include/EnvelopeAndLfoParameters.h index 5db9763fd..ca035830f 100644 --- a/include/envelope_and_lfo_parameters.h +++ b/include/EnvelopeAndLfoParameters.h @@ -1,8 +1,8 @@ /* - * envelope_and_lfo_parameters.h - class envelopeAndLFOParameters + * EnvelopeAndLfoParameters.h - class EnvelopeAndLfoParameters + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -28,79 +28,79 @@ #include -#include "journalling_object.h" -#include "automatable_model.h" +#include "JournallingObject.h" +#include "AutomatableModel.h" #include "sample_buffer.h" -#include "tempo_sync_knob.h" +#include "TempoSyncKnobModel.h" #include "lmms_basics.h" -class EXPORT envelopeAndLFOParameters : public model, public journallingObject +class EXPORT EnvelopeAndLfoParameters : public Model, public JournallingObject { Q_OBJECT public: - envelopeAndLFOParameters( float _value_for_zero_amount, - model * _parent ); - virtual ~envelopeAndLFOParameters(); + EnvelopeAndLfoParameters( float _value_for_zero_amount, + Model * _parent ); + virtual ~EnvelopeAndLfoParameters(); static inline float expKnobVal( float _val ) { - return( ( ( _val < 0 ) ? -_val : _val ) * _val ); + return ( ( _val < 0 ) ? -_val : _val ) * _val; } - static void triggerLFO( void ); - static void resetLFO( void ); + static void triggerLfo(); + static void resetLfo(); void fillLevel( float * _buf, f_cnt_t _frame, const f_cnt_t _release_begin, const fpp_t _frames ); - inline bool used( void ) const + inline bool isUsed() const { - return( m_used ); + return m_used; } virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - virtual QString nodeName( void ) const + virtual QString nodeName() const { - return( "el" ); + return "el"; } - inline f_cnt_t PAHD_Frames( void ) const + inline f_cnt_t PAHD_Frames() const { - return( m_pahdFrames ); + return m_pahdFrames; } - inline f_cnt_t releaseFrames( void ) const + inline f_cnt_t releaseFrames() const { - return( m_rFrames ); + return m_rFrames; } public slots: - void updateSampleVars( void ); + void updateSampleVars(); protected: - void fillLFOLevel( float * _buf, f_cnt_t _frame, const fpp_t _frames ); + void fillLfoLevel( float * _buf, f_cnt_t _frame, const fpp_t _frames ); private: - static QVector s_EaLParametersInstances; + static QVector s_EaLParametersInstances; bool m_used; - floatModel m_predelayModel; - floatModel m_attackModel; - floatModel m_holdModel; - floatModel m_decayModel; - floatModel m_sustainModel; - floatModel m_releaseModel; - floatModel m_amountModel; + FloatModel m_predelayModel; + FloatModel m_attackModel; + FloatModel m_holdModel; + FloatModel m_decayModel; + FloatModel m_sustainModel; + FloatModel m_releaseModel; + FloatModel m_amountModel; float m_sustainLevel; float m_amount; @@ -112,14 +112,14 @@ private: sample_t * m_rEnv; - floatModel m_lfoPredelayModel; - floatModel m_lfoAttackModel; - tempoSyncKnobModel m_lfoSpeedModel; - floatModel m_lfoAmountModel; - intModel m_lfoWaveModel; + FloatModel m_lfoPredelayModel; + FloatModel m_lfoAttackModel; + TempoSyncKnobModel m_lfoSpeedModel; + FloatModel m_lfoAmountModel; + IntModel m_lfoWaveModel; - boolModel m_x100Model; - boolModel m_controlEnvAmountModel; + BoolModel m_x100Model; + BoolModel m_controlEnvAmountModel; f_cnt_t m_lfoPredelayFrames; @@ -143,12 +143,12 @@ private: } ; sample_t lfoShapeSample( fpp_t _frame_offset ); - void updateLFOShapeData( void ); + void updateLfoShapeData(); - friend class envelopeAndLFOView; - friend class flpImport; + friend class EnvelopeAndLfoView; + friend class FlpImport; } ; diff --git a/include/envelope_and_lfo_view.h b/include/EnvelopeAndLfoView.h similarity index 73% rename from include/envelope_and_lfo_view.h rename to include/EnvelopeAndLfoView.h index 199edee83..dec4a5bb8 100644 --- a/include/envelope_and_lfo_view.h +++ b/include/EnvelopeAndLfoView.h @@ -1,10 +1,9 @@ /* - * envelope_and_lfo_view.h - declaration of class envelopeAndLFOWidget which - * is used by envelope/lfo/filter-tab of - * channel-window + * EnvelopeAndLfoView.h - declaration of class EnvelopeAndLfoView which + * is used by envelope/lfo/filter-tab of instrument track + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -24,37 +23,36 @@ * */ - #ifndef _ENVELOPE_AND_LFO_VIEW_H #define _ENVELOPE_AND_LFO_VIEW_H #include -#include "mv_base.h" +#include "ModelView.h" class QPaintEvent; class QPixmap; -class envelopeAndLFOParameters; +class EnvelopeAndLfoParameters; class automatableButtonGroup; class knob; class ledCheckBox; class pixmapButton; -class tempoSyncKnob; +class TempoSyncKnob; -class envelopeAndLFOView : public QWidget, public modelView +class EnvelopeAndLfoView : public QWidget, public ModelView { Q_OBJECT public: - envelopeAndLFOView( QWidget * _parent ); - virtual ~envelopeAndLFOView(); + EnvelopeAndLfoView( QWidget * _parent ); + virtual ~EnvelopeAndLfoView(); protected: - virtual void modelChanged( void ); + virtual void modelChanged(); virtual void dragEnterEvent( QDragEnterEvent * _dee ); virtual void dropEvent( QDropEvent * _de ); @@ -63,17 +61,17 @@ protected: protected slots: - void lfoUserWaveChanged( void ); + void lfoUserWaveChanged(); private: static QPixmap * s_envGraph; static QPixmap * s_lfoGraph; - envelopeAndLFOParameters * m_params; + EnvelopeAndLfoParameters * m_params; - // envelope-stuff + // envelope stuff knob * m_predelayKnob; knob * m_attackKnob; knob * m_holdKnob; @@ -82,10 +80,10 @@ private: knob * m_releaseKnob; knob * m_amountKnob; - // LFO-stuff + // LFO stuff knob * m_lfoPredelayKnob; knob * m_lfoAttackKnob; - tempoSyncKnob * m_lfoSpeedKnob; + TempoSyncKnob * m_lfoSpeedKnob; knob * m_lfoAmountKnob; pixmapButton * m_userLfoBtn; automatableButtonGroup * m_lfoWaveBtnGrp; diff --git a/include/fx_mixer.h b/include/FxMixer.h similarity index 70% rename from include/fx_mixer.h rename to include/FxMixer.h index 2feaf5a84..2a6bd84e0 100644 --- a/include/fx_mixer.h +++ b/include/FxMixer.h @@ -1,8 +1,8 @@ /* - * fx_mixer.h - effect-mixer for LMMS + * FxMixer.h - effect-mixer for LMMS + * + * Copyright (c) 2008-2009 Tobias Doerffel * - * Copyright (c) 2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,32 +22,31 @@ * */ - #ifndef _FX_MIXER_H #define _FX_MIXER_H -#include "mv_base.h" +#include "Model.h" #include "mixer.h" -#include "effect_chain.h" -#include "journalling_object.h" +#include "EffectChain.h" +#include "JournallingObject.h" const int NumFxChannels = 64; -struct fxChannel +struct FxChannel { - fxChannel( model * _parent ); - ~fxChannel(); + FxChannel( Model * _parent ); + ~FxChannel(); - effectChain m_fxChain; + EffectChain m_fxChain; bool m_used; bool m_stillRunning; float m_peakLeft; float m_peakRight; sampleFrame * m_buffer; - boolModel m_muteModel; - floatModel m_volumeModel; + BoolModel m_muteModel; + FloatModel m_volumeModel; QString m_name; QMutex m_lock; @@ -55,30 +54,30 @@ struct fxChannel -class fxMixer : public journallingObject, public model +class FxMixer : public JournallingObject, public Model { public: - fxMixer(); - virtual ~fxMixer(); + FxMixer(); + virtual ~FxMixer(); void mixToChannel( const sampleFrame * _buf, fx_ch_t _ch ); void processChannel( fx_ch_t _ch, sampleFrame * _buf = NULL ); - void prepareMasterMix( void ); + void prepareMasterMix(); void masterMix( sampleFrame * _buf ); - void clear( void ); + void clear(); virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - virtual QString nodeName( void ) const + virtual QString nodeName() const { return "fxmixer"; } - fxChannel * getEffectChannel( int _ch ) + FxChannel * effectChannel( int _ch ) { if( _ch >= 0 && _ch <= NumFxChannels ) { @@ -89,11 +88,11 @@ public: private: - fxChannel * m_fxChannels[NumFxChannels+1]; // +1 = master + FxChannel * m_fxChannels[NumFxChannels+1]; // +1 = master friend class mixerWorkerThread; - friend class fxMixerView; + friend class FxMixerView; } ; diff --git a/include/fx_mixer_view.h b/include/FxMixerView.h similarity index 72% rename from include/fx_mixer_view.h rename to include/FxMixerView.h index 75f6dda63..dab34caaf 100644 --- a/include/fx_mixer_view.h +++ b/include/FxMixerView.h @@ -1,5 +1,5 @@ /* - * fx_mixer_view.h - effect-mixer-view for LMMS + * FxMixerView.h - effect-mixer-view for LMMS * * Copyright (c) 2008 Tobias Doerffel * @@ -22,64 +22,62 @@ * */ - #ifndef _FX_MIXER_VIEW_H #define _FX_MIXER_VIEW_H #include -#include "fx_mixer.h" - +#include "FxMixer.h" +#include "ModelView.h" class QStackedLayout; class QButtonGroup; class fader; -class fxLine; -class effectRackView; +class FxLine; +class EffectRackView; class pixmapButton; - -class fxMixerView : public QWidget, public modelView, - public serializingObjectHook +class FxMixerView : public QWidget, public ModelView, + public SerializingObjectHook { Q_OBJECT public: - fxMixerView(); - virtual ~fxMixerView(); + FxMixerView(); + virtual ~FxMixerView(); virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); virtual void loadSettings( const QDomElement & _this ); - fxLine * currentFxLine( void ) + FxLine * currentFxLine() { - return( m_currentFxLine ); + return m_currentFxLine; } - void setCurrentFxLine( fxLine * _line ); + void setCurrentFxLine( FxLine * _line ); void setCurrentFxLine( int _line ); - void clear( void ); + void clear(); private slots: - void updateFaders( void ); + void updateFaders(); private: - struct fxChannelView + struct FxChannelView { - fxLine * m_fxLine; - effectRackView * m_rackView; + FxLine * m_fxLine; + EffectRackView * m_rackView; pixmapButton * m_muteBtn; fader * m_fader; } ; - fxChannelView m_fxChannelViews[NumFxChannels+1]; + FxChannelView m_fxChannelViews[NumFxChannels+1]; QStackedLayout * m_fxRacksLayout; QStackedLayout * m_fxLineBanks; QButtonGroup * m_bankButtons; - fxLine * m_currentFxLine; + FxLine * m_currentFxLine; } ; diff --git a/include/import_filter.h b/include/ImportFilter.h similarity index 71% rename from include/import_filter.h rename to include/ImportFilter.h index 8f0dbfb5a..676114cbb 100644 --- a/include/import_filter.h +++ b/include/ImportFilter.h @@ -1,9 +1,9 @@ /* - * import_filter.h - declaration of class importFilter, the base-class for all - * file import filters + * ImportFilter.h - declaration of class ImportFilter, the base-class for all + * file import filters + * + * Copyright (c) 2006-2009 Tobias Doerffel * - * Copyright (c) 2006-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,25 +23,23 @@ * */ - #ifndef _IMPORT_FILTER_H #define _IMPORT_FILTER_H #include - -#include "plugin.h" +#include "Plugin.h" class trackContainer; -class EXPORT importFilter : public plugin +class EXPORT ImportFilter : public Plugin { public: - importFilter( const QString & _file_name, - const descriptor * _descriptor ); - virtual ~importFilter(); + ImportFilter( const QString & _file_name, + const Descriptor * _descriptor ); + virtual ~ImportFilter(); // tries to import given file to given track-container by having all @@ -53,31 +51,31 @@ public: protected: virtual bool tryImport( trackContainer * _tc ) = 0; - const QFile & file( void ) const + const QFile & file() const { - return( m_file ); + return m_file; } - bool openFile( void ); + bool openFile(); - inline void closeFile( void ) + inline void closeFile() { m_file.close(); } - inline int readByte( void ) + inline int readByte() { unsigned char c; if( m_file.getChar( (char*) &c ) ) { - return( static_cast( c ) ); + return static_cast( c ); } - return( -1 ); + return -1; } inline int readBlock( char * _data, int _len ) { - return( m_file.read( _data, _len ) ); + return m_file.read( _data, _len ); } inline void ungetChar( char _ch ) @@ -93,9 +91,9 @@ protected: { } - virtual QString nodeName( void ) const + virtual QString nodeName() const { - return( "import_filter" ); + return "import_filter"; } diff --git a/include/instrument.h b/include/Instrument.h similarity index 86% rename from include/instrument.h rename to include/Instrument.h index e974eef65..74e47ac7e 100644 --- a/include/instrument.h +++ b/include/Instrument.h @@ -1,5 +1,5 @@ /* - * instrument.h - declaration of class instrument, which provides a + * Instrument.h - declaration of class Instrument, which provides a * standard interface for all instrument plugins * * Copyright (c) 2005-2009 Tobias Doerffel @@ -28,25 +28,25 @@ #include -#include "plugin.h" +#include "Plugin.h" #include "mixer.h" // forward-declarations -class instrumentTrack; -class instrumentView; +class InstrumentTrack; +class InstrumentView; class midiEvent; class midiTime; class notePlayHandle; class track; -class EXPORT instrument : public plugin +class EXPORT Instrument : public Plugin { public: - instrument( instrumentTrack * _instrument_track, - const descriptor * _descriptor ); - virtual ~instrument(); + Instrument( InstrumentTrack * _instrument_track, + const Descriptor * _descriptor ); + virtual ~Instrument(); // -------------------------------------------------------------------- // functions that can/should be re-implemented: @@ -99,8 +99,7 @@ public: // sub-classes can re-implement this for receiving all incoming // MIDI-events - inline virtual bool handleMidiEvent( const midiEvent &, - const midiTime & ) + inline virtual bool handleMidiEvent( const midiEvent &, const midiTime & ) { return false; } @@ -113,14 +112,14 @@ public: // instantiate instrument-plugin with given name or return NULL // on failure - static instrument * instantiate( const QString & _plugin_name, - instrumentTrack * _instrument_track ); + static Instrument * instantiate( const QString & _plugin_name, + InstrumentTrack * _instrument_track ); virtual bool isFromTrack( const track * _track ) const; protected: - inline instrumentTrack * getInstrumentTrack() const + inline InstrumentTrack * instrumentTrack() const { return m_instrumentTrack; } @@ -132,7 +131,7 @@ protected: private: - instrumentTrack * m_instrumentTrack; + InstrumentTrack * m_instrumentTrack; } ; diff --git a/include/instrument_function_views.h b/include/InstrumentFunctionViews.h similarity index 67% rename from include/instrument_function_views.h rename to include/InstrumentFunctionViews.h index 1de8686ca..3b4334147 100644 --- a/include/instrument_function_views.h +++ b/include/InstrumentFunctionViews.h @@ -1,8 +1,8 @@ /* - * instrument_function_views.h - views for instrument-functions-tab + * InstrumentFunctionViews.h - views for instrument-functions-tab + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,11 +22,10 @@ * */ - #ifndef _INSTRUMENT_FUNCTION_VIEWS_H #define _INSTRUMENT_FUNCTION_VIEWS_H -#include "mv_base.h" +#include "ModelView.h" #include @@ -34,25 +33,25 @@ class QLabel; class comboBox; class groupBox; class knob; -class tempoSyncKnob; +class TempoSyncKnob; -class arpeggiator; -class chordCreator; +class Arpeggiator; +class ChordCreator; -class chordCreatorView : public QWidget, public modelView +class ChordCreatorView : public QWidget, public ModelView { Q_OBJECT public: - chordCreatorView( chordCreator * _cc, QWidget * _parent ); - virtual ~chordCreatorView(); + ChordCreatorView( ChordCreator * _cc, QWidget * _parent ); + virtual ~ChordCreatorView(); private: - virtual void modelChanged( void ); + virtual void modelChanged(); - chordCreator * m_cc; + ChordCreator * m_cc; groupBox * m_chordsGroupBox; comboBox * m_chordsComboBox; @@ -64,22 +63,22 @@ private: -class arpeggiatorView : public QWidget, public modelView +class ArpeggiatorView : public QWidget, public ModelView { Q_OBJECT public: - arpeggiatorView( arpeggiator * _arp, QWidget * _parent ); - virtual ~arpeggiatorView(); + ArpeggiatorView( Arpeggiator * _arp, QWidget * _parent ); + virtual ~ArpeggiatorView(); private: - virtual void modelChanged( void ); + virtual void modelChanged(); - arpeggiator * m_a; + Arpeggiator * m_a; groupBox * m_arpGroupBox; comboBox * m_arpComboBox; knob * m_arpRangeKnob; - tempoSyncKnob * m_arpTimeKnob; + TempoSyncKnob * m_arpTimeKnob; knob * m_arpGateKnob; QLabel * m_arpDirectionLbl; diff --git a/include/instrument_functions.h b/include/InstrumentFunctions.h similarity index 60% rename from include/instrument_functions.h rename to include/InstrumentFunctions.h index 74a4d8f39..43a73bbe4 100644 --- a/include/instrument_functions.h +++ b/include/InstrumentFunctions.h @@ -1,8 +1,8 @@ /* - * instrument_functions.h - models for instrument-functions-tab + * InstrumentFunctions.h - models for instrument-functions-tab + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,30 +22,29 @@ * */ - #ifndef _INSTRUMENT_FUNCTIONS_H #define _INSTRUMENT_FUNCTIONS_H -#include "journalling_object.h" +#include "JournallingObject.h" #include "lmms_basics.h" -#include "automatable_model.h" -#include "tempo_sync_knob.h" -#include "combobox_model.h" +#include "AutomatableModel.h" +#include "TempoSyncKnobModel.h" +#include "ComboBoxModel.h" -class instrumentTrack; +class InstrumentTrack; class notePlayHandle; const int MAX_CHORD_POLYPHONY = 10; -class chordCreator : public model, public journallingObject +class ChordCreator : public Model, public JournallingObject { Q_OBJECT public: - chordCreator( model * _parent ); - virtual ~chordCreator(); + ChordCreator( Model * _parent ); + virtual ~ChordCreator(); void processNote( notePlayHandle * _n ); @@ -53,44 +52,44 @@ public: virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { - return( "chordcreator" ); + return "chordcreator"; } - static struct chord + static struct Chord { const QString name; Sint8 interval[MAX_CHORD_POLYPHONY]; } s_chordTable[]; - static inline int getChordSize( chord & _c ) + static inline int getChordSize( Chord & _c ) { int idx = 0; while( _c.interval[idx] != -1 ) { ++idx; } - return( idx ); + return idx; } private: - boolModel m_chordsEnabledModel; - comboBoxModel m_chordsModel; - floatModel m_chordRangeModel; + BoolModel m_chordsEnabledModel; + ComboBoxModel m_chordsModel; + FloatModel m_chordRangeModel; - friend class chordCreatorView; + friend class ChordCreatorView; } ; -class arpeggiator : public model, public journallingObject +class Arpeggiator : public Model, public JournallingObject { Q_OBJECT public: @@ -103,8 +102,8 @@ public: NumArpDirections } ; - arpeggiator( model * _parent ); - virtual ~arpeggiator(); + Arpeggiator( Model * _parent ); + virtual ~Arpeggiator(); void processNote( notePlayHandle * _n ); @@ -112,9 +111,9 @@ public: virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { - return( "arpeggiator" ); + return "arpeggiator"; } @@ -126,18 +125,18 @@ private: SyncMode } ; - boolModel m_arpEnabledModel; - comboBoxModel m_arpModel; - floatModel m_arpRangeModel; - tempoSyncKnobModel m_arpTimeModel; - floatModel m_arpGateModel; - comboBoxModel m_arpDirectionModel; - comboBoxModel m_arpModeModel; + BoolModel m_arpEnabledModel; + ComboBoxModel m_arpModel; + FloatModel m_arpRangeModel; + TempoSyncKnobModel m_arpTimeModel; + FloatModel m_arpGateModel; + ComboBoxModel m_arpDirectionModel; + ComboBoxModel m_arpModeModel; - friend class flpImport; - friend class instrumentTrack; - friend class arpeggiatorView; + friend class FlpImport; + friend class InstrumentTrack; + friend class ArpeggiatorView; } ; diff --git a/include/instrument_midi_io_view.h b/include/InstrumentMidiIOView.h similarity index 76% rename from include/instrument_midi_io_view.h rename to include/InstrumentMidiIOView.h index d9b1128b8..4747cd13d 100644 --- a/include/instrument_midi_io_view.h +++ b/include/InstrumentMidiIOView.h @@ -1,9 +1,9 @@ /* - * instrument_midi_io_view.h - tab-widget in instrument-track-window for setting - * up MIDI-related stuff + * InstrumentMidiIOView.h - widget in instrument-track-window for setting + * up MIDI-related stuff + * + * Copyright (c) 2005-2009 Tobias Doerffel * - * Copyright (c) 2005-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,30 +23,28 @@ * */ - #ifndef _INSTRUMENT_MIDI_IO_VIEW_H #define _INSTRUMENT_MIDI_IO_VIEW_H #include -#include "mv_base.h" +#include "ModelView.h" class groupBox; class lcdSpinBox; -class midiPortMenu; class QToolButton; -class instrumentMidiIOView : public QWidget, public modelView +class InstrumentMidiIOView : public QWidget, public ModelView { public: - instrumentMidiIOView( QWidget * _parent ); - virtual ~instrumentMidiIOView(); + InstrumentMidiIOView( QWidget * _parent ); + virtual ~InstrumentMidiIOView(); private: - virtual void modelChanged( void ); + virtual void modelChanged(); groupBox * m_midiInputGroupBox; lcdSpinBox * m_inputChannelSpinBox; diff --git a/include/instrument_sound_shaping.h b/include/InstrumentSoundShaping.h similarity index 60% rename from include/instrument_sound_shaping.h rename to include/InstrumentSoundShaping.h index 2cba120b7..398df0688 100644 --- a/include/instrument_sound_shaping.h +++ b/include/InstrumentSoundShaping.h @@ -1,8 +1,8 @@ /* - * instrument_sound_shaping.h - class instrumentSoundShaping + * InstrumentSoundShaping.h - declaration of class InstrumentSoundShaping + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,25 +22,24 @@ * */ - #ifndef _INSTRUMENT_SOUND_SHAPING_H #define _INSTRUMENT_SOUND_SHAPING_H #include "mixer.h" -#include "combobox_model.h" +#include "ComboBoxModel.h" -class instrumentTrack; -class envelopeAndLFOParameters; +class InstrumentTrack; +class EnvelopeAndLfoParameters; class notePlayHandle; -class instrumentSoundShaping : public model, public journallingObject +class InstrumentSoundShaping : public Model, public JournallingObject { Q_OBJECT public: - instrumentSoundShaping( instrumentTrack * _instrument_track ); - virtual ~instrumentSoundShaping(); + InstrumentSoundShaping( InstrumentTrack * _instrument_track ); + virtual ~InstrumentSoundShaping(); void processAudioBuffer( sampleFrame * _ab, const fpp_t _frames, notePlayHandle * _n ); @@ -53,37 +52,37 @@ public: NumTargets } ; - f_cnt_t envFrames( const bool _only_vol = FALSE ) const; - f_cnt_t releaseFrames( void ) const; + f_cnt_t envFrames( const bool _only_vol = false ) const; + f_cnt_t releaseFrames() const; 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( void ) const + inline virtual QString nodeName() const { - return( "eldata" ); + return "eldata"; } private: - envelopeAndLFOParameters * m_envLFOParameters[NumTargets]; - instrumentTrack * m_instrumentTrack; + EnvelopeAndLfoParameters * m_envLfoParameters[NumTargets]; + InstrumentTrack * m_instrumentTrack; - boolModel m_filterEnabledModel; - comboBoxModel m_filterModel; - floatModel m_filterCutModel; - floatModel m_filterResModel; + BoolModel m_filterEnabledModel; + ComboBoxModel m_filterModel; + FloatModel m_filterCutModel; + FloatModel m_filterResModel; - friend class instrumentSoundShapingView; - friend class flpImport; + friend class InstrumentSoundShapingView; + friend class FlpImport; } ; -extern const QString __targetNames[instrumentSoundShaping::NumTargets][3]; +extern const QString __targetNames[InstrumentSoundShaping::NumTargets][3]; #endif diff --git a/include/instrument_sound_shaping_view.h b/include/InstrumentSoundShapingView.h similarity index 71% rename from include/instrument_sound_shaping_view.h rename to include/InstrumentSoundShapingView.h index 0e6551c01..51bea29e8 100644 --- a/include/instrument_sound_shaping_view.h +++ b/include/InstrumentSoundShapingView.h @@ -1,8 +1,8 @@ /* - * instrument_sound_shaping_view.h - view for instrumentSoundShaping-class + * InstrumentSoundShapingView.h - view for InstrumentSoundShaping class + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,36 +22,36 @@ * */ - #ifndef _INSTRUMENT_SOUND_SHAPING_VIEW_H #define _INSTRUMENT_SOUND_SHAPING_VIEW_H #include -#include "instrument_sound_shaping.h" +#include "InstrumentSoundShaping.h" +#include "ModelView.h" -class envelopeAndLFOView; +class EnvelopeAndLfoView; class comboBox; class groupBox; class knob; class tabWidget; -class instrumentSoundShapingView : public QWidget, public modelView +class InstrumentSoundShapingView : public QWidget, public ModelView { Q_OBJECT public: - instrumentSoundShapingView( QWidget * _parent ); - virtual ~instrumentSoundShapingView(); + InstrumentSoundShapingView( QWidget * _parent ); + virtual ~InstrumentSoundShapingView(); private: - virtual void modelChanged( void ); + virtual void modelChanged(); - instrumentSoundShaping * m_ss; + InstrumentSoundShaping * m_ss; tabWidget * m_targetsTabWidget; - envelopeAndLFOView * m_envLFOViews[instrumentSoundShaping::NumTargets]; + EnvelopeAndLfoView * m_envLfoViews[InstrumentSoundShaping::NumTargets]; // filter-stuff groupBox * m_filterGroupBox; diff --git a/include/instrument_track.h b/include/InstrumentTrack.h similarity index 71% rename from include/instrument_track.h rename to include/InstrumentTrack.h index 277515d32..53177b1c4 100644 --- a/include/instrument_track.h +++ b/include/InstrumentTrack.h @@ -1,6 +1,6 @@ /* - * instrument_track.h - declaration of class instrumentTrack, a track + window - * which holds an instrument-plugin + * InstrumentTrack.h - declaration of class InstrumentTrack, a track + window + * which holds an instrument-plugin * * Copyright (c) 2004-2009 Tobias Doerffel * @@ -29,41 +29,43 @@ #include #include "AudioPort.h" -#include "instrument_functions.h" -#include "instrument_sound_shaping.h" +#include "InstrumentFunctions.h" +#include "InstrumentSoundShaping.h" #include "MidiEventProcessor.h" #include "MidiPort.h" #include "note_play_handle.h" -#include "piano.h" +#include "Piano.h" +#include "PianoView.h" #include "track.h" class QLineEdit; template class QQueue; -class arpeggiatorView; -class chordCreatorView; -class effectRackView; -class instrumentSoundShapingView; +class ArpeggiatorView; +class ChordCreatorView; +class EffectRackView; +class InstrumentSoundShapingView; class fadeButton; -class instrument; -class instrumentTrackWindow; -class instrumentMidiIOView; +class Instrument; +class InstrumentTrackWindow; +class InstrumentMidiIOView; +class knob; class lcdSpinBox; class midiPortMenu; class multimediaProject; class notePlayHandle; -class pluginView; +class PluginView; class tabWidget; class trackLabelButton; -class EXPORT instrumentTrack : public track, public MidiEventProcessor +class EXPORT InstrumentTrack : public track, public MidiEventProcessor { Q_OBJECT mapPropertyFromModel(int,getVolume,setVolume,m_volumeModel); public: - instrumentTrack( trackContainer * _tc ); - virtual ~instrumentTrack(); + InstrumentTrack( trackContainer * _tc ); + virtual ~InstrumentTrack(); // used by instrument void processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, @@ -86,12 +88,12 @@ public: void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); QString instrumentName() const; - inline const instrument * getInstrument() const + inline const Instrument * instrument() const { return m_instrument; } - inline instrument * getInstrument() + inline Instrument * instrument() { return m_instrument; } @@ -131,7 +133,7 @@ public: // load instrument whose name matches given one - instrument * loadInstrument( const QString & _instrument_name ); + Instrument * loadInstrument( const QString & _instrument_name ); inline AudioPort * audioPort() { @@ -143,17 +145,17 @@ public: return &m_midiPort; } - intModel * baseNoteModel() + IntModel * baseNoteModel() { return &m_baseNoteModel; } - piano * getPiano() + Piano * getPiano() { return &m_piano; } - bool arpeggiatorEnabled() const + bool isArpeggiatorEnabled() const { return m_arpeggiator.m_arpEnabledModel.value(); } @@ -161,22 +163,22 @@ public: // simple helper for removing midiport-XML-node when loading presets static void removeMidiPortNode( multimediaProject & _mmp ); - floatModel * pitchModel() + FloatModel * pitchModel() { return &m_pitchModel; } - floatModel * volumeModel() + FloatModel * volumeModel() { return &m_volumeModel; } - floatModel * panningModel() + FloatModel * panningModel() { return &m_panningModel; } - intModel * effectChannelModel() + IntModel * effectChannelModel() { return &m_effectChannelModel; } @@ -209,51 +211,51 @@ private: notePlayHandle * m_notes[NumKeys]; int m_runningMidiNotes[NumKeys]; - intModel m_baseNoteModel; + IntModel m_baseNoteModel; NotePlayHandleList m_processHandles; - floatModel m_volumeModel; - floatModel m_panningModel; - floatModel m_pitchModel; - intModel m_effectChannelModel; + FloatModel m_volumeModel; + FloatModel m_panningModel; + FloatModel m_pitchModel; + IntModel m_effectChannelModel; - instrument * m_instrument; - instrumentSoundShaping m_soundShaping; - arpeggiator m_arpeggiator; - chordCreator m_chordCreator; + Instrument * m_instrument; + InstrumentSoundShaping m_soundShaping; + Arpeggiator m_arpeggiator; + ChordCreator m_chordCreator; - piano m_piano; + Piano m_piano; - friend class instrumentTrackView; - friend class instrumentTrackWindow; + friend class InstrumentTrackView; + friend class InstrumentTrackWindow; friend class notePlayHandle; - friend class flpImport; + friend class FlpImport; } ; -class instrumentTrackView : public trackView +class InstrumentTrackView : public trackView { Q_OBJECT public: - instrumentTrackView( instrumentTrack * _it, trackContainerView * _tc ); - virtual ~instrumentTrackView(); + InstrumentTrackView( InstrumentTrack * _it, trackContainerView * _tc ); + virtual ~InstrumentTrackView(); - instrumentTrackWindow * getInstrumentTrackWindow(); + InstrumentTrackWindow * getInstrumentTrackWindow(); - instrumentTrack * model() + InstrumentTrack * model() { - return castModel(); + return castModel(); } - const instrumentTrack * model() const + const InstrumentTrack * model() const { - return castModel(); + return castModel(); } @@ -283,9 +285,9 @@ private slots: private: - instrumentTrackWindow * m_window; + InstrumentTrackWindow * m_window; - static QQueue s_windows; + static QQueue s_windows; // widgets in track-settings-widget trackLabelButton * m_tlb; @@ -301,20 +303,20 @@ private: QPoint m_lastPos; - friend class instrumentTrackWindow; + friend class InstrumentTrackWindow; } ; -class instrumentTrackWindow : public QWidget, public modelView, - public serializingObjectHook +class InstrumentTrackWindow : public QWidget, public ModelView, + public SerializingObjectHook { Q_OBJECT public: - instrumentTrackWindow( instrumentTrackView * _tv ); - virtual ~instrumentTrackWindow(); + InstrumentTrackWindow( InstrumentTrackView * _tv ); + virtual ~InstrumentTrackWindow(); // parent for all internal tab-widgets tabWidget * tabWidgetParent() @@ -322,17 +324,17 @@ public: return m_tabWidget; } - instrumentTrack * model() + InstrumentTrack * model() { - return castModel(); + return castModel(); } - const instrumentTrack * model() const + const InstrumentTrack * model() const { - return castModel(); + return castModel(); } - void setInstrumentTrackView( instrumentTrackView * _tv ) + void setInstrumentTrackView( InstrumentTrackView * _tv ) { m_itv = _tv; } @@ -366,8 +368,8 @@ protected slots: private: virtual void modelChanged(); - instrumentTrack * m_track; - instrumentTrackView * m_itv; + InstrumentTrack * m_track; + InstrumentTrackView * m_itv; // widgets on the top of an instrument-track-window tabWidget * m_generalSettingsWidget; @@ -381,17 +383,17 @@ private: // tab-widget with all children tabWidget * m_tabWidget; - pluginView * m_instrumentView; - instrumentSoundShapingView * m_ssView; - chordCreatorView * m_chordView; - arpeggiatorView * m_arpView; - instrumentMidiIOView * m_midiView; - effectRackView * m_effectView; + PluginView * m_instrumentView; + InstrumentSoundShapingView * m_ssView; + ChordCreatorView * m_chordView; + ArpeggiatorView * m_arpView; + InstrumentMidiIOView * m_midiView; + EffectRackView * m_effectView; // test-piano at the bottom of every instrument-settings-window - pianoView * m_pianoView; + PianoView * m_pianoView; - friend class instrumentView; + friend class InstrumentView; } ; diff --git a/include/instrument_view.h b/include/InstrumentView.h similarity index 69% rename from include/instrument_view.h rename to include/InstrumentView.h index bdf716432..8c4c4c8d3 100644 --- a/include/instrument_view.h +++ b/include/InstrumentView.h @@ -26,31 +26,31 @@ #ifndef _INSTRUMENT_VIEW_H #define _INSTRUMENT_VIEW_H -#include "instrument.h" -#include "plugin_view.h" +#include "Instrument.h" +#include "PluginView.h" -class instrumentTrackWindow; +class InstrumentTrackWindow; -class EXPORT instrumentView : public pluginView +class EXPORT InstrumentView : public PluginView { public: - instrumentView( instrument * _instrument, QWidget * _parent ); - virtual ~instrumentView(); + InstrumentView( Instrument * _instrument, QWidget * _parent ); + virtual ~InstrumentView(); - instrument * model( void ) + Instrument * model() { - return( castModel() ); + return( castModel() ); } - const instrument * model( void ) const + const Instrument * model() const { - return( castModel() ); + return( castModel() ); } - virtual void setModel( ::model * _model, bool = FALSE ); + virtual void setModel( Model * _model, bool = FALSE ); - instrumentTrackWindow * getInstrumentTrackWindow( void ); + InstrumentTrackWindow * instrumentTrackWindow(); } ; diff --git a/include/journalling_object.h b/include/JournallingObject.h similarity index 65% rename from include/journalling_object.h rename to include/JournallingObject.h index d30b5364a..df9902546 100644 --- a/include/journalling_object.h +++ b/include/JournallingObject.h @@ -1,8 +1,8 @@ /* - * journalling_object.h - declaration of class journallingObject + * JournallingObject.h - declaration of class JournallingObject + * + * Copyright (c) 2006-2009 Tobias Doerffel * - * Copyright (c) 2006-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,13 +22,12 @@ * */ - #ifndef _JOURNALLING_OBJECT_H #define _JOURNALLING_OBJECT_H #include "lmms_basics.h" #include "export.h" -#include "serializing_object.h" +#include "SerializingObject.h" #include #include @@ -38,43 +37,43 @@ typedef uint32_t t_action_id; -class journalEntry +class JournalEntry { public: - journalEntry( const t_action_id _action_id, const QVariant & _data ) : + JournalEntry( const t_action_id _action_id, const QVariant & _data ) : m_actionID( _action_id ), m_data( _data ) { } - journalEntry( void ) : + JournalEntry() : m_actionID( 0 ), m_data( 0 ) { } - ~journalEntry() + ~JournalEntry() { } - t_action_id actionID( void ) const + t_action_id actionID() const { - return( m_actionID ); + return m_actionID; } - t_action_id & actionID( void ) + t_action_id & actionID() { - return( m_actionID ); + return m_actionID; } - const QVariant & data( void ) const + const QVariant & data() const { - return( m_data ); + return m_data; } - QVariant & data( void ) + QVariant & data() { - return( m_data ); + return m_data; } @@ -85,30 +84,30 @@ private: } ; -typedef QVector journalEntryVector; +typedef QVector JournalEntryVector; -class EXPORT journallingObject : public serializingObject +class EXPORT JournallingObject : public SerializingObject { public: - journallingObject( void ); - virtual ~journallingObject(); + JournallingObject(); + virtual ~JournallingObject(); - inline jo_id_t id( void ) const + inline jo_id_t id() const { - return( m_id ); + return m_id; } - void undo( void ); - void redo( void ); + void undo(); + void redo(); - void clear( void ) + void clear() { m_journalEntries.clear(); m_currentJournalEntry = m_journalEntries.end(); } - void clearRedoSteps( void ) + void clearRedoSteps() { m_journalEntries.erase( m_currentJournalEntry, m_journalEntries.end() ); @@ -122,7 +121,7 @@ public: m_journalling = _new_state; } - void restoreJournallingState( void ) + void restoreJournallingState() { m_journalling = m_journallingStateStack.pop(); } @@ -133,9 +132,9 @@ public: virtual void restoreState( const QDomElement & _this ); - inline bool isJournalling( void ) const + inline bool isJournalling() const { - return( m_journalling ); + return m_journalling; } inline void setJournalling( const bool _sr ) @@ -145,22 +144,22 @@ public: inline bool testAndSetJournalling( const bool _sr ) { - bool old_journalling = m_journalling; + const bool oldJournalling = m_journalling; m_journalling = _sr; - return( old_journalling ); + return oldJournalling; } protected: void changeID( jo_id_t _id ); - void addJournalEntry( const journalEntry & _je ); + void addJournalEntry( const JournalEntry & _je ); // to be implemented by sub-objects - virtual void undoStep( journalEntry & ) + virtual void undoStep( JournalEntry & ) { } - virtual void redoStep( journalEntry & ) + virtual void redoStep( JournalEntry & ) { } @@ -172,8 +171,8 @@ private: jo_id_t m_id; - journalEntryVector m_journalEntries; - journalEntryVector::iterator m_currentJournalEntry; + JournalEntryVector m_journalEntries; + JournalEntryVector::Iterator m_currentJournalEntry; bool m_journalling; diff --git a/include/ladspa_base.h b/include/LadspaBase.h similarity index 72% rename from include/ladspa_base.h rename to include/LadspaBase.h index f6e1aaf9c..8654b7687 100644 --- a/include/ladspa_base.h +++ b/include/LadspaBase.h @@ -1,9 +1,9 @@ /* - * ladspa_base.h - basic declarations concerning LADSPA + * LadspaBase.h - basic declarations concerning LADSPA * * Copyright (c) 2006-2007 Danny McRae - * Copyright (c) 2006-2008 Tobias Doerffel - * + * Copyright (c) 2006-2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -27,12 +27,12 @@ #define _LADSPA_BASE_H #include "ladspa_manager.h" -#include "plugin.h" +#include "Plugin.h" -class ladspaControl; +class LadspaControl; -typedef enum bufferRates +typedef enum BufferRates { CHANNEL_IN, CHANNEL_OUT, @@ -42,7 +42,7 @@ typedef enum bufferRates CONTROL_RATE_OUTPUT } buffer_rate_t; -typedef enum bufferData +typedef enum BufferData { TOGGLED, INTEGER, @@ -51,7 +51,7 @@ typedef enum bufferData NONE } buffer_data_t; -typedef struct portDescription +typedef struct PortDescription { QString name; ch_cnt_t proc; @@ -65,22 +65,20 @@ typedef struct portDescription LADSPA_Data def; LADSPA_Data value; LADSPA_Data * buffer; - ladspaControl * control; + LadspaControl * control; } port_desc_t; -inline plugin::descriptor::subPluginFeatures::key ladspaKeyToSubPluginKey( - plugin::descriptor * _desc, +inline Plugin::Descriptor::SubPluginFeatures::Key ladspaKeyToSubPluginKey( + Plugin::Descriptor * _desc, const QString & _name, const ladspa_key_t & _key ) { - plugin::descriptor::subPluginFeatures::key::attributeMap m; + Plugin::Descriptor::SubPluginFeatures::Key::AttributeMap m; QString file = _key.first; - m["file"] = file.remove( QRegExp( "\\.so$" ) ). - remove( QRegExp( "\\.dll$" ) ); + m["file"] = file.remove( QRegExp( "\\.so$" ) ).remove( QRegExp( "\\.dll$" ) ); m["plugin"] = _key.second; - return( plugin::descriptor::subPluginFeatures::key( _desc, _name, - m ) ); + return Plugin::Descriptor::SubPluginFeatures::Key( _desc, _name, m ); } diff --git a/include/ladspa_control.h b/include/LadspaControl.h similarity index 57% rename from include/ladspa_control.h rename to include/LadspaControl.h index 72de0aa18..abbd04043 100644 --- a/include/ladspa_control.h +++ b/include/LadspaControl.h @@ -1,5 +1,5 @@ /* - * ladspa_control.h - model for controlling a LADSPA port + * LadspaControl.h - model for controlling a LADSPA port * * Copyright (c) 2008 Tobias Doerffel * Copyright (c) 2006-2008 Danny McRae @@ -28,57 +28,55 @@ #include -#include "automatable_model.h" -#include "knob.h" -#include "tempo_sync_knob.h" +#include "AutomatableModel.h" +#include "TempoSyncKnobModel.h" - -typedef struct portDescription port_desc_t; +typedef struct PortDescription port_desc_t; -class EXPORT ladspaControl : public model, public journallingObject +class EXPORT LadspaControl : public Model, public JournallingObject { Q_OBJECT public: - ladspaControl( model * _parent, port_desc_t * _port, + LadspaControl( Model * _parent, port_desc_t * _port, bool _link = FALSE ); - ~ladspaControl(); + ~LadspaControl(); - LADSPA_Data getValue( void ); + LADSPA_Data value(); void setValue( LADSPA_Data _value ); void setLink( bool _state ); - void linkControls( ladspaControl * _control ); - void unlinkControls( ladspaControl * _control ); + void linkControls( LadspaControl * _control ); + void unlinkControls( LadspaControl * _control ); - inline boolModel * getToggledModel( void ) + inline BoolModel * toggledModel() { - return( &m_toggledModel ); + return &m_toggledModel; } - inline knobModel * getKnobModel( void ) + inline FloatModel * knobModel() { - return( &m_knobModel ); + return &m_knobModel; } - inline tempoSyncKnobModel * getTempoSyncKnobModel( void ) + inline TempoSyncKnobModel * tempoSyncKnobModel() { - return( &m_tempoSyncKnobModel ); + return &m_tempoSyncKnobModel; } - inline port_desc_t * getPort( void ) + inline port_desc_t * port() { - return( m_port ); + return m_port; } virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent, - const QString & _name ); + const QString & _name ); virtual void loadSettings( const QDomElement & _this, - const QString & _name ); - inline virtual QString nodeName( void ) const + const QString & _name ); + inline virtual QString nodeName() const { - return( "port" ); + return "port"; } @@ -88,23 +86,23 @@ signals: protected slots: - void ledChanged( void ); - void knobChanged( void ); - void tempoKnobChanged( void ); - void linkStateChanged( void ); + void ledChanged(); + void knobChanged(); + void tempoKnobChanged(); + void linkStateChanged(); private: bool m_link; port_desc_t * m_port; - boolModel m_linkEnabledModel; - boolModel m_toggledModel; - knobModel m_knobModel; - tempoSyncKnobModel m_tempoSyncKnobModel; + BoolModel m_linkEnabledModel; + BoolModel m_toggledModel; + FloatModel m_knobModel; + TempoSyncKnobModel m_tempoSyncKnobModel; - friend class ladspaControlView; + friend class LadspaControlView; } ; diff --git a/include/ladspa_control_view.h b/include/LadspaControlView.h similarity index 74% rename from include/ladspa_control_view.h rename to include/LadspaControlView.h index 47f62874e..5bfdcb0ec 100644 --- a/include/ladspa_control_view.h +++ b/include/LadspaControlView.h @@ -1,7 +1,8 @@ /* - * ladspa_control_view.h - widget for controlling a LADSPA port + * LadspaControlView.h - widget for controlling a LADSPA port * * Copyright (c) 2006-2008 Danny McRae + * Copyright (c) 2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -27,21 +28,20 @@ #include -#include "mv_base.h" +#include "ModelView.h" + +class LadspaControl; -class ladspaControl; - - -class EXPORT ladspaControlView : public QWidget, public modelView +class EXPORT LadspaControlView : public QWidget, public ModelView { Q_OBJECT public: - ladspaControlView( QWidget * _parent, ladspaControl * _ctl ); - virtual ~ladspaControlView(); + LadspaControlView( QWidget * _parent, LadspaControl * _ctl ); + virtual ~LadspaControlView(); private: - ladspaControl * m_ctl; + LadspaControl * m_ctl; } ; diff --git a/include/LfoController.h b/include/LfoController.h index 102460036..45118e9e1 100644 --- a/include/LfoController.h +++ b/include/LfoController.h @@ -27,32 +27,31 @@ #include -#include "mv_base.h" -#include "automatable_model.h" +#include "Model.h" +#include "AutomatableModel.h" #include "Controller.h" #include "ControllerDialog.h" -#include "tempo_sync_knob.h" -#include "oscillator.h" - +#include "TempoSyncKnobModel.h" +#include "Oscillator.h" class automatableButtonGroup; class knob; class ledCheckBox; -class tempoSyncKnob; +class TempoSyncKnob; class pixmapButton; -class oscillator; + class LfoController : public Controller { Q_OBJECT public: - LfoController( model * _parent ); + LfoController( Model * _parent ); virtual ~LfoController(); virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); virtual void loadSettings( const QDomElement & _this ); - virtual QString nodeName( void ) const; + virtual QString nodeName() const; public slots: @@ -63,12 +62,12 @@ protected: // The internal per-controller get-value function virtual float value( int _offset ); - floatModel m_baseModel; - tempoSyncKnobModel m_speedModel; - floatModel m_amountModel; - floatModel m_phaseModel; - intModel m_waveModel; - intModel m_multiplierModel; + FloatModel m_baseModel; + TempoSyncKnobModel m_speedModel; + FloatModel m_amountModel; + FloatModel m_phaseModel; + IntModel m_waveModel; + IntModel m_multiplierModel; int m_duration; int m_phaseCorrection; @@ -78,9 +77,10 @@ protected: protected slots: - void updateSampleFunction( void ); + void updateSampleFunction(); friend class LfoControllerDialog; + } ; @@ -95,12 +95,12 @@ public: protected: virtual void contextMenuEvent( QContextMenuEvent * _me ); - virtual void modelChanged( void ); + virtual void modelChanged(); LfoController * m_lfo; knob * m_baseKnob; - tempoSyncKnob * m_speedKnob; + TempoSyncKnob * m_speedKnob; knob * m_amountKnob; knob * m_phaseKnob; pixmapButton * m_userLfoBtn; diff --git a/include/main_window.h b/include/MainWindow.h similarity index 94% rename from include/main_window.h rename to include/MainWindow.h index daed10e2a..6956eef5f 100644 --- a/include/main_window.h +++ b/include/MainWindow.h @@ -1,5 +1,5 @@ /* - * main_window.h - declaration of class mainWindow, the main window of LMMS + * main_window.h - declaration of class MainWindow, the main window of LMMS * * Copyright (c) 2004-2008 Tobias Doerffel * @@ -37,11 +37,11 @@ class QGridLayout; class QMdiArea; class configManager; -class pluginView; +class PluginView; class toolButton; -class mainWindow : public QMainWindow +class MainWindow : public QMainWindow { Q_OBJECT public: @@ -125,9 +125,9 @@ protected: private: - mainWindow( void ); - mainWindow( const mainWindow & ); - virtual ~mainWindow(); + MainWindow( void ); + MainWindow( const MainWindow & ); + virtual ~MainWindow(); void finalize( void ); @@ -157,7 +157,7 @@ private: } m_keyMods; QMenu * m_toolsMenu; - QList m_tools; + QList m_tools; QBasicTimer m_updateTimer; diff --git a/include/meter_dialog.h b/include/MeterDialog.h similarity index 77% rename from include/meter_dialog.h rename to include/MeterDialog.h index 0949e9b56..94d76ce3f 100644 --- a/include/meter_dialog.h +++ b/include/MeterDialog.h @@ -1,7 +1,8 @@ /* - * meter_dialog.h - dialog for entering meter settings + * MeterDialog.h - dialog for entering meter settings * * Copyright (c) 2006-2008 Danny McRae + * Copyright (c) 2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -27,19 +28,18 @@ #include -#include "mv_base.h" - +#include "ModelView.h" class lcdSpinBox; -class meterDialog : public QWidget, public modelView +class MeterDialog : public QWidget, public ModelView { public: - meterDialog( QWidget * _parent, bool _simple = FALSE ); - virtual ~meterDialog(); + MeterDialog( QWidget * _parent, bool _simple = false ); + virtual ~MeterDialog(); - virtual void modelChanged( void ); + virtual void modelChanged(); private: diff --git a/include/meter_model.h b/include/MeterModel.h similarity index 73% rename from include/meter_model.h rename to include/MeterModel.h index 258b72b80..4f12060b6 100644 --- a/include/meter_model.h +++ b/include/MeterModel.h @@ -1,7 +1,7 @@ /* - * meter_model.h - model for meter specification + * MeterModel.h - model for meter specification * - * Copyright (c) 2008 Tobias Doerffel + * Copyright (c) 2008-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -25,44 +25,40 @@ #ifndef _METER_MODEL_H #define _METER_MODEL_H -#include "automatable_model.h" +#include "AutomatableModel.h" -class meterModel : public model +class MeterModel : public Model { Q_OBJECT mapPropertyFromModel(int,getNumerator,setNumerator,m_numeratorModel); mapPropertyFromModel(int,getDenominator,setDenominator,m_denominatorModel); public: - meterModel( ::model * _parent ); - ~meterModel(); + MeterModel( Model * _parent ); + ~MeterModel(); void saveSettings( QDomDocument & _doc, QDomElement & _this, const QString & _name ); - void loadSettings( const QDomElement & _this, - const QString & _name ); + void loadSettings( const QDomElement & _this, const QString & _name ); - void reset( void ); + void reset(); // Must have the sub-models exposed to programatically connect // to automation or controllers - intModel & numeratorModel( void ) + IntModel & numeratorModel() { return m_numeratorModel; } - intModel & denominatorModel( void ) + IntModel & denominatorModel() { return m_denominatorModel; } private: - intModel m_numeratorModel; - intModel m_denominatorModel; - - - friend class meterDialog; + IntModel m_numeratorModel; + IntModel m_denominatorModel; } ; diff --git a/include/MidiController.h b/include/MidiController.h index 409d3bdf6..539c1211a 100644 --- a/include/MidiController.h +++ b/include/MidiController.h @@ -27,7 +27,7 @@ #include -#include "automatable_model.h" +#include "AutomatableModel.h" #include "Controller.h" #include "MidiEventProcessor.h" #include "MidiPort.h" @@ -40,7 +40,7 @@ class MidiController : public Controller, public MidiEventProcessor { Q_OBJECT public: - MidiController( model * _parent ); + MidiController( Model * _parent ); virtual ~MidiController(); virtual void processInEvent( const midiEvent & _me, diff --git a/include/MidiPort.h b/include/MidiPort.h index 8a6f0088a..50e8db3c6 100644 --- a/include/MidiPort.h +++ b/include/MidiPort.h @@ -31,7 +31,7 @@ #include #include "midi.h" -#include "automatable_model.h" +#include "AutomatableModel.h" class MidiClient; @@ -41,7 +41,7 @@ class midiTime; // class for abstraction of MIDI-port -class MidiPort : public model, public serializingObject +class MidiPort : public Model, public SerializingObject { Q_OBJECT mapPropertyFromModel(int,inputChannel,setInputChannel, @@ -74,7 +74,7 @@ public: MidiPort( const QString & _name, MidiClient * _mc, MidiEventProcessor * _mep, - model * _parent = NULL, + Model * _parent = NULL, Modes _mode = Disabled ); virtual ~MidiPort(); @@ -149,22 +149,22 @@ private: Modes m_mode; - intModel m_inputChannelModel; - intModel m_outputChannelModel; - intModel m_inputControllerModel; - intModel m_outputControllerModel; - intModel m_fixedInputVelocityModel; - intModel m_fixedOutputVelocityModel; - intModel m_outputProgramModel; - boolModel m_readableModel; - boolModel m_writableModel; + IntModel m_inputChannelModel; + IntModel m_outputChannelModel; + IntModel m_inputControllerModel; + IntModel m_outputControllerModel; + IntModel m_fixedInputVelocityModel; + IntModel m_fixedOutputVelocityModel; + IntModel m_outputProgramModel; + BoolModel m_readableModel; + BoolModel m_writableModel; Map m_readablePorts; Map m_writablePorts; friend class ControllerConnectionDialog; - friend class instrumentMidiIOView; + friend class InstrumentMidiIOView; signals: diff --git a/include/MidiPortMenu.h b/include/MidiPortMenu.h index 80fa1d581..55e61eee2 100644 --- a/include/MidiPortMenu.h +++ b/include/MidiPortMenu.h @@ -28,14 +28,13 @@ #include -#include "mv_base.h" +#include "ModelView.h" #include "MidiPort.h" - class QAction; -class MidiPortMenu : public QMenu, public modelView +class MidiPortMenu : public QMenu, public ModelView { Q_OBJECT public: diff --git a/include/mv_base.h b/include/Model.h similarity index 50% rename from include/mv_base.h rename to include/Model.h index 1cac53724..dc2ea3895 100644 --- a/include/mv_base.h +++ b/include/Model.h @@ -1,8 +1,8 @@ /* - * mv_base.h - base for M/V-architecture of LMMS + * Model.h - declaration of Model base class + * + * Copyright (c) 2007-2009 Tobias Doerffel * - * Copyright (c) 2007-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,9 +22,8 @@ * */ - -#ifndef _MV_BASE_H -#define _MV_BASE_H +#ifndef _MODEL_H +#define _MODEL_H #include #include @@ -32,36 +31,33 @@ #include "export.h" -class modelView; - - -class EXPORT model : public QObject +class EXPORT Model : public QObject { Q_OBJECT public: - model( model * _parent, QString _display_name = QString::null, - bool _default_constructed = FALSE ) : + Model( Model * _parent, QString _display_name = QString::null, + bool _default_constructed = false ) : QObject( _parent ), m_displayName( _display_name ), m_defaultConstructed( _default_constructed ) { } - virtual ~model() + virtual ~Model() { } - inline bool defaultConstructed( void ) + inline bool defaultConstructed() { - return( m_defaultConstructed ); + return m_defaultConstructed; } - inline model * parentModel( void ) const + inline Model * parentModel() const { - return static_cast( parent() ); + return static_cast( parent() ); } - virtual QString displayName( void ) const + virtual QString displayName() const { return m_displayName; } @@ -71,75 +67,23 @@ public: m_displayName = _display_name; } - virtual QString fullDisplayName( void ) const; + virtual QString fullDisplayName() const; + private: QString m_displayName; bool m_defaultConstructed; + signals: // emitted if actual data of the model (e.g. values) have changed - void dataChanged( void ); + void dataChanged(); // emitted in case new data was not set as it's been equal to old data - void dataUnchanged( void ); + void dataUnchanged(); // emitted if properties of the model (e.g. ranges) have changed - void propertiesChanged( void ); - -} ; - - - - -class EXPORT modelView -{ -public: - modelView( model * _model, QWidget * _this ); - virtual ~modelView(); - - virtual void setModel( model * _model, bool _old_model_valid = TRUE ); - - inline model * getModel( void ) - { - return( m_model ); - } - - inline const model * getModel( void ) const - { - return( m_model ); - } - - template - T * castModel( void ) - { - return( dynamic_cast( getModel() ) ); - } - - template - const T * castModel( void ) const - { - return( dynamic_cast( getModel() ) ); - } - - -protected: - // sub-classes can re-implement this to track model-changes - virtual void modelChanged( void ) - { - } - - QWidget * widget( void ) - { - return( m_widget ); - } - - virtual void doConnections( void ); - - -private: - QWidget * m_widget; - QPointer m_model; + void propertiesChanged(); } ; diff --git a/include/ModelView.h b/include/ModelView.h new file mode 100644 index 000000000..437c7bd5d --- /dev/null +++ b/include/ModelView.h @@ -0,0 +1,84 @@ +/* + * ModelView.h - declaration of ModelView base class + * + * Copyright (c) 2007-2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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 _MODEL_VIEW_H +#define _MODEL_VIEW_H + +#include "Model.h" + + +class EXPORT ModelView +{ +public: + ModelView( Model * _model, QWidget * _this ); + virtual ~ModelView(); + + virtual void setModel( Model * _model, bool _old_model_valid = true ); + + inline Model * model() + { + return m_model; + } + + inline const Model * model() const + { + return m_model; + } + + template + T * castModel() + { + return dynamic_cast( model() ); + } + + template + const T * castModel() const + { + return dynamic_cast( model() ); + } + + +protected: + // sub-classes can re-implement this to track model-changes + virtual void modelChanged() + { + } + + QWidget * widget() + { + return m_widget; + } + + virtual void doConnections(); + + +private: + QWidget * m_widget; + QPointer m_model; + +} ; + + +#endif + diff --git a/include/oscillator.h b/include/Oscillator.h similarity index 81% rename from include/oscillator.h rename to include/Oscillator.h index 39af3adb2..edf7c0341 100644 --- a/include/oscillator.h +++ b/include/Oscillator.h @@ -1,8 +1,8 @@ /* - * oscillator.h - header-file for oscillator.cpp, a powerful oscillator-class + * Oscillator.h - declaration of class Oscillator + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ * */ - #ifndef _OSCILLATOR_H #define _OSCILLATOR_H @@ -39,10 +38,10 @@ class sampleBuffer; -class intModel; +class IntModel; -class EXPORT oscillator +class EXPORT Oscillator { public: enum WaveShapes @@ -69,14 +68,14 @@ public: } ; - oscillator( const intModel * _wave_shape_model, - const intModel * _mod_algo_model, + Oscillator( const IntModel * _wave_shape_model, + const IntModel * _mod_algo_model, const float & _freq, const float & _detuning, const float & _phase_offset, const float & _volume, - oscillator * _m_subOsc = NULL ); - virtual ~oscillator() + Oscillator * _m_subOsc = NULL ); + virtual ~Oscillator() { delete m_subOsc; } @@ -94,7 +93,7 @@ public: static inline sample_t sinSample( const float _sample ) { - return( sinf( _sample * F_2PI ) ); + return sinf( _sample * F_2PI ); } static inline sample_t triangleSample( const float _sample ) @@ -102,23 +101,23 @@ public: const float ph = fraction( _sample ); if( ph <= 0.25f ) { - return( ph * 4.0f ); + return ph * 4.0f; } else if( ph <= 0.75f ) { - return( 2.0f - ph * 4.0f ); + return 2.0f - ph * 4.0f; } - return( ph * 4.0f - 4.0f ); + return ph * 4.0f - 4.0f; } static inline sample_t sawSample( const float _sample ) { - return( -1.0f + fraction( _sample ) * 2.0f ); + return -1.0f + fraction( _sample ) * 2.0f; } static inline sample_t squareSample( const float _sample ) { - return( ( fraction( _sample ) > 0.5f ) ? -1.0f : 1.0f ); + return ( fraction( _sample ) > 0.5f ) ? -1.0f : 1.0f; } static inline sample_t moogSawSample( const float _sample ) @@ -126,9 +125,9 @@ public: const float ph = fraction( _sample ); if( ph < 0.5f ) { - return( -1.0f + ph * 4.0f ); + return -1.0f + ph * 4.0f; } - return( 1.0f - 2.0f * ph ); + return 1.0f - 2.0f * ph; } static inline sample_t expSample( const float _sample ) @@ -138,32 +137,32 @@ public: { ph = 1.0f - ph; } - return( -1.0f + 8.0f * ph * ph ); + return -1.0f + 8.0f * ph * ph; } static inline sample_t noiseSample( const float ) { // Precise implementation -// return( 1.0f - rand() * 2.0f / RAND_MAX ); +// return 1.0f - rand() * 2.0f / RAND_MAX; // Fast implementation - return( 1.0f - fast_rand() * 2.0f / FAST_RAND_MAX ); + return 1.0f - fast_rand() * 2.0f / FAST_RAND_MAX; } inline sample_t userWaveSample( const float _sample ) const { - return( m_userWave->userWaveSample( _sample ) ); + return m_userWave->userWaveSample( _sample ); } private: - const intModel * m_waveShapeModel; - const intModel * m_modulationAlgoModel; + const IntModel * m_waveShapeModel; + const IntModel * m_modulationAlgoModel; const float & m_freq; const float & m_detuning; const float & m_volume; const float & m_ext_phaseOffset; - oscillator * m_subOsc; + Oscillator * m_subOsc; float m_phaseOffset; float m_phase; const sampleBuffer * m_userWave; @@ -208,11 +207,9 @@ private: template inline sample_t getSample( const float _sample ); - inline void recalcPhase( void ); + inline void recalcPhase(); } ; - - #endif diff --git a/include/PeakController.h b/include/PeakController.h index 414b85361..4210da75d 100644 --- a/include/PeakController.h +++ b/include/PeakController.h @@ -27,24 +27,24 @@ #include -#include "mv_base.h" -#include "automatable_model.h" +#include "Model.h" +#include "AutomatableModel.h" #include "Controller.h" #include "ControllerDialog.h" class automatableButtonGroup; class knob; -class peakControllerEffect; +class PeakControllerEffect; -typedef QVector peakControllerEffectVector; +typedef QVector PeakControllerEffectVector; class EXPORT PeakController : public Controller { Q_OBJECT public: - PeakController( model * _parent, - peakControllerEffect *_peak_effect = NULL ); + PeakController( Model * _parent, + PeakControllerEffect *_peak_effect = NULL ); virtual ~PeakController(); @@ -53,7 +53,7 @@ public: virtual void loadSettings( const QDomElement & _this ); virtual QString nodeName( void ) const; - static peakControllerEffectVector s_effects; + static PeakControllerEffectVector s_effects; static int s_lastEffectId; @@ -65,7 +65,7 @@ protected: // The internal per-controller get-value function virtual float value( int _offset ); - peakControllerEffect * m_peakEffect; + PeakControllerEffect * m_peakEffect; friend class PeakControllerDialog; } ; diff --git a/include/Piano.h b/include/Piano.h new file mode 100644 index 000000000..c82e0beb0 --- /dev/null +++ b/include/Piano.h @@ -0,0 +1,63 @@ +/* + * Piano.h - declaration of class Piano + * + * Copyright (c) 2004-2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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 _PIANO_H +#define _PIANO_H + +#include "note.h" +#include "Model.h" + +class InstrumentTrack; +class MidiEventProcessor; + +class Piano : public Model +{ +public: + enum KeyTypes + { + WhiteKey, + BlackKey + } ; + + Piano( InstrumentTrack * _it ); + virtual ~Piano(); + + void setKeyState( int _key, bool _on = false ); + + void handleKeyPress( int _key ); + void handleKeyRelease( int _key ); + + +private: + InstrumentTrack * m_instrumentTrack; + MidiEventProcessor * m_midiEvProc; + bool m_pressedKeys[NumKeys]; + + + friend class PianoView; + +} ; + +#endif + diff --git a/include/piano.h b/include/PianoView.h similarity index 70% rename from include/piano.h rename to include/PianoView.h index 082adee8a..4acc12daa 100644 --- a/include/piano.h +++ b/include/PianoView.h @@ -1,8 +1,8 @@ /* - * piano.h - piano and pianoView, an interactive piano/keyboard-widget + * PianoView.h - declaration of PianoView, an interactive piano/keyboard-widget * * Copyright (c) 2004-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,66 +22,29 @@ * */ +#ifndef _PIANO_VIEW_H +#define _PIANO_VIEW_H -#ifndef _PIANO_H -#define _PIANO_H - -#include #include #include +#include "ModelView.h" -#include "note.h" -#include "automatable_model.h" +class Piano; -class instrumentTrack; -class instrumentTrackView; -class notePlayHandle; - - -enum KeyTypes -{ - WhiteKey, - BlackKey -} ; - - -class piano : public model -{ -public: - piano( instrumentTrack * _it ); - virtual ~piano(); - - void setKeyState( int _key, bool _on = FALSE ); - - void handleKeyPress( int _key ); - void handleKeyRelease( int _key ); - - -private: - instrumentTrack * m_instrumentTrack; - bool m_pressedKeys[NumKeys]; - - - friend class pianoView; - -} ; - - - -class pianoView : public QWidget, public modelView +class PianoView : public QWidget, public ModelView { Q_OBJECT public: - pianoView( QWidget * _parent ); - virtual ~pianoView(); + PianoView( QWidget * _parent ); + virtual ~PianoView(); static int getKeyFromKeyEvent( QKeyEvent * _ke ); protected: - virtual void modelChanged( void ); + virtual void modelChanged(); virtual void keyPressEvent( QKeyEvent * ke ); virtual void keyReleaseEvent( QKeyEvent * ke ); virtual void contextMenuEvent( QContextMenuEvent * _me ); @@ -90,6 +53,7 @@ protected: virtual void mouseReleaseEvent( QMouseEvent * me ); virtual void mouseMoveEvent( QMouseEvent * me ); virtual void focusOutEvent( QFocusEvent * _fe ); + virtual void resizeEvent( QResizeEvent * _event ); private: @@ -101,7 +65,7 @@ private: static QPixmap * s_whiteKeyPressedPm; static QPixmap * s_blackKeyPressedPm; - piano * m_piano; + Piano * m_piano; QScrollBar * m_pianoScroll; int m_startKey; // first key when drawing @@ -111,6 +75,10 @@ private: private slots: void pianoScrolled( int _new_pos ); +signals: + void keyPressed( int ); + void baseNoteChanged(); + } ; diff --git a/include/plugin.h b/include/Plugin.h similarity index 65% rename from include/plugin.h rename to include/Plugin.h index 4affe9847..d17827803 100644 --- a/include/plugin.h +++ b/include/Plugin.h @@ -1,5 +1,5 @@ /* - * plugin.h - class plugin, the base-class and generic interface for all plugins + * Plugin.h - class plugin, the base-class and generic interface for all plugins * * Copyright (c) 2005-2008 Tobias Doerffel * @@ -32,20 +32,20 @@ #include #include -#include "journalling_object.h" -#include "mv_base.h" +#include "JournallingObject.h" +#include "Model.h" #include "base64.h" class QWidget; -class pixmapLoader; -class pluginView; -class automatableModel; +class PixmapLoader; +class PluginView; +class AutomatableModel; -class EXPORT plugin : public journallingObject, public model +class EXPORT Plugin : public JournallingObject, public Model { public: enum PluginTypes @@ -64,7 +64,7 @@ public: // descriptor holds information about a plugin - every external plugin // has to instantiate such a descriptor in an extern "C"-section so that // the plugin-loader is able to access information about the plugin - struct descriptor + struct Descriptor { const char * name; const char * displayName; @@ -72,7 +72,7 @@ public: const char * author; int version; PluginTypes type; - const pixmapLoader * logo; + const PixmapLoader * logo; const char * supportedFileTypes; inline bool supportsFileType( const QString & _ext ) const { @@ -80,17 +80,16 @@ public: split( QChar( ',' ) ). contains( _ext ); } - class EXPORT subPluginFeatures + class EXPORT SubPluginFeatures { public: - struct key + struct Key { - typedef QMap attributeMap; + typedef QMap AttributeMap; - inline key( plugin::descriptor * _desc = NULL, - const QString & _name = QString(), - const attributeMap & _am = - attributeMap() ) + inline Key( Plugin::Descriptor * _desc = NULL, + const QString & _name = QString(), + const AttributeMap & _am = AttributeMap() ) : desc( _desc ), name( _name ), @@ -98,63 +97,60 @@ public: { } - key( const QDomElement & _key ); + Key( const QDomElement & _key ); - QDomElement saveXML( QDomDocument & - _doc ) const; + QDomElement saveXML( QDomDocument & _doc ) const; - inline bool isValid( void ) const + inline bool isValid() const { return desc != NULL && name != QString::null; } - plugin::descriptor * desc; + Plugin::Descriptor * desc; QString name; - attributeMap attributes; + AttributeMap attributes; } ; - typedef QList keyList; + typedef QList KeyList; - subPluginFeatures( plugin::PluginTypes _type ) : + SubPluginFeatures( Plugin::PluginTypes _type ) : m_type( _type ) { } - virtual ~subPluginFeatures() + virtual ~SubPluginFeatures() { } - virtual void fillDescriptionWidget( QWidget *, - const key * ) + virtual void fillDescriptionWidget( QWidget *, const Key * ) { } - virtual void listSubPluginKeys( plugin::descriptor *, - keyList & ) + virtual void listSubPluginKeys( Plugin::Descriptor *, KeyList & ) { } protected: - const plugin::PluginTypes m_type; + const Plugin::PluginTypes m_type; } ; - subPluginFeatures * sub_plugin_features; + SubPluginFeatures * sub_plugin_features; } ; // contructor of a plugin - plugin( const descriptor * _descriptor, model * _parent ); - virtual ~plugin(); + Plugin( const Descriptor * _descriptor, Model * _parent ); + virtual ~Plugin(); // returns display-name out of descriptor - virtual QString displayName( void ) const + virtual QString displayName() const { - return model::displayName().isEmpty() ? + return Model::displayName().isEmpty() ? m_descriptor->displayName : - model::displayName(); + Model::displayName(); } // return plugin-type @@ -164,7 +160,7 @@ public: } // return plugin-descriptor for further information - inline const descriptor * getDescriptor( void ) const + inline const Descriptor * descriptor() const { return m_descriptor; } @@ -175,32 +171,31 @@ public: // Called if external source needs to change something but we cannot // reference the class header. Should return null if not key not found. - virtual automatableModel * getChildModel( const QString & _modelName ); + virtual AutomatableModel * childModel( const QString & _modelName ); // returns an instance of a plugin whose name matches to given one // if specified plugin couldn't be loaded, it creates a dummy-plugin - static plugin * instantiate( const QString & _plugin_name, - model * _parent, - void * _data ); + static Plugin * instantiate( const QString & _plugin_name, + Model * _parent, void * _data ); // fills given vector with descriptors of all available plugins static void getDescriptorsOfAvailPlugins( - QVector & _plugin_descs ); + QVector & _plugin_descs ); // create a view for the model - pluginView * createView( QWidget * _parent ); + PluginView * createView( QWidget * _parent ); protected: // create a view for the model - virtual pluginView * instantiateView( QWidget * ) = 0; + virtual PluginView * instantiateView( QWidget * ) = 0; private: - const descriptor * m_descriptor; + const Descriptor * m_descriptor; // pointer to instantiation-function in plugin - typedef plugin * ( * instantiationHook )( model *, void * ); + typedef Plugin * ( * instantiationHook )( Model *, void * ); } ; diff --git a/include/plugin_view.h b/include/PluginView.h similarity index 75% rename from include/plugin_view.h rename to include/PluginView.h index 201bfc6a0..0f17ff2f9 100644 --- a/include/plugin_view.h +++ b/include/PluginView.h @@ -1,8 +1,8 @@ /* - * plugin_view.h - definition of pluginView-class + * PluginView.h - declaration of class PluginView + * + * Copyright (c) 2008-2009 Tobias Doerffel * - * Copyright (c) 2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,21 +22,21 @@ * */ - #ifndef _PLUGIN_VIEW_H #define _PLUGIN_VIEW_H #include -#include "plugin.h" +#include "Plugin.h" +#include "ModelView.h" -class EXPORT pluginView : public QWidget, public modelView +class EXPORT PluginView : public QWidget, public ModelView { public: - pluginView( plugin * _plugin, QWidget * _parent ) : + PluginView( Plugin * _plugin, QWidget * _parent ) : QWidget( _parent ), - modelView( _plugin, this ) + ModelView( _plugin, this ) { } diff --git a/include/project_journal.h b/include/ProjectJournal.h similarity index 73% rename from include/project_journal.h rename to include/ProjectJournal.h index 7cd8e3523..041f7507e 100644 --- a/include/project_journal.h +++ b/include/ProjectJournal.h @@ -1,8 +1,8 @@ /* - * project_journal.h - declaration of class projectJournal + * ProjectJournal.h - declaration of class ProjectJournal * * Copyright (c) 2006-2008 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ * */ - #ifndef _PROJECT_JOURNAL_H #define _PROJECT_JOURNAL_H @@ -32,25 +31,24 @@ #include "lmms_basics.h" - -class journallingObject; +class JournallingObject; -class projectJournal +class ProjectJournal { public: - projectJournal( void ); - virtual ~projectJournal(); + ProjectJournal(); + virtual ~ProjectJournal(); - void undo( void ); - void redo( void ); + void undo(); + void redo(); // tell history that a new journal entry was added to object with ID _id void journalEntryAdded( const jo_id_t _id ); - bool isJournalling( void ) const + bool isJournalling() const { - return( m_journalling ); + return m_journalling; } void setJournalling( const bool _on ) @@ -59,12 +57,12 @@ public: } // alloc new ID and register object _obj to it - jo_id_t allocID( journallingObject * _obj ); + jo_id_t allocID( JournallingObject * _obj ); // if there's already something known about ID _id, but it is currently // unused (e.g. after jouralling object was deleted), register object // _obj to this id - void reallocID( const jo_id_t _id, journallingObject * _obj ); + void reallocID( const jo_id_t _id, JournallingObject * _obj ); // make ID _id unused, but keep all global journalling information // (order of journalling entries etc.) referring to _id - needed for @@ -78,26 +76,26 @@ public: // journalling information about the ID get's lost void forgetAboutID( const jo_id_t _id ); - void clearJournal( void ); + void clearJournal(); - journallingObject * getJournallingObject( const jo_id_t _id ) + JournallingObject * journallingObject( const jo_id_t _id ) { if( m_joIDs.contains( _id ) ) { - return( m_joIDs[_id] ); + return m_joIDs[_id]; } - return( NULL ); + return NULL; } private: - typedef QHash joIDMap; - typedef QVector journalEntryVector; + typedef QHash JoIdMap; + typedef QVector JournalEntryVector; - joIDMap m_joIDs; + JoIdMap m_joIDs; - journalEntryVector m_journalEntries; - journalEntryVector::iterator m_currentJournalEntry; + JournalEntryVector m_journalEntries; + JournalEntryVector::Iterator m_currentJournalEntry; bool m_journalling; diff --git a/include/remote_plugin.h b/include/RemotePlugin.h similarity index 93% rename from include/remote_plugin.h rename to include/RemotePlugin.h index 1dc240281..86b38c1f6 100644 --- a/include/remote_plugin.h +++ b/include/RemotePlugin.h @@ -1,5 +1,5 @@ /* - * remote_plugin.h - base class providing RPC like mechanisms + * RemotePlugin.h - base class providing RPC like mechanisms * * Copyright (c) 2008-2009 Tobias Doerffel * @@ -516,7 +516,7 @@ enum RemoteMessageIDs -class EXPORT remotePluginBase +class EXPORT RemotePluginBase { public: struct message @@ -595,12 +595,12 @@ public: private: std::vector data; - friend class remotePluginBase; + friend class RemotePluginBase; } ; - remotePluginBase( shmFifo * _in, shmFifo * _out ); - virtual ~remotePluginBase(); + RemotePluginBase( shmFifo * _in, shmFifo * _out ); + virtual ~RemotePluginBase(); void sendMessage( const message & _m ); message receiveMessage(); @@ -667,13 +667,13 @@ private: #ifndef BUILD_REMOTE_PLUGIN_CLIENT -class remotePlugin; +class RemotePlugin; -class processWatcher : public QThread +class ProcessWatcher : public QThread { public: - processWatcher( remotePlugin * ); - virtual ~processWatcher() + ProcessWatcher( RemotePlugin * ); + virtual ~ProcessWatcher() { } @@ -686,18 +686,18 @@ public: private: virtual void run(); - remotePlugin * m_plugin; + RemotePlugin * m_plugin; volatile bool m_quit; } ; -class EXPORT remotePlugin : public remotePluginBase +class EXPORT RemotePlugin : public RemotePluginBase { public: - remotePlugin( const QString & _plugin_executable, + RemotePlugin( const QString & _plugin_executable, bool _wait_for_init_done = true ); - virtual ~remotePlugin(); + virtual ~RemotePlugin(); inline bool isRunning() { @@ -774,7 +774,7 @@ private: bool m_failed; QProcess m_process; - processWatcher m_watcher; + ProcessWatcher m_watcher; QMutex m_commMutex; bool m_splitChannels; @@ -789,7 +789,7 @@ private: int m_inputCount; int m_outputCount; - friend class processWatcher; + friend class ProcessWatcher; } ; #endif @@ -797,11 +797,11 @@ private: #ifdef BUILD_REMOTE_PLUGIN_CLIENT -class remotePluginClient : public remotePluginBase +class RemotePluginClient : public RemotePluginBase { public: - remotePluginClient( key_t _shm_in, key_t _shm_out ); - virtual ~remotePluginClient(); + RemotePluginClient( key_t _shm_in, key_t _shm_out ); + virtual ~RemotePluginClient(); virtual bool processMessage( const message & _m ); @@ -894,7 +894,7 @@ private: #endif -remotePluginBase::remotePluginBase( shmFifo * _in, shmFifo * _out ) : +RemotePluginBase::RemotePluginBase( shmFifo * _in, shmFifo * _out ) : m_in( _in ), m_out( _out ) { @@ -908,7 +908,7 @@ remotePluginBase::remotePluginBase( shmFifo * _in, shmFifo * _out ) : -remotePluginBase::~remotePluginBase() +RemotePluginBase::~RemotePluginBase() { delete m_in; delete m_out; @@ -917,7 +917,7 @@ remotePluginBase::~remotePluginBase() -void remotePluginBase::sendMessage( const message & _m ) +void RemotePluginBase::sendMessage( const message & _m ) { m_out->lock(); m_out->writeInt( _m.id ); @@ -935,7 +935,7 @@ void remotePluginBase::sendMessage( const message & _m ) -remotePluginBase::message remotePluginBase::receiveMessage() +RemotePluginBase::message RemotePluginBase::receiveMessage() { m_in->waitForMessage(); m_in->lock(); @@ -953,7 +953,7 @@ remotePluginBase::message remotePluginBase::receiveMessage() -remotePluginBase::message remotePluginBase::waitForMessage( +RemotePluginBase::message RemotePluginBase::waitForMessage( const message & _wm, bool _busy_waiting ) { @@ -992,8 +992,8 @@ remotePluginBase::message remotePluginBase::waitForMessage( #ifdef BUILD_REMOTE_PLUGIN_CLIENT -remotePluginClient::remotePluginClient( key_t _shm_in, key_t _shm_out ) : - remotePluginBase( new shmFifo( _shm_in ), +RemotePluginClient::RemotePluginClient( key_t _shm_in, key_t _shm_out ) : + RemotePluginBase( new shmFifo( _shm_in ), new shmFifo( _shm_out ) ), #ifdef USE_QT_SHMEM m_shmObj(), @@ -1011,7 +1011,7 @@ remotePluginClient::remotePluginClient( key_t _shm_in, key_t _shm_out ) : -remotePluginClient::~remotePluginClient() +RemotePluginClient::~RemotePluginClient() { sendMessage( IdQuit ); @@ -1023,7 +1023,7 @@ remotePluginClient::~remotePluginClient() -bool remotePluginClient::processMessage( const message & _m ) +bool RemotePluginClient::processMessage( const message & _m ) { message reply_message( _m.id ); bool reply = false; @@ -1084,7 +1084,7 @@ bool remotePluginClient::processMessage( const message & _m ) -void remotePluginClient::setShmKey( key_t _key, int _size ) +void RemotePluginClient::setShmKey( key_t _key, int _size ) { #ifdef USE_QT_SHMEM m_shmObj.setKey( QString::number( _key ) ); @@ -1124,7 +1124,7 @@ void remotePluginClient::setShmKey( key_t _key, int _size ) -void remotePluginClient::doProcessing() +void RemotePluginClient::doProcessing() { if( m_shm != NULL ) { diff --git a/include/serializing_object.h b/include/SerializingObject.h similarity index 68% rename from include/serializing_object.h rename to include/SerializingObject.h index da8cb4e28..e647ad31f 100644 --- a/include/serializing_object.h +++ b/include/SerializingObject.h @@ -1,8 +1,8 @@ /* - * serializing_object.h - declaration of class serializingObject + * SerializingObject.h - declaration of class SerializingObject + * + * Copyright (c) 2008-2009 Tobias Doerffel * - * Copyright (c) 2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ * */ - #ifndef _SERIALIZING_OBJECT_H #define _SERIALIZING_OBJECT_H @@ -34,57 +33,51 @@ class QDomDocument; class QDomElement; -class serializingObjectHook; +class SerializingObjectHook; -class EXPORT serializingObject +class EXPORT SerializingObject { public: - serializingObject( void ); - virtual ~serializingObject(); + SerializingObject(); + virtual ~SerializingObject(); - virtual QDomElement saveState( QDomDocument & _doc, - QDomElement & _parent ); + virtual QDomElement saveState( QDomDocument & _doc, QDomElement & _parent ); virtual void restoreState( const QDomElement & _this ); // to be implemented by actual object - virtual QString nodeName( void ) const = 0; + virtual QString nodeName() const = 0; - void setHook( serializingObjectHook * _hook ); + void setHook( SerializingObjectHook * _hook ); - serializingObjectHook * getHook( void ) + SerializingObjectHook * getHook() { - return( m_hook ); + return m_hook; } protected: // to be implemented by sub-objects virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); -// { -// } - virtual void loadSettings( const QDomElement & _this ); -// { -// } private: - serializingObjectHook * m_hook; + SerializingObjectHook * m_hook; } ; -class serializingObjectHook +class SerializingObjectHook { public: - serializingObjectHook() : + SerializingObjectHook() : m_hookedIn( NULL ) { } - virtual ~serializingObjectHook() + virtual ~SerializingObjectHook() { if( m_hookedIn != NULL ) { @@ -96,9 +89,9 @@ public: virtual void loadSettings( const QDomElement & _this ) = 0; private: - serializingObject * m_hookedIn; + SerializingObject * m_hookedIn; - friend class serializingObject; + friend class SerializingObject; } ; diff --git a/include/sweep_oscillator.h b/include/SweepOscillator.h similarity index 80% rename from include/sweep_oscillator.h rename to include/SweepOscillator.h index 33ed59e96..38403488e 100644 --- a/include/sweep_oscillator.h +++ b/include/SweepOscillator.h @@ -1,8 +1,8 @@ /* - * sweep_oscillator.h - sweep-oscillator + * SweepOscillator.h - sweeping oscillator + * + * Copyright (c) 2006-2009 Tobias Doerffel * - * Copyright (c) 2006-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,25 +22,24 @@ * */ - #ifndef _SWEEP_OSCILLATOR_H #define _SWEEP_OSCILLATOR_H -#include "oscillator.h" +#include "Oscillator.h" #include "effect_lib.h" template -class sweepOscillator +class SweepOscillator { public: - sweepOscillator( const FX & _fx = FX() ) : + SweepOscillator( const FX & _fx = FX() ) : m_phase( 0.0f ), m_FX( _fx ) { } - virtual ~sweepOscillator() + virtual ~SweepOscillator() { } @@ -51,7 +50,7 @@ public: const float df = _freq2 - _freq1; for( fpp_t frame = 0; frame < _frames; ++frame ) { - const sample_t s = oscillator::sinSample( m_phase ); + const sample_t s = Oscillator::sinSample( m_phase ); _ab[frame][0] = s; _ab[frame][1] = s; m_FX.nextSample( _ab[frame][0], _ab[frame][1] ); @@ -65,8 +64,8 @@ private: float m_phase; FX m_FX; - inline sample_t getSample( const float _sample ); - inline void recalcPhase( void ); +// inline sample_t getSample( const float _sample ); +// inline void recalcPhase(); } ; diff --git a/include/TempoSyncKnob.h b/include/TempoSyncKnob.h new file mode 100644 index 000000000..6f54089f0 --- /dev/null +++ b/include/TempoSyncKnob.h @@ -0,0 +1,83 @@ +/* + * TempoSyncKnob.h - adds bpm to ms conversion for knob class + * + * Copyright (c) 2005-2008 Danny McRae + * Copyright (c) 2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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 _TEMPO_SYNC_KNOB_H +#define _TEMPO_SYNC_KNOB_H + +#include +#include + +#include "knob.h" +#include "TempoSyncKnobModel.h" + +class MeterDialog; + +class EXPORT TempoSyncKnob : public knob +{ + Q_OBJECT +public: + TempoSyncKnob( int _knob_num, QWidget * _parent, + const QString & _name = QString() ); + virtual ~TempoSyncKnob(); + + const QString & syncDescription(); + void setSyncDescription( const QString & _new_description ); + + const QPixmap & syncIcon(); + void setSyncIcon( const QPixmap & _new_pix ); + + TempoSyncKnobModel * model() + { + return castModel(); + } + + virtual void modelChanged(); + + +signals: + void syncDescriptionChanged( const QString & _new_description ); + void syncIconChanged(); + + +protected: + virtual void contextMenuEvent( QContextMenuEvent * _me ); + + +protected slots: + void updateDescAndIcon(); + void showCustom(); + + +private: + QPixmap m_tempoSyncIcon; + QString m_tempoSyncDescription; + + QPointer m_custom; + +} ; + + + +#endif diff --git a/include/tempo_sync_knob.h b/include/TempoSyncKnobModel.h similarity index 51% rename from include/tempo_sync_knob.h rename to include/TempoSyncKnobModel.h index 77c3187e6..54a2befe6 100644 --- a/include/tempo_sync_knob.h +++ b/include/TempoSyncKnobModel.h @@ -1,7 +1,8 @@ /* - * tempo_sync_knob.h - adds bpm to ms conversion for knob class + * TempoSyncKnobModel.h - adds bpm to ms conversion for knob class * * Copyright (c) 2005-2008 Danny McRae + * Copyright (c) 2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -22,27 +23,18 @@ * */ +#ifndef _TEMPO_SYNC_KNOB_MODEL_H +#define _TEMPO_SYNC_KNOB_MODEL_H -#ifndef _TEMPO_SYNC_KNOB_H -#define _TEMPO_SYNC_KNOB_H - -#include -#include - -#include "knob.h" -#include "meter_model.h" - +#include "MeterModel.h" class QAction; -class meterDialog; - - -class EXPORT tempoSyncKnobModel : public knobModel +class EXPORT TempoSyncKnobModel : public FloatModel { Q_OBJECT public: - enum tempoSyncMode + enum TempoSyncMode { SyncNone, SyncDoubleWholeNote, @@ -55,12 +47,11 @@ public: SyncCustom } ; - - tempoSyncKnobModel( const float _val, const float _min, + TempoSyncKnobModel( const float _val, const float _min, const float _max, const float _step, - const float _scale, ::model * _parent, + const float _scale, Model * _parent, const QString & _display_name = QString() ); - virtual ~tempoSyncKnobModel(); + virtual ~TempoSyncKnobModel(); virtual void saveSettings( QDomDocument & _doc, QDomElement & _this, @@ -68,19 +59,27 @@ public: virtual void loadSettings( const QDomElement & _this, const QString & _name ); - tempoSyncMode getSyncMode( void ); - void setSyncMode( tempoSyncMode _new_mode ); + TempoSyncMode syncMode() const + { + return m_tempoSyncMode; + } + + void setSyncMode( TempoSyncMode _new_mode ); + + float scale() const + { + return m_scale; + } - float getScale( void ); void setScale( float _new_scale ); signals: - void syncModeChanged( tempoSyncMode _new_mode ); + void syncModeChanged( TempoSyncMode _new_mode ); void scaleChanged( float _new_scale ); public slots: - inline void disableSync( void ) + inline void disableSync() { setTempoSync( SyncNone ); } @@ -90,67 +89,19 @@ public slots: protected slots: void calculateTempoSyncTime( bpm_t _bpm ); - void updateCustom( void ); + void updateCustom(); private: - tempoSyncMode m_tempoSyncMode; - tempoSyncMode m_tempoLastSyncMode; + TempoSyncMode m_tempoSyncMode; + TempoSyncMode m_tempoLastSyncMode; float m_scale; - meterModel m_custom; + MeterModel m_custom; - friend class tempoSyncKnob; + friend class TempoSyncKnob; } ; - - -class EXPORT tempoSyncKnob : public knob -{ - Q_OBJECT -public: - tempoSyncKnob( int _knob_num, QWidget * _parent, - const QString & _name = QString() ); - virtual ~tempoSyncKnob(); - - const QString & getSyncDescription( void ); - void setSyncDescription( const QString & _new_description ); - - const QPixmap & getSyncIcon( void ); - void setSyncIcon( const QPixmap & _new_pix ); - - tempoSyncKnobModel * model( void ) - { - return( castModel() ); - } - - virtual void modelChanged( void ); - - -signals: - void syncDescriptionChanged( const QString & _new_description ); - void syncIconChanged( void ); - - -protected: - virtual void contextMenuEvent( QContextMenuEvent * _me ); - - -protected slots: - void updateDescAndIcon( void ); - void showCustom( void ); - - -private: - QPixmap m_tempoSyncIcon; - QString m_tempoSyncDescription; - - QPointer m_custom; - -} ; - - - #endif diff --git a/include/tool.h b/include/ToolPlugin.h similarity index 66% rename from include/tool.h rename to include/ToolPlugin.h index 4e9aa26a2..e680a9e74 100644 --- a/include/tool.h +++ b/include/ToolPlugin.h @@ -1,9 +1,10 @@ /* - * tool.h - declaration of class tool, standard interface for all tool plugins + * ToolPlugin.h - declaration of class ToolPlugin, a standard interface for all + * tool plugins * * Copyright (c) 2006-2007 Javier Serrano Polo - * Copyright (c) 2008 Tobias Doerffel - * + * Copyright (c) 2008-2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,35 +24,22 @@ * */ +#ifndef _TOOL_PLUGIN_H +#define _TOOL_PLUGIN_H -#ifndef _TOOL_H -#define _TOOL_H +#include "Plugin.h" -#include "plugin.h" -#include "plugin_view.h" - - -class EXPORT tool : public plugin +class EXPORT ToolPlugin : public Plugin { public: - tool( const descriptor * _descriptor, model * _parent ); - virtual ~tool(); + ToolPlugin( const Descriptor * _descriptor, Model * _parent ); + virtual ~ToolPlugin(); // instantiate tool-plugin with given name or return NULL // on failure - static tool * instantiate( const QString & _plugin_name, - model * _parent ); + static ToolPlugin * instantiate( const QString & _plugin_name, + Model * _parent ); } ; - - -class EXPORT toolView : public pluginView -{ -public: - toolView( tool * _tool ); - -} ; - - #endif diff --git a/include/ToolPluginView.h b/include/ToolPluginView.h new file mode 100644 index 000000000..9b8107001 --- /dev/null +++ b/include/ToolPluginView.h @@ -0,0 +1,41 @@ +/* + * ToolPluginView.h - declaration of class ToolPluginView + * + * Copyright (c) 2006-2007 Javier Serrano Polo + * Copyright (c) 2008-2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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 _TOOL_PLUGIN_VIEW_H +#define _TOOL_PLUGIN_VIEW_H + +#include "PluginView.h" + +class ToolPlugin; + +class EXPORT ToolPluginView : public PluginView +{ +public: + ToolPluginView( ToolPlugin * _toolPlugin ); + +} ; + + +#endif diff --git a/include/automatable_button.h b/include/automatable_button.h index 33d2bd5e5..40b1c8e11 100644 --- a/include/automatable_button.h +++ b/include/automatable_button.h @@ -28,13 +28,13 @@ #include -#include "automatable_model_view.h" +#include "AutomatableModelView.h" class automatableButtonGroup; -class EXPORT automatableButton : public QPushButton, public boolModelView +class EXPORT automatableButton : public QPushButton, public BoolModelView { Q_OBJECT public: @@ -79,7 +79,7 @@ private: -class EXPORT automatableButtonGroup : public QWidget, public intModelView +class EXPORT automatableButtonGroup : public QWidget, public IntModelView { Q_OBJECT public: diff --git a/include/automatable_slider.h b/include/automatable_slider.h index a0a5bf512..fa02552f4 100644 --- a/include/automatable_slider.h +++ b/include/automatable_slider.h @@ -28,11 +28,11 @@ #include -#include "automatable_model_view.h" +#include "AutomatableModelView.h" -class automatableSlider : public QSlider, public intModelView +class automatableSlider : public QSlider, public IntModelView { Q_OBJECT public: @@ -71,7 +71,7 @@ private slots: } ; -typedef intModel sliderModel; +typedef IntModel sliderModel; #endif diff --git a/include/automation_editor.h b/include/automation_editor.h index c522c6411..e1612fa69 100644 --- a/include/automation_editor.h +++ b/include/automation_editor.h @@ -30,10 +30,10 @@ #include #include "lmms_basics.h" -#include "journalling_object.h" +#include "JournallingObject.h" #include "midi_time.h" #include "automation_pattern.h" -#include "combobox_model.h" +#include "ComboBoxModel.h" class QPainter; @@ -46,7 +46,7 @@ class timeLine; class toolButton; -class automationEditor : public QWidget, public journallingObject +class automationEditor : public QWidget, public JournallingObject { Q_OBJECT public: @@ -183,9 +183,9 @@ private: comboBox * m_zoomingYComboBox; comboBox * m_quantizeComboBox; - comboBoxModel m_zoomingXModel; - comboBoxModel m_zoomingYModel; - comboBoxModel m_quantizeModel; + ComboBoxModel m_zoomingXModel; + ComboBoxModel m_zoomingYModel; + ComboBoxModel m_quantizeModel; automationPattern * m_pattern; float m_minLevel; diff --git a/include/automation_pattern.h b/include/automation_pattern.h index 49eedeaa5..95665e996 100644 --- a/include/automation_pattern.h +++ b/include/automation_pattern.h @@ -43,15 +43,15 @@ class EXPORT automationPattern : public trackContentObject Q_OBJECT public: typedef QMap timeMap; - typedef QVector > objectVector; + typedef QVector > objectVector; automationPattern( automationTrack * _auto_track ); automationPattern( const automationPattern & _pat_to_copy ); virtual ~automationPattern(); - void addObject( automatableModel * _obj, bool _search_dup = true ); + void addObject( AutomatableModel * _obj, bool _search_dup = true ); - const automatableModel * firstObject( void ) const; + const AutomatableModel * firstObject( void ) const; virtual midiTime length( void ) const; @@ -98,9 +98,9 @@ public: virtual trackContentObjectView * createView( trackView * _tv ); - static bool isAutomated( const automatableModel * _m ); + static bool isAutomated( const AutomatableModel * _m ); static automationPattern * globalAutomationPattern( - automatableModel * _m ); + AutomatableModel * _m ); static void resolveAllIDs( void ); diff --git a/include/bb_track_container.h b/include/bb_track_container.h index a69819037..82ee50850 100644 --- a/include/bb_track_container.h +++ b/include/bb_track_container.h @@ -72,7 +72,7 @@ public slots: private: - comboBoxModel m_bbComboBoxModel; + ComboBoxModel m_bbComboBoxModel; friend class bbEditor; diff --git a/include/combobox.h b/include/combobox.h index ec61b9fdc..a8a18fc8b 100644 --- a/include/combobox.h +++ b/include/combobox.h @@ -29,26 +29,26 @@ #include #include -#include "combobox_model.h" -#include "automatable_model_view.h" +#include "ComboBoxModel.h" +#include "AutomatableModelView.h" -class EXPORT comboBox : public QWidget, public intModelView +class EXPORT comboBox : public QWidget, public IntModelView { Q_OBJECT public: comboBox( QWidget * _parent, const QString & _name = QString() ); virtual ~comboBox(); - comboBoxModel * model( void ) + ComboBoxModel * model( void ) { - return( castModel() ); + return( castModel() ); } - const comboBoxModel * model( void ) const + const ComboBoxModel * model( void ) const { - return( castModel() ); + return( castModel() ); } diff --git a/include/embed.h b/include/embed.h index 0f91ae3bc..0a7dafed7 100644 --- a/include/embed.h +++ b/include/embed.h @@ -1,8 +1,8 @@ /* * embed.h - misc. stuff for using embedded data (resources linked into binary) * - * Copyright (c) 2004-2008 Tobias Doerffel - * + * Copyright (c) 2004-2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,14 +22,12 @@ * */ - #ifndef _EMBED_H #define _EMBED_H #include #include - #include "export.h" #include "lmms_basics.h" @@ -63,15 +61,15 @@ QPixmap getIconPixmap( const char * _name, int _w = -1, int _h = -1 ); -class pixmapLoader +class PixmapLoader { public: - pixmapLoader( const pixmapLoader * _ref ) : + PixmapLoader( const PixmapLoader * _ref ) : m_name( _ref != NULL ? _ref->m_name : QString::null ) { } - pixmapLoader( const QString & _name = QString::null ) : + PixmapLoader( const QString & _name = QString::null ) : m_name( _name ) { } @@ -86,7 +84,7 @@ public: return( QPixmap() ); } - virtual ~pixmapLoader() + virtual ~PixmapLoader() { } @@ -101,11 +99,11 @@ protected: #ifdef PLUGIN_NAME -class pluginPixmapLoader : public pixmapLoader +class PluginPixmapLoader : public PixmapLoader { public: - pluginPixmapLoader( const QString & _name = QString::null ) : - pixmapLoader( _name ) + PluginPixmapLoader( const QString & _name = QString::null ) : + PixmapLoader( _name ) { } diff --git a/include/engine.h b/include/engine.h index 83a702985..2951edb38 100644 --- a/include/engine.h +++ b/include/engine.h @@ -35,11 +35,11 @@ class automationEditor; class bbEditor; class bbTrackContainer; -class dummyTrackContainer; -class fxMixer; -class fxMixerView; -class projectJournal; -class mainWindow; +class DummyTrackContainer; +class FxMixer; +class FxMixerView; +class ProjectJournal; +class MainWindow; class mixer; class pianoRoll; class projectNotes; @@ -53,11 +53,11 @@ class EXPORT engine { public: static void init( const bool _has_gui = true ); - static void destroy( void ); + static void destroy(); - static bool hasGUI( void ) + static bool hasGUI() { - return( s_hasGUI ); + return s_hasGUI; } static void setSuppressMessages( bool _on ) @@ -65,97 +65,97 @@ public: s_suppressMessages = _on; } - static bool suppressMessages( void ) + static bool suppressMessages() { return !s_hasGUI || s_suppressMessages; } // core - static mixer * getMixer( void ) + static mixer * getMixer() { - return( s_mixer ); + return s_mixer; } - static fxMixer * getFxMixer( void ) + static FxMixer * fxMixer() { - return( s_fxMixer ); + return s_fxMixer; } - static song * getSong( void ) + static song * getSong() { - return( s_song ); + return s_song; } - static bbTrackContainer * getBBTrackContainer( void ) + static bbTrackContainer * getBBTrackContainer() { - return( s_bbTrackContainer ); + return s_bbTrackContainer; } - static projectJournal * getProjectJournal( void ) + static ProjectJournal * projectJournal() { - return( s_projectJournal ); + return s_projectJournal; } // GUI - static mainWindow * getMainWindow( void ) + static MainWindow * mainWindow() { - return( s_mainWindow ); + return s_mainWindow; } - static fxMixerView * getFxMixerView( void ) + static FxMixerView * fxMixerView() { - return( s_fxMixerView ); + return s_fxMixerView; } - static songEditor * getSongEditor( void ) + static songEditor * getSongEditor() { - return( s_songEditor ); + return s_songEditor; } - static bbEditor * getBBEditor( void ) + static bbEditor * getBBEditor() { - return( s_bbEditor ); + return s_bbEditor; } - static pianoRoll * getPianoRoll( void ) + static pianoRoll * getPianoRoll() { - return( s_pianoRoll ); + return s_pianoRoll; } - static projectNotes * getProjectNotes( void ) + static projectNotes * getProjectNotes() { - return( s_projectNotes ); + return s_projectNotes; } - static automationEditor * getAutomationEditor( void ) + static automationEditor * getAutomationEditor() { - return( s_automationEditor ); + return s_automationEditor; } - static ladspa2LMMS * getLADSPAManager( void ) + static ladspa2LMMS * getLADSPAManager() { - return( s_ladspaManager ); + return s_ladspaManager; } - static dummyTrackContainer * getDummyTrackContainer( void ) + static DummyTrackContainer * dummyTrackContainer() { - return( s_dummyTC ); + return s_dummyTC; } - static ControllerRackView * getControllerRackView( void ) + static ControllerRackView * getControllerRackView() { - return( s_controllerRackView ); + return s_controllerRackView; } - static float framesPerTick( void ) + static float framesPerTick() { - return( s_framesPerTick ); + return s_framesPerTick; } - static void updateFramesPerTick( void ); + static void updateFramesPerTick(); - static const QMap & pluginFileHandling( void ) + static const QMap & pluginFileHandling() { - return( s_pluginFileHandling ); + return s_pluginFileHandling; } @@ -166,16 +166,16 @@ private: // core static mixer * s_mixer; - static fxMixer * s_fxMixer; + static FxMixer * s_fxMixer; static song * s_song; static bbTrackContainer * s_bbTrackContainer; - static projectJournal * s_projectJournal; - static dummyTrackContainer * s_dummyTC; + static ProjectJournal * s_projectJournal; + static DummyTrackContainer * s_dummyTC; static ControllerRackView * s_controllerRackView; // GUI - static mainWindow * s_mainWindow; - static fxMixerView * s_fxMixerView; + static MainWindow * s_mainWindow; + static FxMixerView * s_fxMixerView; static songEditor * s_songEditor; static automationEditor * s_automationEditor; static bbEditor * s_bbEditor; @@ -185,7 +185,7 @@ private: static QMap s_pluginFileHandling; - static void initPluginFileHandling( void ); + static void initPluginFileHandling(); } ; diff --git a/include/fader.h b/include/fader.h index 257fc353d..f627e17b9 100644 --- a/include/fader.h +++ b/include/fader.h @@ -51,14 +51,14 @@ #include #include -#include "automatable_model_view.h" +#include "AutomatableModelView.h" -class fader : public QWidget, public floatModelView +class fader : public QWidget, public FloatModelView { Q_OBJECT public: - fader( floatModel * _model, const QString & _name, QWidget * _parent ); + fader( FloatModel * _model, const QString & _name, QWidget * _parent ); virtual ~fader(); void setMaxPeak( float _max ); @@ -78,7 +78,7 @@ private: virtual void wheelEvent( QWheelEvent *ev ); virtual void paintEvent( QPaintEvent *ev ); - floatModel * m_model; + FloatModel * m_model; float m_fPeakValue_L; float m_fPeakValue_R; diff --git a/include/file_browser.h b/include/file_browser.h index d69aa546d..f8ca13eec 100644 --- a/include/file_browser.h +++ b/include/file_browser.h @@ -37,7 +37,7 @@ class QLineEdit; class fileItem; -class instrumentTrack; +class InstrumentTrack; class fileBrowserTreeWidget; class playHandle; class trackContainer; @@ -95,7 +95,7 @@ protected: private: - void handleFile( fileItem * _fi, instrumentTrack * _it ); + void handleFile( fileItem * _fi, InstrumentTrack * _it ); void openInNewInstrumentTrack( trackContainer * _tc ); diff --git a/include/graph.h b/include/graph.h index 9c2f24494..3661a462d 100644 --- a/include/graph.h +++ b/include/graph.h @@ -31,13 +31,14 @@ #include #include -#include "mv_base.h" +#include "Model.h" +#include "ModelView.h" #include "lmms_basics.h" class graphModel; -class EXPORT graph : public QWidget, public modelView +class EXPORT graph : public QWidget, public ModelView { Q_OBJECT public: @@ -55,12 +56,12 @@ public: void setGraphColor( const QColor ); - inline graphModel * model( void ) + inline graphModel * model() { return castModel(); } - inline graphStyle getGraphStyle( void ) + inline graphStyle getGraphStyle() { return m_graphStyle; } @@ -82,10 +83,10 @@ protected: protected slots: void updateGraph( int _startPos, int _endPos ); - void updateGraph( void ); + void updateGraph(); private: - virtual void modelChanged( void ); + virtual void modelChanged(); void changeSampleAt(int _x, int _y); @@ -102,14 +103,14 @@ private: } ; -class EXPORT graphModel : public model +class EXPORT graphModel : public Model { Q_OBJECT public: graphModel( float _min, float _max, int _size, - :: model * _parent, + :: Model * _parent, bool _default_constructed = FALSE, float _step = 0.0 ); @@ -117,22 +118,22 @@ public: // TODO: saveSettings, loadSettings? - inline float minValue( void ) const + inline float minValue() const { return( m_minValue ); } - inline float maxValue( void ) const + inline float maxValue() const { return( m_maxValue ); } - inline int length( void ) const + inline int length() const { return( m_samples.count() ); } - inline const float * samples( void ) const + inline const float * samples() const { return( m_samples.data() ); } @@ -145,20 +146,20 @@ public slots: void setSampleAt( int _samplePos, float _value ); void setSamples( const float * _value ); - void setWaveToSine( void ); - void setWaveToTriangle( void ); - void setWaveToSaw( void ); - void setWaveToSquare( void ); - void setWaveToNoise( void ); + void setWaveToSine(); + void setWaveToTriangle(); + void setWaveToSaw(); + void setWaveToSquare(); + void setWaveToNoise(); //void setWaveToUser( ); - void smooth( void ); - void normalize( void ); + void smooth(); + void normalize(); signals: - void lengthChanged( void ); + void lengthChanged(); void samplesChanged( int startPos, int endPos ); - void rangeChanged( void ); + void rangeChanged(); private: diff --git a/include/group_box.h b/include/group_box.h index f506b5b2c..996a545ff 100644 --- a/include/group_box.h +++ b/include/group_box.h @@ -28,14 +28,14 @@ #include -#include "automatable_model_view.h" +#include "AutomatableModelView.h" #include "pixmap_button.h" class QPixmap; -class groupBox : public QWidget, public boolModelView +class groupBox : public QWidget, public BoolModelView { Q_OBJECT public: @@ -64,7 +64,7 @@ private: } ; -typedef boolModel groupBoxModel; +typedef BoolModel groupBoxModel; #endif diff --git a/include/inline_automation.h b/include/inline_automation.h index 3f82eaae3..a89a23b42 100644 --- a/include/inline_automation.h +++ b/include/inline_automation.h @@ -30,11 +30,11 @@ #include "shared_object.h" -class inlineAutomation : public floatModel, public sharedObject +class inlineAutomation : public FloatModel, public sharedObject { public: inlineAutomation( void ) : - floatModel(), + FloatModel(), sharedObject(), m_autoPattern( NULL ) { diff --git a/include/instrument_play_handle.h b/include/instrument_play_handle.h index eba03e6b1..252995363 100644 --- a/include/instrument_play_handle.h +++ b/include/instrument_play_handle.h @@ -27,19 +27,19 @@ #define _INSTRUMENT_PLAY_HANDLE_H #include "play_handle.h" -#include "instrument.h" +#include "Instrument.h" -class instrumentPlayHandle : public playHandle +class InstrumentPlayHandle : public playHandle { public: - instrumentPlayHandle( instrument * _instrument ) : - playHandle( InstrumentPlayHandle ), + InstrumentPlayHandle( Instrument * _instrument ) : + playHandle( playHandle::InstrumentPlayHandle ), m_instrument( _instrument ) { } - virtual ~instrumentPlayHandle() + virtual ~InstrumentPlayHandle() { } @@ -49,7 +49,7 @@ public: m_instrument->play( _working_buffer ); } - virtual bool done( void ) const + virtual bool done() const { return false; } @@ -61,7 +61,7 @@ public: private: - instrument * m_instrument; + Instrument * m_instrument; } ; diff --git a/include/knob.h b/include/knob.h index 36bbfbeee..4e7abca30 100644 --- a/include/knob.h +++ b/include/knob.h @@ -29,7 +29,7 @@ #include #include -#include "automatable_model_view.h" +#include "AutomatableModelView.h" #include "templates.h" @@ -44,7 +44,7 @@ enum knobTypes -class EXPORT knob : public QWidget, public floatModelView +class EXPORT knob : public QWidget, public FloatModelView { Q_OBJECT Q_PROPERTY(float innerRadius READ innerRadius WRITE setInnerRadius) @@ -145,7 +145,7 @@ private: QString m_label; QPixmap * m_knobPixmap; - boolModel m_volumeKnob; + BoolModel m_volumeKnob; float m_mouseOffset; QPoint m_origMousePos; @@ -164,7 +164,4 @@ private: } ; - -typedef floatModel knobModel; - #endif diff --git a/include/lcd_spinbox.h b/include/lcd_spinbox.h index 09175fcc0..db599006e 100644 --- a/include/lcd_spinbox.h +++ b/include/lcd_spinbox.h @@ -29,10 +29,10 @@ #include #include -#include "automatable_model_view.h" +#include "AutomatableModelView.h" -class EXPORT lcdSpinBox : public QWidget, public intModelView +class EXPORT lcdSpinBox : public QWidget, public IntModelView { Q_OBJECT public: @@ -52,9 +52,9 @@ public: update(); } - virtual void modelChanged( void ) + virtual void modelChanged() { - modelView::modelChanged(); + ModelView::modelChanged(); update(); } @@ -62,7 +62,7 @@ public: public slots: virtual void setEnabled( bool _on ); virtual void setMarginWidth( int _width ); - virtual void update( void ); + virtual void update(); protected: @@ -95,10 +95,10 @@ private: signals: - void manualChange( void ); + void manualChange(); } ; -typedef intModel lcdSpinBoxModel; +typedef IntModel lcdSpinBoxModel; #endif diff --git a/include/note.h b/include/note.h index 3a2be2994..2024fdb69 100644 --- a/include/note.h +++ b/include/note.h @@ -32,7 +32,7 @@ #include "volume.h" #include "panning.h" #include "midi_time.h" -#include "serializing_object.h" +#include "SerializingObject.h" class detuningHelper; @@ -79,7 +79,7 @@ const float MaxDetuning = 4 * 12.0f; -class EXPORT note : public serializingObject +class EXPORT note : public SerializingObject { public: note( const midiTime & _length = midiTime( 0 ), @@ -209,8 +209,8 @@ protected: QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); -/* virtual void undoStep( journalEntry & _je ); - virtual void redoStep( journalEntry & _je );*/ +/* virtual void undoStep( JournalEntry & _je ); + virtual void redoStep( JournalEntry & _je );*/ private: diff --git a/include/note_play_handle.h b/include/note_play_handle.h index 7c66c3a2d..56d24ed49 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -34,7 +34,7 @@ #include "track.h" -class instrumentTrack; +class InstrumentTrack; class notePlayHandle; template class basicFilters; @@ -48,7 +48,7 @@ public: void * m_pluginData; basicFilters<> * m_filter; - notePlayHandle( instrumentTrack * _instrument_track, + notePlayHandle( InstrumentTrack * _instrument_track, const f_cnt_t _offset, const f_cnt_t _frames, const note & _n, notePlayHandle * _parent = NULL, @@ -57,31 +57,31 @@ public: virtual void setVolume( const volume_t _volume = DefaultVolume ); - int getMidiVelocity( void ) const; + int getMidiVelocity() const; - const float & frequency( void ) const + const float & frequency() const { return( m_frequency ); } - void updateFrequency( void ); + void updateFrequency(); // returns frequency without pitch-wheel influence - float unpitchedFrequency( void ) const + float unpitchedFrequency() const { return( m_unpitchedFrequency ); } virtual void play( sampleFrame * _working_buffer ); - virtual inline bool done( void ) const + virtual inline bool done() const { return( m_released && framesLeft() <= 0 ); } - f_cnt_t framesLeft( void ) const; + f_cnt_t framesLeft() const; - inline fpp_t framesLeftForCurrentPeriod( void ) const + inline fpp_t framesLeftForCurrentPeriod() const { return( (fpp_t) qMin( framesLeft(), engine::getMixer()->framesPerPeriod() ) ); @@ -93,21 +93,21 @@ public: void noteOff( const f_cnt_t _s = 0 ); - inline f_cnt_t framesBeforeRelease( void ) const + inline f_cnt_t framesBeforeRelease() const { return( m_framesBeforeRelease ); } - inline f_cnt_t releaseFramesDone( void ) const + inline f_cnt_t releaseFramesDone() const { return( m_releaseFramesDone ); } - f_cnt_t actualReleaseFramesToDo( void ) const; + f_cnt_t actualReleaseFramesToDo() const; // returns total numbers of frames to play - inline f_cnt_t frames( void ) const + inline f_cnt_t frames() const { return( m_frames ); } @@ -115,13 +115,13 @@ public: void setFrames( const f_cnt_t _frames ); // returns whether note was released - inline bool released( void ) const + inline bool released() const { return( m_released ); } // returns total numbers of played frames - inline f_cnt_t totalFramesPlayed( void ) const + inline f_cnt_t totalFramesPlayed() const { return( m_totalFramesPlayed ); } @@ -130,19 +130,19 @@ public: float volumeLevel( const f_cnt_t _frame ); // returns instrument-track this note-play-handle plays - inline instrumentTrack * getInstrumentTrack( void ) + inline InstrumentTrack * instrumentTrack() { - return( m_instrumentTrack ); + return m_instrumentTrack; } // returns whether note is a base-note, e.g. is not part of an arpeggio // or a chord - inline bool isBaseNote( void ) const + inline bool isBaseNote() const { return( m_baseNote ); } - inline bool isPartOfArpeggio( void ) const + inline bool isPartOfArpeggio() const { return( m_partOfArpeggio ); } @@ -153,28 +153,28 @@ public: } // returns whether note is base-note for arpeggio - bool isArpeggioBaseNote( void ) const; + bool isArpeggioBaseNote() const; - inline bool isMuted( void ) const + inline bool isMuted() const { return( m_muted ); } - void mute( void ); + void mute(); // returns index of note-play-handle in vector of note-play-handles // belonging to this instrument-track - used by arpeggiator - int index( void ) const; + int index() const; // note-play-handles belonging to given channel, if _all_ph = true, // also released note-play-handles are returned static ConstNotePlayHandleList nphsOfInstrumentTrack( - const instrumentTrack * _ct, bool _all_ph = false ); + const InstrumentTrack * _ct, bool _all_ph = false ); // return whether given note-play-handle is equal to *this bool operator==( const notePlayHandle & _nph ) const; - inline bool bbTrackMuted( void ) + inline bool bbTrackMuted() { return( m_bbTrack && m_bbTrack->isMuted() ); } @@ -187,7 +187,7 @@ public: void resize( const bpm_t _new_tempo ); #ifdef LMMS_SINGERBOT_SUPPORT - int patternIndex( void ) + int patternIndex() { return( m_patternIndex ); } @@ -210,7 +210,7 @@ private: m_value = _val; } - float value( void ) const + float value() const { return( m_value ); } @@ -223,8 +223,8 @@ private: } ; - instrumentTrack * m_instrumentTrack; // needed for calling - // instrumentTrack::playNote + InstrumentTrack * m_instrumentTrack; // needed for calling + // InstrumentTrack::playNote f_cnt_t m_frames; // total frames to play f_cnt_t m_totalFramesPlayed; // total frame-counter - used for // figuring out whether a whole note diff --git a/include/pattern.h b/include/pattern.h index 9f2aaad1c..53aafa0ae 100644 --- a/include/pattern.h +++ b/include/pattern.h @@ -3,7 +3,7 @@ * about a pattern * * Copyright (c) 2004-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,7 +23,6 @@ * */ - #ifndef _PATTERN_H #define _PATTERN_H @@ -42,7 +41,7 @@ class QAction; class QProgressBar; class QPushButton; -class instrumentTrack; +class InstrumentTrack; class patternFreezeThread; class sampleBuffer; @@ -58,15 +57,15 @@ public: MelodyPattern } ; - pattern( instrumentTrack * _instrument_track ); + pattern( InstrumentTrack * _instrument_track ); pattern( const pattern & _pat_to_copy ); virtual ~pattern(); - void init( void ); + void init(); - virtual midiTime length( void ) const; - midiTime beatPatternLength( void ) const; + virtual midiTime length() const; + midiTime beatPatternLength() const; // note management note * addNote( const note & _new_note, const bool _quant_pos = true ); @@ -75,10 +74,10 @@ public: note * rearrangeNote( const note * _note_to_proc, const bool _quant_pos = true ); - void rearrangeAllNotes( void ); - void clearNotes( void ); + void rearrangeAllNotes(); + void clearNotes(); - inline const NoteVector & notes( void ) const + inline const NoteVector & notes() const { return m_notes; } @@ -86,26 +85,26 @@ public: void setStep( int _step, bool _enabled ); // pattern-type stuff - inline PatternTypes type( void ) const + inline PatternTypes type() const { return m_patternType; } void setType( PatternTypes _new_pattern_type ); - void checkType( void ); + void checkType(); // functions which are part of freezing-feature - inline bool freezing( void ) const + inline bool freezing() const { return m_freezing; } - inline bool frozen( void ) const + inline bool frozen() const { return m_frozenPattern != NULL; } - sampleBuffer * getFrozenPattern( void ) + sampleBuffer * frozenPattern() { return m_frozenPattern; } @@ -113,17 +112,17 @@ public: // settings-management virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { return "pattern"; } - inline instrumentTrack * getInstrumentTrack( void ) + inline InstrumentTrack * instrumentTrack() const { return m_instrumentTrack; } - bool empty( void ); + bool empty(); void addSteps( int _n ); @@ -132,24 +131,24 @@ public: virtual trackContentObjectView * createView( trackView * _tv ); - using model::dataChanged; + using Model::dataChanged; protected: - void ensureBeatNotes( void ); - void updateBBTrack( void ); + void ensureBeatNotes(); + void updateBBTrack(); protected slots: - void clear( void ); - void freeze( void ); - void unfreeze( void ); - void abortFreeze( void ); - void changeTimeSignature( void ); + void clear(); + void freeze(); + void unfreeze(); + void abortFreeze(); + void changeTimeSignature(); private: - instrumentTrack * m_instrumentTrack; + InstrumentTrack * m_instrumentTrack; PatternTypes m_patternType; @@ -179,14 +178,14 @@ public: public slots: - virtual void update( void ); + virtual void update(); protected slots: - void openInPianoRoll( void ); + void openInPianoRoll(); - void resetName( void ); - void changeName( void ); + void resetName(); + void changeName(); void addSteps( QAction * _item ); void removeSteps( QAction * _item ); @@ -240,8 +239,8 @@ protected: protected slots: - void cancelBtnClicked( void ); - void updateProgress( void ); + void cancelBtnClicked(); + void updateProgress(); private: @@ -254,7 +253,7 @@ private: signals: - void aborted( void ); + void aborted(); } ; @@ -270,7 +269,7 @@ public: protected: - virtual void run( void ); + virtual void run(); private: diff --git a/include/piano_roll.h b/include/piano_roll.h index c2640010c..52115af8d 100644 --- a/include/piano_roll.h +++ b/include/piano_roll.h @@ -30,8 +30,8 @@ #include -#include "combobox_model.h" -#include "serializing_object.h" +#include "ComboBoxModel.h" +#include "SerializingObject.h" #include "note.h" #include "lmms_basics.h" #include "song.h" @@ -51,7 +51,7 @@ class timeLine; class toolButton; -class pianoRoll : public QWidget, public serializingObject +class pianoRoll : public QWidget, public SerializingObject { Q_OBJECT public: @@ -241,9 +241,9 @@ private: comboBox * m_quantizeComboBox; comboBox * m_noteLenComboBox; - comboBoxModel m_zoomingModel; - comboBoxModel m_quantizeModel; - comboBoxModel m_noteLenModel; + ComboBoxModel m_zoomingModel; + ComboBoxModel m_quantizeModel; + ComboBoxModel m_noteLenModel; diff --git a/include/plugin_browser.h b/include/plugin_browser.h index f49290593..03f639522 100644 --- a/include/plugin_browser.h +++ b/include/plugin_browser.h @@ -32,7 +32,7 @@ #include "side_bar_widget.h" -#include "plugin.h" +#include "Plugin.h" class trackContainer; @@ -47,7 +47,7 @@ public: private: - QVector m_pluginDescriptors; + QVector m_pluginDescriptors; QWidget * m_view; @@ -60,7 +60,7 @@ class pluginDescWidget : public QWidget { Q_OBJECT public: - pluginDescWidget( const plugin::descriptor & _pd, QWidget * _parent ); + pluginDescWidget( const Plugin::Descriptor & _pd, QWidget * _parent ); virtual ~pluginDescWidget(); @@ -78,7 +78,7 @@ private slots: private: QTimer m_updateTimer; - const plugin::descriptor & m_pluginDescriptor; + const Plugin::Descriptor & m_pluginDescriptor; QPixmap m_logo; bool m_mouseOver; diff --git a/include/preset_preview_play_handle.h b/include/preset_preview_play_handle.h index d358d3a76..3e4d4e53c 100644 --- a/include/preset_preview_play_handle.h +++ b/include/preset_preview_play_handle.h @@ -30,7 +30,7 @@ #include "note_play_handle.h" -class instrumentTrack; +class InstrumentTrack; class previewTrackContainer; @@ -49,7 +49,7 @@ public: static void init( void ); static void cleanup( void ); static ConstNotePlayHandleList nphsOfInstrumentTrack( - const instrumentTrack * _ct ); + const InstrumentTrack * _ct ); private: diff --git a/include/project_notes.h b/include/project_notes.h index 97848b63e..876507083 100644 --- a/include/project_notes.h +++ b/include/project_notes.h @@ -28,8 +28,7 @@ #include -#include "journalling_object.h" - +#include "JournallingObject.h" class QAction; class QComboBox; @@ -37,36 +36,36 @@ class QTextCharFormat; class QTextEdit; -class EXPORT projectNotes : public QMainWindow, public serializingObject +class EXPORT projectNotes : public QMainWindow, public SerializingObject { Q_OBJECT public: - projectNotes( void ); + projectNotes(); virtual ~projectNotes(); - void clear( void ); + void clear(); void setText( const QString & _text ); virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { - return( "projectnotes" ); + return "projectnotes"; } protected: - void setupActions( void ); + void setupActions(); private slots: - void textBold( void ); - void textUnderline( void ); - void textItalic( void ); + void textBold(); + void textUnderline(); + void textItalic(); void textFamily( const QString & _f ); void textSize( const QString & _p ); - void textColor( void ); + void textColor(); void textAlign( QAction * _a ); void formatChanged( const QTextCharFormat & _f ); diff --git a/include/sample_play_handle.h b/include/sample_play_handle.h index e98fda7a7..502464529 100644 --- a/include/sample_play_handle.h +++ b/include/sample_play_handle.h @@ -28,7 +28,7 @@ #include "mixer.h" #include "sample_buffer.h" -#include "automatable_model.h" +#include "AutomatableModel.h" class bbTrack; class pattern; @@ -72,7 +72,7 @@ public: m_bbTrack = _bb_track; } - void setVolumeModel( floatModel * _model ) + void setVolumeModel( FloatModel * _model ) { m_volumeModel = _model; } @@ -88,8 +88,8 @@ private: AudioPort * m_audioPort; const bool m_ownAudioPort; - floatModel m_defaultVolumeModel; - floatModel * m_volumeModel; + FloatModel m_defaultVolumeModel; + FloatModel * m_volumeModel; track * m_track; bbTrack * m_bbTrack; diff --git a/include/sample_track.h b/include/sample_track.h index 82d020a7b..a5c2001ab 100644 --- a/include/sample_track.h +++ b/include/sample_track.h @@ -31,7 +31,7 @@ #include "AudioPort.h" #include "track.h" -class effectRackView; +class EffectRackView; class knob; class sampleBuffer; @@ -73,7 +73,7 @@ public slots: private: sampleBuffer * m_sampleBuffer; - boolModel m_recordModel; + BoolModel m_recordModel; friend class sampleTCOView; @@ -146,7 +146,7 @@ public: private: AudioPort m_audioPort; - floatModel m_volumeModel; + FloatModel m_volumeModel; friend class sampleTrackView; @@ -168,7 +168,7 @@ public slots: private: - effectRackView * m_effectRack; + EffectRackView * m_effectRack; QWidget * m_effWindow; knob * m_volumeKnob; diff --git a/include/song.h b/include/song.h index 874b26916..0c94ced81 100644 --- a/include/song.h +++ b/include/song.h @@ -29,9 +29,9 @@ #include #include "track_container.h" -#include "automatable_model.h" +#include "AutomatableModel.h" #include "Controller.h" -#include "meter_model.h" +#include "MeterModel.h" class automationTrack; @@ -187,7 +187,7 @@ public: } - meterModel & getTimeSigModel( void ) + MeterModel & getTimeSigModel( void ) { return m_timeSigModel; } @@ -264,11 +264,11 @@ private: automationTrack * m_globalAutomationTrack; - intModel m_tempoModel; - meterModel m_timeSigModel; + IntModel m_tempoModel; + MeterModel m_timeSigModel; int m_oldTicksPerTact; - intModel m_masterVolumeModel; - intModel m_masterPitchModel; + IntModel m_masterVolumeModel; + IntModel m_masterPitchModel; ControllerVector m_controllers; diff --git a/include/song_editor.h b/include/song_editor.h index 6dbfb5274..8302d795e 100644 --- a/include/song_editor.h +++ b/include/song_editor.h @@ -35,7 +35,7 @@ class QScrollBar; class automatableSlider; class comboBox; class lcdSpinBox; -class meterDialog; +class MeterDialog; class song; class textFloat; class timeLine; @@ -108,7 +108,7 @@ private: timeLine * m_timeLine; - meterDialog * m_timeSigDisplay; + MeterDialog * m_timeSigDisplay; automatableSlider * m_masterVolumeSlider; automatableSlider * m_masterPitchSlider; diff --git a/include/surround_area.h b/include/surround_area.h index 7a3ad3c09..bd797568c 100644 --- a/include/surround_area.h +++ b/include/surround_area.h @@ -30,7 +30,7 @@ #include -#include "automatable_model.h" +#include "AutomatableModel.h" #include "mixer.h" @@ -41,13 +41,13 @@ class knob; const int SURROUND_AREA_SIZE = 1024; -class surroundAreaModel : public model +class surroundAreaModel : public Model { Q_OBJECT mapPropertyFromModel(int,x,setX,m_posX); mapPropertyFromModel(int,y,setY,m_posY); public: - surroundAreaModel( ::model * _parent, + surroundAreaModel( Model * _parent, bool _default_constructed = FALSE ); surroundVolumeVector getVolumeVector( float _v_scale ) const; @@ -74,14 +74,14 @@ public: private: - intModel m_posX; - intModel m_posY; + IntModel m_posX; + IntModel m_posY; } ; /* -class surroundArea : public QWidget, public modelView +class surroundArea : public QWidget, public ModelView { Q_OBJECT public: diff --git a/include/timeline.h b/include/timeline.h index 4014b79ab..d1deca16f 100644 --- a/include/timeline.h +++ b/include/timeline.h @@ -36,7 +36,7 @@ class nStateButton; class textFloat; -class timeLine : public QWidget, public journallingObject +class timeLine : public QWidget, public JournallingObject { Q_OBJECT public: diff --git a/include/track.h b/include/track.h index a191df788..c0c4f0ab2 100644 --- a/include/track.h +++ b/include/track.h @@ -3,7 +3,7 @@ * track-like objects (beat/bassline, sample-track...) * * Copyright (c) 2004-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,7 +23,6 @@ * */ - #ifndef _TRACK_H #define _TRACK_H @@ -34,8 +33,9 @@ #include "lmms_basics.h" #include "midi_time.h" #include "rubberband.h" -#include "journalling_object.h" -#include "automatable_model.h" +#include "JournallingObject.h" +#include "AutomatableModel.h" +#include "ModelView.h" class QMenu; @@ -59,7 +59,7 @@ const int TRACK_OP_WIDTH = 78; const int TCO_BORDER_WIDTH = 1; -class trackContentObject : public model, public journallingObject +class trackContentObject : public Model, public JournallingObject { Q_OBJECT mapPropertyFromModel(bool,isMuted,setMuted,m_mutedModel); @@ -67,14 +67,14 @@ public: trackContentObject( track * _track ); virtual ~trackContentObject(); - inline track * getTrack( void ) + inline track * getTrack() const { - return( m_track ); + return m_track; } - inline const QString & name( void ) const + inline const QString & name() const { - return( m_name ); + return m_name; } inline void setName( const QString & _name ) @@ -83,26 +83,26 @@ public: emit dataChanged(); } - virtual QString displayName( void ) const + virtual QString displayName() const { - return( name() ); + return name(); } - inline const midiTime & startPosition( void ) const + inline const midiTime & startPosition() const { - return( m_startPosition ); + return m_startPosition; } - inline midiTime endPosition( void ) const + inline midiTime endPosition() const { const int sp = m_startPosition; return sp + m_length; } - inline const midiTime & length( void ) const + inline const midiTime & length() const { - return( m_length ); + return m_length; } virtual void movePosition( const midiTime & _pos ); @@ -112,20 +112,20 @@ public: public slots: - void copy( void ); - void paste( void ); - void toggleMute( void ); + void copy(); + void paste(); + void toggleMute(); protected: - virtual void undoStep( journalEntry & _je ); - virtual void redoStep( journalEntry & _je ); + virtual void undoStep( JournalEntry & _je ); + virtual void redoStep( JournalEntry & _je ); signals: - void lengthChanged( void ); - void positionChanged( void ); - void destroyedTCO( void ); + void lengthChanged(); + void positionChanged(); + void destroyedTCO(); private: @@ -142,7 +142,7 @@ private: midiTime m_startPosition; midiTime m_length; - boolModel m_mutedModel; + BoolModel m_mutedModel; friend class trackContentObjectView; @@ -151,25 +151,25 @@ private: -class trackContentObjectView : public selectableObject, public modelView +class trackContentObjectView : public selectableObject, public ModelView { Q_OBJECT public: trackContentObjectView( trackContentObject * _tco, trackView * _tv ); virtual ~trackContentObjectView(); - bool fixedTCOs( void ); + bool fixedTCOs(); - inline trackContentObject * getTrackContentObject( void ) + inline trackContentObject * getTrackContentObject() { - return( m_tco ); + return m_tco; } public slots: - virtual bool close( void ); - void cut( void ); - void remove( void ); + virtual bool close(); + void cut(); + void remove(); protected: virtual void constructContextMenu( QMenu * ) @@ -185,17 +185,17 @@ protected: virtual void mouseReleaseEvent( QMouseEvent * _me ); void setAutoResizeEnabled( bool _e = FALSE ); - float pixelsPerTact( void ); + float pixelsPerTact(); - inline trackView * getTrackView( void ) + inline trackView * getTrackView() { - return( m_trackView ); + return m_trackView; } protected slots: - void updateLength( void ); - void updatePosition( void ); + void updateLength(); + void updatePosition(); private: @@ -225,7 +225,7 @@ private: -class trackContentWidget : public QWidget, public journallingObject +class trackContentWidget : public QWidget, public JournallingObject { Q_OBJECT public: @@ -244,9 +244,8 @@ public: midiTime endPosition( const midiTime & _pos_start ); - public slots: - void update( void ); + void update(); void changePosition( const midiTime & _new_pos = midiTime( -1 ) ); @@ -257,13 +256,13 @@ protected: virtual void paintEvent( QPaintEvent * _pe ); virtual void resizeEvent( QResizeEvent * _re ); - virtual QString nodeName( void ) const + virtual QString nodeName() const { - return( "trackcontentwidget" ); + return "trackcontentwidget"; } - virtual void undoStep( journalEntry & _je ); - virtual void redoStep( journalEntry & _je ); + virtual void undoStep( JournalEntry & _je ); + virtual void redoStep( JournalEntry & _je ); private: @@ -273,7 +272,7 @@ private: RemoveTrackContentObject } ; - track * getTrack( void ); + track * getTrack(); midiTime getPosition( int _mouse_x ); trackView * m_trackView; @@ -305,9 +304,9 @@ protected: private slots: - void cloneTrack( void ); - void removeTrack( void ); - void updateMenu( void ); + void cloneTrack(); + void removeTrack(); + void updateMenu(); private: @@ -332,7 +331,7 @@ signals: // base-class for all tracks -class EXPORT track : public model, public journallingObject +class EXPORT track : public Model, public JournallingObject { Q_OBJECT mapPropertyFromModel(bool,isMuted,setMuted,m_mutedModel); @@ -357,13 +356,13 @@ public: static track * create( TrackTypes _tt, trackContainer * _tc ); static track * create( const QDomElement & _this, trackContainer * _tc ); - void clone( void ); + void clone(); // pure virtual functions - TrackTypes type( void ) const + TrackTypes type() const { - return( m_type ); + return m_type; } virtual bool play( const midiTime & _start, const fpp_t _frames, @@ -382,7 +381,7 @@ public: virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); virtual void loadSettings( const QDomElement & _this ); - void setSimpleSerializing( void ) + void setSimpleSerializing() { m_simpleSerializingMode = TRUE; } @@ -392,11 +391,11 @@ public: void removeTCO( trackContentObject * _tco ); // ------------------------------------------------------- - int numOfTCOs( void ); + int numOfTCOs(); trackContentObject * getTCO( int _tco_num ); int getTCONum( trackContentObject * _tco ); - const tcoVector & getTCOs( void ) const + const tcoVector & getTCOs() const { return( m_trackContentObjects ); } @@ -408,26 +407,26 @@ public: void insertTact( const midiTime & _pos ); void removeTact( const midiTime & _pos ); - tact_t length( void ) const; + tact_t length() const; - inline trackContainer * getTrackContainer( void ) const + inline trackContainer * getTrackContainer() const { return( m_trackContainer ); } // name-stuff - virtual const QString & name( void ) const + virtual const QString & name() const { return( m_name ); } - virtual QString displayName( void ) const + virtual QString displayName() const { return( name() ); } - using model::dataChanged; + using Model::dataChanged; public slots: @@ -437,7 +436,7 @@ public slots: emit nameChanged(); } - void toggleSolo( void ); + void toggleSolo(); private: @@ -445,8 +444,8 @@ private: TrackTypes m_type; QString m_name; - boolModel m_mutedModel; - boolModel m_soloModel; + BoolModel m_mutedModel; + BoolModel m_soloModel; bool m_mutedBeforeSolo; bool m_simpleSerializingMode; @@ -458,8 +457,8 @@ private: signals: - void destroyedTrack( void ); - void nameChanged( void ); + void destroyedTrack(); + void nameChanged(); void trackContentObjectAdded( trackContentObject * ); } ; @@ -467,63 +466,63 @@ signals: -class trackView : public QWidget, public modelView, public journallingObject +class trackView : public QWidget, public ModelView, public JournallingObject { Q_OBJECT public: trackView( track * _track, trackContainerView * _tcv ); virtual ~trackView(); - inline const track * getTrack( void ) const + inline const track * getTrack() const { return( m_track ); } - inline track * getTrack( void ) + inline track * getTrack() { return( m_track ); } - inline trackContainerView * getTrackContainerView( void ) + inline trackContainerView * getTrackContainerView() { return( m_trackContainerView ); } - inline trackOperationsWidget * getTrackOperationsWidget( void ) + inline trackOperationsWidget * getTrackOperationsWidget() { return( &m_trackOperationsWidget ); } - inline trackSettingsWidget * getTrackSettingsWidget( void ) + inline trackSettingsWidget * getTrackSettingsWidget() { return( &m_trackSettingsWidget ); } - inline trackContentWidget * getTrackContentWidget( void ) + inline trackContentWidget * getTrackContentWidget() { return( &m_trackContentWidget ); } - bool isMovingTrack( void ) const + bool isMovingTrack() const { return( m_action == MoveTrack ); } - virtual void update( void ); + virtual void update(); public slots: - virtual bool close( void ); + virtual bool close(); protected: - virtual void modelChanged( void ); - virtual void undoStep( journalEntry & _je ); - virtual void redoStep( journalEntry & _je ); + virtual void modelChanged(); + virtual void undoStep( JournalEntry & _je ); + virtual void redoStep( JournalEntry & _je ); - virtual QString nodeName( void ) const + virtual QString nodeName() const { - return( "trackview" ); + return "trackview"; } diff --git a/include/track_container.h b/include/track_container.h index 6920d25df..7cf26db83 100644 --- a/include/track_container.h +++ b/include/track_container.h @@ -30,21 +30,21 @@ #include #include "track.h" -#include "journalling_object.h" +#include "JournallingObject.h" class automationPattern; -class instrumentTrack; +class InstrumentTrack; class trackContainerView; -class EXPORT trackContainer : public model, public journallingObject +class EXPORT trackContainer : public Model, public JournallingObject { Q_OBJECT public: typedef QVector trackList; - trackContainer( void ); + trackContainer(); virtual ~trackContainer(); virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); @@ -52,7 +52,7 @@ public: virtual void loadSettings( const QDomElement & _this ); - virtual automationPattern * tempoAutomationPattern( void ) + virtual automationPattern * tempoAutomationPattern() { return NULL; } @@ -63,18 +63,18 @@ public: void addTrack( track * _track ); void removeTrack( track * _track ); - virtual void updateAfterTrackAdd( void ); + virtual void updateAfterTrackAdd(); - void clearAllTracks( void ); + void clearAllTracks(); - const trackList & tracks( void ) const + const trackList & tracks() const { return m_tracks; } - bool isEmpty( void ) const; + bool isEmpty() const; - static const QString classNodeName( void ) + static const QString classNodeName() { return "trackcontainer"; } @@ -96,28 +96,28 @@ private: } ; -class dummyTrackContainer : public trackContainer +class DummyTrackContainer : public trackContainer { public: - dummyTrackContainer( void ); + DummyTrackContainer(); - virtual ~dummyTrackContainer() + virtual ~DummyTrackContainer() { } - virtual QString nodeName( void ) const + virtual QString nodeName() const { - return "dummytrackcontainer"; + return "DummyTrackContainer"; } - instrumentTrack * dummyInstrumentTrack( void ) + InstrumentTrack * dummyInstrumentTrack() { return m_dummyInstrumentTrack; } private: - instrumentTrack * m_dummyInstrumentTrack; + InstrumentTrack * m_dummyInstrumentTrack; } ; diff --git a/include/track_container_view.h b/include/track_container_view.h index 83ed9bcb2..7256c95a7 100644 --- a/include/track_container_view.h +++ b/include/track_container_view.h @@ -1,7 +1,7 @@ /* * track_container_view.h - view-component for trackContainer * - * Copyright (c) 2004-2008 Tobias Doerffel + * Copyright (c) 2004-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -32,16 +32,16 @@ #include "track.h" -#include "journalling_object.h" +#include "JournallingObject.h" class QVBoxLayout; class trackContainer; -class trackContainerView : public QWidget, public modelView, - public journallingObject, - public serializingObjectHook +class trackContainerView : public QWidget, public ModelView, + public JournallingObject, + public SerializingObjectHook { Q_OBJECT public: @@ -51,22 +51,22 @@ public: virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); virtual void loadSettings( const QDomElement & _this ); - QWidget * contentWidget( void ) + QWidget * contentWidget() { return( m_scrollArea ); } - inline const midiTime & currentPosition( void ) const + inline const midiTime & currentPosition() const { return( m_currentPosition ); } - virtual bool fixedTCOs( void ) const + virtual bool fixedTCOs() const { return( FALSE ); } - inline float pixelsPerTact( void ) const + inline float pixelsPerTact() const { return( m_ppt ); } @@ -75,14 +75,14 @@ public: const trackView * trackViewAt( const int _y ) const; - virtual bool allowRubberband( void ) const; + virtual bool allowRubberband() const; - inline bool rubberBandActive( void ) const + inline bool rubberBandActive() const { return( m_rubberBand->isVisible() ); } - inline QVector selectedObjects( void ) + inline QVector selectedObjects() { if( allowRubberband() == TRUE ) { @@ -92,12 +92,12 @@ public: } - trackContainer * model( void ) + trackContainer * model() { return( m_tc ); } - const trackContainer * model( void ) const + const trackContainer * model() const { return( m_tc ); } @@ -110,16 +110,16 @@ public: void removeTrackView( trackView * _tv ); // ------------------------------------------------------- - void clearAllTracks( void ); + void clearAllTracks(); - virtual QString nodeName( void ) const + virtual QString nodeName() const { return( "trackcontainerview" ); } public slots: - void realignTracks( void ); + void realignTracks(); void createTrackView( track * _t ); void deleteTrackView( trackView * _tv ); @@ -127,7 +127,7 @@ public slots: protected: static const int DEFAULT_PIXELS_PER_TACT = 16; - const QList & trackViews( void ) const + const QList & trackViews() const { return( m_trackViews ); } @@ -139,8 +139,8 @@ protected: virtual void mouseReleaseEvent( QMouseEvent * _me ); virtual void resizeEvent( QResizeEvent * ); - virtual void undoStep( journalEntry & _je ); - virtual void redoStep( journalEntry & _je ); + virtual void undoStep( JournalEntry & _je ); + virtual void redoStep( JournalEntry & _je ); midiTime m_currentPosition; diff --git a/include/transformable_auto_model.h b/include/transformable_auto_model.h index b8ffb8985..c2a4ec41d 100644 --- a/include/transformable_auto_model.h +++ b/include/transformable_auto_model.h @@ -26,7 +26,7 @@ #ifndef _TRANSFORMABLE_AUTO_MODEL_H #define _TRANSFORMABLE_AUTO_MODEL_H -#include "automatable_model.h" +#include "AutomatableModel.h" //#include "automatable_model_templates.h" @@ -41,7 +41,7 @@ struct AutoModelTransformer template -class transformableAutoModel : public automatableModel +class transformableAutoModel : public AutomatableModel { public: transformableAutoModel( const AutoModelTransformer * _transformer, @@ -49,9 +49,9 @@ public: const T _min = 0, const T _max = 0, const T _step = defaultRelStep(), - ::model * _parent = NULL, + Model * _parent = NULL, bool _default_constructed = FALSE ) : - automatableModel( _val, _min, _max, _step, _parent, + AutomatableModel( _val, _min, _max, _step, _parent, _default_constructed ), m_transformer( _transformer ) { diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 63fe55e7c..15e4e7b7e 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -33,7 +33,7 @@ #include "audio_file_processor.h" #include "engine.h" #include "song.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "note_play_handle.h" #include "interpolation.h" #include "gui_templates.h" @@ -47,7 +47,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT audiofileprocessor_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT audiofileprocessor_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "AudioFileProcessor", @@ -57,8 +57,8 @@ plugin::descriptor PLUGIN_EXPORT audiofileprocessor_plugin_descriptor = "instrument-track" ), "Tobias Doerffel ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), "wav,ogg,ds,spx,au,voc,aif,aiff,flac,raw", NULL } ; @@ -68,22 +68,22 @@ plugin::descriptor PLUGIN_EXPORT audiofileprocessor_plugin_descriptor = -audioFileProcessor::audioFileProcessor( instrumentTrack * _instrument_track ) : - instrument( _instrument_track, &audiofileprocessor_plugin_descriptor ), +audioFileProcessor::audioFileProcessor( InstrumentTrack * _instrument_track ) : + Instrument( _instrument_track, &audiofileprocessor_plugin_descriptor ), m_sampleBuffer(), m_ampModel( 100, 0, 500, 1, this, tr( "Amplify" ) ), - m_startPointModel( 0, 0, 1, 0.0000001f, this, tr( "Start of sample") ), - m_endPointModel( 1, 0, 1, 0.0000001f, this, tr( "End of sample" ) ), - m_reverseModel( FALSE, this, tr( "Reverse sample" ) ), - m_loopModel( FALSE, this, tr( "Loop") ) + m_startPoIntModel( 0, 0, 1, 0.0000001f, this, tr( "Start of sample") ), + m_endPoIntModel( 1, 0, 1, 0.0000001f, this, tr( "End of sample" ) ), + m_reverseModel( false, this, tr( "Reverse sample" ) ), + m_loopModel( false, this, tr( "Loop") ) { connect( &m_reverseModel, SIGNAL( dataChanged() ), this, SLOT( reverseModelChanged() ) ); connect( &m_ampModel, SIGNAL( dataChanged() ), this, SLOT( ampModelChanged() ) ); - connect( &m_startPointModel, SIGNAL( dataChanged() ), + connect( &m_startPoIntModel, SIGNAL( dataChanged() ), this, SLOT( loopPointChanged() ) ); - connect( &m_endPointModel, SIGNAL( dataChanged() ), + connect( &m_endPoIntModel, SIGNAL( dataChanged() ), this, SLOT( loopPointChanged() ) ); } @@ -113,7 +113,7 @@ void audioFileProcessor::playNote( notePlayHandle * _n, m_loopModel.value() ) == TRUE ) { applyRelease( _working_buffer, _n ); - getInstrumentTrack()->processAudioBuffer( _working_buffer, + instrumentTrack()->processAudioBuffer( _working_buffer, frames,_n ); } } @@ -142,8 +142,8 @@ void audioFileProcessor::saveSettings( QDomDocument & _doc, m_reverseModel.saveSettings( _doc, _this, "reversed" ); m_loopModel.saveSettings( _doc, _this, "looped" ); m_ampModel.saveSettings( _doc, _this, "amp" ); - m_startPointModel.saveSettings( _doc, _this, "sframe" ); - m_endPointModel.saveSettings( _doc, _this, "eframe" ); + m_startPoIntModel.saveSettings( _doc, _this, "sframe" ); + m_endPoIntModel.saveSettings( _doc, _this, "eframe" ); } @@ -162,8 +162,8 @@ void audioFileProcessor::loadSettings( const QDomElement & _this ) m_reverseModel.loadSettings( _this, "reversed" ); m_loopModel.loadSettings( _this, "looped" ); m_ampModel.loadSettings( _this, "amp" ); - m_startPointModel.loadSettings( _this, "sframe" ); - m_endPointModel.loadSettings( _this, "eframe" ); + m_startPoIntModel.loadSettings( _this, "sframe" ); + m_endPoIntModel.loadSettings( _this, "eframe" ); loopPointChanged(); } @@ -201,9 +201,9 @@ Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const -pluginView * audioFileProcessor::instantiateView( QWidget * _parent ) +PluginView * audioFileProcessor::instantiateView( QWidget * _parent ) { - return( new audioFileProcessorView( this, _parent ) ); + return( new AudioFileProcessorView( this, _parent ) ); } @@ -214,13 +214,12 @@ void audioFileProcessor::setAudioFile( const QString & _audio_file, { // is current channel-name equal to previous-filename?? if( _rename && - ( getInstrumentTrack()->name() == + ( instrumentTrack()->name() == QFileInfo( m_sampleBuffer.audioFile() ).fileName() || m_sampleBuffer.audioFile().isEmpty() ) ) { // then set it to new one - getInstrumentTrack()->setName( QFileInfo( _audio_file - ).fileName() ); + instrumentTrack()->setName( QFileInfo( _audio_file).fileName() ); } // else we don't touch the track-name, because the user named it self @@ -249,9 +248,9 @@ void audioFileProcessor::ampModelChanged( void ) void audioFileProcessor::loopPointChanged( void ) { - const f_cnt_t f1 = static_cast( m_startPointModel.value() * + const f_cnt_t f1 = static_cast( m_startPoIntModel.value() * ( m_sampleBuffer.frames()-1 ) ); - const f_cnt_t f2 = static_cast( m_endPointModel.value() * + const f_cnt_t f2 = static_cast( m_endPoIntModel.value() * ( m_sampleBuffer.frames()-1 ) ); m_sampleBuffer.setStartFrame( qMin( f1, f2 ) ); m_sampleBuffer.setEndFrame( qMax( f1, f2 ) ); @@ -277,12 +276,12 @@ public: -QPixmap * audioFileProcessorView::s_artwork = NULL; +QPixmap * AudioFileProcessorView::s_artwork = NULL; -audioFileProcessorView::audioFileProcessorView( instrument * _instrument, +AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) + InstrumentView( _instrument, _parent ) { if( s_artwork == NULL ) { @@ -374,14 +373,14 @@ audioFileProcessorView::audioFileProcessorView( instrument * _instrument, -audioFileProcessorView::~audioFileProcessorView() +AudioFileProcessorView::~AudioFileProcessorView() { } -void audioFileProcessorView::dragEnterEvent( QDragEnterEvent * _dee ) +void AudioFileProcessorView::dragEnterEvent( QDragEnterEvent * _dee ) { if( _dee->mimeData()->hasFormat( stringPairDrag::mimeType() ) ) { @@ -410,7 +409,7 @@ void audioFileProcessorView::dragEnterEvent( QDragEnterEvent * _dee ) -void audioFileProcessorView::dropEvent( QDropEvent * _de ) +void AudioFileProcessorView::dropEvent( QDropEvent * _de ) { QString type = stringPairDrag::decodeKey( _de ); QString value = stringPairDrag::decodeValue( _de ); @@ -435,7 +434,7 @@ void audioFileProcessorView::dropEvent( QDropEvent * _de ) -void audioFileProcessorView::paintEvent( QPaintEvent * ) +void AudioFileProcessorView::paintEvent( QPaintEvent * ) { QPainter p( this ); @@ -490,7 +489,7 @@ void audioFileProcessorView::paintEvent( QPaintEvent * ) -void audioFileProcessorView::sampleUpdated( void ) +void AudioFileProcessorView::sampleUpdated( void ) { m_graph = QPixmap( 245, 75 ); m_graph.fill( Qt::transparent ); @@ -506,7 +505,7 @@ void audioFileProcessorView::sampleUpdated( void ) -void audioFileProcessorView::openAudioFile( void ) +void AudioFileProcessorView::openAudioFile( void ) { QString af = castModel()->m_sampleBuffer. openAudioFile(); @@ -520,14 +519,14 @@ void audioFileProcessorView::openAudioFile( void ) -void audioFileProcessorView::modelChanged( void ) +void AudioFileProcessorView::modelChanged( void ) { audioFileProcessor * a = castModel(); connect( &a->m_sampleBuffer, SIGNAL( sampleUpdated() ), this, SLOT( sampleUpdated() ) ); m_ampKnob->setModel( &a->m_ampModel ); - m_startKnob->setModel( &a->m_startPointModel ); - m_endKnob->setModel( &a->m_endPointModel ); + m_startKnob->setModel( &a->m_startPoIntModel ); + m_endKnob->setModel( &a->m_endPoIntModel ); m_reverseButton->setModel( &a->m_reverseModel ); m_loopButton->setModel( &a->m_loopModel ); sampleUpdated(); @@ -541,10 +540,10 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { - return( new audioFileProcessor( - static_cast( _data ) ) ); + return new audioFileProcessor( + static_cast( _data ) ); } diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index e2e00689b..b94122d2e 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -29,19 +29,19 @@ #include -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" #include "sample_buffer.h" #include "knob.h" #include "pixmap_button.h" -class audioFileProcessor : public instrument +class audioFileProcessor : public Instrument { Q_OBJECT public: - audioFileProcessor( instrumentTrack * _instrument_track ); + audioFileProcessor( InstrumentTrack * _instrument_track ); virtual ~audioFileProcessor(); virtual void playNote( notePlayHandle * _n, @@ -63,7 +63,7 @@ public: return( 128 ); } - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); public slots: @@ -81,25 +81,25 @@ private: sampleBuffer m_sampleBuffer; - knobModel m_ampModel; - knobModel m_startPointModel; - knobModel m_endPointModel; - boolModel m_reverseModel; - boolModel m_loopModel; + FloatModel m_ampModel; + FloatModel m_startPoIntModel; + FloatModel m_endPoIntModel; + BoolModel m_reverseModel; + BoolModel m_loopModel; - friend class audioFileProcessorView; + friend class AudioFileProcessorView; } ; -class audioFileProcessorView : public instrumentView +class AudioFileProcessorView : public InstrumentView { Q_OBJECT public: - audioFileProcessorView( instrument * _instrument, QWidget * _parent ); - virtual ~audioFileProcessorView(); + AudioFileProcessorView( Instrument * _instrument, QWidget * _parent ); + virtual ~AudioFileProcessorView(); protected slots: diff --git a/plugins/bass_booster/bass_booster.cpp b/plugins/bass_booster/bass_booster.cpp index 229f7c590..81328a0b1 100644 --- a/plugins/bass_booster/bass_booster.cpp +++ b/plugins/bass_booster/bass_booster.cpp @@ -31,7 +31,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT bassbooster_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT bassbooster_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "BassBooster Effect", @@ -39,8 +39,8 @@ plugin::descriptor PLUGIN_EXPORT bassbooster_plugin_descriptor = "plugin for boosting bass" ), "Tobias Doerffel ", 0x0100, - plugin::Effect, - new pluginPixmapLoader( "logo" ), + Plugin::Effect, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; @@ -49,9 +49,9 @@ plugin::descriptor PLUGIN_EXPORT bassbooster_plugin_descriptor = -bassBoosterEffect::bassBoosterEffect( model * _parent, - const descriptor::subPluginFeatures::key * _key ) : - effect( &bassbooster_plugin_descriptor, _parent, _key ), +bassBoosterEffect::bassBoosterEffect( Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ) : + Effect( &bassbooster_plugin_descriptor, _parent, _key ), m_bbFX( effectLib::fastBassBoost( 70.0f, 1.0f, 2.8f ) ), m_bbControls( this ) { @@ -76,8 +76,8 @@ bool bassBoosterEffect::processAudioBuffer( sampleFrame * _buf, } double out_sum = 0.0; - const float d = getDryLevel(); - const float w = getWetLevel(); + const float d = dryLevel(); + const float w = wetLevel(); for( fpp_t f = 0; f < _frames; ++f ) { sample_t s[2] = { _buf[f][0], _buf[f][1] }; @@ -102,10 +102,10 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model * _parent, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model * _parent, void * _data ) { return( new bassBoosterEffect( _parent, - static_cast( + static_cast( _data ) ) ); } diff --git a/plugins/bass_booster/bass_booster.h b/plugins/bass_booster/bass_booster.h index 17f5c107e..089fc547f 100644 --- a/plugins/bass_booster/bass_booster.h +++ b/plugins/bass_booster/bass_booster.h @@ -26,22 +26,22 @@ #ifndef _BASS_BOOSTER_H #define _BASS_BOOSTER_H -#include "effect.h" +#include "Effect.h" #include "effect_lib.h" #include "bassbooster_controls.h" -class bassBoosterEffect : public effect +class bassBoosterEffect : public Effect { public: - bassBoosterEffect( model * _parent, - const descriptor::subPluginFeatures::key * _key ); + bassBoosterEffect( Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ); virtual ~bassBoosterEffect(); virtual bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ); - virtual effectControls * getControls( void ) + virtual EffectControls * controls( void ) { return( &m_bbControls ); } diff --git a/plugins/bass_booster/bassbooster_control_dialog.cpp b/plugins/bass_booster/bassbooster_control_dialog.cpp index 62ffd77ad..8dfc16400 100644 --- a/plugins/bass_booster/bassbooster_control_dialog.cpp +++ b/plugins/bass_booster/bassbooster_control_dialog.cpp @@ -33,7 +33,7 @@ bassBoosterControlDialog::bassBoosterControlDialog( bassBoosterControls * _controls ) : - effectControlDialog( _controls ) + EffectControlDialog( _controls ) { setAutoFillBackground( TRUE ); QPalette pal; diff --git a/plugins/bass_booster/bassbooster_control_dialog.h b/plugins/bass_booster/bassbooster_control_dialog.h index 7a482302f..b1ab28e76 100644 --- a/plugins/bass_booster/bassbooster_control_dialog.h +++ b/plugins/bass_booster/bassbooster_control_dialog.h @@ -25,13 +25,13 @@ #ifndef _BASSBOOSTER_CONTROL_DIALOG_H #define _BASSBOOSTER_CONTROL_DIALOG_H -#include "effect_control_dialog.h" +#include "EffectControlDialog.h" class bassBoosterControls; -class bassBoosterControlDialog : public effectControlDialog +class bassBoosterControlDialog : public EffectControlDialog { public: bassBoosterControlDialog( bassBoosterControls * _controls ); diff --git a/plugins/bass_booster/bassbooster_controls.cpp b/plugins/bass_booster/bassbooster_controls.cpp index 240c857fe..2741eb56f 100644 --- a/plugins/bass_booster/bassbooster_controls.cpp +++ b/plugins/bass_booster/bassbooster_controls.cpp @@ -31,7 +31,7 @@ bassBoosterControls::bassBoosterControls( bassBoosterEffect * _eff ) : - effectControls( _eff ), + EffectControls( _eff ), m_effect( _eff ), m_freqModel( 100.0f, 50.0f, 200.0f, 1.0f, this, tr( "Frequency" ) ), m_gainModel( 1.0f, 0.1f, 5.0f, 0.05f, this, tr( "Gain" ) ), diff --git a/plugins/bass_booster/bassbooster_controls.h b/plugins/bass_booster/bassbooster_controls.h index 28d663c9f..d220d26d4 100644 --- a/plugins/bass_booster/bassbooster_controls.h +++ b/plugins/bass_booster/bassbooster_controls.h @@ -25,7 +25,7 @@ #ifndef _BASSBOOSTER_CONTROLS_H #define _BASSBOOSTER_CONTROLS_H -#include "effect_controls.h" +#include "EffectControls.h" #include "bassbooster_control_dialog.h" #include "knob.h" @@ -33,7 +33,7 @@ class bassBoosterEffect; -class bassBoosterControls : public effectControls +class bassBoosterControls : public EffectControls { Q_OBJECT public: @@ -49,12 +49,12 @@ public: return( "bassboostercontrols" ); } - virtual int getControlCount( void ) + virtual int controlCount( void ) { return( 3 ); } - virtual effectControlDialog * createView( void ) + virtual EffectControlDialog * createView( void ) { return( new bassBoosterControlDialog( this ) ); } @@ -68,9 +68,9 @@ private slots: private: bassBoosterEffect * m_effect; - knobModel m_freqModel; - knobModel m_gainModel; - knobModel m_ratioModel; + FloatModel m_freqModel; + FloatModel m_gainModel; + FloatModel m_ratioModel; friend class bassBoosterControlDialog; diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index 35c939912..d2e468dbb 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -28,11 +28,11 @@ #include "bit_invader.h" #include "engine.h" #include "graph.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "knob.h" #include "led_checkbox.h" #include "note_play_handle.h" -#include "oscillator.h" +#include "Oscillator.h" #include "pixmap_button.h" #include "song_editor.h" #include "templates.h" @@ -44,7 +44,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT bitinvader_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT bitinvader_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "BitInvader", @@ -52,8 +52,8 @@ plugin::descriptor PLUGIN_EXPORT bitinvader_plugin_descriptor = "Customizable wavetable synthesizer" ), "Andreas Brandmaier ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; @@ -134,8 +134,8 @@ sample_t bSynth::nextStringSample( void ) ***********************************************************************/ -bitInvader::bitInvader( instrumentTrack * _channel_track ) : - instrument( _channel_track, &bitinvader_plugin_descriptor ), +bitInvader::bitInvader( InstrumentTrack * _instrument_track ) : + Instrument( _instrument_track, &bitinvader_plugin_descriptor ), m_sampleLength( 128, 8, 128, 1, this, tr( "Samplelength" ) ), m_graph( -1.0f, 1.0f, 128, this ), m_interpolation( FALSE, this ), @@ -295,7 +295,7 @@ void bitInvader::playNote( notePlayHandle * _n, applyRelease( _working_buffer, _n ); - getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); + instrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } @@ -309,7 +309,7 @@ void bitInvader::deleteNotePluginData( notePlayHandle * _n ) -pluginView * bitInvader::instantiateView( QWidget * _parent ) +PluginView * bitInvader::instantiateView( QWidget * _parent ) { return( new bitInvaderView( this, _parent ) ); } @@ -320,9 +320,9 @@ pluginView * bitInvader::instantiateView( QWidget * _parent ) -bitInvaderView::bitInvaderView( instrument * _instrument, +bitInvaderView::bitInvaderView( Instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) + InstrumentView( _instrument, _parent ) { setAutoFillBackground( TRUE ); QPalette pal; @@ -576,9 +576,9 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { - return( new bitInvader( static_cast( _data ) ) ); + return( new bitInvader( static_cast( _data ) ) ); } diff --git a/plugins/bit_invader/bit_invader.h b/plugins/bit_invader/bit_invader.h index 561347120..e0a708b06 100644 --- a/plugins/bit_invader/bit_invader.h +++ b/plugins/bit_invader/bit_invader.h @@ -27,9 +27,8 @@ #ifndef _BIT_INVADER_H #define _BIT_INVADER_H - -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" #include "graph.h" #include "knob.h" #include "pixmap_button.h" @@ -61,11 +60,11 @@ private: } ; -class bitInvader : public instrument +class bitInvader : public Instrument { Q_OBJECT public: - bitInvader(instrumentTrack * _channel_track ); + bitInvader(InstrumentTrack * _instrument_track ); virtual ~bitInvader(); virtual void playNote( notePlayHandle * _n, @@ -84,7 +83,7 @@ public: return( 64 ); } - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); protected slots: void lengthChanged( void ); @@ -94,11 +93,11 @@ protected slots: private: - knobModel m_sampleLength; + FloatModel m_sampleLength; graphModel m_graph; - boolModel m_interpolation; - boolModel m_normalize; + BoolModel m_interpolation; + BoolModel m_normalize; float normalizeFactor; @@ -109,11 +108,11 @@ private: -class bitInvaderView : public instrumentView +class bitInvaderView : public InstrumentView { Q_OBJECT public: - bitInvaderView( instrument * _instrument, + bitInvaderView( Instrument * _instrument, QWidget * _parent ); virtual ~bitInvaderView() {}; diff --git a/plugins/flp_import/CMakeLists.txt b/plugins/flp_import/CMakeLists.txt index 702f49e31..1a2c2c7e4 100644 --- a/plugins/flp_import/CMakeLists.txt +++ b/plugins/flp_import/CMakeLists.txt @@ -2,4 +2,4 @@ INCLUDE(BuildPlugin) INCLUDE_DIRECTORIES(unrtf) -BUILD_PLUGIN(flpimport flp_import.cpp unrtf.cpp flp_import.h) +BUILD_PLUGIN(flpimport FlpImport.cpp unrtf.cpp FlpImport.h) diff --git a/plugins/flp_import/flp_import.cpp b/plugins/flp_import/FlpImport.cpp similarity index 91% rename from plugins/flp_import/flp_import.cpp rename to plugins/flp_import/FlpImport.cpp index 0563b656c..05bff0395 100644 --- a/plugins/flp_import/flp_import.cpp +++ b/plugins/flp_import/FlpImport.cpp @@ -28,7 +28,7 @@ #include #include -#include "flp_import.h" +#include "FlpImport.h" #include "note_play_handle.h" #include "automation_pattern.h" #include "basic_filters.h" @@ -37,21 +37,20 @@ #include "combobox.h" #include "config_mgr.h" #include "debug.h" -#include "effect.h" +#include "Effect.h" #include "engine.h" -#include "fx_mixer.h" +#include "FxMixer.h" #include "group_box.h" -#include "instrument.h" -#include "instrument_track.h" -#include "envelope_and_lfo_parameters.h" +#include "Instrument.h" +#include "InstrumentTrack.h" +#include "EnvelopeAndLfoParameters.h" #include "knob.h" -#include "oscillator.h" +#include "Oscillator.h" #include "pattern.h" -#include "piano.h" -#include "project_journal.h" +#include "Piano.h" +#include "ProjectJournal.h" #include "project_notes.h" #include "song.h" -#include "tempo_sync_knob.h" #include "track_container.h" #include "embed.h" #include "lmmsconfig.h" @@ -67,7 +66,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT flpimport_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT flpimport_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "FLP Import", @@ -75,7 +74,7 @@ plugin::descriptor PLUGIN_EXPORT flpimport_plugin_descriptor = "Filter for importing FL Studio projects into LMMS" ), "Tobias Doerffel ", 0x0100, - plugin::ImportFilter, + Plugin::ImportFilter, NULL, NULL, NULL @@ -305,7 +304,7 @@ struct FL_Automation struct FL_Channel_Envelope { - instrumentSoundShaping::Targets target; + InstrumentSoundShaping::Targets target; float predelay; float attack; float hold; @@ -422,7 +421,7 @@ struct FL_Channel : public FL_Plugin bool sampleReverseStereo; bool sampleUseLoopPoints; - instrument * instrumentPlugin; + Instrument * instrumentPlugin; QList envelopes; @@ -462,7 +461,7 @@ struct FL_Channel : public FL_Plugin filterCut( 10000 ), filterRes( 0.1 ), filterEnabled( false ), - arpDir( arpeggiator::ArpDirUp ), + arpDir( Arpeggiator::ArpDirUp ), arpRange( 0 ), selectedArp( 0 ), arpTime( 100 ), @@ -572,22 +571,22 @@ struct FL_Project -flpImport::flpImport( const QString & _file ) : - importFilter( _file, &flpimport_plugin_descriptor ) +FlpImport::FlpImport( const QString & _file ) : + ImportFilter( _file, &flpimport_plugin_descriptor ) { } -flpImport::~flpImport() +FlpImport::~FlpImport() { } -bool flpImport::tryImport( trackContainer * _tc ) +bool FlpImport::tryImport( trackContainer * _tc ) { const int mappedFilter[] = { @@ -601,14 +600,14 @@ bool flpImport::tryImport( trackContainer * _tc ) basicFilters<>::NumFilters+basicFilters<>::LowPass } ; - const arpeggiator::ArpDirections mappedArpDir[] = + const Arpeggiator::ArpDirections mappedArpDir[] = { - arpeggiator::ArpDirUp, - arpeggiator::ArpDirUp, - arpeggiator::ArpDirDown, - arpeggiator::ArpDirUpAndDown, - arpeggiator::ArpDirUpAndDown, - arpeggiator::ArpDirRandom + Arpeggiator::ArpDirUp, + Arpeggiator::ArpDirUp, + Arpeggiator::ArpDirDown, + Arpeggiator::ArpDirUpAndDown, + Arpeggiator::ArpDirUpAndDown, + Arpeggiator::ArpDirRandom } ; QMap mappedPluginTypes; @@ -677,21 +676,21 @@ bool flpImport::tryImport( trackContainer * _tc ) if( readID() != makeID( 'F', 'L', 'h', 'd' ) ) { - qWarning( "flpImport::tryImport(): not a valid FL project\n" ); + qWarning( "FlpImport::tryImport(): not a valid FL project\n" ); return false; } const int header_len = read32LE(); if( header_len != 6 ) { - qWarning( "flpImport::tryImport(): invalid file format\n" ); + qWarning( "FlpImport::tryImport(): invalid file format\n" ); return false; } const int type = read16LE(); if( type != 0 ) { - qWarning( "flpImport::tryImport(): type %d format is not " + qWarning( "FlpImport::tryImport(): type %d format is not " "supported\n", type ); return false; } @@ -699,7 +698,7 @@ bool flpImport::tryImport( trackContainer * _tc ) p.numChannels = read16LE(); if( p.numChannels < 1 || p.numChannels > 1000 ) { - qWarning( "flpImport::tryImport(): invalid number of channels " + qWarning( "FlpImport::tryImport(): invalid number of channels " "(%d)\n", p.numChannels ); return false; } @@ -707,7 +706,7 @@ bool flpImport::tryImport( trackContainer * _tc ) const int ppq = read16LE(); if( ppq < 0 ) { - qWarning( "flpImport::tryImport(): invalid ppq\n" ); + qWarning( "FlpImport::tryImport(): invalid ppq\n" ); return false; } @@ -726,13 +725,13 @@ bool flpImport::tryImport( trackContainer * _tc ) const int len = read32LE(); if( file().atEnd() ) { - qWarning( "flpImport::tryImport(): unexpected " + qWarning( "FlpImport::tryImport(): unexpected " "end of file\n" ); return false; } if( len < 0 || len >= 0x10000000 ) { - qWarning( "flpImport::tryImport(): invalid " + qWarning( "FlpImport::tryImport(): invalid " "chunk length %d\n", len ); return false; } @@ -763,8 +762,8 @@ bool flpImport::tryImport( trackContainer * _tc ) int cur_channel = -1; - const bool is_journ = engine::getProjectJournal()->isJournalling(); - engine::getProjectJournal()->setJournalling( false ); + const bool is_journ = engine::projectJournal()->isJournalling(); + engine::projectJournal()->setJournalling( false ); while( file().atEnd() == false ) @@ -1200,16 +1199,16 @@ if( p.currentEffectChannel <= NumFxChannels ) switch( cc->envelopes.size() ) { case 1: - e.target = instrumentSoundShaping::Volume; + e.target = InstrumentSoundShaping::Volume; break; case 2: - e.target = instrumentSoundShaping::Cut; + e.target = InstrumentSoundShaping::Cut; break; case 3: - e.target = instrumentSoundShaping::Resonance; + e.target = InstrumentSoundShaping::Resonance; break; default: - e.target = instrumentSoundShaping::NumTargets; + e.target = InstrumentSoundShaping::NumTargets; break; } e.predelay = pi[2] * scaling; @@ -1218,7 +1217,7 @@ if( p.currentEffectChannel <= NumFxChannels ) e.decay = pi[5] * scaling; e.sustain = 1-pi[6] / 128.0f; e.release = pi[7] * scaling; - if( e.target == instrumentSoundShaping::Volume ) + if( e.target == InstrumentSoundShaping::Volume ) { e.amount = pi[1] ? 1 : 0; } @@ -1424,7 +1423,7 @@ else // create BB tracks QList bb_tracks; - QList i_tracks; + QList i_tracks; while( engine::getBBTrackContainer()->numOfBBs() <= p.maxPatterns ) { @@ -1441,10 +1440,10 @@ else } // create instrument-track for each channel - for( QList::iterator it = p.channels.begin(); + for( QList::Iterator it = p.channels.begin(); it != p.channels.end(); ++it ) { - instrumentTrack * t = dynamic_cast( + InstrumentTrack * t = dynamic_cast( track::create( track::InstrumentTrack, engine::getBBTrackContainer() ) ); engine::getBBTrackContainer()->updateAfterTrackAdd(); @@ -1486,7 +1485,7 @@ else t->baseNoteModel()->setValue( it->baseNote ); t->effectChannelModel()->setValue( it->fxChannel ); - instrumentSoundShaping * iss = &t->m_soundShaping; + InstrumentSoundShaping * iss = &t->m_soundShaping; iss->m_filterModel.setValue( it->filterType ); iss->m_filterCutModel.setValue( it->filterCut * ( iss->m_filterCutModel.maxValue() - @@ -1501,10 +1500,10 @@ else for( QList::iterator jt = it->envelopes.begin(); jt != it->envelopes.end(); ++jt ) { - if( jt->target != instrumentSoundShaping::NumTargets ) + if( jt->target != InstrumentSoundShaping::NumTargets ) { - envelopeAndLFOParameters * elp = - iss->m_envLFOParameters[jt->target]; + EnvelopeAndLfoParameters * elp = + iss->m_envLfoParameters[jt->target]; elp->m_predelayModel.setValue( jt->predelay ); elp->m_attackModel.setValue( jt->attack ); @@ -1517,7 +1516,7 @@ else } } - arpeggiator * arp = &t->m_arpeggiator; + Arpeggiator * arp = &t->m_arpeggiator; arp->m_arpDirectionModel.setValue( it->arpDir ); arp->m_arpRangeModel.setValue( it->arpRange ); arp->m_arpModel.setValue( it->selectedArp ); @@ -1526,7 +1525,7 @@ else arp->m_arpEnabledModel.setValue( it->arpEnabled ); // process all dots - for( QList::const_iterator jt = it->dots.begin(); + for( QList::ConstIterator jt = it->dots.begin(); jt != it->dots.end(); ++jt ) { const int pat = *jt / 256; @@ -1547,7 +1546,7 @@ else } // process all notes - for( FL_Channel::noteVector::const_iterator jt = it->notes.begin(); + for( FL_Channel::noteVector::ConstIterator jt = it->notes.begin(); jt != it->notes.end(); ++jt ) { const int pat = jt->first; @@ -1564,11 +1563,11 @@ else } // process automation data - for( QList::const_iterator jt = + for( QList::ConstIterator jt = it->automationData.begin(); jt != it->automationData.end(); ++jt ) { - automatableModel * m = NULL; + AutomatableModel * m = NULL; float value = jt->value; bool scale = false; switch( jt->control ) @@ -1625,13 +1624,13 @@ p->putValue( jt->pos, value, false ); } // process all effects - effectKeyList effKeys; - QVector pluginDescs; - plugin::getDescriptorsOfAvailPlugins( pluginDescs ); - for( QVector::iterator it = pluginDescs.begin(); + EffectKeyList effKeys; + QVector pluginDescs; + Plugin::getDescriptorsOfAvailPlugins( pluginDescs ); + for( QVector::Iterator it = pluginDescs.begin(); it != pluginDescs.end(); ++it ) { - if( it->type != plugin::Effect ) + if( it->type != Plugin::Effect ) { continue; } @@ -1642,13 +1641,13 @@ p->putValue( jt->pos, value, false ); } else { - effKeys << effectKey( &( *it ), it->name ); + effKeys << EffectKey( &( *it ), it->name ); } } for( int fx_ch = 0; fx_ch <= NumFxChannels ; ++fx_ch ) { - fxChannel * ch = engine::getFxMixer()->getEffectChannel( fx_ch ); + FxChannel * ch = engine::fxMixer()->effectChannel( fx_ch ); if( !ch ) { continue; @@ -1662,8 +1661,8 @@ p->putValue( jt->pos, value, false ); ch->m_muteModel.setValue( flch->isMuted ); } - for( QList::const_iterator it = p.effects.begin(); - it != p.effects.end(); ++it ) + for( QList::ConstIterator it = p.effects.begin(); + it != p.effects.end(); ++it ) { QString effName; switch( it->pluginType ) @@ -1710,21 +1709,19 @@ p->putValue( jt->pos, value, false ); { continue; } - effectChain * ec = &engine::getFxMixer()-> - getEffectChannel( it->fxChannel )->m_fxChain; + EffectChain * ec = &engine::fxMixer()-> + effectChannel( it->fxChannel )->m_fxChain; qDebug( "adding %s to %d\n", effName.toUtf8().constData(), it->fxChannel ); - for( effectKeyList::iterator jt = effKeys.begin(); + for( EffectKeyList::Iterator jt = effKeys.begin(); jt != effKeys.end(); ++jt ) { - if( QString( jt->desc->displayName ). - contains( effName ) || + if( QString( jt->desc->displayName ).contains( effName ) || ( jt->desc->sub_plugin_features != NULL && jt->name.contains( effName ) ) ) { qDebug( "instantiate %s\n", jt->desc->name ); - effect * e = effect::instantiate( - jt->desc->name, ec, &( *jt ) ); + ::Effect * e = Effect::instantiate( jt->desc->name, ec, &( *jt ) ); ec->appendEffect( e ); ec->setEnabled( true ); break; @@ -1738,8 +1735,7 @@ p->putValue( jt->pos, value, false ); // process all playlist-items - for( QList::const_iterator it = - p.playListItems.begin(); + for( QList::ConstIterator it = p.playListItems.begin(); it != p.playListItems.end(); ++it ) { if( it->pattern > p.maxPatterns ) @@ -1765,15 +1761,15 @@ p->putValue( jt->pos, value, false ); } // restore journalling settings - engine::getProjectJournal()->setJournalling( is_journ ); + engine::projectJournal()->setJournalling( is_journ ); - return true; + return true; } -void flpImport::processPluginParams( FL_Channel * _ch ) +void FlpImport::processPluginParams( FL_Channel * _ch ) { qDebug( "plugin params for plugin %d (%d bytes): ", _ch->pluginType, _ch->pluginSettingsLength ); @@ -1800,23 +1796,23 @@ void flpImport::processPluginParams( FL_Channel * _ch ) case FL_Plugin::Fruity_3x_Osc: // TripleOscillator loaded { - const oscillator::WaveShapes mapped_3xOsc_Shapes[] = + const Oscillator::WaveShapes mapped_3xOsc_Shapes[] = { - oscillator::SineWave, - oscillator::TriangleWave, - oscillator::SquareWave, - oscillator::SawWave, - oscillator::SquareWave, // square-sin - oscillator::WhiteNoise, - oscillator::UserDefinedWave + Oscillator::SineWave, + Oscillator::TriangleWave, + Oscillator::SquareWave, + Oscillator::SawWave, + Oscillator::SquareWave, // square-sin + Oscillator::WhiteNoise, + Oscillator::UserDefinedWave } ; QDomDocument dd; QDomElement de = dd.createElement( _ch->instrumentPlugin->nodeName() ); - de.setAttribute( "modalgo1", oscillator::SignalMix ); - de.setAttribute( "modalgo2", oscillator::SignalMix ); - int ws = oscillator::UserDefinedWave; + de.setAttribute( "modalgo1", Oscillator::SignalMix ); + de.setAttribute( "modalgo2", Oscillator::SignalMix ); + int ws = Oscillator::UserDefinedWave; for( int i = 0; i < 3; ++i ) { const Sint32 * d = (const Sint32 *) @@ -1838,15 +1834,15 @@ void flpImport::processPluginParams( FL_Channel * _ch ) const int s = mapped_3xOsc_Shapes[d[2]]; de.setAttribute( "wavetype" + is, QString::number( s ) ); - if( s != oscillator::UserDefinedWave ) + if( s != Oscillator::UserDefinedWave ) { ws = s; } } - if( ws == oscillator::UserDefinedWave ) + if( ws == Oscillator::UserDefinedWave ) { de.setAttribute( "wavetype0", - oscillator::SawWave ); + Oscillator::SawWave ); } de.setAttribute( "vol0", QString::number( 100/2 ) ); // now apply the prepared plugin-state @@ -1877,9 +1873,9 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { - return new flpImport( static_cast( _data ) ); + return new FlpImport( static_cast( _data ) ); } } diff --git a/plugins/flp_import/flp_import.h b/plugins/flp_import/FlpImport.h similarity index 80% rename from plugins/flp_import/flp_import.h rename to plugins/flp_import/FlpImport.h index b266df8a1..e096f1301 100644 --- a/plugins/flp_import/flp_import.h +++ b/plugins/flp_import/FlpImport.h @@ -1,8 +1,8 @@ /* - * flp_import.h - support for importing FLP-files + * FlpImport.h - support for importing FLP-files + * + * Copyright (c) 2006-2009 Tobias Doerffel * - * Copyright (c) 2006-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ * */ - #ifndef _FLP_IMPORT_H #define _FLP_IMPORT_H @@ -30,7 +29,7 @@ #include #include -#include "import_filter.h" +#include "ImportFilter.h" #include "note.h" @@ -38,15 +37,15 @@ class instrument; struct FL_Channel; -class flpImport : public importFilter +class FlpImport : public ImportFilter { public: - flpImport( const QString & _file ); - virtual ~flpImport(); + FlpImport( const QString & _file ); + virtual ~FlpImport(); - virtual pluginView * instantiateView( QWidget * ) + virtual PluginView * instantiateView( QWidget * ) { - return( NULL ); + return NULL; } @@ -70,7 +69,7 @@ private: return( value ); } - inline Sint32 read32LE( void ) + inline Sint32 read32LE() { int value = readByte(); value |= readByte() << 8; @@ -78,14 +77,14 @@ private: value |= readByte() << 24; return( value ); } - inline Sint32 read16LE( void ) + inline Sint32 read16LE() { int value = readByte(); value |= readByte() << 8; return( value ); } - inline Sint32 readID( void ) + inline Sint32 readID() { return( read32LE() ); } @@ -99,7 +98,6 @@ private: } } - } ; diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index 4393277f7..f1a251a52 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -28,10 +28,10 @@ #include "kicker.h" #include "engine.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "knob.h" #include "note_play_handle.h" -#include "sweep_oscillator.h" +#include "SweepOscillator.h" #include "embed.cpp" @@ -39,7 +39,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT kicker_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT kicker_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "Kicker", @@ -47,8 +47,8 @@ plugin::descriptor PLUGIN_EXPORT kicker_plugin_descriptor = "versatile kick- & bassdrum-synthesizer" ), "Tobias Doerffel ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; @@ -56,8 +56,8 @@ plugin::descriptor PLUGIN_EXPORT kicker_plugin_descriptor = } -kickerInstrument::kickerInstrument( instrumentTrack * _instrument_track ) : - instrument( _instrument_track, &kicker_plugin_descriptor ), +kickerInstrument::kickerInstrument( InstrumentTrack * _instrument_track ) : + Instrument( _instrument_track, &kicker_plugin_descriptor ), m_startFreqModel( 150.0f, 5.0f, 1000.0f, 1.0f, this, tr( "Start frequency" ) ), m_endFreqModel( 40.0f, 5.0f, 1000.0f, 1.0f, this, tr( "End frequency" ) ), m_decayModel( 120.0f, 5.0f, 1000.0f, 1.0f, this, tr( "Decay" ) ), @@ -101,16 +101,16 @@ void kickerInstrument::loadSettings( const QDomElement & _this ) -QString kickerInstrument::nodeName( void ) const +QString kickerInstrument::nodeName() const { - return( kicker_plugin_descriptor.name ); + return kicker_plugin_descriptor.name; } -//typedef effectLib::foldbackDistortion<> distFX; -typedef effectLib::distortion distFX; -typedef sweepOscillator > sweepOsc; +//typedef effectLib::foldbackDistortion<> DistFX; +typedef effectLib::distortion DistFX; +typedef SweepOscillator > SweepOsc; void kickerInstrument::playNote( notePlayHandle * _n, @@ -122,8 +122,8 @@ void kickerInstrument::playNote( notePlayHandle * _n, if ( tfp == 0 ) { - _n->m_pluginData = new sweepOsc( - distFX( m_distModel.value(), + _n->m_pluginData = new SweepOsc( + DistFX( m_distModel.value(), m_gainModel.value() ) ); } else if( tfp > decfr && !_n->released() ) @@ -131,7 +131,7 @@ void kickerInstrument::playNote( notePlayHandle * _n, _n->noteOff(); } - //const float freq = getInstrumentTrack()->frequency( _n ) / 2; + //const float freq = instrumentTrack()->frequency( _n ) / 2; const float fdiff = m_endFreqModel.value() - m_startFreqModel.value(); /* const fpp_t frames = _n->released() ? tMax( tMin( desiredReleaseFrames() - @@ -144,7 +144,7 @@ void kickerInstrument::playNote( notePlayHandle * _n, const float f2 = m_startFreqModel.value() + (frames+tfp-1)*fdiff/decfr; - sweepOsc * so = static_cast( _n->m_pluginData ); + SweepOsc * so = static_cast( _n->m_pluginData ); so->update( _working_buffer, frames, f1, f2, engine::getMixer()->processingSampleRate() ); @@ -160,7 +160,7 @@ void kickerInstrument::playNote( notePlayHandle * _n, } } - getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); + instrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } @@ -168,15 +168,15 @@ void kickerInstrument::playNote( notePlayHandle * _n, void kickerInstrument::deleteNotePluginData( notePlayHandle * _n ) { - delete static_cast( _n->m_pluginData ); + delete static_cast( _n->m_pluginData ); } -pluginView * kickerInstrument::instantiateView( QWidget * _parent ) +PluginView * kickerInstrument::instantiateView( QWidget * _parent ) { - return( new kickerInstrumentView( this, _parent ) ); + return new kickerInstrumentView( this, _parent ); } @@ -195,9 +195,9 @@ public: -kickerInstrumentView::kickerInstrumentView( instrument * _instrument, +kickerInstrumentView::kickerInstrumentView( Instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) + InstrumentView( _instrument, _parent ) { m_startFreqKnob = new kickerKnob( this ); m_startFreqKnob->setHintText( tr( "Start frequency:" ) + " ", "Hz" ); @@ -236,7 +236,7 @@ kickerInstrumentView::~kickerInstrumentView() -void kickerInstrumentView::modelChanged( void ) +void kickerInstrumentView::modelChanged() { kickerInstrument * k = castModel(); m_startFreqKnob->setModel( &k->m_startFreqModel ); @@ -254,10 +254,9 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { - return( new kickerInstrument( - static_cast( _data ) ) ); + return new kickerInstrument( static_cast( _data ) ); } diff --git a/plugins/kicker/kicker.h b/plugins/kicker/kicker.h index 6cf1de88d..302cc33f5 100644 --- a/plugins/kicker/kicker.h +++ b/plugins/kicker/kicker.h @@ -27,8 +27,8 @@ #define _KICKER_H #include -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" #include "knob.h" @@ -36,10 +36,10 @@ class kickerInstrumentView; class notePlayHandle; -class kickerInstrument : public instrument +class kickerInstrument : public Instrument { public: - kickerInstrument( instrumentTrack * _instrument_track ); + kickerInstrument( InstrumentTrack * _instrument_track ); virtual ~kickerInstrument(); virtual void playNote( notePlayHandle * _n, @@ -57,15 +57,15 @@ public: return( 512 ); } - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); private: - knobModel m_startFreqModel; - knobModel m_endFreqModel; - knobModel m_decayModel; - knobModel m_distModel; - knobModel m_gainModel; + FloatModel m_startFreqModel; + FloatModel m_endFreqModel; + FloatModel m_decayModel; + FloatModel m_distModel; + FloatModel m_gainModel; friend class kickerInstrumentView; @@ -73,11 +73,11 @@ private: -class kickerInstrumentView : public instrumentView +class kickerInstrumentView : public InstrumentView { Q_OBJECT public: - kickerInstrumentView( instrument * _instrument, QWidget * _parent ); + kickerInstrumentView( Instrument * _instrument, QWidget * _parent ); virtual ~kickerInstrumentView(); private: diff --git a/plugins/ladspa_browser/ladspa_browser.cpp b/plugins/ladspa_browser/ladspa_browser.cpp index b83d0b03d..1d6ab26f8 100644 --- a/plugins/ladspa_browser/ladspa_browser.cpp +++ b/plugins/ladspa_browser/ladspa_browser.cpp @@ -3,6 +3,7 @@ * plugins * * Copyright (c) 2006-2008 Danny McRae + * Copyright (c) 2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -44,7 +45,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT ladspabrowser_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT ladspabrowser_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "LADSPA Plugin Browser", @@ -52,17 +53,17 @@ plugin::descriptor PLUGIN_EXPORT ladspabrowser_plugin_descriptor = "List installed LADSPA plugins" ), "Danny McRae ", 0x0100, - plugin::Tool, - new pluginPixmapLoader( "logo" ), + Plugin::Tool, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model * _parent, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model * _parent, void * _data ) { - return( new ladspaBrowser ); + return new ladspaBrowser; } } @@ -70,8 +71,8 @@ plugin * PLUGIN_EXPORT lmms_plugin_main( model * _parent, void * _data ) -ladspaBrowser::ladspaBrowser( void ) : - tool( &ladspabrowser_plugin_descriptor, NULL ) +ladspaBrowser::ladspaBrowser() : + ToolPlugin( &ladspabrowser_plugin_descriptor, NULL ) { } @@ -85,9 +86,9 @@ ladspaBrowser::~ladspaBrowser() -QString ladspaBrowser::nodeName( void ) const +QString ladspaBrowser::nodeName() const { - return( ladspabrowser_plugin_descriptor.name ); + return ladspabrowser_plugin_descriptor.name; } @@ -95,8 +96,8 @@ QString ladspaBrowser::nodeName( void ) const -ladspaBrowserView::ladspaBrowserView( tool * _tool ) : - toolView( _tool ) +ladspaBrowserView::ladspaBrowserView( ToolPlugin * _tool ) : + ToolPluginView( _tool ) { QHBoxLayout * hlayout = new QHBoxLayout( this ); hlayout->setSpacing( 0 ); @@ -219,7 +220,7 @@ QWidget * ladspaBrowserView::createTab( QWidget * _parent, const QString & _txt, SLOT( showPorts( const ladspa_key_t & ) ) ); layout->addWidget( description, 1 ); - return( tab ); + return tab; } diff --git a/plugins/ladspa_browser/ladspa_browser.h b/plugins/ladspa_browser/ladspa_browser.h index 82b340bcd..5d2a9b943 100644 --- a/plugins/ladspa_browser/ladspa_browser.h +++ b/plugins/ladspa_browser/ladspa_browser.h @@ -3,7 +3,8 @@ * plugins * * Copyright (c) 2006-2008 Danny McRae - * + * Copyright (c) 2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,23 +24,21 @@ * */ - #ifndef _LADSPA_BROWSER_H #define _LADSPA_BROWSER_H - #include "ladspa_manager.h" -#include "tool.h" - +#include "ToolPlugin.h" +#include "ToolPluginView.h" class tabBar; -class ladspaBrowserView : public toolView +class ladspaBrowserView : public ToolPluginView { Q_OBJECT public: - ladspaBrowserView( tool * _tool ); + ladspaBrowserView( ToolPlugin * _tool ); virtual ~ladspaBrowserView(); @@ -56,18 +55,18 @@ private: } ; -class ladspaBrowser : public tool +class ladspaBrowser : public ToolPlugin { public: - ladspaBrowser( void ); + ladspaBrowser(); virtual ~ladspaBrowser(); - virtual pluginView * instantiateView( QWidget * ) + virtual PluginView * instantiateView( QWidget * ) { - return( new ladspaBrowserView( this ) ); + return new ladspaBrowserView( this ); } - virtual QString nodeName( void ) const; + virtual QString nodeName() const; } ; diff --git a/plugins/ladspa_effect/CMakeLists.txt b/plugins/ladspa_effect/CMakeLists.txt index 26bce76fe..fe5897787 100644 --- a/plugins/ladspa_effect/CMakeLists.txt +++ b/plugins/ladspa_effect/CMakeLists.txt @@ -21,6 +21,6 @@ ENDIF(WANT_CALF) INCLUDE(BuildPlugin) -BUILD_PLUGIN(ladspaeffect ladspa_effect.cpp ladspa_controls.cpp ladspa_control_dialog.cpp ladspa_subplugin_features.cpp ladspa_effect.h ladspa_controls.h ladspa_control_dialog.h ladspa_subplugin_features.h MOCFILES ladspa_effect.h ladspa_controls.h ladspa_control_dialog.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png) +BUILD_PLUGIN(ladspaeffect LadspaEffect.cpp LadspaControls.cpp LadspaControlDialog.cpp LadspaSubPluginFeatures.cpp LadspaEffect.h LadspaControls.h LadspaControlDialog.h LadspaSubPluginFeatures.h MOCFILES LadspaEffect.h LadspaControls.h LadspaControlDialog.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png) diff --git a/plugins/ladspa_effect/ladspa_control_dialog.cpp b/plugins/ladspa_effect/LadspaControlDialog.cpp similarity index 77% rename from plugins/ladspa_effect/ladspa_control_dialog.cpp rename to plugins/ladspa_effect/LadspaControlDialog.cpp index 35c2b1dd6..d217574cb 100644 --- a/plugins/ladspa_effect/ladspa_control_dialog.cpp +++ b/plugins/ladspa_effect/LadspaControlDialog.cpp @@ -1,9 +1,10 @@ /* - * ladspa_control_dialog.cpp - dialog for displaying and editing control port + * LadspaControlDialog.cpp - dialog for displaying and editing control port * values for LADSPA plugins * * Copyright (c) 2006-2008 Danny McRae - * + * Copyright (c) 2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -27,15 +28,15 @@ #include #include -#include "ladspa_effect.h" -#include "ladspa_control_dialog.h" -#include "ladspa_control_view.h" +#include "LadspaEffect.h" +#include "LadspaControlDialog.h" +#include "LadspaControlView.h" #include "led_checkbox.h" -ladspaControlDialog::ladspaControlDialog( ladspaControls * _ctl ) : - effectControlDialog( _ctl ), +LadspaControlDialog::LadspaControlDialog( LadspaControls * _ctl ) : + EffectControlDialog( _ctl ), m_effectLayout( NULL ), m_stereoLink( NULL ) { @@ -60,14 +61,14 @@ ladspaControlDialog::ladspaControlDialog( ladspaControls * _ctl ) : -ladspaControlDialog::~ladspaControlDialog() +LadspaControlDialog::~LadspaControlDialog() { } -void ladspaControlDialog::updateEffectView( ladspaControls * _ctl ) +void LadspaControlDialog::updateEffectView( LadspaControls * _ctl ) { QList list = findChildren(); for( QList::iterator it = list.begin(); it != list.end(); @@ -108,27 +109,23 @@ void ladspaControlDialog::updateEffectView( ladspaControls * _ctl ) for( control_list_t::iterator it = controls.begin(); it != controls.end(); it++ ) { - if( (*it)->getPort()->proc == proc ) + if( (*it)->port()->proc == proc ) { if( last_port != NONE && - (*it)->getPort()->data_type == - TOGGLED && - !( (*it)->getPort()->data_type == - TOGGLED && + (*it)->port()->data_type == TOGGLED && + !( (*it)->port()->data_type == TOGGLED && last_port == TOGGLED ) ) { ++row; col = 0; } - gl->addWidget( new ladspaControlView( - grouper, *it ), - row, col ); + gl->addWidget( new LadspaControlView( grouper, *it ), row, col ); if( ++col == cols ) { ++row; col = 0; } - last_port = (*it)->getPort()->data_type; + last_port = (*it)->port()->data_type; } } @@ -140,11 +137,11 @@ void ladspaControlDialog::updateEffectView( ladspaControls * _ctl ) m_stereoLink->setModel( &_ctl->m_stereoLinkModel ); } - connect( _ctl, SIGNAL( effectModelChanged( ladspaControls * ) ), - this, SLOT( updateEffectView( ladspaControls * ) ), + connect( _ctl, SIGNAL( effectModelChanged( LadspaControls * ) ), + this, SLOT( updateEffectView( LadspaControls * ) ), Qt::DirectConnection ); } -#include "moc_ladspa_control_dialog.cxx" +#include "moc_LadspaControlDialog.cxx" diff --git a/plugins/ladspa_effect/ladspa_control_dialog.h b/plugins/ladspa_effect/LadspaControlDialog.h similarity index 72% rename from plugins/ladspa_effect/ladspa_control_dialog.h rename to plugins/ladspa_effect/LadspaControlDialog.h index b51dba973..204c7ce6d 100644 --- a/plugins/ladspa_effect/ladspa_control_dialog.h +++ b/plugins/ladspa_effect/LadspaControlDialog.h @@ -1,8 +1,9 @@ /* - * ladspa_control_dialog.h - dialog for displaying and editing control port - * values for LADSPA plugins + * LadspaControlDialog.h - dialog for displaying and editing control port + * values for LADSPA plugins * * Copyright (c) 2006-2008 Danny McRae + * Copyright (c) 2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,24 +27,24 @@ #ifndef _LADSPA_CONTROL_DIALOG_H #define _LADSPA_CONTROL_DIALOG_H -#include "effect_control_dialog.h" +#include "EffectControlDialog.h" class QHBoxLayout; -class ladspaControls; +class LadspaControls; class ledCheckBox; -class ladspaControlDialog : public effectControlDialog +class LadspaControlDialog : public EffectControlDialog { Q_OBJECT public: - ladspaControlDialog( ladspaControls * _ctl ); - ~ladspaControlDialog(); + LadspaControlDialog( LadspaControls * _ctl ); + ~LadspaControlDialog(); private slots: - void updateEffectView( ladspaControls * _ctl ); + void updateEffectView( LadspaControls * _ctl ); private: diff --git a/plugins/ladspa_effect/ladspa_controls.cpp b/plugins/ladspa_effect/LadspaControls.cpp similarity index 72% rename from plugins/ladspa_effect/ladspa_controls.cpp rename to plugins/ladspa_effect/LadspaControls.cpp index 1461d25ba..86d0807b3 100644 --- a/plugins/ladspa_effect/ladspa_controls.cpp +++ b/plugins/ladspa_effect/LadspaControls.cpp @@ -1,7 +1,7 @@ /* - * ladspa_controls.cpp - model for LADSPA-plugin controls + * LadspaControls.cpp - model for LADSPA-plugin controls * - * Copyright (c) 2008 Tobias Doerffel + * Copyright (c) 2008-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -25,15 +25,15 @@ #include -#include "ladspa_effect.h" +#include "LadspaEffect.h" -ladspaControls::ladspaControls( ladspaEffect * _eff ) : - effectControls( _eff ), +LadspaControls::LadspaControls( LadspaEffect * _eff ) : + EffectControls( _eff ), m_effect( _eff ), - m_processors( _eff->getProcessorCount() ), - m_noLink( FALSE ), - m_stereoLinkModel( TRUE, this ) + m_processors( _eff->processorCount() ), + m_noLink( false ), + m_stereoLinkModel( true, this ) { multi_proc_t controls = m_effect->getPortControls(); m_controlCount = controls.count(); @@ -45,12 +45,12 @@ ladspaControls::ladspaControls( ladspaEffect * _eff ) : const bool linked_control = ( m_processors > 1 && proc == 0 ); buffer_data_t last_port = NONE; - for( multi_proc_t::iterator it = controls.begin(); + for( multi_proc_t::Iterator it = controls.begin(); it != controls.end(); it++ ) { if( (*it)->proc == proc ) { - (*it)->control = new ladspaControl( this, *it, + (*it)->control = new LadspaControl( this, *it, linked_control ); last_port = (*it)->data_type; @@ -73,12 +73,12 @@ ladspaControls::ladspaControls( ladspaEffect * _eff ) : // now link all controls if( m_processors > 1 ) { - for( multi_proc_t::iterator it = controls.begin(); + for( multi_proc_t::Iterator it = controls.begin(); it != controls.end(); it++ ) { if( (*it)->proc == 0 ) { - linkPort( ( *it )->control_id, TRUE ); + linkPort( ( *it )->control_id, true ); } } } @@ -87,7 +87,7 @@ ladspaControls::ladspaControls( ladspaEffect * _eff ) : -ladspaControls::~ladspaControls() +LadspaControls::~LadspaControls() { for( ch_cnt_t proc = 0; proc < m_processors; proc++ ) { @@ -99,7 +99,7 @@ ladspaControls::~ladspaControls() -void ladspaControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void LadspaControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) { if( m_processors > 1 ) { @@ -108,7 +108,7 @@ void ladspaControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) multi_proc_t controls = m_effect->getPortControls(); _this.setAttribute( "ports", controls.count() ); - for( multi_proc_t::iterator it = controls.begin(); + for( multi_proc_t::Iterator it = controls.begin(); it != controls.end(); it++ ) { QString n = "port" + QString::number( (*it)->proc ) + @@ -120,7 +120,7 @@ void ladspaControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) -void ladspaControls::loadSettings( const QDomElement & _this ) +void LadspaControls::loadSettings( const QDomElement & _this ) { if( m_processors > 1 ) { @@ -128,7 +128,7 @@ void ladspaControls::loadSettings( const QDomElement & _this ) } multi_proc_t controls = m_effect->getPortControls(); - for( multi_proc_t::iterator it = controls.begin(); + for( multi_proc_t::Iterator it = controls.begin(); it != controls.end(); it++ ) { QString n = "port" + QString::number( (*it)->proc ) + @@ -140,9 +140,9 @@ void ladspaControls::loadSettings( const QDomElement & _this ) -void ladspaControls::linkPort( Uint16 _port, bool _state ) +void LadspaControls::linkPort( Uint16 _port, bool _state ) { - ladspaControl * first = m_controls[0][_port]; + LadspaControl * first = m_controls[0][_port]; if( _state ) { for( ch_cnt_t proc = 1; proc < m_processors; proc++ ) @@ -156,14 +156,14 @@ void ladspaControls::linkPort( Uint16 _port, bool _state ) { first->unlinkControls( m_controls[proc][_port] ); } - m_noLink = TRUE; - m_stereoLinkModel.setValue( FALSE ); + m_noLink = true; + m_stereoLinkModel.setValue( false ); } } -void ladspaControls::updateChannelLinkState( void ) +void LadspaControls::updateChannelLinkState() { if( m_stereoLinkModel.value() ) { @@ -171,7 +171,7 @@ void ladspaControls::updateChannelLinkState( void ) port < m_controlCount / m_processors; port++ ) { - m_controls[0][port]->setLink( TRUE ); + m_controls[0][port]->setLink( true ); } } else if( !m_noLink ) @@ -180,15 +180,15 @@ void ladspaControls::updateChannelLinkState( void ) port < m_controlCount / m_processors; port++ ) { - m_controls[0][port]->setLink( FALSE ); + m_controls[0][port]->setLink( false ); } } else { - m_noLink = FALSE; + m_noLink = false; } } -#include "moc_ladspa_controls.cxx" +#include "moc_LadspaControls.cxx" diff --git a/plugins/ladspa_effect/ladspa_controls.h b/plugins/ladspa_effect/LadspaControls.h similarity index 66% rename from plugins/ladspa_effect/ladspa_controls.h rename to plugins/ladspa_effect/LadspaControls.h index 2c882f919..3e13517a0 100644 --- a/plugins/ladspa_effect/ladspa_controls.h +++ b/plugins/ladspa_effect/LadspaControls.h @@ -25,61 +25,61 @@ #ifndef _LADSPA_CONTROLS_H #define _LADSPA_CONTROLS_H -#include "effect_controls.h" -#include "ladspa_control.h" -#include "ladspa_control_dialog.h" +#include "EffectControls.h" +#include "LadspaControl.h" +#include "LadspaControlDialog.h" -typedef QVector control_list_t; +typedef QVector control_list_t; -class ladspaEffect; +class LadspaEffect; -class ladspaControls : public effectControls +class LadspaControls : public EffectControls { Q_OBJECT public: - ladspaControls( ladspaEffect * _eff ); - virtual ~ladspaControls(); + LadspaControls( LadspaEffect * _eff ); + virtual ~LadspaControls(); - inline int getControlCount( void ) + inline int controlCount() { - return( m_controlCount ); + return m_controlCount; } virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { - return( "ladspacontrols" ); + return "ladspacontrols"; } - virtual effectControlDialog * createView( void ) + virtual EffectControlDialog * createView() { - return( new ladspaControlDialog( this ) ); + return new LadspaControlDialog( this ); } protected slots: - void updateChannelLinkState( void ); + void updateChannelLinkState(); void linkPort( Uint16 _port, bool _state ); private: - ladspaEffect * m_effect; + LadspaEffect * m_effect; ch_cnt_t m_processors; ch_cnt_t m_controlCount; bool m_noLink; - boolModel m_stereoLinkModel; + BoolModel m_stereoLinkModel; QVector m_controls; - friend class ladspaControlDialog; - friend class ladspaEffect; + friend class LadspaControlDialog; + friend class LadspaEffect; signals: - void effectModelChanged( ladspaControls * ); + void effectModelChanged( LadspaControls * ); } ; diff --git a/plugins/ladspa_effect/ladspa_effect.cpp b/plugins/ladspa_effect/LadspaEffect.cpp similarity index 84% rename from plugins/ladspa_effect/ladspa_effect.cpp rename to plugins/ladspa_effect/LadspaEffect.cpp index 4e370d37e..e055d6c16 100644 --- a/plugins/ladspa_effect/ladspa_effect.cpp +++ b/plugins/ladspa_effect/LadspaEffect.cpp @@ -1,5 +1,5 @@ /* - * ladspa_effect.cpp - class for processing LADSPA effects + * LadspaEffect.cpp - class for processing LADSPA effects * * Copyright (c) 2006-2008 Danny McRae * Copyright (c) 2009 Tobias Doerffel @@ -26,15 +26,15 @@ #include -#include "ladspa_effect.h" +#include "LadspaEffect.h" #include "mmp.h" #include "AudioDevice.h" #include "config_mgr.h" #include "ladspa_2_lmms.h" -#include "ladspa_control.h" -#include "ladspa_subplugin_features.h" +#include "LadspaControl.h" +#include "LadspaSubPluginFeatures.h" #include "mixer.h" -#include "effect_chain.h" +#include "EffectChain.h" #include "automation_pattern.h" #include "ControllerConnection.h" @@ -44,7 +44,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT ladspaeffect_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT ladspaeffect_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "LADSPA Effect", @@ -53,21 +53,21 @@ plugin::descriptor PLUGIN_EXPORT ladspaeffect_plugin_descriptor = "inside LMMS." ), "Danny McRae ", 0x0100, - plugin::Effect, - new pluginPixmapLoader( "logo" ), + Plugin::Effect, + new PluginPixmapLoader( "logo" ), NULL, - new ladspaSubPluginFeatures( plugin::Effect ) + new LadspaSubPluginFeatures( Plugin::Effect ) } ; } -ladspaEffect::ladspaEffect( model * _parent, - const descriptor::subPluginFeatures::key * _key ) : - effect( &ladspaeffect_plugin_descriptor, _parent, _key ), +LadspaEffect::LadspaEffect( Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ) : + Effect( &ladspaeffect_plugin_descriptor, _parent, _key ), m_controls( NULL ), m_maxSampleRate( 0 ), - m_key( ladspaSubPluginFeatures::subPluginKeyToLadspaKey( _key ) ) + m_key( LadspaSubPluginFeatures::subPluginKeyToLadspaKey( _key ) ) { ladspa2LMMS * manager = engine::getLADSPAManager(); if( manager->getDescription( m_key ) == NULL ) @@ -94,7 +94,7 @@ ladspaEffect::ladspaEffect( model * _parent, -ladspaEffect::~ladspaEffect() +LadspaEffect::~LadspaEffect() { pluginDestruction(); } @@ -102,12 +102,12 @@ ladspaEffect::~ladspaEffect() -void ladspaEffect::changeSampleRate( void ) +void LadspaEffect::changeSampleRate() { multimediaProject mmp( multimediaProject::EffectSettings ); m_controls->saveState( mmp, mmp.content() ); - ladspaControls * controls = m_controls; + LadspaControls * controls = m_controls; m_controls = NULL; m_pluginMutex.lock(); @@ -131,7 +131,7 @@ void ladspaEffect::changeSampleRate( void ) -bool ladspaEffect::processAudioBuffer( sampleFrame * _buf, +bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) { m_pluginMutex.lock(); @@ -158,7 +158,7 @@ bool ladspaEffect::processAudioBuffer( sampleFrame * _buf, // plugins--would speed things up to use the same buffer for both // LMMS and LADSPA. ch_cnt_t channel = 0; - for( ch_cnt_t proc = 0; proc < getProcessorCount(); ++proc ) + for( ch_cnt_t proc = 0; proc < processorCount(); ++proc ) { for( int port = 0; port < m_portCount; ++port ) { @@ -175,10 +175,8 @@ bool ladspaEffect::processAudioBuffer( sampleFrame * _buf, ++channel; break; case AUDIO_RATE_INPUT: - pp->value = - static_cast( - pp->control->getValue() / - pp->scale ); + pp->value = static_cast( + pp->control->value() / pp->scale ); // This only supports control rate ports, so the audio rates are // treated as though they were control rate by setting the // port buffer to all the same value. @@ -194,10 +192,8 @@ bool ladspaEffect::processAudioBuffer( sampleFrame * _buf, { break; } - pp->value = - static_cast( - pp->control->getValue() / - pp->scale ); + pp->value = static_cast( + pp->control->value() / pp->scale ); pp->buffer[0] = pp->value; break; @@ -212,7 +208,7 @@ bool ladspaEffect::processAudioBuffer( sampleFrame * _buf, } // Process the buffers. - for( ch_cnt_t proc = 0; proc < getProcessorCount(); ++proc ) + for( ch_cnt_t proc = 0; proc < processorCount(); ++proc ) { (m_descriptor->run)( m_handles[proc], frames ); } @@ -220,9 +216,9 @@ bool ladspaEffect::processAudioBuffer( sampleFrame * _buf, // Copy the LADSPA output buffers to the LMMS buffer. double out_sum = 0.0; channel = 0; - const float d = getDryLevel(); - const float w = getWetLevel(); - for( ch_cnt_t proc = 0; proc < getProcessorCount(); ++proc ) + const float d = dryLevel(); + const float w = wetLevel(); + for( ch_cnt_t proc = 0; proc < processorCount(); ++proc ) { for( int port = 0; port < m_portCount; ++port ) { @@ -274,7 +270,7 @@ bool ladspaEffect::processAudioBuffer( sampleFrame * _buf, -void ladspaEffect::setControl( int _control, LADSPA_Data _value ) +void LadspaEffect::setControl( int _control, LADSPA_Data _value ) { if( !isOkay() ) { @@ -286,7 +282,7 @@ void ladspaEffect::setControl( int _control, LADSPA_Data _value ) -void ladspaEffect::pluginInstantiation( void ) +void LadspaEffect::pluginInstantiation() { m_maxSampleRate = maxSamplerate( displayName() ); @@ -300,12 +296,12 @@ void ladspaEffect::pluginInstantiation( void ) // Categorize the ports, and create the buffers. m_portCount = manager->getPortCount( m_key ); - for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++ ) + for( ch_cnt_t proc = 0; proc < processorCount(); proc++ ) { multi_proc_t ports; for( int port = 0; port < m_portCount; port++ ) { - port_desc_t * p = new portDescription; + port_desc_t * p = new PortDescription; p->name = manager->getPortName( m_key, port ); p->proc = proc; @@ -467,7 +463,7 @@ void ladspaEffect::pluginInstantiation( void ) QMessageBox::Ok, QMessageBox::NoButton ); setDontRun( TRUE ); } - for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++ ) + for( ch_cnt_t proc = 0; proc < processorCount(); proc++ ) { LADSPA_Handle effect = manager->instantiate( m_key, m_maxSampleRate ); @@ -483,7 +479,7 @@ void ladspaEffect::pluginInstantiation( void ) } // Connect the ports. - for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++ ) + for( ch_cnt_t proc = 0; proc < processorCount(); proc++ ) { for( int port = 0; port < m_portCount; port++ ) { @@ -503,17 +499,17 @@ void ladspaEffect::pluginInstantiation( void ) } // Activate the processing units. - for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++ ) + for( ch_cnt_t proc = 0; proc < processorCount(); proc++ ) { manager->activate( m_key, m_handles[proc] ); } - m_controls = new ladspaControls( this ); + m_controls = new LadspaControls( this ); } -void ladspaEffect::pluginDestruction( void ) +void LadspaEffect::pluginDestruction() { if( !isOkay() ) { @@ -522,7 +518,7 @@ void ladspaEffect::pluginDestruction( void ) delete m_controls; - for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++ ) + for( ch_cnt_t proc = 0; proc < processorCount(); proc++ ) { ladspa2LMMS * manager = engine::getLADSPAManager(); manager->deactivate( m_key, m_handles[proc] ); @@ -547,7 +543,7 @@ void ladspaEffect::pluginDestruction( void ) static QMap __buggy_plugins; -sample_rate_t ladspaEffect::maxSamplerate( const QString & _name ) +sample_rate_t LadspaEffect::maxSamplerate( const QString & _name ) { if( __buggy_plugins.isEmpty() ) { @@ -571,15 +567,15 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model * _parent, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model * _parent, void * _data ) { - return( new ladspaEffect( _parent, - static_cast( - _data ) ) ); + return new LadspaEffect( _parent, + static_cast( + _data ) ); } } -#include "moc_ladspa_effect.cxx" +#include "moc_LadspaEffect.cxx" diff --git a/plugins/ladspa_effect/ladspa_effect.h b/plugins/ladspa_effect/LadspaEffect.h similarity index 70% rename from plugins/ladspa_effect/ladspa_effect.h rename to plugins/ladspa_effect/LadspaEffect.h index a4ee04a25..52adc0f0d 100644 --- a/plugins/ladspa_effect/ladspa_effect.h +++ b/plugins/ladspa_effect/LadspaEffect.h @@ -1,8 +1,9 @@ /* - * ladspa_effect.h - class for handling LADSPA effect plugins + * LadspaEffect.h - class for handling LADSPA effect plugins * * Copyright (c) 2006-2008 Danny McRae - * + * Copyright (c) 2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -27,53 +28,50 @@ #include -#include "effect.h" -#include "engine.h" -#include "ladspa_base.h" -#include "ladspa_controls.h" -#include "main_window.h" -#include "mixer.h" +#include "Effect.h" +#include "LadspaBase.h" +#include "LadspaControls.h" typedef QVector multi_proc_t; -class ladspaEffect : public effect +class LadspaEffect : public Effect { Q_OBJECT public: - ladspaEffect( model * _parent, - const descriptor::subPluginFeatures::key * _key ); - virtual ~ladspaEffect(); + LadspaEffect( Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ); + virtual ~LadspaEffect(); virtual bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ); void setControl( int _control, LADSPA_Data _data ); - virtual effectControls * getControls( void ) + virtual EffectControls * controls() { - return( m_controls ); + return m_controls; } - inline const multi_proc_t & getPortControls( void ) + inline const multi_proc_t & getPortControls() { - return( m_portControls ); + return m_portControls; } private slots: - void changeSampleRate( void ); + void changeSampleRate(); private: - void pluginInstantiation( void ); - void pluginDestruction( void ); + void pluginInstantiation(); + void pluginDestruction(); static sample_rate_t maxSamplerate( const QString & _name ); QMutex m_pluginMutex; - ladspaControls * m_controls; + LadspaControls * m_controls; sample_rate_t m_maxSampleRate; ladspa_key_t m_key; @@ -84,6 +82,7 @@ private: QVector m_ports; multi_proc_t m_portControls; + } ; #endif diff --git a/plugins/ladspa_effect/ladspa_subplugin_features.cpp b/plugins/ladspa_effect/LadspaSubPluginFeatures.cpp similarity index 84% rename from plugins/ladspa_effect/ladspa_subplugin_features.cpp rename to plugins/ladspa_effect/LadspaSubPluginFeatures.cpp index a4cc93de5..586a4b40d 100644 --- a/plugins/ladspa_effect/ladspa_subplugin_features.cpp +++ b/plugins/ladspa_effect/LadspaSubPluginFeatures.cpp @@ -1,7 +1,7 @@ /* - * ladspa_subplugin_features.cpp - derivation from - * plugin::descriptor::subPluginFeatures for - * hosting LADSPA-plugins + * LadspaSubPluginFeatures.cpp - derivation from + * Plugin::Descriptor::SubPluginFeatures for + * hosting LADSPA-plugins * * Copyright (c) 2006-2007 Danny McRae * Copyright (c) 2006-2009 Tobias Doerffel @@ -25,28 +25,28 @@ * */ -#include "ladspa_subplugin_features.h" #include #include +#include "LadspaSubPluginFeatures.h" #include "AudioDevice.h" #include "engine.h" #include "ladspa_2_lmms.h" -#include "ladspa_base.h" +#include "LadspaBase.h" #include "mixer.h" -ladspaSubPluginFeatures::ladspaSubPluginFeatures( plugin::PluginTypes _type ) : - subPluginFeatures( _type ) +LadspaSubPluginFeatures::LadspaSubPluginFeatures( Plugin::PluginTypes _type ) : + SubPluginFeatures( _type ) { } -void ladspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, - const key * _key ) +void LadspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, + const Key * _key ) { const ladspa_key_t & lkey = subPluginKeyToLadspaKey( _key ); ladspa2LMMS * lm = engine::getLADSPAManager(); @@ -114,25 +114,25 @@ void ladspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, -void ladspaSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc, - keyList & _kl ) +void LadspaSubPluginFeatures::listSubPluginKeys( Plugin::Descriptor * _desc, + KeyList & _kl ) { ladspa2LMMS * lm = engine::getLADSPAManager(); l_sortable_plugin_t plugins; switch( m_type ) { - case plugin::Instrument: + case Plugin::Instrument: plugins = lm->getInstruments(); break; - case plugin::Effect: + case Plugin::Effect: plugins = lm->getValidEffects(); //plugins += lm->getInvalidEffects(); break; - case plugin::Tool: + case Plugin::Tool: plugins = lm->getAnalysisTools(); break; - case plugin::Other: + case Plugin::Other: plugins = lm->getOthers(); break; default: @@ -145,10 +145,7 @@ void ladspaSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc, if( lm->getDescription( ( *it ).second )->inputChannels <= engine::getMixer()->audioDev()->channels() ) { - _kl.push_back( ladspaKeyToSubPluginKey( - _desc, - ( *it ).first, - ( *it ).second ) ); + _kl.push_back( ladspaKeyToSubPluginKey( _desc, ( *it ).first, ( *it ).second ) ); } } } @@ -156,8 +153,8 @@ void ladspaSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc, -ladspa_key_t ladspaSubPluginFeatures::subPluginKeyToLadspaKey( - const key * _key ) +ladspa_key_t LadspaSubPluginFeatures::subPluginKeyToLadspaKey( + const Key * _key ) { QString file = _key->attributes["file"].toLower(); return( ladspa_key_t( file.remove( QRegExp( "\\.so$" ) ). diff --git a/plugins/ladspa_effect/ladspa_subplugin_features.h b/plugins/ladspa_effect/LadspaSubPluginFeatures.h similarity index 63% rename from plugins/ladspa_effect/ladspa_subplugin_features.h rename to plugins/ladspa_effect/LadspaSubPluginFeatures.h index 239763836..d2e0ef594 100644 --- a/plugins/ladspa_effect/ladspa_subplugin_features.h +++ b/plugins/ladspa_effect/LadspaSubPluginFeatures.h @@ -1,11 +1,11 @@ /* - * ladspa_subplugin_features.h - derivation from - * plugin::descriptor::subPluginFeatures for - * hosting LADSPA-plugins + * LadspaSubPluginFeatures.h - derivation from + * Plugin::Descriptor::SubPluginFeatures for + * hosting LADSPA-plugins * * Copyright (c) 2006-2007 Danny McRae - * Copyright (c) 2006-2007 Tobias Doerffel - * + * Copyright (c) 2006-2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -30,21 +30,19 @@ #define _LADSPA_SUBPLUGIN_FEATURES_H #include "ladspa_manager.h" -#include "plugin.h" +#include "Plugin.h" -class ladspaSubPluginFeatures : public plugin::descriptor::subPluginFeatures +class LadspaSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures { public: - ladspaSubPluginFeatures( plugin::PluginTypes _type ); + LadspaSubPluginFeatures( Plugin::PluginTypes _type ); - virtual void fillDescriptionWidget( QWidget * _parent, - const key * _key ); + virtual void fillDescriptionWidget( QWidget * _parent, const Key * _key ); - virtual void listSubPluginKeys( plugin::descriptor * _desc, - keyList & _kl ); + virtual void listSubPluginKeys( Plugin::Descriptor * _desc, KeyList & _kl ); - static ladspa_key_t subPluginKeyToLadspaKey( const key * _key ); + static ladspa_key_t subPluginKeyToLadspaKey( const Key * _key ); } ; diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index 3b290d3c9..00f28353b 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -32,10 +32,10 @@ #include "automatable_button.h" #include "engine.h" #include "instrument_play_handle.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "knob.h" #include "note_play_handle.h" -#include "oscillator.h" +#include "Oscillator.h" #include "pixmap_button.h" #include "templates.h" #include "tooltip.h" @@ -76,7 +76,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT lb302_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT lb302_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "LB302", @@ -84,8 +84,8 @@ plugin::descriptor PLUGIN_EXPORT lb302_plugin_descriptor = "Incomplete monophonic immitation tb303" ), "Paul Giblock ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), NULL, NULL }; @@ -268,8 +268,8 @@ float lb302Filter3Pole::process(const float& samp) // LBSynth // -lb302Synth::lb302Synth( instrumentTrack * _instrumentTrack ) : - instrument( _instrumentTrack, &lb302_plugin_descriptor ), +lb302Synth::lb302Synth( InstrumentTrack * _instrumentTrack ) : + Instrument( _instrumentTrack, &lb302_plugin_descriptor ), vcf_cut_knob( 0.75f, 0.0f, 1.5f, 0.005f, this, tr( "VCF Cutoff Frequency" ) ), vcf_res_knob( 0.75f, 0.0f, 1.25f, 0.005f, this, tr( "VCF Resonance" ) ), vcf_mod_knob( 0.1f, 0.0f, 1.0f, 0.005f, this, tr( "VCF Envelope Mod" ) ), @@ -277,10 +277,10 @@ lb302Synth::lb302Synth( instrumentTrack * _instrumentTrack ) : dist_knob( 0.0f, 0.0f, 1.0f, 0.01f, this, tr( "Distortion" ) ), wave_shape( 0.0f, 0.0f, 7.0f, this, tr( "Waveform" ) ), slide_dec_knob( 0.6f, 0.0f, 1.0f, 0.005f, this, tr( "Slide Decay" ) ), - slideToggle( FALSE, this, tr( "Slide" ) ), - accentToggle( FALSE, this, tr( "Accent" ) ), - deadToggle( FALSE, this, tr( "Dead" ) ), - db24Toggle( FALSE, this, tr( "24dB/oct Filter" ) ) + slideToggle( false, this, tr( "Slide" ) ), + accentToggle( false, this, tr( "Accent" ) ), + deadToggle( false, this, tr( "Dead" ) ), + db24Toggle( false, this, tr( "24dB/oct Filter" ) ) { @@ -353,7 +353,7 @@ lb302Synth::lb302Synth( instrumentTrack * _instrumentTrack ) : current_freq = -1; delete_freq = -1; - instrumentPlayHandle * iph = new instrumentPlayHandle( this ); + InstrumentPlayHandle * iph = new InstrumentPlayHandle( this ); engine::getMixer()->addPlayHandle( iph ); filterChanged(); @@ -403,7 +403,7 @@ void lb302Synth::loadSettings( const QDomElement & _this ) // TODO: Split into one function per knob. envdecay doesn't require // recalcFilter. -void lb302Synth::filterChanged( void ) +void lb302Synth::filterChanged() { fs.cutoff = vcf_cut_knob.value(); fs.reso = vcf_res_knob.value(); @@ -420,7 +420,7 @@ void lb302Synth::filterChanged( void ) } -void lb302Synth::db24Toggled( void ) +void lb302Synth::db24Toggled() { delete vcf; if(db24Toggle.value()) { @@ -434,7 +434,7 @@ void lb302Synth::db24Toggled( void ) -QString lb302Synth::nodeName( void ) const +QString lb302Synth::nodeName() const { return( lb302_plugin_descriptor.name ); } @@ -583,15 +583,15 @@ int lb302Synth::process(sampleFrame *outbuf, const Uint32 size) case SINE: // [-0.5, 0.5] : [-pi, pi] - vco_k = 0.5f * oscillator::sinSample( vco_c ); + vco_k = 0.5f * Oscillator::sinSample( vco_c ); break; case EXPONENTIAL: - vco_k = 0.5 * oscillator::expSample( vco_c ); + vco_k = 0.5 * Oscillator::expSample( vco_c ); break; case WHITE_NOISE: - vco_k = 0.5 * oscillator::noiseSample( vco_c ); + vco_k = 0.5 * Oscillator::noiseSample( vco_c ); break; } @@ -775,7 +775,7 @@ void lb302Synth::play( sampleFrame * _working_buffer ) const fpp_t frames = engine::getMixer()->framesPerPeriod(); process( _working_buffer, frames); - getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, + instrumentTrack()->processAudioBuffer( _working_buffer, frames, NULL ); } @@ -791,14 +791,14 @@ void lb302Synth::deleteNotePluginData( notePlayHandle * _n ) } -pluginView * lb302Synth::instantiateView( QWidget * _parent ) +PluginView * lb302Synth::instantiateView( QWidget * _parent ) { return( new lb302SynthView( this, _parent ) ); } -lb302SynthView::lb302SynthView( instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) +lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) : + InstrumentView( _instrument, _parent ) { // GUI m_vcfCutKnob = new knob( knobBright_26, this ); @@ -940,7 +940,7 @@ lb302SynthView::lb302SynthView( instrument * _instrument, QWidget * _parent ) : m_waveBtnGrp->addButton( exponentialWaveBtn ); m_waveBtnGrp->addButton( whiteNoiseWaveBtn ); - setAutoFillBackground( TRUE ); + setAutoFillBackground( true ); QPalette pal; pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); @@ -953,7 +953,7 @@ lb302SynthView::~lb302SynthView() } -void lb302SynthView::modelChanged( void ) +void lb302SynthView::modelChanged() { lb302Synth * syn = castModel(); @@ -978,11 +978,11 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { return( new lb302Synth( - static_cast( _data ) ) ); + static_cast( _data ) ) ); } diff --git a/plugins/lb302/lb302.h b/plugins/lb302/lb302.h index 289b75b26..6b5d8b7f4 100644 --- a/plugins/lb302/lb302.h +++ b/plugins/lb302/lb302.h @@ -33,8 +33,8 @@ #define _LB302_H_ #include "effect_lib.h" -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" #include "led_checkbox.h" #include "knob.h" #include "mixer.h" @@ -131,11 +131,11 @@ public: }; -class lb302Synth : public instrument +class lb302Synth : public Instrument { Q_OBJECT public: - lb302Synth( instrumentTrack * _channel_track ); + lb302Synth( InstrumentTrack * _instrument_track ); virtual ~lb302Synth(); virtual void play( sampleFrame * _working_buffer ); @@ -154,7 +154,7 @@ public: return 0; //4048; } - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); private: @@ -162,21 +162,21 @@ private: private: - knobModel vcf_cut_knob; - knobModel vcf_res_knob; - knobModel vcf_mod_knob; - knobModel vcf_dec_knob; + FloatModel vcf_cut_knob; + FloatModel vcf_res_knob; + FloatModel vcf_mod_knob; + FloatModel vcf_dec_knob; - knobModel vco_fine_detune_knob; + FloatModel vco_fine_detune_knob; - knobModel dist_knob; - intModel wave_shape; - knobModel slide_dec_knob; + FloatModel dist_knob; + IntModel wave_shape; + FloatModel slide_dec_knob; - boolModel slideToggle; - boolModel accentToggle; - boolModel deadToggle; - boolModel db24Toggle; + BoolModel slideToggle; + BoolModel accentToggle; + BoolModel deadToggle; + BoolModel db24Toggle; public slots: @@ -238,10 +238,10 @@ private: } ; -class lb302SynthView : public instrumentView +class lb302SynthView : public InstrumentView { public: - lb302SynthView( instrument * _instrument, + lb302SynthView( Instrument * _instrument, QWidget * _parent ); virtual ~lb302SynthView(); diff --git a/plugins/lb303/lb303.cpp b/plugins/lb303/lb303.cpp index d0177fc4d..886e6e411 100644 --- a/plugins/lb303/lb303.cpp +++ b/plugins/lb303/lb303.cpp @@ -34,7 +34,7 @@ #include "lb303.h" #include "engine.h" #include "instrument_play_handle.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "knob.h" #include "note_play_handle.h" #include "templates.h" @@ -76,7 +76,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT lb303_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT lb303_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "LB303", @@ -84,8 +84,8 @@ plugin::descriptor PLUGIN_EXPORT lb303_plugin_descriptor = "Incomplete monophonic immitation tb303" ), "Paul Giblock ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), NULL }; @@ -267,8 +267,8 @@ float lb303Filter3Pole::process(const float& samp) // LBSynth // -lb303Synth::lb303Synth( instrumentTrack * _instrumentTrack ) : - instrument( _instrumentTrack, &lb303_plugin_descriptor ), +lb303Synth::lb303Synth( InstrumentTrack * _InstrumentTrack ) : + instrument( _InstrumentTrack, &lb303_plugin_descriptor ), vcf_cut_knob( 0.75f, 0.0f, 1.5f, 0.005f, this, tr( "VCF Cutoff Frequency" ) ), vcf_res_knob( 0.75f, 0.0f, 1.25f, 0.005f, this, tr( "VCF Resonance" ) ), vcf_mod_knob( 0.1f, 0.0f, 1.0f, 0.005f, this, tr( "VCF Envelope Mod" ) ), @@ -713,7 +713,7 @@ void lb303Synth::play( sampleFrame * _working_buffer ) const fpp_t frames = engine::getMixer()->framesPerPeriod(); process( _working_buffer, frames); - getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, + instrumentTrack()->processAudioBuffer( _working_buffer, frames, NULL ); } @@ -729,14 +729,14 @@ void lb303Synth::deleteNotePluginData( notePlayHandle * _n ) } -pluginView * lb303Synth::instantiateView( QWidget * _parent ) +PluginView * lb303Synth::instantiateView( QWidget * _parent ) { return( new lb303SynthView( this, _parent ) ); } -lb303SynthView::lb303SynthView( instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) +lb303SynthView::lb303SynthView( Instrument * _instrument, QWidget * _parent ) : + InstrumentView( _instrument, _parent ) { // GUI m_vcfCutKnob = new knob( knobBright_26, this ); @@ -830,11 +830,11 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { return( new lb303Synth( - static_cast( _data ) ) ); + static_cast( _data ) ) ); } diff --git a/plugins/lb303/lb303.h b/plugins/lb303/lb303.h index 1b215d9d7..f10e3b093 100644 --- a/plugins/lb303/lb303.h +++ b/plugins/lb303/lb303.h @@ -33,8 +33,8 @@ #define _LB303_H_ #include "effect_lib.h" -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" #include "led_checkbox.h" #include "knob.h" #include "mixer.h" @@ -132,11 +132,11 @@ public: }; -class lb303Synth : public instrument +class lb303Synth : public Instrument { Q_OBJECT public: - lb303Synth( instrumentTrack * _channel_track ); + lb303Synth( InstrumentTrack * _instrument_track ); virtual ~lb303Synth(); virtual void play( sampleFrame * _working_buffer ); @@ -155,7 +155,7 @@ public: return 0; //4048; } - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); private: @@ -163,21 +163,21 @@ private: private: - knobModel vcf_cut_knob; - knobModel vcf_res_knob; - knobModel vcf_mod_knob; - knobModel vcf_dec_knob; + FloatModel vcf_cut_knob; + FloatModel vcf_res_knob; + FloatModel vcf_mod_knob; + FloatModel vcf_dec_knob; - knobModel vco_fine_detune_knob; + FloatModel vco_fine_detune_knob; - knobModel dist_knob; - knobModel wave_knob; - knobModel slide_dec_knob; + FloatModel dist_knob; + FloatModel wave_knob; + FloatModel slide_dec_knob; - boolModel slideToggle; - boolModel accentToggle; - boolModel deadToggle; - boolModel db24Toggle; + BoolModel slideToggle; + BoolModel accentToggle; + BoolModel deadToggle; + BoolModel db24Toggle; public slots: @@ -239,10 +239,10 @@ private: } ; -class lb303SynthView : public instrumentView +class lb303SynthView : public InstrumentView { public: - lb303SynthView( instrument * _instrument, + lb303SynthView( Instrument * _instrument, QWidget * _parent ); virtual ~lb303SynthView(); diff --git a/plugins/midi_import/CMakeLists.txt b/plugins/midi_import/CMakeLists.txt index dad8e6f3c..1255f0835 100644 --- a/plugins/midi_import/CMakeLists.txt +++ b/plugins/midi_import/CMakeLists.txt @@ -1,6 +1,6 @@ INCLUDE(BuildPlugin) -BUILD_PLUGIN(midiimport midi_import.cpp midi_import.h +BUILD_PLUGIN(midiimport MidiImport.cpp MidiImport.h portsmf/allegro.cpp portsmf/allegro.h portsmf/allegrosmfwr.cpp portsmf/allegrord.cpp portsmf/allegrowr.cpp portsmf/allegrosmfrd.cpp portsmf/mfmidi.cpp portsmf/mfmidi.h portsmf/strparse.cpp diff --git a/plugins/midi_import/midi_import.cpp b/plugins/midi_import/MidiImport.cpp similarity index 80% rename from plugins/midi_import/midi_import.cpp rename to plugins/midi_import/MidiImport.cpp index ed3f3c35a..7caba07ae 100644 --- a/plugins/midi_import/midi_import.cpp +++ b/plugins/midi_import/MidiImport.cpp @@ -1,5 +1,5 @@ /* - * midi_import.cpp - support for importing MIDI-files + * MidiImport.cpp - support for importing MIDI files * * Copyright (c) 2005-2009 Tobias Doerffel * @@ -29,15 +29,15 @@ #include #include -#include "midi_import.h" +#include "MidiImport.h" #include "track_container.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "automation_track.h" #include "automation_pattern.h" #include "config_mgr.h" #include "pattern.h" -#include "instrument.h" -#include "main_window.h" +#include "Instrument.h" +#include "MainWindow.h" #include "debug.h" #include "embed.h" #include "song.h" @@ -53,7 +53,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT midiimport_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT midiimport_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "MIDI Import", @@ -61,7 +61,7 @@ plugin::descriptor PLUGIN_EXPORT midiimport_plugin_descriptor = "Filter for importing MIDI-files into LMMS" ), "Tobias Doerffel ", 0x0100, - plugin::ImportFilter, + Plugin::ImportFilter, NULL, NULL, NULL @@ -70,8 +70,8 @@ plugin::descriptor PLUGIN_EXPORT midiimport_plugin_descriptor = } -midiImport::midiImport( const QString & _file ) : - importFilter( _file, &midiimport_plugin_descriptor ), +MidiImport::MidiImport( const QString & _file ) : + ImportFilter( _file, &midiimport_plugin_descriptor ), m_events(), m_timingDivision( 0 ) { @@ -80,25 +80,25 @@ midiImport::midiImport( const QString & _file ) : -midiImport::~midiImport() +MidiImport::~MidiImport() { } -bool midiImport::tryImport( trackContainer * _tc ) +bool MidiImport::tryImport( trackContainer * _tc ) { - if( openFile() == FALSE ) + if( openFile() == false ) { - return( FALSE ); + return false; } #ifdef LMMS_HAVE_FLUIDSYNTH if( engine::hasGUI() && configManager::inst()->defaultSoundfont().isEmpty() ) { - QMessageBox::information( engine::getMainWindow(), + QMessageBox::information( engine::mainWindow(), tr( "Setup incomplete" ), tr( "You do not have set up a default soundfont in " "the settings dialog (Edit->Settings). " @@ -110,7 +110,7 @@ bool midiImport::tryImport( trackContainer * _tc ) #else if( engine::hasGUI() ) { - QMessageBox::information( engine::getMainWindow(), + QMessageBox::information( engine::mainWindow(), tr( "Setup incomplete" ), tr( "You did not compile LMMS with support for " "SoundFont2 player, which is used to add default " @@ -123,17 +123,17 @@ bool midiImport::tryImport( trackContainer * _tc ) switch( readID() ) { case makeID( 'M', 'T', 'h', 'd' ): - printf( "midiImport::tryImport(): found MThd\n"); - return( readSMF( _tc ) ); + printf( "MidiImport::tryImport(): found MThd\n"); + return readSMF( _tc ); case makeID( 'R', 'I', 'F', 'F' ): - printf( "midiImport::tryImport(): found RIFF\n"); - return( readRIFF( _tc ) ); + printf( "MidiImport::tryImport(): found RIFF\n"); + return readRIFF( _tc ); default: - printf( "midiImport::tryImport(): not a Standard MIDI " + printf( "MidiImport::tryImport(): not a Standard MIDI " "file\n" ); - return( FALSE ); + return false; } } @@ -173,7 +173,7 @@ public: } - smfMidiCC & putValue( midiTime time, automatableModel * objModel, float value ) + smfMidiCC & putValue( midiTime time, AutomatableModel * objModel, float value ) { if( !ap || time > lastPos + DefaultTicksPerTact ) { @@ -208,9 +208,9 @@ public: lastEnd( 0 ) { } - instrumentTrack * it; + InstrumentTrack * it; pattern * p; - instrument * it_inst; + Instrument * it_inst; bool isSF2; bool hasNotes; midiTime lastEnd; @@ -218,7 +218,7 @@ public: smfMidiChannel * create( trackContainer * _tc ) { if( !it ) { - it = dynamic_cast( + it = dynamic_cast( track::create( track::InstrumentTrack, _tc ) ); #ifdef LMMS_HAVE_FLUIDSYNTH @@ -228,8 +228,8 @@ public: { isSF2 = true; it_inst->loadFile( configManager::inst()->defaultSoundfont() ); - it_inst->getChildModel( "bank" )->setValue( 0 ); - it_inst->getChildModel( "patch" )->setValue( 0 ); + it_inst->childModel( "bank" )->setValue( 0 ); + it_inst->childModel( "patch" )->setValue( 0 ); } else { @@ -262,14 +262,14 @@ public: }; -bool midiImport::readSMF( trackContainer * _tc ) +bool MidiImport::readSMF( trackContainer * _tc ) { QString filename = file().fileName(); closeFile(); const int preTrackSteps = 2; QProgressDialog pd( trackContainer::tr( "Importing MIDI-file..." ), - trackContainer::tr( "Cancel" ), 0, preTrackSteps, engine::getMainWindow() ); + trackContainer::tr( "Cancel" ), 0, preTrackSteps, engine::mainWindow() ); pd.setWindowTitle( trackContainer::tr( "Please wait..." ) ); pd.setWindowModality(Qt::WindowModal); pd.setMinimumDuration( 0 ); @@ -286,7 +286,7 @@ bool midiImport::readSMF( trackContainer * _tc ) smfMidiCC ccs[129]; smfMidiChannel chs[256]; - meterModel & timeSigMM = engine::getSong()->getTimeSigModel(); + MeterModel & timeSigMM = engine::getSong()->getTimeSigModel(); automationPattern * timeSigNumeratorPat = automationPattern::globalAutomationPattern( &timeSigMM.numeratorModel() ); automationPattern * timeSigDenominatorPat = @@ -399,8 +399,8 @@ bool midiImport::readSMF( trackContainer * _tc ) long prog = evt->get_integer_value(); if( ch->isSF2 ) { - ch->it_inst->getChildModel( "bank" )->setValue( 0 ); - ch->it_inst->getChildModel( "patch" )->setValue( prog ); + ch->it_inst->childModel( "bank" )->setValue( 0 ); + ch->it_inst->childModel( "patch" )->setValue( prog ); } else { const QString num = QString::number( prog ); @@ -432,14 +432,14 @@ bool midiImport::readSMF( trackContainer * _tc ) if( ccid <= 128 ) { double cc = evt->get_real_value(); - automatableModel * objModel = NULL; + AutomatableModel * objModel = NULL; switch( ccid ) { case 0: if( ch->isSF2 && ch->it_inst ) { - objModel = ch->it_inst->getChildModel( "bank" ); + objModel = ch->it_inst->childModel( "bank" ); printf("BANK SELECT %f %d\n", cc, (int)(cc*127.0)); cc *= 127.0f; } @@ -503,54 +503,55 @@ bool midiImport::readSMF( trackContainer * _tc ) -bool midiImport::readRIFF( trackContainer * _tc ) +bool MidiImport::readRIFF( trackContainer * _tc ) { - // skip file length + // skip file length skip( 4 ); - // check file type ("RMID" = RIFF MIDI) - if( readID() != makeID( 'R', 'M', 'I', 'D' ) ) + // check file type ("RMID" = RIFF MIDI) + if( readID() != makeID( 'R', 'M', 'I', 'D' ) ) { invalid_format: - printf( "midiImport::readRIFF(): invalid file format\n" ); - return( FALSE ); - } - // search for "data" chunk - while( 1 ) + qWarning( "MidiImport::readRIFF(): invalid file format" ); + return false; + } + + // search for "data" chunk + while( 1 ) { - int id = readID(); - int len = read32LE(); - if( file().atEnd() ) + const int id = readID(); + const int len = read32LE(); + if( file().atEnd() ) { data_not_found: - printf( "midiImport::readRIFF(): data chunk not " - "found\n" ); - return( FALSE ); - } - if( id == makeID( 'd', 'a', 't', 'a' ) ) + qWarning( "MidiImport::readRIFF(): data chunk not found" ); + return false; + } + if( id == makeID( 'd', 'a', 't', 'a' ) ) { - break; + break; } - if( len < 0 ) + if( len < 0 ) { - goto data_not_found; + goto data_not_found; } - skip( ( len + 1 ) & ~1 ); - } - // the "data" chunk must contain data in SMF format - if( readID() != makeID( 'M', 'T', 'h', 'd' ) ) - { - goto invalid_format; + skip( ( len + 1 ) & ~1 ); } - return( readSMF( _tc ) ); + + // the "data" chunk must contain data in SMF format + if( readID() != makeID( 'M', 'T', 'h', 'd' ) ) + { + goto invalid_format; + } + return readSMF( _tc ); } -void midiImport::error( void ) +void MidiImport::error() { - printf( "midiImport::readTrack(): invalid MIDI data (offset %#x)\n", + printf( "MidiImport::readTrack(): invalid MIDI data (offset %#x)\n", (unsigned int) file().pos() ); } @@ -560,9 +561,9 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { - return( new midiImport( static_cast( _data ) ) ); + return new MidiImport( static_cast( _data ) ); } diff --git a/plugins/midi_import/midi_import.h b/plugins/midi_import/MidiImport.h similarity index 88% rename from plugins/midi_import/midi_import.h rename to plugins/midi_import/MidiImport.h index d3a41d559..a6dd4dce2 100644 --- a/plugins/midi_import/midi_import.h +++ b/plugins/midi_import/MidiImport.h @@ -1,8 +1,8 @@ /* - * midi_import.h - support for importing MIDI-files + * MidiImport.h - support for importing MIDI-files + * + * Copyright (c) 2005-2009 Tobias Doerffel * - * Copyright (c) 2005-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ * */ - #ifndef _MIDI_IMPORT_H #define _MIDI_IMPORT_H @@ -31,16 +30,16 @@ #include #include "midi.h" -#include "import_filter.h" +#include "ImportFilter.h" -class midiImport : public importFilter +class MidiImport : public ImportFilter { public: - midiImport( const QString & _file ); - virtual ~midiImport(); + MidiImport( const QString & _file ); + virtual ~MidiImport(); - virtual pluginView * instantiateView( QWidget * ) + virtual PluginView * instantiateView( QWidget * ) { return( NULL ); } diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index a373a8faf..9d0c0df0c 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -31,10 +31,10 @@ #include "engine.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "knob.h" #include "note_play_handle.h" -#include "oscillator.h" +#include "Oscillator.h" #include "pixmap_button.h" #include "templates.h" #include "tooltip.h" @@ -45,7 +45,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT organic_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT organic_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "Organic", @@ -53,8 +53,8 @@ plugin::descriptor PLUGIN_EXPORT organic_plugin_descriptor = "Additive Synthesizer for organ-like sounds" ), "Andreas Brandmaier ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; @@ -73,18 +73,18 @@ QPixmap * organicInstrumentView::s_artwork = NULL; ***********************************************************************/ -organicInstrument::organicInstrument( instrumentTrack * _instrument_track ) : - instrument( _instrument_track, &organic_plugin_descriptor ), - m_modulationAlgo( oscillator::SignalMix ), +organicInstrument::organicInstrument( InstrumentTrack * _instrument_track ) : + Instrument( _instrument_track, &organic_plugin_descriptor ), + m_modulationAlgo( Oscillator::SignalMix ), m_fx1Model( 0.0f, 0.0f, 0.99f, 0.01f , this, tr( "Distortion" ) ), m_volModel( 100.0f, 0.0f, 200.0f, 1.0f, this, tr( "Volume" ) ) { m_numOscillators = 8; - m_osc = new oscillatorObject*[ m_numOscillators ]; + m_osc = new OscillatorObject*[ m_numOscillators ]; for (int i=0; i < m_numOscillators; i++) { - m_osc[i] = new oscillatorObject( this, i ); + m_osc[i] = new OscillatorObject( this, i ); m_osc[i]->m_numOscillators = m_numOscillators; // Connect events @@ -174,7 +174,7 @@ void organicInstrument::loadSettings( const QDomElement & _this ) } -QString organicInstrument::nodeName( void ) const +QString organicInstrument::nodeName() const { return( organic_plugin_descriptor.name ); } @@ -187,8 +187,8 @@ void organicInstrument::playNote( notePlayHandle * _n, { if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) { - oscillator * oscs_l[m_numOscillators]; - oscillator * oscs_r[m_numOscillators]; + Oscillator * oscs_l[m_numOscillators]; + Oscillator * oscs_r[m_numOscillators]; for( Sint8 i = m_numOscillators - 1; i >= 0; --i ) { @@ -205,7 +205,7 @@ void organicInstrument::playNote( notePlayHandle * _n, if( i == m_numOscillators - 1 ) { // create left oscillator - oscs_l[i] = new oscillator( + oscs_l[i] = new Oscillator( &m_osc[i]->m_waveShape, &m_modulationAlgo, _n->frequency(), @@ -213,7 +213,7 @@ void organicInstrument::playNote( notePlayHandle * _n, m_osc[i]->m_phaseOffsetLeft, m_osc[i]->m_volumeLeft ); // create right oscillator - oscs_r[i] = new oscillator( + oscs_r[i] = new Oscillator( &m_osc[i]->m_waveShape, &m_modulationAlgo, _n->frequency(), @@ -224,7 +224,7 @@ void organicInstrument::playNote( notePlayHandle * _n, else { // create left oscillator - oscs_l[i] = new oscillator( + oscs_l[i] = new Oscillator( &m_osc[i]->m_waveShape, &m_modulationAlgo, _n->frequency(), @@ -233,7 +233,7 @@ void organicInstrument::playNote( notePlayHandle * _n, m_osc[i]->m_volumeLeft, oscs_l[i + 1] ); // create right oscillator - oscs_r[i] = new oscillator( + oscs_r[i] = new Oscillator( &m_osc[i]->m_waveShape, &m_modulationAlgo, _n->frequency(), @@ -251,9 +251,8 @@ void organicInstrument::playNote( notePlayHandle * _n, static_cast( _n->m_pluginData )->oscRight = oscs_r[0]; } - oscillator * osc_l = static_cast( _n->m_pluginData )->oscLeft; - oscillator * osc_r = static_cast( _n->m_pluginData - )->oscRight; + Oscillator * osc_l = static_cast( _n->m_pluginData )->oscLeft; + Oscillator * osc_r = static_cast( _n->m_pluginData)->oscRight; const fpp_t frames = _n->framesLeftForCurrentPeriod(); @@ -276,7 +275,7 @@ void organicInstrument::playNote( notePlayHandle * _n, // -- -- - getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); + instrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } @@ -284,9 +283,9 @@ void organicInstrument::playNote( notePlayHandle * _n, void organicInstrument::deleteNotePluginData( notePlayHandle * _n ) { - delete static_cast( static_cast( + delete static_cast( static_cast( _n->m_pluginData )->oscLeft ); - delete static_cast( static_cast( + delete static_cast( static_cast( _n->m_pluginData )->oscRight ); delete static_cast( _n->m_pluginData ); } @@ -314,7 +313,7 @@ float inline organicInstrument::waveshape(float in, float amount) -void organicInstrument::randomiseSettings( void ) +void organicInstrument::randomiseSettings() { for( int i = 0; i < m_numOscillators; i++ ) @@ -333,7 +332,7 @@ void organicInstrument::randomiseSettings( void ) -void organicInstrument::updateAllDetuning( void ) +void organicInstrument::updateAllDetuning() { for( int i = 0; i < m_numOscillators; ++i ) { @@ -353,7 +352,7 @@ int organicInstrument::intRand( int min, int max ) } -pluginView * organicInstrument::instantiateView( QWidget * _parent ) +PluginView * organicInstrument::instantiateView( QWidget * _parent ) { return( new organicInstrumentView( this, _parent ) ); } @@ -374,9 +373,9 @@ public: -organicInstrumentView::organicInstrumentView( instrument * _instrument, +organicInstrumentView::organicInstrumentView( Instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) + InstrumentView( _instrument, _parent ) { organicInstrument * oi = castModel(); @@ -428,7 +427,7 @@ organicInstrumentView::~organicInstrumentView() } -void organicInstrumentView::modelChanged( void ) +void organicInstrumentView::modelChanged() { organicInstrument * oi = castModel(); const float y=91.3; @@ -443,7 +442,7 @@ void organicInstrumentView::modelChanged( void ) // TODO: Delete existing oscKnobs if they exist - m_oscKnobs = new oscillatorKnobs[ m_numOscillators ]; + m_oscKnobs = new OscillatorKnobs[ m_numOscillators ]; // Create knobs, now that we know how many to make for( int i = 0; i < m_numOscillators; ++i ) @@ -476,7 +475,7 @@ void organicInstrumentView::modelChanged( void ) + " ", " " + tr( "cents" ) ); - m_oscKnobs[i] = oscillatorKnobs( volKnob, oscKnob, panKnob, detuneKnob ); + m_oscKnobs[i] = OscillatorKnobs( volKnob, oscKnob, panKnob, detuneKnob ); // Attach to models m_oscKnobs[i].m_volKnob->setModel( @@ -493,9 +492,9 @@ void organicInstrumentView::modelChanged( void ) -oscillatorObject::oscillatorObject( model * _parent, int _index ) : - model( _parent ), - m_waveShape( oscillator::SineWave, 0, oscillator::NumWaveShapes-1, this ), +OscillatorObject::OscillatorObject( Model * _parent, int _index ) : + Model( _parent ), + m_waveShape( Oscillator::SineWave, 0, Oscillator::NumWaveShapes-1, this ), m_oscModel( 0.0f, 0.0f, 5.0f, 1.0f, this, tr( "Osc %1 waveform" ).arg( _index + 1 ) ), m_volModel( 100.0f, 0.0f, 100.0f, 1.0f, @@ -510,24 +509,24 @@ oscillatorObject::oscillatorObject( model * _parent, int _index ) : -oscillatorObject::~oscillatorObject() +OscillatorObject::~OscillatorObject() { } -void oscillatorObject::oscButtonChanged( void ) +void OscillatorObject::oscButtonChanged() { - static oscillator::WaveShapes shapes[] = + static Oscillator::WaveShapes shapes[] = { - oscillator::SineWave, - oscillator::SawWave, - oscillator::SquareWave, - oscillator::TriangleWave, - oscillator::MoogSawWave, - oscillator::ExponentialWave + Oscillator::SineWave, + Oscillator::SawWave, + Oscillator::SquareWave, + Oscillator::TriangleWave, + Oscillator::MoogSawWave, + Oscillator::ExponentialWave } ; m_waveShape.setValue( shapes[(int)roundf( m_oscModel.value() )] ); @@ -537,7 +536,7 @@ void oscillatorObject::oscButtonChanged( void ) -void oscillatorObject::updateVolume( void ) +void OscillatorObject::updateVolume() { m_volumeLeft = ( 1.0f - m_panModel.value() / (float)PanningRight ) * m_volModel.value() / m_numOscillators / 100.0f; @@ -548,7 +547,7 @@ void oscillatorObject::updateVolume( void ) -void oscillatorObject::updateDetuning( void ) +void OscillatorObject::updateDetuning() { m_detuningLeft = powf( 2.0f, m_harmonic + (float)m_detuneModel.value() / 100.0f ) / @@ -565,9 +564,9 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { - return( new organicInstrument( static_cast( _data ) ) ); + return( new organicInstrument( static_cast( _data ) ) ); } diff --git a/plugins/organic/organic.h b/plugins/organic/organic.h index 23e93a540..58e58445b 100644 --- a/plugins/organic/organic.h +++ b/plugins/organic/organic.h @@ -26,11 +26,10 @@ #ifndef _ORGANIC_H #define _ORGANIC_H - -#include "instrument.h" -#include "instrument_view.h" -#include "oscillator.h" -#include "automatable_model.h" +#include "Instrument.h" +#include "InstrumentView.h" +#include "Oscillator.h" +#include "AutomatableModel.h" class QPixmap; @@ -39,16 +38,16 @@ class notePlayHandle; class pixmapButton; -class oscillatorObject : public model +class OscillatorObject : public Model { Q_OBJECT private: int m_numOscillators; - intModel m_waveShape; - floatModel m_oscModel; - floatModel m_volModel; - floatModel m_panModel; - floatModel m_detuneModel; + IntModel m_waveShape; + FloatModel m_oscModel; + FloatModel m_volModel; + FloatModel m_panModel; + FloatModel m_detuneModel; float m_harmonic; float m_volumeLeft; @@ -60,8 +59,8 @@ private: float m_phaseOffsetLeft; float m_phaseOffsetRight; - oscillatorObject( model * _parent, int _index ); - virtual ~oscillatorObject(); + OscillatorObject( Model * _parent, int _index ); + virtual ~OscillatorObject(); friend class organicInstrument; friend class organicInstrumentView; @@ -75,11 +74,11 @@ private slots: } ; -class organicInstrument : public instrument +class organicInstrument : public Instrument { Q_OBJECT public: - organicInstrument( instrumentTrack * _instrument_track ); + organicInstrument( InstrumentTrack * _instrument_track ); virtual ~organicInstrument(); virtual void playNote( notePlayHandle * _n, @@ -111,20 +110,20 @@ private: int m_numOscillators; - oscillatorObject ** m_osc; + OscillatorObject ** m_osc; struct oscPtr { - oscillator * oscLeft; - oscillator * oscRight; + Oscillator * oscLeft; + Oscillator * oscRight; } ; - const intModel m_modulationAlgo; + const IntModel m_modulationAlgo; - floatModel m_fx1Model; - floatModel m_volModel; + FloatModel m_fx1Model; + FloatModel m_volModel; - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); private slots: void updateAllDetuning( void ); @@ -133,19 +132,19 @@ private slots: } ; -class organicInstrumentView : public instrumentView +class organicInstrumentView : public InstrumentView { Q_OBJECT public: - organicInstrumentView( instrument * _instrument, QWidget * _parent ); + organicInstrumentView( Instrument * _instrument, QWidget * _parent ); virtual ~organicInstrumentView(); private: virtual void modelChanged( void ); - struct oscillatorKnobs + struct OscillatorKnobs { - oscillatorKnobs( knob * v, + OscillatorKnobs( knob * v, knob * o, knob * p, knob * dt ) : @@ -155,7 +154,7 @@ private: m_detuneKnob( dt ) { } - oscillatorKnobs() + OscillatorKnobs() { } @@ -165,7 +164,7 @@ private: knob * m_detuneKnob; } ; - oscillatorKnobs * m_oscKnobs; + OscillatorKnobs * m_oscKnobs; knob * m_fx1Knob; knob * m_volKnob; diff --git a/plugins/papu/papu_instrument.cpp b/plugins/papu/papu_instrument.cpp index b5c87b795..1ab5012cb 100644 --- a/plugins/papu/papu_instrument.cpp +++ b/plugins/papu/papu_instrument.cpp @@ -29,7 +29,7 @@ #include "Basic_Gb_Apu.h" #include "papu_instrument.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "knob.h" #include "note_play_handle.h" #include "pixmap_button.h" @@ -40,7 +40,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT papu_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT papu_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "FreeBoy", @@ -49,16 +49,16 @@ plugin::descriptor PLUGIN_EXPORT papu_plugin_descriptor = "Attila Herman " "Csaba Hruska ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), NULL } ; } -papuInstrument::papuInstrument( instrumentTrack * _instrument_track ) : - instrument( _instrument_track, &papu_plugin_descriptor ), +papuInstrument::papuInstrument( InstrumentTrack * _instrument_track ) : + Instrument( _instrument_track, &papu_plugin_descriptor ), m_ch1SweepTimeModel( 4.0f, 0.0f, 7.0f, 1.0f, this, tr( "Sweep time" ) ), m_ch1SweepDirModel( false, this, tr( "Sweep direction" ) ), @@ -404,7 +404,7 @@ void papuInstrument::playNote( notePlayHandle * _n, } framesleft -= count; } - getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); + instrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } @@ -417,7 +417,7 @@ void papuInstrument::deleteNotePluginData( notePlayHandle * _n ) -pluginView * papuInstrument::instantiateView( QWidget * _parent ) +PluginView * papuInstrument::instantiateView( QWidget * _parent ) { return( new papuInstrumentView( this, _parent ) ); } @@ -442,9 +442,9 @@ public: -papuInstrumentView::papuInstrumentView( instrument * _instrument, +papuInstrumentView::papuInstrumentView( Instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) + InstrumentView( _instrument, _parent ) { setAutoFillBackground( true ); @@ -733,10 +733,10 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { return( new papuInstrument( - static_cast( _data ) ) ); + static_cast( _data ) ) ); } diff --git a/plugins/papu/papu_instrument.h b/plugins/papu/papu_instrument.h index 6e34cfaf6..0c0626adf 100644 --- a/plugins/papu/papu_instrument.h +++ b/plugins/papu/papu_instrument.h @@ -1,5 +1,5 @@ /* - * papu_instrument.h - GameBoy papu based instrument + * papu_Instrument.h - GameBoy papu based instrument * * Copyright (c) 2008 * Csaba Hruska @@ -27,8 +27,8 @@ #define _PAPU_H #include -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" #include "knob.h" #include "graph.h" @@ -36,12 +36,12 @@ class papuInstrumentView; class notePlayHandle; class pixmapButton; -class papuInstrument : public instrument +class papuInstrument : public Instrument { Q_OBJECT public: - papuInstrument( instrumentTrack * _instrument_track ); + papuInstrument( InstrumentTrack * _instrument_track ); virtual ~papuInstrument(); virtual void playNote( notePlayHandle * _n, @@ -56,7 +56,7 @@ public: virtual f_cnt_t desiredReleaseFrames( void ) const; - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); /*public slots: @@ -64,41 +64,41 @@ public: void updateKnobToolTip( void );*/ private: - knobModel m_ch1SweepTimeModel; - boolModel m_ch1SweepDirModel; - knobModel m_ch1SweepRtShiftModel; - knobModel m_ch1WavePatternDutyModel; - knobModel m_ch1VolumeModel; - boolModel m_ch1VolSweepDirModel; - knobModel m_ch1SweepStepLengthModel; + FloatModel m_ch1SweepTimeModel; + BoolModel m_ch1SweepDirModel; + FloatModel m_ch1SweepRtShiftModel; + FloatModel m_ch1WavePatternDutyModel; + FloatModel m_ch1VolumeModel; + BoolModel m_ch1VolSweepDirModel; + FloatModel m_ch1SweepStepLengthModel; - knobModel m_ch2WavePatternDutyModel; - knobModel m_ch2VolumeModel; - boolModel m_ch2VolSweepDirModel; - knobModel m_ch2SweepStepLengthModel; + FloatModel m_ch2WavePatternDutyModel; + FloatModel m_ch2VolumeModel; + BoolModel m_ch2VolSweepDirModel; + FloatModel m_ch2SweepStepLengthModel; - boolModel m_ch3OnModel; - knobModel m_ch3VolumeModel; + BoolModel m_ch3OnModel; + FloatModel m_ch3VolumeModel; - knobModel m_ch4VolumeModel; - boolModel m_ch4VolSweepDirModel; - knobModel m_ch4SweepStepLengthModel; - knobModel m_ch4ShiftClockFreqModel; - boolModel m_ch4ShiftRegWidthModel; - knobModel m_ch4FreqDivRatioModel; + FloatModel m_ch4VolumeModel; + BoolModel m_ch4VolSweepDirModel; + FloatModel m_ch4SweepStepLengthModel; + FloatModel m_ch4ShiftClockFreqModel; + BoolModel m_ch4ShiftRegWidthModel; + FloatModel m_ch4FreqDivRatioModel; - knobModel m_so1VolumeModel; - knobModel m_so2VolumeModel; - boolModel m_ch1So1Model; - boolModel m_ch2So1Model; - boolModel m_ch3So1Model; - boolModel m_ch4So1Model; - boolModel m_ch1So2Model; - boolModel m_ch2So2Model; - boolModel m_ch3So2Model; - boolModel m_ch4So2Model; - knobModel m_trebleModel; - knobModel m_bassModel; + FloatModel m_so1VolumeModel; + FloatModel m_so2VolumeModel; + BoolModel m_ch1So1Model; + BoolModel m_ch2So1Model; + BoolModel m_ch3So1Model; + BoolModel m_ch4So1Model; + BoolModel m_ch1So2Model; + BoolModel m_ch2So2Model; + BoolModel m_ch3So2Model; + BoolModel m_ch4So2Model; + FloatModel m_trebleModel; + FloatModel m_bassModel; graphModel m_graphModel; @@ -106,11 +106,11 @@ private: } ; -class papuInstrumentView : public instrumentView +class papuInstrumentView : public InstrumentView { Q_OBJECT public: - papuInstrumentView( instrument * _instrument, QWidget * _parent ); + papuInstrumentView( Instrument * _instrument, QWidget * _parent ); virtual ~papuInstrumentView(); private: diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index 518d54ffa..2d628a326 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -32,7 +32,7 @@ #include "endian_handling.h" #include "engine.h" #include "gui_templates.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "note_play_handle.h" #include "pixmap_button.h" #include "song.h" @@ -47,7 +47,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT patman_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT patman_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "PatMan", @@ -55,17 +55,17 @@ plugin::descriptor PLUGIN_EXPORT patman_plugin_descriptor = "GUS-compatible patch instrument" ), "Javier Serrano Polo ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), "pat", NULL } ; // necessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { - return( new patmanInstrument( static_cast( _data ) ) ); + return new patmanInstrument( static_cast( _data ) ); } } @@ -73,8 +73,8 @@ plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) -patmanInstrument::patmanInstrument( instrumentTrack * _instrument_track ) : - instrument( _instrument_track, &patman_plugin_descriptor ), +patmanInstrument::patmanInstrument( InstrumentTrack * _instrument_track ) : + Instrument( _instrument_track, &patman_plugin_descriptor ), m_patchFile( QString::null ), m_loopedModel( true, this ), m_tunedModel( true, this ) @@ -151,7 +151,7 @@ void patmanInstrument::playNote( notePlayHandle * _n, play_freq, m_loopedModel.value() ) ) { applyRelease( _working_buffer, _n ); - getInstrumentTrack()->processAudioBuffer( _working_buffer, + instrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } } @@ -180,12 +180,12 @@ void patmanInstrument::setFile( const QString & _patch_file, bool _rename ) // is current instrument-track-name equal to previous-filename?? if( _rename && - ( getInstrumentTrack()->name() == + ( instrumentTrack()->name() == QFileInfo( m_patchFile ).fileName() || m_patchFile == "" ) ) { // then set it to new one - getInstrumentTrack()->setName( QFileInfo( _patch_file + instrumentTrack()->setName( QFileInfo( _patch_file ).fileName() ); } // else we don't touch the instrument-track-name, because the user @@ -423,9 +423,9 @@ void patmanInstrument::selectSample( notePlayHandle * _n ) -pluginView * patmanInstrument::instantiateView( QWidget * _parent ) +PluginView * patmanInstrument::instantiateView( QWidget * _parent ) { - return( new patmanView( this, _parent ) ); + return( new PatmanView( this, _parent ) ); } @@ -437,8 +437,8 @@ pluginView * patmanInstrument::instantiateView( QWidget * _parent ) -patmanView::patmanView( instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ), +PatmanView::PatmanView( Instrument * _instrument, QWidget * _parent ) : + InstrumentView( _instrument, _parent ), m_pi( NULL ) { setAutoFillBackground( TRUE ); @@ -500,14 +500,14 @@ patmanView::patmanView( instrument * _instrument, QWidget * _parent ) : -patmanView::~patmanView() +PatmanView::~PatmanView() { } -void patmanView::openFile( void ) +void PatmanView::openFile( void ) { QFileDialog ofd( NULL, tr( "Open patch file" ) ); ofd.setFileMode( QFileDialog::ExistingFiles ); @@ -559,7 +559,7 @@ void patmanView::openFile( void ) -void patmanView::updateFilename( void ) +void PatmanView::updateFilename( void ) { m_displayFilename = ""; Uint16 idx = m_pi->m_patchFile.length(); @@ -586,7 +586,7 @@ void patmanView::updateFilename( void ) -void patmanView::dragEnterEvent( QDragEnterEvent * _dee ) +void PatmanView::dragEnterEvent( QDragEnterEvent * _dee ) { if( _dee->mimeData()->hasFormat( stringPairDrag::mimeType() ) ) { @@ -610,7 +610,7 @@ void patmanView::dragEnterEvent( QDragEnterEvent * _dee ) -void patmanView::dropEvent( QDropEvent * _de ) +void PatmanView::dropEvent( QDropEvent * _de ) { QString type = stringPairDrag::decodeKey( _de ); QString value = stringPairDrag::decodeValue( _de ); @@ -627,7 +627,7 @@ void patmanView::dropEvent( QDropEvent * _de ) -void patmanView::paintEvent( QPaintEvent * ) +void PatmanView::paintEvent( QPaintEvent * ) { QPainter p( this ); @@ -640,7 +640,7 @@ void patmanView::paintEvent( QPaintEvent * ) -void patmanView::modelChanged( void ) +void PatmanView::modelChanged( void ) { m_pi = castModel(); m_loopButton->setModel( &m_pi->m_loopedModel ); diff --git a/plugins/patman/patman.h b/plugins/patman/patman.h index 3d38b0d5c..863562292 100644 --- a/plugins/patman/patman.h +++ b/plugins/patman/patman.h @@ -26,11 +26,10 @@ #ifndef _PATMAN_H_ #define _PATMAN_H_ - -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" #include "sample_buffer.h" -#include "automatable_model.h" +#include "AutomatableModel.h" class pixmapButton; @@ -46,11 +45,11 @@ class pixmapButton; #define MODES_CLAMPED ( 1 << 7 ) -class patmanInstrument : public instrument +class patmanInstrument : public Instrument { Q_OBJECT public: - patmanInstrument( instrumentTrack * _track ); + patmanInstrument( InstrumentTrack * _track ); virtual ~patmanInstrument(); virtual void playNote( notePlayHandle * _n, @@ -70,7 +69,7 @@ public: return( 128 ); } - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); public slots: @@ -87,8 +86,8 @@ private: QString m_patchFile; QVector m_patchSamples; - boolModel m_loopedModel; - boolModel m_tunedModel; + BoolModel m_loopedModel; + BoolModel m_tunedModel; enum LoadErrors @@ -107,7 +106,7 @@ private: void selectSample( notePlayHandle * _n ); - friend class patmanView; + friend class PatmanView; signals: void fileChanged( void ); @@ -116,12 +115,12 @@ signals: -class patmanView : public instrumentView +class PatmanView : public InstrumentView { Q_OBJECT public: - patmanView( instrument * _instrument, QWidget * _parent ); - virtual ~patmanView(); + PatmanView( Instrument * _instrument, QWidget * _parent ); + virtual ~PatmanView(); public slots: diff --git a/plugins/peak_controller_effect/peak_controller_effect.cpp b/plugins/peak_controller_effect/peak_controller_effect.cpp index ce96a3e9d..c3db27432 100644 --- a/plugins/peak_controller_effect/peak_controller_effect.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect.cpp @@ -34,7 +34,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT peakcontrollereffect_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT peakcontrollereffect_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "Peak Controller", @@ -42,25 +42,24 @@ plugin::descriptor PLUGIN_EXPORT peakcontrollereffect_plugin_descriptor = "Plugin for controlling knobs with sound peaks" ), "Paul Giblock ", 0x0100, - plugin::Effect, - new pluginPixmapLoader( "logo" ), + Plugin::Effect, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; } -// We have to keep a list of all the peakController effects so that we can save -// an peakEffect-ID to the project. This ID is referenced in the peakController -// settings and is used to set the peakControllerEffect pointer upon load +// We have to keep a list of all the PeakController effects so that we can save +// an peakEffect-ID to the project. This ID is referenced in the PeakController +// settings and is used to set the PeakControllerEffect pointer upon load -//QVector peakControllerEffect::s_effects; +//QVector PeakControllerEffect::s_effects; -peakControllerEffect::peakControllerEffect( - model * _parent, - const descriptor::subPluginFeatures::key * _key ) : - effect( &peakcontrollereffect_plugin_descriptor, _parent, _key ), - m_effectId( ++PeakController::s_lastEffectId ), +PeakControllerEffect::PeakControllerEffect( + Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ) : + Effect( &peakcontrollereffect_plugin_descriptor, _parent, _key ), m_peakControls( this ), m_autoController( NULL ) { @@ -72,7 +71,7 @@ peakControllerEffect::peakControllerEffect( -peakControllerEffect::~peakControllerEffect() +PeakControllerEffect::~PeakControllerEffect() { int idx = PeakController::s_effects.indexOf( this ); if( idx >= 0 ) @@ -83,10 +82,10 @@ peakControllerEffect::~peakControllerEffect() -bool peakControllerEffect::processAudioBuffer( sampleFrame * _buf, +bool PeakControllerEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) { - peakControllerEffectControls & c = m_peakControls; + PeakControllerEffectControls & c = m_peakControls; // This appears to be used for determining whether or not to continue processing // audio with this effect @@ -126,11 +125,11 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model * _parent, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model * _parent, void * _data ) { - return( new peakControllerEffect( _parent, - static_cast( - _data ) ) ); + return new PeakControllerEffect( _parent, + static_cast( + _data ) ); } } diff --git a/plugins/peak_controller_effect/peak_controller_effect.h b/plugins/peak_controller_effect/peak_controller_effect.h index c1a9217fe..86dd216b9 100644 --- a/plugins/peak_controller_effect/peak_controller_effect.h +++ b/plugins/peak_controller_effect/peak_controller_effect.h @@ -1,5 +1,5 @@ /* - * peak_controller_effect.h - PeakController effect plugin + * peak_controller_Effect.h - PeakController effect plugin * * Copyright (c) 2008 Paul Giblock * @@ -26,29 +26,24 @@ #ifndef _PEAK_CONTROLLER_EFFECT_H #define _PEAK_CONTROLLER_EFFECT_H -#include - -#include "effect.h" -#include "effect_lib.h" -#include "engine.h" -#include "main_window.h" +#include "Effect.h" #include "peak_controller_effect_controls.h" -class peakControllerEffect : public effect +class PeakControllerEffect : public Effect { public: - peakControllerEffect( model * parent, - const descriptor::subPluginFeatures::key * _key ); - virtual ~peakControllerEffect(); + PeakControllerEffect( Model * parent, + const Descriptor::SubPluginFeatures::Key * _key ); + virtual ~PeakControllerEffect(); virtual bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ); - virtual effectControls * getControls( void ) + virtual EffectControls * controls() { return &m_peakControls; } - float lastSample( void ) + float lastSample() { return m_lastSample; } @@ -56,15 +51,14 @@ public: int m_effectId; private: - peakControllerEffectControls m_peakControls; - - friend class peakControllerEffectControls; + PeakControllerEffectControls m_peakControls; float m_lastSample; Controller * m_autoController; + + friend class PeakControllerEffectControls; + } ; - - #endif diff --git a/plugins/peak_controller_effect/peak_controller_effect_control_dialog.cpp b/plugins/peak_controller_effect/peak_controller_effect_control_dialog.cpp index 3ca1f483a..6372e2339 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_control_dialog.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect_control_dialog.cpp @@ -1,5 +1,6 @@ /* - * stereomatrix_control_dialog.cpp - control dialog for stereoMatrix-effect + * peak_controller_effect_control_dialog.cpp - control dialog for + * PeakControllerEffect * * Copyright (c) 2008 Paul Giblock * @@ -30,14 +31,13 @@ #include "peak_controller_effect_control_dialog.h" #include "peak_controller_effect_controls.h" #include "knob.h" -#include "tempo_sync_knob.h" #include "led_checkbox.h" #include "embed.h" -peakControllerEffectControlDialog::peakControllerEffectControlDialog( - peakControllerEffectControls * _controls ) : - effectControlDialog( _controls ) +PeakControllerEffectControlDialog::PeakControllerEffectControlDialog( + PeakControllerEffectControls * _controls ) : + EffectControlDialog( _controls ) { setAutoFillBackground( TRUE ); QPalette pal; @@ -61,7 +61,7 @@ peakControllerEffectControlDialog::peakControllerEffectControlDialog( m_amountKnob->setModel( &_controls->m_amountModel ); m_amountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" ); - m_decayKnob = new tempoSyncKnob( knobBright_26, this ); + m_decayKnob = new knob( knobBright_26, this ); m_decayKnob->setLabel( tr( "DECAY" ) ); m_decayKnob->setModel( &_controls->m_decayModel ); m_decayKnob->setHintText( tr( "Release decay (not implemented):" ) + " ", "" ); diff --git a/plugins/peak_controller_effect/peak_controller_effect_control_dialog.h b/plugins/peak_controller_effect/peak_controller_effect_control_dialog.h index a1c56db51..095c17828 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_control_dialog.h +++ b/plugins/peak_controller_effect/peak_controller_effect_control_dialog.h @@ -1,5 +1,6 @@ /* - * stereomatrix_control_dialog.h - control dialog for stereoMatrix-effect + * peak_controller_EffectControlDialog.h - control dialog for + * peakControllerEffect * * Copyright (c) 2008 Paul Giblock * @@ -25,26 +26,26 @@ #ifndef _PEAK_CONTROLLER_EFFECT_CONTROL_DIALOG_H #define _PEAK_CONTROLLER_EFFECT_CONTROL_DIALOG_H -#include "effect_control_dialog.h" +#include "EffectControlDialog.h" -class peakControllerEffectControls; +class PeakControllerEffectControls; class knob; -class tempoSyncKnob; class ledCheckBox; -class peakControllerEffectControlDialog : public effectControlDialog +class PeakControllerEffectControlDialog : public EffectControlDialog { public: - peakControllerEffectControlDialog( peakControllerEffectControls * _controls ); - virtual ~peakControllerEffectControlDialog() + PeakControllerEffectControlDialog( + PeakControllerEffectControls * _controls ); + virtual ~PeakControllerEffectControlDialog() { } protected: knob * m_baseKnob; knob * m_amountKnob; - tempoSyncKnob * m_decayKnob; + knob * m_decayKnob; ledCheckBox * m_muteLed; }; diff --git a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp index 11e49c13b..c10c46cfd 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp @@ -1,5 +1,5 @@ /* - * stereomatrix_controls.cpp - controls for stereoMatrix-effect + * peak_controller_effect_controls.cpp - controls for PeakController effect * * Copyright (c) 2008 Paul Giblock * @@ -30,20 +30,20 @@ #include "peak_controller_effect.h" -peakControllerEffectControls:: -peakControllerEffectControls( peakControllerEffect * _eff ) : - effectControls( _eff ), +PeakControllerEffectControls:: +PeakControllerEffectControls( PeakControllerEffect * _eff ) : + EffectControls( _eff ), m_effect( _eff ), m_baseModel( 0.5, 0.0, 1.0, 0.001, this, tr( "Base value" ) ), m_amountModel( 1.0, -1.0, 1.0, 0.005, this, tr( "Modulation amount" ) ), - m_decayModel( 0.1, 0.01, 5.0, 0.0001, 20000.0, this, tr( "Release decay" ) ), + m_decayModel( 0.1, 0.01, 5.0, 0.0001, this, tr( "Release decay" ) ), m_muteModel( FALSE, this, tr( "Mute output" ) ) { } -void peakControllerEffectControls::loadSettings( const QDomElement & _this ) +void PeakControllerEffectControls::loadSettings( const QDomElement & _this ) { m_baseModel.setValue( _this.attribute( "base" ).toFloat() ); m_amountModel.setValue( _this.attribute( "amount" ).toFloat() ); @@ -66,7 +66,7 @@ void peakControllerEffectControls::loadSettings( const QDomElement & _this ) -void peakControllerEffectControls::saveSettings( QDomDocument & _doc, +void PeakControllerEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) { _this.setAttribute( "base", m_baseModel.value() ); diff --git a/plugins/peak_controller_effect/peak_controller_effect_controls.h b/plugins/peak_controller_effect/peak_controller_effect_controls.h index 1a9e0b70f..36eabf690 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_controls.h +++ b/plugins/peak_controller_effect/peak_controller_effect_controls.h @@ -1,5 +1,5 @@ /* - * stereomatrix_controls.h - controls for stereoMatrix-effect + * peak_controller_EffectControls.h - controls for peakController effect * * Copyright (c) 2008 Paul Giblock * @@ -25,49 +25,48 @@ #ifndef _PEAK_CONTROLLER_EFFECT_CONTROLS_H #define _PEAK_CONTROLLER_EFFECT_CONTROLS_H -#include "effect_controls.h" +#include "EffectControls.h" #include "peak_controller_effect_control_dialog.h" #include "knob.h" -class peakControllerEffect; +class PeakControllerEffect; -class peakControllerEffectControls : public effectControls +class PeakControllerEffectControls : public EffectControls { Q_OBJECT public: - peakControllerEffectControls( peakControllerEffect( * _eff ) ); - virtual ~peakControllerEffectControls() + PeakControllerEffectControls( PeakControllerEffect * _eff ); + virtual ~PeakControllerEffectControls() { } virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { return( "peakcontrollereffectcontrols" ); } - virtual int getControlCount( void ) + virtual int controlCount() { return( 1 ); } - - virtual effectControlDialog * createView( void ) + virtual EffectControlDialog * createView() { - return new peakControllerEffectControlDialog( this ); + return new PeakControllerEffectControlDialog( this ); } private: - peakControllerEffect * m_effect; + PeakControllerEffect * m_effect; - floatModel m_baseModel; - floatModel m_amountModel; - tempoSyncKnobModel m_decayModel; - boolModel m_muteModel; - - friend class peakControllerEffectControlDialog; - friend class peakControllerEffect; + FloatModel m_baseModel; + FloatModel m_amountModel; + FloatModel m_decayModel; + BoolModel m_muteModel; + + friend class PeakControllerEffectControlDialog; + friend class PeakControllerEffect; } ; diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 01afdf724..58ca83355 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -32,13 +32,12 @@ #include "sf2_player.h" #include "engine.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "instrument_play_handle.h" #include "note_play_handle.h" #include "knob.h" #include "song.h" -#include "main_window.h" #include "patches_dialog.h" #include "tooltip.h" #include "lcd_spinbox.h" @@ -49,7 +48,7 @@ extern "C" { -plugin::descriptor sf2player_plugin_descriptor = +Plugin::Descriptor sf2player_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "Sf2 Player", @@ -57,8 +56,8 @@ plugin::descriptor sf2player_plugin_descriptor = "Player for SoundFont files" ), "Paul Giblock ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), "sf2", NULL } ; @@ -82,8 +81,8 @@ QMutex sf2Instrument::s_fontsMutex; -sf2Instrument::sf2Instrument( instrumentTrack * _instrument_track ) : - instrument( _instrument_track, &sf2player_plugin_descriptor ), +sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) : + Instrument( _instrument_track, &sf2player_plugin_descriptor ), m_srcState( NULL ), m_font( NULL ), m_fontId( 0 ), @@ -126,7 +125,7 @@ sf2Instrument::sf2Instrument( instrumentTrack * _instrument_track ) : // everytime we load a new soundfont. m_synth = new_fluid_synth( m_settings ); - instrumentPlayHandle * iph = new instrumentPlayHandle( this ); + InstrumentPlayHandle * iph = new InstrumentPlayHandle( this ); engine::getMixer()->addPlayHandle( iph ); //loadFile( configManager::inst()->defaultSoundfont() ); @@ -190,7 +189,7 @@ sf2Instrument::sf2Instrument( instrumentTrack * _instrument_track ) : sf2Instrument::~sf2Instrument() { - engine::getMixer()->removePlayHandles( getInstrumentTrack() ); + engine::getMixer()->removePlayHandles( instrumentTrack() ); freeFont(); delete_fluid_synth( m_synth ); delete_fluid_settings( m_settings ); @@ -270,7 +269,7 @@ void sf2Instrument::loadFile( const QString & _file ) -automatableModel * sf2Instrument::getChildModel( const QString & _modelName ) +AutomatableModel * sf2Instrument::childModel( const QString & _modelName ) { if( _modelName == "bank" ) { @@ -674,9 +673,9 @@ void sf2Instrument::play( sampleFrame * _working_buffer ) const fpp_t frames = engine::getMixer()->framesPerPeriod(); m_synthMutex.lock(); - if( m_lastMidiPitch != getInstrumentTrack()->midiPitch() ) + if( m_lastMidiPitch != instrumentTrack()->midiPitch() ) { - m_lastMidiPitch = getInstrumentTrack()->midiPitch(); + m_lastMidiPitch = instrumentTrack()->midiPitch(); fluid_synth_pitch_bend( m_synth, m_channel, m_lastMidiPitch ); } @@ -721,7 +720,7 @@ void sf2Instrument::play( sampleFrame * _working_buffer ) } m_synthMutex.unlock(); - getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, + instrumentTrack()->processAudioBuffer( _working_buffer, frames, NULL ); } @@ -749,7 +748,7 @@ void sf2Instrument::deleteNotePluginData( notePlayHandle * _n ) -pluginView * sf2Instrument::instantiateView( QWidget * _parent ) +PluginView * sf2Instrument::instantiateView( QWidget * _parent ) { return new sf2InstrumentView( this, _parent ); } @@ -772,9 +771,9 @@ public: -sf2InstrumentView::sf2InstrumentView( instrument * _instrument, +sf2InstrumentView::sf2InstrumentView( Instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) + InstrumentView( _instrument, _parent ) { // QVBoxLayout * vl = new QVBoxLayout( this ); // QHBoxLayout * hl = new QHBoxLayout(); @@ -1091,7 +1090,7 @@ void sf2InstrumentView::showPatchDialog() patchesDialog pd( this ); - pd.setup( k->m_synth, 1, k->getInstrumentTrack()->name(), + pd.setup( k->m_synth, 1, k->instrumentTrack()->name(), &k->m_bankNum, &k->m_patchNum, m_patchLabel ); pd.exec(); @@ -1103,10 +1102,9 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * lmms_plugin_main( model *, void * _data ) +Plugin * lmms_plugin_main( Model *, void * _data ) { - return( new sf2Instrument( - static_cast( _data ) ) ); + return new sf2Instrument( static_cast( _data ) ); } diff --git a/plugins/sf2_player/sf2_player.h b/plugins/sf2_player/sf2_player.h index ee5b4bd60..1c1ef2764 100644 --- a/plugins/sf2_player/sf2_player.h +++ b/plugins/sf2_player/sf2_player.h @@ -29,9 +29,9 @@ #include -#include "instrument.h" +#include "Instrument.h" #include "pixmap_button.h" -#include "instrument_view.h" +#include "InstrumentView.h" #include "knob.h" #include "lcd_spinbox.h" #include "led_checkbox.h" @@ -46,14 +46,14 @@ class patchesDialog; class QLabel; -class sf2Instrument : public instrument +class sf2Instrument : public Instrument { Q_OBJECT mapPropertyFromModel(int,getBank,setBank,m_bankNum); mapPropertyFromModel(int,getPatch,setPatch,m_patchNum); public: - sf2Instrument( instrumentTrack * _instrument_track ); + sf2Instrument( InstrumentTrack * _instrument_track ); virtual ~sf2Instrument(); virtual void play( sampleFrame * _working_buffer ); @@ -68,7 +68,7 @@ public: virtual void loadFile( const QString & _file ); - virtual automatableModel * getChildModel( const QString & _modelName ); + virtual AutomatableModel * childModel( const QString & _modelName ); virtual QString nodeName() const; @@ -82,7 +82,7 @@ public: return true; } - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); QString getCurrentPatchName(); @@ -134,19 +134,19 @@ private: lcdSpinBoxModel m_bankNum; lcdSpinBoxModel m_patchNum; - knobModel m_gain; + FloatModel m_gain; - boolModel m_reverbOn; - knobModel m_reverbRoomSize; - knobModel m_reverbDamping; - knobModel m_reverbWidth; - knobModel m_reverbLevel; + BoolModel m_reverbOn; + FloatModel m_reverbRoomSize; + FloatModel m_reverbDamping; + FloatModel m_reverbWidth; + FloatModel m_reverbLevel; - boolModel m_chorusOn; - knobModel m_chorusNum; - knobModel m_chorusLevel; - knobModel m_chorusSpeed; - knobModel m_chorusDepth; + BoolModel m_chorusOn; + FloatModel m_chorusNum; + FloatModel m_chorusLevel; + FloatModel m_chorusSpeed; + FloatModel m_chorusDepth; private: @@ -178,11 +178,11 @@ public: -class sf2InstrumentView : public instrumentView +class sf2InstrumentView : public InstrumentView { Q_OBJECT public: - sf2InstrumentView( instrument * _instrument, + sf2InstrumentView( Instrument * _instrument, QWidget * _parent ); virtual ~sf2InstrumentView(); diff --git a/plugins/sid/sid_instrument.cpp b/plugins/sid/sid_instrument.cpp index 958e24b01..1060d6c8c 100644 --- a/plugins/sid/sid_instrument.cpp +++ b/plugins/sid/sid_instrument.cpp @@ -33,10 +33,9 @@ #include "sid_instrument.h" #include "engine.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "knob.h" #include "note_play_handle.h" -#include "sweep_oscillator.h" #include "pixmap_button.h" #include "tooltip.h" @@ -69,7 +68,7 @@ static const int relTime[16] = { 6, 24, 48, 72, 114, 168, 204, 240, 300, 750, extern "C" { -plugin::descriptor PLUGIN_EXPORT sid_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT sid_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "SID", @@ -79,16 +78,16 @@ plugin::descriptor PLUGIN_EXPORT sid_plugin_descriptor = "Csaba Hruska " "Attila Herman ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; } -voiceObject::voiceObject( model * _parent, int _idx ) : - model( _parent ), +voiceObject::voiceObject( Model * _parent, int _idx ) : + Model( _parent ), m_pulseWidthModel( 2048.0f, 0.0f, 4095.0f, 1.0f, this, tr( "Voice %1 pulse width" ).arg( _idx+1 ) ), m_attackModel( 8.0f, 0.0f, 15.0f, 1.0f, this, @@ -117,8 +116,8 @@ voiceObject::~voiceObject() } -sidInstrument::sidInstrument( instrumentTrack * _instrument_track ) : - instrument( _instrument_track, &sid_plugin_descriptor ), +sidInstrument::sidInstrument( InstrumentTrack * _instrument_track ) : + Instrument( _instrument_track, &sid_plugin_descriptor ), // filter m_filterFCModel( 1024.0f, 0.0f, 2047.0f, 1.0f, this, tr( "Cutoff" ) ), m_filterResonanceModel( 8.0f, 0.0f, 15.0f, 1.0f, this, tr( "Resonance" ) ), @@ -432,7 +431,7 @@ void sidInstrument::playNote( notePlayHandle * _n, } } - getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); + instrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } @@ -446,7 +445,7 @@ void sidInstrument::deleteNotePluginData( notePlayHandle * _n ) -pluginView * sidInstrument::instantiateView( QWidget * _parent ) +PluginView * sidInstrument::instantiateView( QWidget * _parent ) { return( new sidInstrumentView( this, _parent ) ); } @@ -473,9 +472,9 @@ public: -sidInstrumentView::sidInstrumentView( instrument * _instrument, +sidInstrumentView::sidInstrumentView( Instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) + InstrumentView( _instrument, _parent ) { setAutoFillBackground( TRUE ); @@ -817,10 +816,10 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { return( new sidInstrument( - static_cast( _data ) ) ); + static_cast( _data ) ) ); } diff --git a/plugins/sid/sid_instrument.h b/plugins/sid/sid_instrument.h index c1c401247..f1e804266 100644 --- a/plugins/sid/sid_instrument.h +++ b/plugins/sid/sid_instrument.h @@ -1,5 +1,5 @@ /* - * sid_instrument.h - ResID based software-synthesizer + * sid_Instrument.h - ResID based software-synthesizer * * Copyright (c) 2008 Csaba Hruska * Attila Herman @@ -28,8 +28,8 @@ #define _SID_H #include -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" #include "knob.h" @@ -38,7 +38,7 @@ class notePlayHandle; class automatableButtonGroup; class pixmapButton; -class voiceObject : public model +class voiceObject : public Model { Q_OBJECT public: @@ -49,28 +49,28 @@ public: NoiseWave, NumWaveShapes }; - voiceObject( model * _parent, int _idx ); + voiceObject( Model * _parent, int _idx ); virtual ~voiceObject(); private: - knobModel m_pulseWidthModel; - knobModel m_attackModel; - knobModel m_decayModel; - knobModel m_sustainModel; - knobModel m_releaseModel; - knobModel m_coarseModel; - intModel m_waveFormModel; - boolModel m_syncModel; - boolModel m_ringModModel; - boolModel m_filteredModel; - boolModel m_testModel; + FloatModel m_pulseWidthModel; + FloatModel m_attackModel; + FloatModel m_decayModel; + FloatModel m_sustainModel; + FloatModel m_releaseModel; + FloatModel m_coarseModel; + IntModel m_waveFormModel; + BoolModel m_syncModel; + BoolModel m_ringModModel; + BoolModel m_filteredModel; + BoolModel m_testModel; friend class sidInstrument; friend class sidInstrumentView; } ; -class sidInstrument : public instrument +class sidInstrument : public Instrument { Q_OBJECT public: @@ -88,7 +88,7 @@ public: }; - sidInstrument( instrumentTrack * _instrument_track ); + sidInstrument( InstrumentTrack * _instrument_track ); virtual ~sidInstrument(); virtual void playNote( notePlayHandle * _n, @@ -103,7 +103,7 @@ public: virtual f_cnt_t desiredReleaseFrames( void ) const; - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); /*public slots: @@ -115,15 +115,15 @@ private: voiceObject * m_voice[3]; // filter - knobModel m_filterFCModel; - knobModel m_filterResonanceModel; - intModel m_filterModeModel; + FloatModel m_filterFCModel; + FloatModel m_filterResonanceModel; + IntModel m_filterModeModel; // misc - boolModel m_voice3OffModel; - knobModel m_volumeModel; + BoolModel m_voice3OffModel; + FloatModel m_volumeModel; - intModel m_chipModel; + IntModel m_chipModel; friend class sidInstrumentView; @@ -131,11 +131,11 @@ private: -class sidInstrumentView : public instrumentView +class sidInstrumentView : public InstrumentView { Q_OBJECT public: - sidInstrumentView( instrument * _instrument, QWidget * _parent ); + sidInstrumentView( Instrument * _instrument, QWidget * _parent ); virtual ~sidInstrumentView(); private: diff --git a/plugins/spectrum_analyzer/spectrum_analyzer.cpp b/plugins/spectrum_analyzer/spectrum_analyzer.cpp index 39aedb144..e72874130 100644 --- a/plugins/spectrum_analyzer/spectrum_analyzer.cpp +++ b/plugins/spectrum_analyzer/spectrum_analyzer.cpp @@ -30,7 +30,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT spectrumanalyzer_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT spectrumanalyzer_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "Spectrum Analyzer", @@ -39,8 +39,8 @@ plugin::descriptor PLUGIN_EXPORT spectrumanalyzer_plugin_descriptor = "inside LMMS." ), "Tobias Doerffel ", 0x0100, - plugin::Effect, - new pluginPixmapLoader( "logo" ), + Plugin::Effect, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; @@ -49,9 +49,9 @@ plugin::descriptor PLUGIN_EXPORT spectrumanalyzer_plugin_descriptor = -spectrumAnalyzer::spectrumAnalyzer( model * _parent, - const descriptor::subPluginFeatures::key * _key ) : - effect( &spectrumanalyzer_plugin_descriptor, _parent, _key ), +spectrumAnalyzer::spectrumAnalyzer( Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ) : + Effect( &spectrumanalyzer_plugin_descriptor, _parent, _key ), m_saControls( this ), m_framesFilledUp( 0 ), m_energy( 0 ) @@ -164,10 +164,10 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model * _parent, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model * _parent, void * _data ) { return( new spectrumAnalyzer( _parent, - static_cast( + static_cast( _data ) ) ); } diff --git a/plugins/spectrum_analyzer/spectrum_analyzer.h b/plugins/spectrum_analyzer/spectrum_analyzer.h index 6a81a742d..b0e26c709 100644 --- a/plugins/spectrum_analyzer/spectrum_analyzer.h +++ b/plugins/spectrum_analyzer/spectrum_analyzer.h @@ -26,7 +26,7 @@ #ifndef _SPECTRUM_ANALYZER_H #define _SPECTRUM_ANALYZER_H -#include "effect.h" +#include "Effect.h" #include "fft_helpers.h" #include "spectrumanalyzer_controls.h" @@ -34,7 +34,7 @@ const int MAX_BANDS = 249; -class spectrumAnalyzer : public effect +class spectrumAnalyzer : public Effect { public: enum ChannelModes @@ -44,13 +44,13 @@ public: RightChannel } ; - spectrumAnalyzer( model * _parent, - const descriptor::subPluginFeatures::key * _key ); + spectrumAnalyzer( Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ); virtual ~spectrumAnalyzer(); virtual bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ); - virtual effectControls * getControls( void ) + virtual EffectControls * controls( void ) { return( &m_saControls ); } diff --git a/plugins/spectrum_analyzer/spectrumanalyzer_control_dialog.cpp b/plugins/spectrum_analyzer/spectrumanalyzer_control_dialog.cpp index 1d24ba653..bcd5b67d4 100644 --- a/plugins/spectrum_analyzer/spectrumanalyzer_control_dialog.cpp +++ b/plugins/spectrum_analyzer/spectrumanalyzer_control_dialog.cpp @@ -27,7 +27,7 @@ #include #include "spectrum_analyzer.h" -#include "main_window.h" +#include "MainWindow.h" #include "led_checkbox.h" #include "embed.h" @@ -60,7 +60,7 @@ public: m_background( PLUGIN_NAME::getIconPixmap( "spectrum_background" ).toImage() ) { setFixedSize( 249, 151 ); - connect( engine::getMainWindow(), SIGNAL( periodicUpdate() ), + connect( engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); setAttribute( Qt::WA_OpaquePaintEvent, TRUE ); } @@ -146,7 +146,7 @@ private: spectrumAnalyzerControlDialog::spectrumAnalyzerControlDialog( spectrumAnalyzerControls * _controls ) : - effectControlDialog( _controls ), + EffectControlDialog( _controls ), m_controls( _controls ), m_logXAxis( PLUGIN_NAME::getIconPixmap( "log_x_axis" ) ), m_logYAxis( PLUGIN_NAME::getIconPixmap( "log_y_axis" ) ) diff --git a/plugins/spectrum_analyzer/spectrumanalyzer_control_dialog.h b/plugins/spectrum_analyzer/spectrumanalyzer_control_dialog.h index 0fd56bb68..28c8e1292 100644 --- a/plugins/spectrum_analyzer/spectrumanalyzer_control_dialog.h +++ b/plugins/spectrum_analyzer/spectrumanalyzer_control_dialog.h @@ -25,13 +25,13 @@ #ifndef _SPECTRUMANALYZER_CONTROL_DIALOG_H #define _SPECTRUMANALYZER_CONTROL_DIALOG_H -#include "effect_control_dialog.h" +#include "EffectControlDialog.h" class spectrumAnalyzerControls; -class spectrumAnalyzerControlDialog : public effectControlDialog +class spectrumAnalyzerControlDialog : public EffectControlDialog { public: spectrumAnalyzerControlDialog( spectrumAnalyzerControls * _controls ); diff --git a/plugins/spectrum_analyzer/spectrumanalyzer_controls.cpp b/plugins/spectrum_analyzer/spectrumanalyzer_controls.cpp index 9edf1fa51..1696a92db 100644 --- a/plugins/spectrum_analyzer/spectrumanalyzer_controls.cpp +++ b/plugins/spectrum_analyzer/spectrumanalyzer_controls.cpp @@ -28,7 +28,7 @@ spectrumAnalyzerControls::spectrumAnalyzerControls( spectrumAnalyzer * _eff ) : - effectControls( _eff ), + EffectControls( _eff ), m_effect( _eff ), m_linearSpec( FALSE, this, tr( "Linear spectrum" ) ), m_linearYAxis( FALSE, this, tr( "Linear Y-axis" ) ), diff --git a/plugins/spectrum_analyzer/spectrumanalyzer_controls.h b/plugins/spectrum_analyzer/spectrumanalyzer_controls.h index 68536c820..bd2238aee 100644 --- a/plugins/spectrum_analyzer/spectrumanalyzer_controls.h +++ b/plugins/spectrum_analyzer/spectrumanalyzer_controls.h @@ -25,7 +25,7 @@ #ifndef _SPECTRUMANALYZER_CONTROLS_H #define _SPECTRUMANALYZER_CONTROLS_H -#include "effect_controls.h" +#include "EffectControls.h" #include "spectrumanalyzer_control_dialog.h" #include "knob.h" @@ -33,7 +33,7 @@ class spectrumAnalyzer; -class spectrumAnalyzerControls : public effectControls +class spectrumAnalyzerControls : public EffectControls { Q_OBJECT public: @@ -49,12 +49,12 @@ public: return( "spectrumanaylzercontrols" ); } - virtual int getControlCount( void ) + virtual int controlCount( void ) { return( 1 ); } - virtual effectControlDialog * createView( void ) + virtual EffectControlDialog * createView( void ) { return( new spectrumAnalyzerControlDialog( this ) ); } @@ -62,9 +62,9 @@ public: private: spectrumAnalyzer * m_effect; - boolModel m_linearSpec; - boolModel m_linearYAxis; - intModel m_channelMode; + BoolModel m_linearSpec; + BoolModel m_linearYAxis; + IntModel m_channelMode; friend class spectrumAnalyzer; friend class spectrumAnalyzerControlDialog; diff --git a/plugins/stereo_enhancer/stereo_enhancer.cpp b/plugins/stereo_enhancer/stereo_enhancer.cpp index 99bb8ee13..fd5975732 100644 --- a/plugins/stereo_enhancer/stereo_enhancer.cpp +++ b/plugins/stereo_enhancer/stereo_enhancer.cpp @@ -31,7 +31,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT stereoenhancer_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT stereoenhancer_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "StereoEnhancer Effect", @@ -39,8 +39,8 @@ plugin::descriptor PLUGIN_EXPORT stereoenhancer_plugin_descriptor = "Plugin for enhancing stereo separation of a stereo input file" ), "Lou Herard ", 0x0100, - plugin::Effect, - new pluginPixmapLoader( "logo" ), + Plugin::Effect, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; @@ -50,9 +50,9 @@ plugin::descriptor PLUGIN_EXPORT stereoenhancer_plugin_descriptor = stereoEnhancerEffect::stereoEnhancerEffect( - model * _parent, - const descriptor::subPluginFeatures::key * _key ) : - effect( &stereoenhancer_plugin_descriptor, _parent, _key ), + Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ) : + Effect( &stereoenhancer_plugin_descriptor, _parent, _key ), m_seFX( effectLib::stereoEnhancer( 0.0f ) ), m_delayBuffer( new sampleFrame[DEFAULT_BUFFER_SIZE] ), m_currFrame( 0 ), @@ -96,8 +96,8 @@ bool stereoEnhancerEffect::processAudioBuffer( sampleFrame * _buf, return( FALSE ); } - const float d = getDryLevel(); - const float w = getWetLevel(); + const float d = dryLevel(); + const float w = wetLevel(); for( fpp_t f = 0; f < _frames; ++f ) { @@ -164,10 +164,10 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model * _parent, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model * _parent, void * _data ) { return( new stereoEnhancerEffect( _parent, - static_cast( + static_cast( _data ) ) ); } diff --git a/plugins/stereo_enhancer/stereo_enhancer.h b/plugins/stereo_enhancer/stereo_enhancer.h index 8fd10e3db..3cc382425 100644 --- a/plugins/stereo_enhancer/stereo_enhancer.h +++ b/plugins/stereo_enhancer/stereo_enhancer.h @@ -26,24 +26,21 @@ #ifndef _STEREO_ENHANCER_H #define _STEREO_ENHANCER_H -#include - -#include "effect.h" +#include "Effect.h" #include "effect_lib.h" #include "engine.h" -#include "main_window.h" #include "stereoenhancer_controls.h" -class stereoEnhancerEffect : public effect +class stereoEnhancerEffect : public Effect { public: - stereoEnhancerEffect( model * parent, - const descriptor::subPluginFeatures::key * _key ); + stereoEnhancerEffect( Model * parent, + const Descriptor::SubPluginFeatures::Key * _key ); virtual ~stereoEnhancerEffect(); virtual bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ); - virtual effectControls * getControls( void ) + virtual EffectControls * controls( void ) { return( &m_bbControls ); } diff --git a/plugins/stereo_enhancer/stereoenhancer_control_dialog.cpp b/plugins/stereo_enhancer/stereoenhancer_control_dialog.cpp index 9c61c19dd..73603f318 100644 --- a/plugins/stereo_enhancer/stereoenhancer_control_dialog.cpp +++ b/plugins/stereo_enhancer/stereoenhancer_control_dialog.cpp @@ -33,7 +33,7 @@ stereoEnhancerControlDialog::stereoEnhancerControlDialog( stereoEnhancerControls * _controls ) : - effectControlDialog( _controls ) + EffectControlDialog( _controls ) { QHBoxLayout * l = new QHBoxLayout( this ); diff --git a/plugins/stereo_enhancer/stereoenhancer_control_dialog.h b/plugins/stereo_enhancer/stereoenhancer_control_dialog.h index 5ba9de711..bbe40e08f 100644 --- a/plugins/stereo_enhancer/stereoenhancer_control_dialog.h +++ b/plugins/stereo_enhancer/stereoenhancer_control_dialog.h @@ -25,12 +25,12 @@ #ifndef _STEREOENHANCER_CONTROL_DIALOG_H #define _STEREOENHANCER_CONTROL_DIALOG_H -#include "effect_control_dialog.h" +#include "EffectControlDialog.h" class stereoEnhancerControls; -class stereoEnhancerControlDialog : public effectControlDialog +class stereoEnhancerControlDialog : public EffectControlDialog { public: stereoEnhancerControlDialog( stereoEnhancerControls * _controls ); diff --git a/plugins/stereo_enhancer/stereoenhancer_controls.cpp b/plugins/stereo_enhancer/stereoenhancer_controls.cpp index f3f1b6623..2a3a8088f 100644 --- a/plugins/stereo_enhancer/stereoenhancer_controls.cpp +++ b/plugins/stereo_enhancer/stereoenhancer_controls.cpp @@ -30,7 +30,7 @@ stereoEnhancerControls::stereoEnhancerControls( stereoEnhancerEffect * _eff ) : - effectControls( _eff ), + EffectControls( _eff ), m_effect( _eff ), m_widthModel(0.0f, 0.0f, 180.0f, 1.0f, this, tr( "Width" ) ) { diff --git a/plugins/stereo_enhancer/stereoenhancer_controls.h b/plugins/stereo_enhancer/stereoenhancer_controls.h index 06ba11f97..7c796e5a0 100644 --- a/plugins/stereo_enhancer/stereoenhancer_controls.h +++ b/plugins/stereo_enhancer/stereoenhancer_controls.h @@ -25,13 +25,13 @@ #ifndef _STEREO_ENHANCER_CONTROLS_H #define _STEREO_ENHANCER_CONTROLS_H -#include "effect_controls.h" +#include "EffectControls.h" #include "stereoenhancer_control_dialog.h" #include "knob.h" class stereoEnhancerEffect; -class stereoEnhancerControls : public effectControls +class stereoEnhancerControls : public EffectControls { Q_OBJECT public: @@ -47,12 +47,12 @@ public: return( "stereoenhancercontrols" ); } - virtual int getControlCount( void ) + virtual int controlCount( void ) { return( 1 ); } - virtual effectControlDialog * createView( void ) + virtual EffectControlDialog * createView( void ) { return new stereoEnhancerControlDialog( this ); } @@ -64,7 +64,7 @@ private slots: private: stereoEnhancerEffect * m_effect; - knobModel m_widthModel; + FloatModel m_widthModel; friend class stereoEnhancerControlDialog; diff --git a/plugins/stereo_matrix/stereo_matrix.cpp b/plugins/stereo_matrix/stereo_matrix.cpp index 6db7b1113..58cb03da3 100644 --- a/plugins/stereo_matrix/stereo_matrix.cpp +++ b/plugins/stereo_matrix/stereo_matrix.cpp @@ -31,7 +31,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT stereomatrix_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT stereomatrix_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "Stereophonic Matrix", @@ -39,8 +39,8 @@ plugin::descriptor PLUGIN_EXPORT stereomatrix_plugin_descriptor = "Plugin for freely manipulating stereo output" ), "Paul Giblock ", 0x0100, - plugin::Effect, - new pluginPixmapLoader( "logo" ), + Plugin::Effect, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; @@ -50,9 +50,9 @@ plugin::descriptor PLUGIN_EXPORT stereomatrix_plugin_descriptor = stereoMatrixEffect::stereoMatrixEffect( - model * _parent, - const descriptor::subPluginFeatures::key * _key ) : - effect( &stereomatrix_plugin_descriptor, _parent, _key ), + Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ) : + Effect( &stereomatrix_plugin_descriptor, _parent, _key ), m_smControls( this ) { } @@ -81,8 +81,8 @@ bool stereoMatrixEffect::processAudioBuffer( sampleFrame * _buf, for( fpp_t f = 0; f < _frames; ++f ) { - const float d = getDryLevel(); - const float w = getWetLevel(); + const float d = dryLevel(); + const float w = wetLevel(); sample_t l = _buf[f][0]; sample_t r = _buf[f][1]; @@ -113,10 +113,10 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model * _parent, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model * _parent, void * _data ) { return( new stereoMatrixEffect( _parent, - static_cast( + static_cast( _data ) ) ); } diff --git a/plugins/stereo_matrix/stereo_matrix.h b/plugins/stereo_matrix/stereo_matrix.h index 6b2c7866d..ba6a0d2ce 100644 --- a/plugins/stereo_matrix/stereo_matrix.h +++ b/plugins/stereo_matrix/stereo_matrix.h @@ -26,24 +26,19 @@ #ifndef _STEREO_MATRIX_H #define _STEREO_MATRIX_H -#include - -#include "effect.h" -#include "effect_lib.h" -#include "engine.h" -#include "main_window.h" +#include "Effect.h" #include "stereomatrix_controls.h" -class stereoMatrixEffect : public effect +class stereoMatrixEffect : public Effect { public: - stereoMatrixEffect( model * parent, - const descriptor::subPluginFeatures::key * _key ); + stereoMatrixEffect( Model * parent, + const Descriptor::SubPluginFeatures::Key * _key ); virtual ~stereoMatrixEffect(); virtual bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ); - virtual effectControls * getControls( void ) + virtual EffectControls * controls( void ) { return( &m_smControls ); } diff --git a/plugins/stereo_matrix/stereomatrix_control_dialog.cpp b/plugins/stereo_matrix/stereomatrix_control_dialog.cpp index 5233fe2bd..7aacf8723 100644 --- a/plugins/stereo_matrix/stereomatrix_control_dialog.cpp +++ b/plugins/stereo_matrix/stereomatrix_control_dialog.cpp @@ -35,7 +35,7 @@ stereoMatrixControlDialog::stereoMatrixControlDialog( stereoMatrixControls * _controls ) : - effectControlDialog( _controls ) + EffectControlDialog( _controls ) { setFixedSize( 105, 115); diff --git a/plugins/stereo_matrix/stereomatrix_control_dialog.h b/plugins/stereo_matrix/stereomatrix_control_dialog.h index c18945b92..de3dcd110 100644 --- a/plugins/stereo_matrix/stereomatrix_control_dialog.h +++ b/plugins/stereo_matrix/stereomatrix_control_dialog.h @@ -25,12 +25,12 @@ #ifndef _STEREOMATRIX_CONTROL_DIALOG_H #define _STEREOMATRIX_CONTROL_DIALOG_H -#include "effect_control_dialog.h" +#include "EffectControlDialog.h" class stereoMatrixControls; -class stereoMatrixControlDialog : public effectControlDialog +class stereoMatrixControlDialog : public EffectControlDialog { public: stereoMatrixControlDialog( stereoMatrixControls * _controls ); diff --git a/plugins/stereo_matrix/stereomatrix_controls.cpp b/plugins/stereo_matrix/stereomatrix_controls.cpp index a0f5d430f..6e75c1da6 100644 --- a/plugins/stereo_matrix/stereomatrix_controls.cpp +++ b/plugins/stereo_matrix/stereomatrix_controls.cpp @@ -30,7 +30,7 @@ stereoMatrixControls::stereoMatrixControls( stereoMatrixEffect * _eff ) : - effectControls( _eff ), + EffectControls( _eff ), m_effect( _eff ), m_llModel( 1.0f, -1.0f, 1.0f, 0.01f, this, tr( "Left to Left" ) ), m_lrModel( 0.0f, -1.0f, 1.0f, 0.01f, this, tr( "Left to Right" ) ), diff --git a/plugins/stereo_matrix/stereomatrix_controls.h b/plugins/stereo_matrix/stereomatrix_controls.h index 75683999b..dd1d8cc0a 100644 --- a/plugins/stereo_matrix/stereomatrix_controls.h +++ b/plugins/stereo_matrix/stereomatrix_controls.h @@ -25,13 +25,13 @@ #ifndef _STEREO_MATRIX_CONTROLS_H #define _STEREO_MATRIX_CONTROLS_H -#include "effect_controls.h" +#include "EffectControls.h" #include "stereomatrix_control_dialog.h" #include "knob.h" class stereoMatrixEffect; -class stereoMatrixControls : public effectControls +class stereoMatrixControls : public EffectControls { Q_OBJECT public: @@ -47,12 +47,12 @@ public: return( "stereomatrixcontrols" ); } - virtual int getControlCount( void ) + virtual int controlCount( void ) { return( 1 ); } - virtual effectControlDialog * createView( void ) + virtual EffectControlDialog * createView( void ) { return new stereoMatrixControlDialog( this ); } @@ -65,10 +65,10 @@ private slots: private: stereoMatrixEffect * m_effect; - knobModel m_llModel; - knobModel m_lrModel; - knobModel m_rlModel; - knobModel m_rrModel; + FloatModel m_llModel; + FloatModel m_lrModel; + FloatModel m_rlModel; + FloatModel m_rrModel; friend class stereoMatrixControlDialog; friend class stereoMatrixEffect; diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index 2b0fc37ba..accd0470a 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -33,7 +33,7 @@ #include "engine.h" #include "gui_templates.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "embed.cpp" @@ -41,7 +41,7 @@ extern "C" { -plugin::descriptor malletsstk_plugin_descriptor = +Plugin::Descriptor malletsstk_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "Mallets", @@ -49,8 +49,8 @@ plugin::descriptor malletsstk_plugin_descriptor = "Tuneful things to bang on" ), "Danny McRae ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; @@ -58,8 +58,8 @@ plugin::descriptor malletsstk_plugin_descriptor = } -malletsInstrument::malletsInstrument( instrumentTrack * _instrument_track ): - instrument( _instrument_track, &malletsstk_plugin_descriptor ), +malletsInstrument::malletsInstrument( InstrumentTrack * _instrument_track ): + Instrument( _instrument_track, &malletsstk_plugin_descriptor ), m_hardnessModel(64.0f, 0.0f, 128.0f, 0.1f, this, tr( "Hardness" )), m_positionModel(64.0f, 0.0f, 128.0f, 0.1f, this, tr( "Position" )), m_vibratoGainModel(64.0f, 0.0f, 128.0f, 0.1f, this, tr( "Vibrato Gain" )), @@ -281,7 +281,7 @@ void malletsInstrument::playNote( notePlayHandle * _n, ( m_scalers[m_presetsModel.value()] + add_scale ); } - getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); + instrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } @@ -295,7 +295,7 @@ void malletsInstrument::deleteNotePluginData( notePlayHandle * _n ) -pluginView * malletsInstrument::instantiateView( QWidget * _parent ) +PluginView * malletsInstrument::instantiateView( QWidget * _parent ) { return( new malletsInstrumentView( this, _parent ) ); } @@ -305,7 +305,7 @@ pluginView * malletsInstrument::instantiateView( QWidget * _parent ) malletsInstrumentView::malletsInstrumentView( malletsInstrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) + InstrumentView( _instrument, _parent ) { m_modalBarWidget = setupModalBarControls( this ); setWidgetBackground( m_modalBarWidget, "artwork" ); @@ -655,9 +655,9 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * lmms_plugin_main( model *, void * _data ) +Plugin * lmms_plugin_main( Model *, void * _data ) { - return( new malletsInstrument( static_cast( _data ) ) ); + return new malletsInstrument( static_cast( _data ) ); } diff --git a/plugins/stk/mallets/mallets.h b/plugins/stk/mallets/mallets.h index a969dfb3b..97c2b26f3 100644 --- a/plugins/stk/mallets/mallets.h +++ b/plugins/stk/mallets/mallets.h @@ -30,8 +30,8 @@ #include "Instrmnt.h" #include "combobox.h" -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" #include "knob.h" #include "note_play_handle.h" #include "led_checkbox.h" @@ -125,10 +125,10 @@ protected: -class malletsInstrument : public instrument +class malletsInstrument : public Instrument { public: - malletsInstrument( instrumentTrack * _channel_track ); + malletsInstrument( InstrumentTrack * _instrument_track ); virtual ~malletsInstrument( void ); virtual void playNote( notePlayHandle * _n, @@ -141,31 +141,31 @@ public: virtual QString nodeName( void ) const; - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); private: - knobModel m_hardnessModel; - knobModel m_positionModel; - knobModel m_vibratoGainModel; - knobModel m_vibratoFreqModel; - knobModel m_stickModel; + FloatModel m_hardnessModel; + FloatModel m_positionModel; + FloatModel m_vibratoGainModel; + FloatModel m_vibratoFreqModel; + FloatModel m_stickModel; - knobModel m_modulatorModel; - knobModel m_crossfadeModel; - knobModel m_lfoSpeedModel; - knobModel m_lfoDepthModel; - knobModel m_adsrModel; + FloatModel m_modulatorModel; + FloatModel m_crossfadeModel; + FloatModel m_lfoSpeedModel; + FloatModel m_lfoDepthModel; + FloatModel m_adsrModel; - knobModel m_pressureModel; - knobModel m_motionModel; - knobModel m_vibratoModel; - knobModel m_velocityModel; + FloatModel m_pressureModel; + FloatModel m_motionModel; + FloatModel m_vibratoModel; + FloatModel m_velocityModel; - boolModel m_strikeModel; + BoolModel m_strikeModel; - comboBoxModel m_presetsModel; - knobModel m_spreadModel; + ComboBoxModel m_presetsModel; + FloatModel m_spreadModel; QVector m_scalers; @@ -177,7 +177,7 @@ private: } ; -class malletsInstrumentView: public instrumentView +class malletsInstrumentView: public InstrumentView { Q_OBJECT public: diff --git a/plugins/triple_oscillator/CMakeLists.txt b/plugins/triple_oscillator/CMakeLists.txt index 59554bedc..e17c39f1d 100644 --- a/plugins/triple_oscillator/CMakeLists.txt +++ b/plugins/triple_oscillator/CMakeLists.txt @@ -1,3 +1,3 @@ INCLUDE(BuildPlugin) -BUILD_PLUGIN(tripleoscillator triple_oscillator.cpp triple_oscillator.h MOCFILES triple_oscillator.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png) +BUILD_PLUGIN(tripleoscillator TripleOscillator.cpp TripleOscillator.h MOCFILES TripleOscillator.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png) diff --git a/plugins/triple_oscillator/triple_oscillator.cpp b/plugins/triple_oscillator/TripleOscillator.cpp similarity index 87% rename from plugins/triple_oscillator/triple_oscillator.cpp rename to plugins/triple_oscillator/TripleOscillator.cpp index d35d33e14..63ac7e66f 100644 --- a/plugins/triple_oscillator/triple_oscillator.cpp +++ b/plugins/triple_oscillator/TripleOscillator.cpp @@ -1,8 +1,8 @@ /* - * triple_oscillator.cpp - powerful instrument with three oscillators + * TripleOscillator.cpp - powerful instrument with three oscillators + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -27,11 +27,11 @@ #include #include -#include "triple_oscillator.h" +#include "TripleOscillator.h" #include "automatable_button.h" #include "debug.h" #include "engine.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "knob.h" #include "note_play_handle.h" #include "pixmap_button.h" @@ -45,7 +45,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT tripleoscillator_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT tripleoscillator_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "TripleOscillator", @@ -54,8 +54,8 @@ plugin::descriptor PLUGIN_EXPORT tripleoscillator_plugin_descriptor = "in several ways" ), "Tobias Doerffel ", 0x0110, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), NULL, NULL } ; @@ -64,8 +64,8 @@ plugin::descriptor PLUGIN_EXPORT tripleoscillator_plugin_descriptor = -oscillatorObject::oscillatorObject( model * _parent, int _idx ) : - model( _parent ), +OscillatorObject::OscillatorObject( Model * _parent, int _idx ) : + Model( _parent ), m_volumeModel( DefaultVolume / NUM_OF_OSCILLATORS, MinVolume, MaxVolume, 1.0f, this, tr( "Osc %1 volume" ).arg( _idx+1 ) ), m_panModel( DefaultPanning, PanningLeft, PanningRight, 1.0f, this, @@ -81,11 +81,11 @@ oscillatorObject::oscillatorObject( model * _parent, int _idx ) : tr( "Osc %1 phase-offset" ).arg( _idx+1 ) ), m_stereoPhaseDetuningModel( 0.0f, 0.0f, 360.0f, 1.0f, this, tr( "Osc %1 stereo phase-detuning" ).arg( _idx+1 ) ), - m_waveShapeModel( oscillator::SineWave, 0, - oscillator::NumWaveShapes-1, this, + m_waveShapeModel( Oscillator::SineWave, 0, + Oscillator::NumWaveShapes-1, this, tr( "Osc %1 wave shape" ).arg( _idx+1 ) ), - m_modulationAlgoModel( oscillator::SignalMix, 0, - oscillator::NumModulationAlgos-1, this, + m_modulationAlgoModel( Oscillator::SignalMix, 0, + Oscillator::NumModulationAlgos-1, this, tr( "Modulation type %1" ).arg( _idx+1 ) ), m_sampleBuffer( new sampleBuffer ), @@ -96,7 +96,7 @@ oscillatorObject::oscillatorObject( model * _parent, int _idx ) : m_phaseOffsetLeft( 0.0f ), m_phaseOffsetRight( 0.0f ) { - // Connect knobs with oscillators' inputs + // Connect knobs with Oscillators' inputs connect( &m_volumeModel, SIGNAL( dataChanged() ), this, SLOT( updateVolume() ) ); connect( &m_panModel, SIGNAL( dataChanged() ), @@ -128,7 +128,7 @@ oscillatorObject::oscillatorObject( model * _parent, int _idx ) : -oscillatorObject::~oscillatorObject() +OscillatorObject::~OscillatorObject() { sharedObject::unref( m_sampleBuffer ); } @@ -136,7 +136,7 @@ oscillatorObject::~oscillatorObject() -void oscillatorObject::oscUserDefWaveDblClick( void ) +void OscillatorObject::oscUserDefWaveDblClick() { QString af = m_sampleBuffer->openAudioFile(); if( af != "" ) @@ -150,7 +150,7 @@ void oscillatorObject::oscUserDefWaveDblClick( void ) -void oscillatorObject::updateVolume( void ) +void OscillatorObject::updateVolume() { if( m_panModel.value() >= 0.0f ) { @@ -173,7 +173,7 @@ void oscillatorObject::updateVolume( void ) -void oscillatorObject::updateDetuningLeft( void ) +void OscillatorObject::updateDetuningLeft() { m_detuningLeft = powf( 2.0f, ( (float)m_coarseModel.value() * 100.0f + (float)m_fineLeftModel.value() ) / 1200.0f ) @@ -183,7 +183,7 @@ void oscillatorObject::updateDetuningLeft( void ) -void oscillatorObject::updateDetuningRight( void ) +void OscillatorObject::updateDetuningRight() { m_detuningRight = powf( 2.0f, ( (float)m_coarseModel.value() * 100.0f + (float)m_fineRightModel.value() ) / 1200.0f ) @@ -193,7 +193,7 @@ void oscillatorObject::updateDetuningRight( void ) -void oscillatorObject::updatePhaseOffsetLeft( void ) +void OscillatorObject::updatePhaseOffsetLeft() { m_phaseOffsetLeft = ( m_phaseOffsetModel.value() + m_stereoPhaseDetuningModel.value() ) / 360.0f; @@ -202,7 +202,7 @@ void oscillatorObject::updatePhaseOffsetLeft( void ) -void oscillatorObject::updatePhaseOffsetRight( void ) +void OscillatorObject::updatePhaseOffsetRight() { m_phaseOffsetRight = m_phaseOffsetModel.value() / 360.0f; } @@ -210,12 +210,12 @@ void oscillatorObject::updatePhaseOffsetRight( void ) -tripleOscillator::tripleOscillator( instrumentTrack * _instrument_track ) : - instrument( _instrument_track, &tripleoscillator_plugin_descriptor ) +TripleOscillator::TripleOscillator( InstrumentTrack * _instrument_track ) : + Instrument( _instrument_track, &tripleoscillator_plugin_descriptor ) { for( int i = 0; i < NUM_OF_OSCILLATORS; ++i ) { - m_osc[i] = new oscillatorObject( this, i ); + m_osc[i] = new OscillatorObject( this, i ); } @@ -226,14 +226,14 @@ tripleOscillator::tripleOscillator( instrumentTrack * _instrument_track ) : -tripleOscillator::~tripleOscillator() +TripleOscillator::~TripleOscillator() { } -void tripleOscillator::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void TripleOscillator::saveSettings( QDomDocument & _doc, QDomElement & _this ) { for( int i = 0; i < NUM_OF_OSCILLATORS; ++i ) { @@ -262,7 +262,7 @@ void tripleOscillator::saveSettings( QDomDocument & _doc, QDomElement & _this ) -void tripleOscillator::loadSettings( const QDomElement & _this ) +void TripleOscillator::loadSettings( const QDomElement & _this ) { for( int i = 0; i < NUM_OF_OSCILLATORS; ++i ) { @@ -288,7 +288,7 @@ void tripleOscillator::loadSettings( const QDomElement & _this ) -QString tripleOscillator::nodeName( void ) const +QString TripleOscillator::nodeName() const { return( tripleoscillator_plugin_descriptor.name ); } @@ -296,13 +296,13 @@ QString tripleOscillator::nodeName( void ) const -void tripleOscillator::playNote( notePlayHandle * _n, +void TripleOscillator::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) { - oscillator * oscs_l[NUM_OF_OSCILLATORS]; - oscillator * oscs_r[NUM_OF_OSCILLATORS]; + Oscillator * oscs_l[NUM_OF_OSCILLATORS]; + Oscillator * oscs_r[NUM_OF_OSCILLATORS]; for( Sint8 i = NUM_OF_OSCILLATORS - 1; i >= 0; --i ) { @@ -310,14 +310,14 @@ void tripleOscillator::playNote( notePlayHandle * _n, // the last oscs needs no sub-oscs... if( i == NUM_OF_OSCILLATORS - 1 ) { - oscs_l[i] = new oscillator( + oscs_l[i] = new Oscillator( &m_osc[i]->m_waveShapeModel, &m_osc[i]->m_modulationAlgoModel, _n->frequency(), m_osc[i]->m_detuningLeft, m_osc[i]->m_phaseOffsetLeft, m_osc[i]->m_volumeLeft ); - oscs_r[i] = new oscillator( + oscs_r[i] = new Oscillator( &m_osc[i]->m_waveShapeModel, &m_osc[i]->m_modulationAlgoModel, _n->frequency(), @@ -327,7 +327,7 @@ void tripleOscillator::playNote( notePlayHandle * _n, } else { - oscs_l[i] = new oscillator( + oscs_l[i] = new Oscillator( &m_osc[i]->m_waveShapeModel, &m_osc[i]->m_modulationAlgoModel, _n->frequency(), @@ -335,7 +335,7 @@ void tripleOscillator::playNote( notePlayHandle * _n, m_osc[i]->m_phaseOffsetLeft, m_osc[i]->m_volumeLeft, oscs_l[i + 1] ); - oscs_r[i] = new oscillator( + oscs_r[i] = new Oscillator( &m_osc[i]->m_waveShapeModel, &m_osc[i]->m_modulationAlgoModel, _n->frequency(), @@ -356,9 +356,8 @@ void tripleOscillator::playNote( notePlayHandle * _n, oscs_r[0]; } - oscillator * osc_l = static_cast( _n->m_pluginData )->oscLeft; - oscillator * osc_r = static_cast( _n->m_pluginData - )->oscRight; + Oscillator * osc_l = static_cast( _n->m_pluginData )->oscLeft; + Oscillator * osc_r = static_cast( _n->m_pluginData )->oscRight; const fpp_t frames = _n->framesLeftForCurrentPeriod(); @@ -367,17 +366,17 @@ void tripleOscillator::playNote( notePlayHandle * _n, applyRelease( _working_buffer, _n ); - getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); + instrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } -void tripleOscillator::deleteNotePluginData( notePlayHandle * _n ) +void TripleOscillator::deleteNotePluginData( notePlayHandle * _n ) { - delete static_cast( static_cast( + delete static_cast( static_cast( _n->m_pluginData )->oscLeft ); - delete static_cast( static_cast( + delete static_cast( static_cast( _n->m_pluginData )->oscRight ); delete static_cast( _n->m_pluginData ); } @@ -385,15 +384,15 @@ void tripleOscillator::deleteNotePluginData( notePlayHandle * _n ) -pluginView * tripleOscillator::instantiateView( QWidget * _parent ) +PluginView * TripleOscillator::instantiateView( QWidget * _parent ) { - return( new tripleOscillatorView( this, _parent ) ); + return new TripleOscillatorView( this, _parent ); } -void tripleOscillator::updateAllDetuning( void ) +void TripleOscillator::updateAllDetuning() { for( int i = 0; i < NUM_OF_OSCILLATORS; ++i ) { @@ -405,10 +404,10 @@ void tripleOscillator::updateAllDetuning( void ) -class tripleOscKnob : public knob +class TripleOscKnob : public knob { public: - tripleOscKnob( QWidget * _parent ) : + TripleOscKnob( QWidget * _parent ) : knob( knobStyled, _parent ) { setFixedSize( 28, 35 ); @@ -418,9 +417,9 @@ public: // 82, 109 -tripleOscillatorView::tripleOscillatorView( instrument * _instrument, +TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) + InstrumentView( _instrument, _parent ) { setAutoFillBackground( TRUE ); QPalette pal; @@ -566,7 +565,7 @@ tripleOscillatorView::tripleOscillatorView( instrument * _instrument, "here.").arg( i+1 ) ); // setup panning-knob - knob * pk = new tripleOscKnob( this ); + knob * pk = new TripleOscKnob( this ); pk->move( 35, knob_y ); pk->setHintText( tr("Osc %1 panning:").arg( i + 1 ) + " ", "" ); pk->setWhatsThis( @@ -576,7 +575,7 @@ tripleOscillatorView::tripleOscillatorView( instrument * _instrument, "output right.").arg( i+1 ) ); // setup coarse-knob - knob * ck = new tripleOscKnob( this ); + knob * ck = new TripleOscKnob( this ); ck->move( 82, knob_y ); ck->setHintText( tr( "Osc %1 coarse detuning:" ).arg( i + 1 ) + " ", " " + tr( "semitones" ) ); @@ -589,7 +588,7 @@ tripleOscillatorView::tripleOscillatorView( instrument * _instrument, // setup knob for left fine-detuning - knob * flk = new tripleOscKnob( this ); + knob * flk = new TripleOscKnob( this ); flk->move( 111, knob_y ); flk->setHintText( tr( "Osc %1 fine detuning left:" ). arg( i + 1 ) + " ", @@ -602,7 +601,7 @@ tripleOscillatorView::tripleOscillatorView( instrument * _instrument, "\"fat\" sounds." ).arg( i + 1 ) ); // setup knob for right fine-detuning - knob * frk = new tripleOscKnob( this ); + knob * frk = new TripleOscKnob( this ); frk->move( 140, knob_y ); frk->setHintText( tr( "Osc %1 fine detuning right:" ). arg( i + 1 ) + " ", @@ -616,7 +615,7 @@ tripleOscillatorView::tripleOscillatorView( instrument * _instrument, // setup phase-offset-knob - knob * pok = new tripleOscKnob( this ); + knob * pok = new TripleOscKnob( this ); pok->move( 188, knob_y ); pok->setHintText( tr( "Osc %1 phase-offset:" ). arg( i + 1 ) + " ", @@ -632,7 +631,7 @@ tripleOscillatorView::tripleOscillatorView( instrument * _instrument, ).arg( i+1 ) ); // setup stereo-phase-detuning-knob - knob * spdk = new tripleOscKnob( this ); + knob * spdk = new TripleOscKnob( this ); spdk->move( 217, knob_y ); spdk->setHintText( tr("Osc %1 stereo phase-detuning:" ). arg( i + 1 ) + " ", @@ -645,7 +644,6 @@ tripleOscillatorView::tripleOscillatorView( instrument * _instrument, "channel. This is very good for creating wide " "stereo sounds." ).arg( i+1 ) ); - int btn_y = 96 + i * osc_h; pixmapButton * sin_wave_btn = new pixmapButton( this, NULL ); @@ -741,25 +739,24 @@ tripleOscillatorView::tripleOscillatorView( instrument * _instrument, wsbg->addButton( white_noise_btn ); wsbg->addButton( uwb ); - m_oscKnobs[i] = oscillatorKnobs( vk, pk, ck, flk, frk, pok, + m_oscKnobs[i] = OscillatorKnobs( vk, pk, ck, flk, frk, pok, spdk, uwb, wsbg ); - } } -tripleOscillatorView::~tripleOscillatorView() +TripleOscillatorView::~TripleOscillatorView() { } -void tripleOscillatorView::modelChanged( void ) +void TripleOscillatorView::modelChanged() { - tripleOscillator * t = castModel(); + TripleOscillator * t = castModel(); m_mod1BtnGrp->setModel( &t->m_osc[0]->m_modulationAlgoModel ); m_mod2BtnGrp->setModel( &t->m_osc[1]->m_modulationAlgoModel ); @@ -794,14 +791,13 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { - return( new tripleOscillator( - static_cast( _data ) ) ); + return new TripleOscillator( static_cast( _data ) ); } } -#include "moc_triple_oscillator.cxx" +#include "moc_TripleOscillator.cxx" diff --git a/plugins/triple_oscillator/triple_oscillator.h b/plugins/triple_oscillator/TripleOscillator.h similarity index 59% rename from plugins/triple_oscillator/triple_oscillator.h rename to plugins/triple_oscillator/TripleOscillator.h index bc92fb4b3..4d95f16d9 100644 --- a/plugins/triple_oscillator/triple_oscillator.h +++ b/plugins/triple_oscillator/TripleOscillator.h @@ -1,9 +1,9 @@ /* - * triple_oscillator.h - declaration of class tripleOscillator a powerful - * instrument-plugin with 3 oscillators + * TripleOscillator.h - declaration of class TripleOscillator a powerful + * instrument-plugin with 3 oscillators + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -26,11 +26,10 @@ #ifndef _TRIPLE_OSCILLATOR_H #define _TRIPLE_OSCILLATOR_H - -#include "instrument.h" -#include "instrument_view.h" -#include "oscillator.h" -#include "automatable_model.h" +#include "Instrument.h" +#include "InstrumentView.h" +#include "Oscillator.h" +#include "AutomatableModel.h" class automatableButtonGroup; @@ -42,24 +41,24 @@ class sampleBuffer; const int NUM_OF_OSCILLATORS = 3; -class oscillatorObject : public model +class OscillatorObject : public Model { Q_OBJECT public: - oscillatorObject( model * _parent, int _idx ); - virtual ~oscillatorObject(); + OscillatorObject( Model * _parent, int _idx ); + virtual ~OscillatorObject(); private: - floatModel m_volumeModel; - floatModel m_panModel; - floatModel m_coarseModel; - floatModel m_fineLeftModel; - floatModel m_fineRightModel; - floatModel m_phaseOffsetModel; - floatModel m_stereoPhaseDetuningModel; - intModel m_waveShapeModel; - intModel m_modulationAlgoModel; + FloatModel m_volumeModel; + FloatModel m_panModel; + FloatModel m_coarseModel; + FloatModel m_fineLeftModel; + FloatModel m_fineRightModel; + FloatModel m_phaseOffsetModel; + FloatModel m_stereoPhaseDetuningModel; + IntModel m_waveShapeModel; + IntModel m_modulationAlgoModel; sampleBuffer * m_sampleBuffer; float m_volumeLeft; @@ -72,30 +71,30 @@ private: float m_phaseOffsetLeft; float m_phaseOffsetRight; - friend class tripleOscillator; - friend class tripleOscillatorView; + friend class TripleOscillator; + friend class TripleOscillatorView; private slots: - void oscUserDefWaveDblClick( void ); + void oscUserDefWaveDblClick(); - void updateVolume( void ); - void updateDetuningLeft( void ); - void updateDetuningRight( void ); - void updatePhaseOffsetLeft( void ); - void updatePhaseOffsetRight( void ); + void updateVolume(); + void updateDetuningLeft(); + void updateDetuningRight(); + void updatePhaseOffsetLeft(); + void updatePhaseOffsetRight(); } ; -class tripleOscillator : public instrument +class TripleOscillator : public Instrument { Q_OBJECT public: - tripleOscillator( instrumentTrack * _track ); - virtual ~tripleOscillator(); + TripleOscillator( InstrumentTrack * _track ); + virtual ~TripleOscillator(); virtual void playNote( notePlayHandle * _n, sampleFrame * _working_buffer ); @@ -105,55 +104,55 @@ public: virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - virtual QString nodeName( void ) const; + virtual QString nodeName() const; - virtual f_cnt_t desiredReleaseFrames( void ) const + virtual f_cnt_t desiredReleaseFrames() const { return( 128 ); } - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); protected slots: - void updateAllDetuning( void ); + void updateAllDetuning(); private: - instrumentTrack * m_instrumentTrack; + InstrumentTrack * m_InstrumentTrack; - oscillatorObject * m_osc[NUM_OF_OSCILLATORS]; + OscillatorObject * m_osc[NUM_OF_OSCILLATORS]; struct oscPtr { - oscillator * oscLeft; - oscillator * oscRight; + Oscillator * oscLeft; + Oscillator * oscRight; } ; - friend class tripleOscillatorView; + friend class TripleOscillatorView; } ; -class tripleOscillatorView : public instrumentView +class TripleOscillatorView : public InstrumentView { Q_OBJECT public: - tripleOscillatorView( instrument * _instrument, QWidget * _parent ); - virtual ~tripleOscillatorView(); + TripleOscillatorView( Instrument * _instrument, QWidget * _parent ); + virtual ~TripleOscillatorView(); private: - virtual void modelChanged( void ); + virtual void modelChanged(); automatableButtonGroup * m_mod1BtnGrp; automatableButtonGroup * m_mod2BtnGrp; - struct oscillatorKnobs + struct OscillatorKnobs { - oscillatorKnobs( knob * v, + OscillatorKnobs( knob * v, knob * p, knob * c, knob * fl, @@ -173,7 +172,7 @@ private: m_waveShapeBtnGrp( wsbg ) { } - oscillatorKnobs() + OscillatorKnobs() { } knob * m_volKnob; @@ -188,7 +187,7 @@ private: } ; - oscillatorKnobs m_oscKnobs[NUM_OF_OSCILLATORS]; + OscillatorKnobs m_oscKnobs[NUM_OF_OSCILLATORS]; } ; diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index f3e8c551e..e98db13a1 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -34,8 +34,8 @@ #include "engine.h" #include "gui_templates.h" #include "instrument_play_handle.h" -#include "instrument_track.h" -#include "vst_plugin.h" +#include "InstrumentTrack.h" +#include "VstPlugin.h" #include "pixmap_button.h" #include "string_pair_drag.h" #include "text_float.h" @@ -47,7 +47,7 @@ extern "C" { -plugin::descriptor vestige_plugin_descriptor = +Plugin::Descriptor vestige_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "VeSTige", @@ -55,8 +55,8 @@ plugin::descriptor vestige_plugin_descriptor = "VST-host for using VST(i)-plugins within LMMS" ), "Tobias Doerffel ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), "dll", NULL } ; @@ -64,16 +64,16 @@ plugin::descriptor vestige_plugin_descriptor = } -QPixmap * vestigeInstrumentView::s_artwork = NULL; +QPixmap * VestigeInstrumentView::s_artwork = NULL; -vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) : - instrument( _instrument_track, &vestige_plugin_descriptor ), +vestigeInstrument::vestigeInstrument( InstrumentTrack * _instrument_track ) : + Instrument( _instrument_track, &vestige_plugin_descriptor ), m_plugin( NULL ), m_pluginMutex() { // now we need a play-handle which cares for calling play() - instrumentPlayHandle * iph = new instrumentPlayHandle( this ); + InstrumentPlayHandle * iph = new InstrumentPlayHandle( this ); engine::getMixer()->addPlayHandle( iph ); } @@ -82,7 +82,7 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) : vestigeInstrument::~vestigeInstrument() { - engine::getMixer()->removePlayHandles( getInstrumentTrack() ); + engine::getMixer()->removePlayHandles( instrumentTrack() ); closePlugin(); } @@ -129,9 +129,9 @@ void vestigeInstrument::loadFile( const QString & _file ) { m_pluginMutex.lock(); const bool set_ch_name = ( m_plugin != NULL && - getInstrumentTrack()->name() == m_plugin->name() ) || - getInstrumentTrack()->name() == - instrumentTrack::tr( "Default preset" ); + instrumentTrack()->name() == m_plugin->name() ) || + instrumentTrack()->name() == + InstrumentTrack::tr( "Default preset" ); m_pluginMutex.unlock(); closePlugin(); @@ -143,7 +143,7 @@ void vestigeInstrument::loadFile( const QString & _file ) PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ), 0 ); m_pluginMutex.lock(); - m_plugin = new vstPlugin( m_pluginDLL ); + m_plugin = new VstPlugin( m_pluginDLL ); if( m_plugin->failed() ) { m_pluginMutex.unlock(); @@ -165,7 +165,7 @@ void vestigeInstrument::loadFile( const QString & _file ) if( set_ch_name ) { - getInstrumentTrack()->setName( m_plugin->name() ); + instrumentTrack()->setName( m_plugin->name() ); } m_pluginMutex.unlock(); @@ -191,7 +191,7 @@ void vestigeInstrument::play( sampleFrame * _buf ) const fpp_t frames = engine::getMixer()->framesPerPeriod(); - getInstrumentTrack()->processAudioBuffer( _buf, frames, NULL ); + instrumentTrack()->processAudioBuffer( _buf, frames, NULL ); m_pluginMutex.unlock(); } @@ -228,9 +228,9 @@ void vestigeInstrument::closePlugin( void ) -pluginView * vestigeInstrument::instantiateView( QWidget * _parent ) +PluginView * vestigeInstrument::instantiateView( QWidget * _parent ) { - return( new vestigeInstrumentView( this, _parent ) ); + return new VestigeInstrumentView( this, _parent ); } @@ -241,9 +241,9 @@ pluginView * vestigeInstrument::instantiateView( QWidget * _parent ) -vestigeInstrumentView::vestigeInstrumentView( instrument * _instrument, +VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) + InstrumentView( _instrument, _parent ) { if( s_artwork == NULL ) { @@ -292,14 +292,14 @@ vestigeInstrumentView::vestigeInstrumentView( instrument * _instrument, -vestigeInstrumentView::~vestigeInstrumentView() +VestigeInstrumentView::~VestigeInstrumentView() { } -void vestigeInstrumentView::modelChanged( void ) +void VestigeInstrumentView::modelChanged( void ) { m_vi = castModel(); } @@ -307,7 +307,7 @@ void vestigeInstrumentView::modelChanged( void ) -void vestigeInstrumentView::openPlugin( void ) +void VestigeInstrumentView::openPlugin( void ) { QFileDialog ofd( NULL, tr( "Open VST-plugin" ) ); @@ -351,7 +351,7 @@ void vestigeInstrumentView::openPlugin( void ) -void vestigeInstrumentView::toggleGUI( void ) +void VestigeInstrumentView::toggleGUI( void ) { QMutexLocker ml( &m_vi->m_pluginMutex ); if( m_vi->m_plugin == NULL ) @@ -376,7 +376,7 @@ void vestigeInstrumentView::toggleGUI( void ) -void vestigeInstrumentView::noteOffAll( void ) +void VestigeInstrumentView::noteOffAll( void ) { m_vi->m_pluginMutex.lock(); if( m_vi->m_plugin != NULL ) @@ -393,7 +393,7 @@ void vestigeInstrumentView::noteOffAll( void ) -void vestigeInstrumentView::dragEnterEvent( QDragEnterEvent * _dee ) +void VestigeInstrumentView::dragEnterEvent( QDragEnterEvent * _dee ) { if( _dee->mimeData()->hasFormat( stringPairDrag::mimeType() ) ) { @@ -417,7 +417,7 @@ void vestigeInstrumentView::dragEnterEvent( QDragEnterEvent * _dee ) -void vestigeInstrumentView::dropEvent( QDropEvent * _de ) +void VestigeInstrumentView::dropEvent( QDropEvent * _de ) { QString type = stringPairDrag::decodeKey( _de ); QString value = stringPairDrag::decodeValue( _de ); @@ -433,7 +433,7 @@ void vestigeInstrumentView::dropEvent( QDropEvent * _de ) -void vestigeInstrumentView::paintEvent( QPaintEvent * ) +void VestigeInstrumentView::paintEvent( QPaintEvent * ) { QPainter p( this ); @@ -474,9 +474,9 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * lmms_plugin_main( model *, void * _data ) +Plugin * lmms_plugin_main( Model *, void * _data ) { - return( new vestigeInstrument( static_cast( _data ) ) ); + return new vestigeInstrument( static_cast( _data ) ); } diff --git a/plugins/vestige/vestige.h b/plugins/vestige/vestige.h index 75d6ed5b3..1b8242b54 100644 --- a/plugins/vestige/vestige.h +++ b/plugins/vestige/vestige.h @@ -29,9 +29,8 @@ #include - -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" #include "midi.h" #include "note.h" @@ -40,14 +39,14 @@ class QPixmap; class QPushButton; class pixmapButton; -class vstPlugin; +class VstPlugin; -class vestigeInstrument : public instrument +class vestigeInstrument : public Instrument { Q_OBJECT public: - vestigeInstrument( instrumentTrack * _channel_track ); + vestigeInstrument( InstrumentTrack * _instrument_track ); virtual ~vestigeInstrument(); virtual void play( sampleFrame * _working_buffer ); @@ -67,7 +66,7 @@ public: virtual bool handleMidiEvent( const midiEvent & _me, const midiTime & _time ); - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); private: @@ -76,24 +75,24 @@ private: int m_runningNotes[NumKeys]; - vstPlugin * m_plugin; + VstPlugin * m_plugin; QMutex m_pluginMutex; QString m_pluginDLL; - friend class vestigeInstrumentView; + friend class VestigeInstrumentView; } ; -class vestigeInstrumentView : public instrumentView +class VestigeInstrumentView : public InstrumentView { Q_OBJECT public: - vestigeInstrumentView( instrument * _instrument, QWidget * _parent ); - virtual ~vestigeInstrumentView(); + VestigeInstrumentView( Instrument * _instrument, QWidget * _parent ); + virtual ~VestigeInstrumentView(); protected slots: diff --git a/plugins/vibed/nine_button_selector.cpp b/plugins/vibed/nine_button_selector.cpp index 864a06a16..65feba9c2 100644 --- a/plugins/vibed/nine_button_selector.cpp +++ b/plugins/vibed/nine_button_selector.cpp @@ -54,7 +54,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, Uint32 _x, Uint32 _y, QWidget * _parent ): QWidget( _parent ), - intModelView( new nineButtonSelectorModel(0, 8, _default, NULL, + IntModelView( new nineButtonSelectorModel(0, 8, _default, NULL, QString::null, TRUE ), this ) { setFixedSize( 50, 50 ); diff --git a/plugins/vibed/nine_button_selector.h b/plugins/vibed/nine_button_selector.h index 67e247375..f22b9e7fc 100644 --- a/plugins/vibed/nine_button_selector.h +++ b/plugins/vibed/nine_button_selector.h @@ -28,7 +28,7 @@ #include "pixmap_button.h" -class nineButtonSelector: public QWidget , public intModelView +class nineButtonSelector: public QWidget , public IntModelView { Q_OBJECT @@ -91,6 +91,6 @@ private: } ; -typedef intModel nineButtonSelectorModel; +typedef IntModel nineButtonSelectorModel; #endif diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index 557535516..f772bcddb 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -2,7 +2,7 @@ * vibed.cpp - combination of PluckedStringSynth and BitInvader * * Copyright (c) 2006-2008 Danny McRae - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -28,12 +28,12 @@ #include "vibed.h" #include "engine.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "note_play_handle.h" #include "tooltip.h" #include "base64.h" #include "caption_menu.h" -#include "oscillator.h" +#include "Oscillator.h" #include "string_container.h" #include "templates.h" #include "volume.h" @@ -45,7 +45,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT vibedstrings_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT vibedstrings_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "Vibed", @@ -53,8 +53,8 @@ plugin::descriptor PLUGIN_EXPORT vibedstrings_plugin_descriptor = "Vibrating string modeler" ), "Danny McRae ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), NULL, NULL }; @@ -62,54 +62,54 @@ plugin::descriptor PLUGIN_EXPORT vibedstrings_plugin_descriptor = } -vibed::vibed( instrumentTrack * instrument_track ) : - instrument( instrument_track, &vibedstrings_plugin_descriptor ) +vibed::vibed( InstrumentTrack * _instrumentTrack ) : + Instrument( _instrumentTrack, &vibedstrings_plugin_descriptor ) { - knobModel * knob; - boolModel * led; + FloatModel * knob; + BoolModel * led; nineButtonSelectorModel * harmonic; graphModel * graphTmp; for( Uint8 harm = 0; harm < 9; harm++ ) { - knob = new knobModel( DefaultVolume, MinVolume, MaxVolume, + knob = new FloatModel( DefaultVolume, MinVolume, MaxVolume, 1.0f, this, tr( "String %1 volume" ).arg( harm+1 ) ); m_volumeKnobs.append( knob ); - knob = new knobModel( 0.0f, 0.0f, 0.05f, 0.001f, this, + knob = new FloatModel( 0.0f, 0.0f, 0.05f, 0.001f, this, tr( "String %1 stiffness" ).arg( harm+1 ) ); m_stiffnessKnobs.append( knob ); - knob = new knobModel( 0.0f, 0.0f, 0.05f, 0.005f, this, + knob = new FloatModel( 0.0f, 0.0f, 0.05f, 0.005f, this, tr( "Pick %1 position" ).arg( harm+1 ) ); m_pickKnobs.append( knob ); - knob = new knobModel( 0.05f, 0.0f, 0.05f, 0.005f, this, + knob = new FloatModel( 0.05f, 0.0f, 0.05f, 0.005f, this, tr( "Pickup %1 position" ).arg( harm+1 ) ); m_pickupKnobs.append( knob ); - knob = new knobModel( 0.0f, -1.0f, 1.0f, 0.01f, this, + knob = new FloatModel( 0.0f, -1.0f, 1.0f, 0.01f, this, tr( "Pan %1" ).arg( harm+1 ) ); m_panKnobs.append( knob ); - knob = new knobModel( 0.0f, -0.1f, 0.1f, 0.001f, this, + knob = new FloatModel( 0.0f, -0.1f, 0.1f, 0.001f, this, tr( "Detune %1" ).arg( harm+1 ) ); m_detuneKnobs.append( knob ); - knob = new knobModel( 0.0f, 0.0f, 0.75f, 0.01f, this, + knob = new FloatModel( 0.0f, 0.0f, 0.75f, 0.01f, this, tr( "Fuzziness %1 " ).arg( harm+1 ) ); m_randomKnobs.append( knob ); - knob = new knobModel( 1, 1, 16, 1, this, + knob = new FloatModel( 1, 1, 16, 1, this, tr( "Length %1" ).arg( harm+1 ) ); m_lengthKnobs.append( knob ); - led = new boolModel( FALSE, this, + led = new BoolModel( FALSE, this, tr( "Impulse %1" ).arg( harm+1 ) ); m_impulses.append( led ); - led = new boolModel( harm==0, this, + led = new BoolModel( harm==0, this, tr( "Octave %1" ).arg( harm+1 ) ); m_powerButtons.append( led ); @@ -182,11 +182,11 @@ void vibed::saveSettings( QDomDocument & _doc, QDomElement & _this ) QString sampleString; base64::encode( - (const char *)m_graphs[i]->samples(), - __sampleLength * sizeof(float), + (const char *)m_graphs[i]->samples(), + __sampleLength * sizeof(float), sampleString ); name = "graph" + QString::number( i ); - _this.setAttribute( name, sampleString ); + _this.setAttribute( name, sampleString ); } } @@ -204,7 +204,7 @@ void vibed::loadSettings( const QDomElement & _this ) name = "active" + QString::number( i ); m_powerButtons[i]->setValue( _this.attribute( name ).toInt() ); - if( m_powerButtons[i]->value() && + if( m_powerButtons[i]->value() && _this.hasAttribute( "volume" + QString::number( i ) ) ) { name = "volume" + QString::number( i ); @@ -258,7 +258,7 @@ void vibed::loadSettings( const QDomElement & _this ) } } -// update(); +// update(); } @@ -315,7 +315,7 @@ void vibed::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) if( ps->exists( string ) ) { // pan: 0 -> left, 1 -> right - const float pan = ( + const float pan = ( m_panKnobs[string]->value() + 1 ) / 2.0f; const sample_t sample = @@ -328,7 +328,7 @@ void vibed::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) } } - getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); + instrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } @@ -342,7 +342,7 @@ void vibed::deleteNotePluginData( notePlayHandle * _n ) -pluginView * vibed::instantiateView( QWidget * _parent ) +PluginView * vibed::instantiateView( QWidget * _parent ) { return( new vibedView( this, _parent ) ); } @@ -351,9 +351,9 @@ pluginView * vibed::instantiateView( QWidget * _parent ) -vibedView::vibedView( instrument * _instrument, +vibedView::vibedView( Instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) + InstrumentView( _instrument, _parent ) { setAutoFillBackground( TRUE ); QPalette pal; @@ -370,9 +370,9 @@ vibedView::vibedView( instrument * _instrument, m_stiffnessKnob = new knob( knobBright_26, this ); m_stiffnessKnob->move( 129, 142 ); - m_stiffnessKnob->setHintText( tr( "String stiffness:" ) + + m_stiffnessKnob->setHintText( tr( "String stiffness:" ) + " ", "" ); - m_stiffnessKnob->setWhatsThis( tr( + m_stiffnessKnob->setWhatsThis( tr( "The 'S' knob sets the stiffness of the selected string. The stiffness " "of the string affects how long the string will ring out. The lower " "the setting, the longer the string will ring." ) ); @@ -381,15 +381,15 @@ vibedView::vibedView( instrument * _instrument, m_pickKnob = new knob( knobBright_26, this ); m_pickKnob->move( 153, 142 ); m_pickKnob->setHintText( tr( "Pick position:" ) + " ", "" ); - m_pickKnob->setWhatsThis( tr( + m_pickKnob->setWhatsThis( tr( "The 'P' knob sets the position where the selected string will be 'picked'. " "The lower the setting the closer the pick is to the bridge." ) ); m_pickupKnob = new knob( knobBright_26, this ); m_pickupKnob->move( 177, 142 ); - m_pickupKnob->setHintText( tr( "Pickup position:" ) + + m_pickupKnob->setHintText( tr( "Pickup position:" ) + " ", "" ); - m_pickupKnob->setWhatsThis( tr( + m_pickupKnob->setWhatsThis( tr( "The 'PU' knob sets the position where the vibrations will be monitored " "for the selected string. The lower the setting, the closer the " "pickup is to the bridge." ) ); @@ -397,32 +397,32 @@ vibedView::vibedView( instrument * _instrument, m_panKnob = new knob( knobBright_26, this ); m_panKnob->move( 105, 187 ); m_panKnob->setHintText( tr( "Pan:" ) + " ", "" ); - m_panKnob->setWhatsThis( tr( + m_panKnob->setWhatsThis( tr( "The Pan knob determines the location of the selected string in the stereo " "field." ) ); m_detuneKnob = new knob( knobBright_26, this ); m_detuneKnob->move( 150, 187 ); m_detuneKnob->setHintText( tr( "Detune:" ) + " ", "" ); - m_detuneKnob->setWhatsThis( tr( + m_detuneKnob->setWhatsThis( tr( "The Detune knob modifies the pitch of the selected string. Settings less " "than zero will cause the string to sound flat. Settings greater than zero " "will cause the string to sound sharp." ) ); m_randomKnob = new knob( knobBright_26, this ); m_randomKnob->move( 194, 187 ); - m_randomKnob->setHintText( tr( "Fuzziness:" ) + + m_randomKnob->setHintText( tr( "Fuzziness:" ) + " ", "" ); - m_randomKnob->setWhatsThis( tr( + m_randomKnob->setWhatsThis( tr( "The Slap knob adds a bit of fuzz to the selected string which is most " "apparent during the attack, though it can also be used to make the string " "sound more 'metallic'.") ); m_lengthKnob = new knob( knobBright_26, this ); m_lengthKnob->move( 23, 193 ); - m_lengthKnob->setHintText( tr( "Length:" ) + + m_lengthKnob->setHintText( tr( "Length:" ) + " ", "" ); - m_lengthKnob->setWhatsThis( tr( + m_lengthKnob->setWhatsThis( tr( "The Length knob sets the length of the selected string. Longer strings " "will both ring longer and sound brighter, however, they will also eat up " "more CPU cycles." ) ); @@ -431,7 +431,7 @@ vibedView::vibedView( instrument * _instrument, m_impulse->move( 23, 94 ); toolTip::add( m_impulse, tr( "Impulse or initial state" ) ); - m_impulse->setWhatsThis( tr( + m_impulse->setWhatsThis( tr( "The 'Imp' selector determines whether the waveform in the graph is to be " "treated as an impulse imparted to the string by the pick or the initial " "state of the string." ) ); @@ -460,7 +460,7 @@ vibedView::vibedView( instrument * _instrument, this ); m_harmonic->setAccessibleName( tr( "Octave" ) ); - m_harmonic->setWhatsThis( tr( + m_harmonic->setWhatsThis( tr( "The Octave selector is used to choose which harmonic of the note the " "string will ring at. For example, '-2' means the string will ring two " "octaves below the fundamental, 'F' means the string will ring at the " @@ -497,7 +497,7 @@ vibedView::vibedView( instrument * _instrument, m_graph->move( 76, 21 ); m_graph->resize(132, 104); - m_graph->setWhatsThis( tr( + m_graph->setWhatsThis( tr( "The waveform editor provides control over the initial state or impulse " "that is used to start the string vibrating. The buttons to the right of " "the graph will initialize the waveform to the selected type. The '?' " @@ -511,7 +511,7 @@ vibedView::vibedView( instrument * _instrument, "The 'N' button will normalize the waveform.") ); - setWhatsThis( tr( + setWhatsThis( tr( "Vibed models up to nine independently vibrating strings. The 'String' " "selector allows you to choose which string is being edited. The 'Imp' " "selector chooses whether the graph represents an impulse or the initial " "state of the string. The 'Octave' selector chooses which harmonic the " @@ -541,7 +541,7 @@ vibedView::vibedView( instrument * _instrument, // String selector is not a part of the model m_stringSelector->setAccessibleName( tr( "String" ) ); - m_stringSelector->setWhatsThis( tr( + m_stringSelector->setWhatsThis( tr( "The String selector is used to choose which string the controls are " "editting. A Vibed instrument can contain up to nine independently " "vibrating strings. The LED in the lower right corner of the " @@ -780,9 +780,9 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { - return( new vibed( static_cast( _data ) ) ); + return( new vibed( static_cast( _data ) ) ); } diff --git a/plugins/vibed/vibed.h b/plugins/vibed/vibed.h index de2e7033a..077f85c27 100644 --- a/plugins/vibed/vibed.h +++ b/plugins/vibed/vibed.h @@ -24,8 +24,8 @@ #ifndef _VIBED_H #define _VIBED_H -#include "instrument.h" -#include "instrument_view.h" +#include "Instrument.h" +#include "InstrumentView.h" #include "sample_buffer.h" #include "graph.h" #include "knob.h" @@ -36,11 +36,11 @@ class vibedView; class notePlayHandle; -class vibed : public instrument +class vibed : public Instrument { Q_OBJECT public: - vibed( instrumentTrack * _instrument_track ); + vibed( InstrumentTrack * _instrument_track ); virtual ~vibed(); virtual void playNote( notePlayHandle * _n, @@ -58,21 +58,21 @@ public: return( false ); } - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); private: - QList m_pickKnobs; - QList m_pickupKnobs; - QList m_stiffnessKnobs; - QList m_volumeKnobs; - QList m_panKnobs; - QList m_detuneKnobs; - QList m_randomKnobs; - QList m_lengthKnobs; - QList m_powerButtons; + QList m_pickKnobs; + QList m_pickupKnobs; + QList m_stiffnessKnobs; + QList m_volumeKnobs; + QList m_panKnobs; + QList m_detuneKnobs; + QList m_randomKnobs; + QList m_lengthKnobs; + QList m_powerButtons; QList m_graphs; - QList m_impulses; + QList m_impulses; QList m_harmonics; static const int __sampleLength = 128; @@ -82,11 +82,11 @@ private: -class vibedView : public instrumentView +class vibedView : public InstrumentView { Q_OBJECT public: - vibedView( instrument * _instrument, + vibedView( Instrument * _instrument, QWidget * _parent ); virtual ~vibedView() {}; diff --git a/plugins/vst_base/CMakeLists.txt b/plugins/vst_base/CMakeLists.txt index 0f92429e0..8dff485c8 100644 --- a/plugins/vst_base/CMakeLists.txt +++ b/plugins/vst_base/CMakeLists.txt @@ -2,7 +2,7 @@ IF(LMMS_SUPPORT_VST) INCLUDE(BuildPlugin) -BUILD_PLUGIN(vstbase vst_base.cpp vst_plugin.cpp vst_plugin.h communication.h MOCFILES vst_plugin.h) +BUILD_PLUGIN(vstbase vst_base.cpp VstPlugin.cpp VstPlugin.h communication.h MOCFILES VstPlugin.h) IF(LMMS_BUILD_WIN32) diff --git a/plugins/vst_base/vst_plugin.cpp b/plugins/vst_base/VstPlugin.cpp similarity index 87% rename from plugins/vst_base/vst_plugin.cpp rename to plugins/vst_base/VstPlugin.cpp index 2e6df51d8..8d8c2ba1b 100644 --- a/plugins/vst_base/vst_plugin.cpp +++ b/plugins/vst_base/VstPlugin.cpp @@ -1,5 +1,5 @@ /* - * vst_plugin.cpp - implementation of vstPlugin class + * VstPlugin.cpp - implementation of VstPlugin class * * Copyright (c) 2005-2009 Tobias Doerffel * @@ -22,8 +22,7 @@ * */ - -#include "vst_plugin.h" +#include "VstPlugin.h" #include #include @@ -40,15 +39,13 @@ #endif #include - #ifdef LMMS_BUILD_WIN32 #include #endif - #include "config_mgr.h" #include "engine.h" -#include "main_window.h" +#include "MainWindow.h" #include "song.h" #include "templates.h" @@ -78,17 +75,17 @@ public: -vstPlugin::vstPlugin( const QString & _plugin ) : +VstPlugin::VstPlugin( const QString & _plugin ) : QObject(), - journallingObject(), - remotePlugin( "remote_vst_plugin", false ), + JournallingObject(), + RemotePlugin( "remote_vst_plugin", false ), m_plugin( _plugin ), m_pluginWidget( NULL ), m_pluginWindowID( 0 ), - m_name( "" ), + m_name(), m_version( 0 ), - m_vendorString( "" ), - m_productString( "" ) + m_vendorString(), + m_productString() { setSplittedChannels( true ); @@ -145,7 +142,7 @@ vstPlugin::vstPlugin( const QString & _plugin ) : { target->setFixedSize( m_pluginGeometry ); vstSubWin * sw = new vstSubWin( - engine::getMainWindow()->workspace() ); + engine::mainWindow()->workspace() ); sw->setWidget( helper ); helper->setWindowTitle( name() ); m_pluginWidget = helper; @@ -167,14 +164,14 @@ vstPlugin::vstPlugin( const QString & _plugin ) : -vstPlugin::~vstPlugin() +VstPlugin::~VstPlugin() { } -void vstPlugin::showEditor( QWidget * _parent ) +void VstPlugin::showEditor( QWidget * _parent ) { QWidget * w = pluginWidget(); if( w ) @@ -195,7 +192,7 @@ void vstPlugin::showEditor( QWidget * _parent ) if( _parent == NULL ) { vstSubWin * sw = new vstSubWin( - engine::getMainWindow()->workspace() ); + engine::mainWindow()->workspace() ); sw->setWidget( m_pluginWidget ); } @@ -214,7 +211,7 @@ void vstPlugin::showEditor( QWidget * _parent ) -void vstPlugin::hideEditor( void ) +void VstPlugin::hideEditor() { QWidget * w = pluginWidget(); if( w ) @@ -226,7 +223,7 @@ void vstPlugin::hideEditor( void ) -void vstPlugin::loadSettings( const QDomElement & _this ) +void VstPlugin::loadSettings( const QDomElement & _this ) { if( pluginWidget() != NULL ) { @@ -265,7 +262,7 @@ void vstPlugin::loadSettings( const QDomElement & _this ) -void vstPlugin::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void VstPlugin::saveSettings( QDomDocument & _doc, QDomElement & _this ) { if( pluginWidget() != NULL ) { @@ -295,7 +292,7 @@ void vstPlugin::saveSettings( QDomDocument & _doc, QDomElement & _this ) -void vstPlugin::setTempo( bpm_t _bpm ) +void VstPlugin::setTempo( bpm_t _bpm ) { lock(); sendMessage( message( IdVstSetTempo ).addInt( _bpm ) ); @@ -305,7 +302,7 @@ void vstPlugin::setTempo( bpm_t _bpm ) -void vstPlugin::updateSampleRate( void ) +void VstPlugin::updateSampleRate() { lock(); sendMessage( message( IdSampleRateInformation ). @@ -316,7 +313,7 @@ void vstPlugin::updateSampleRate( void ) -const QMap & vstPlugin::parameterDump( void ) +const QMap & VstPlugin::parameterDump() { lock(); sendMessage( IdVstGetParameterDump ); @@ -329,14 +326,14 @@ const QMap & vstPlugin::parameterDump( void ) -void vstPlugin::setParameterDump( const QMap & _pdump ) +void VstPlugin::setParameterDump( const QMap & _pdump ) { message m( IdVstSetParameterDump ); m.addInt( _pdump.size() ); - for( QMap::const_iterator it = _pdump.begin(); + for( QMap::ConstIterator it = _pdump.begin(); it != _pdump.end(); ++it ) { - const vstParameterDumpItem item = + const VstParameterDumpItem item = { ( *it ).section( ':', 0, 0 ).toInt(), "", @@ -354,7 +351,7 @@ void vstPlugin::setParameterDump( const QMap & _pdump ) -bool vstPlugin::processMessage( const message & _m ) +bool VstPlugin::processMessage( const message & _m ) { switch( _m.id ) { @@ -395,7 +392,7 @@ bool vstPlugin::processMessage( const message & _m ) int p = 0; for( int i = 0; i < num_params; ++i ) { - vstParameterDumpItem item; + VstParameterDumpItem item; item.index = _m.getInt( ++p ); item.shortLabel = _m.getString( ++p ); item.value = _m.getFloat( ++p ); @@ -407,7 +404,7 @@ bool vstPlugin::processMessage( const message & _m ) break; } default: - return remotePlugin::processMessage( _m ); + return RemotePlugin::processMessage( _m ); } return true; @@ -416,7 +413,7 @@ bool vstPlugin::processMessage( const message & _m ) -void vstPlugin::loadChunk( const QByteArray & _chunk ) +void VstPlugin::loadChunk( const QByteArray & _chunk ) { QTemporaryFile tf; if( tf.open() ) @@ -436,7 +433,7 @@ void vstPlugin::loadChunk( const QByteArray & _chunk ) -QByteArray vstPlugin::saveChunk( void ) +QByteArray VstPlugin::saveChunk() { QByteArray a; QTemporaryFile tf; @@ -456,5 +453,5 @@ QByteArray vstPlugin::saveChunk( void ) } -#include "moc_vst_plugin.cxx" +#include "moc_VstPlugin.cxx" diff --git a/plugins/vst_base/vst_plugin.h b/plugins/vst_base/VstPlugin.h similarity index 76% rename from plugins/vst_base/vst_plugin.h rename to plugins/vst_base/VstPlugin.h index 6c4e71260..c365b9253 100644 --- a/plugins/vst_base/vst_plugin.h +++ b/plugins/vst_base/VstPlugin.h @@ -1,8 +1,8 @@ /* - * vst_plugin.h - declaration of vstPlugin class + * VstPlugin.h - declaration of VstPlugin class * * Copyright (c) 2005-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ * */ - #ifndef _VST_PLUGIN_H #define _VST_PLUGIN_H @@ -31,51 +30,49 @@ #include #include "mixer.h" -#include "journalling_object.h" +#include "JournallingObject.h" #include "communication.h" -#include "remote_plugin.h" - -class PLUGIN_EXPORT vstPlugin : public QObject, public journallingObject, - public remotePlugin +class PLUGIN_EXPORT VstPlugin : public QObject, public JournallingObject, + public RemotePlugin { Q_OBJECT public: - vstPlugin( const QString & _plugin ); - virtual ~vstPlugin(); + VstPlugin( const QString & _plugin ); + virtual ~VstPlugin(); virtual bool processMessage( const message & _m ); - inline bool hasEditor( void ) const + inline bool hasEditor() const { return m_pluginWindowID != 0; } void showEditor( QWidget * _parent = NULL ); - void hideEditor( void ); + void hideEditor(); - inline const QString & name( void ) const + inline const QString & name() const { return m_name; } - inline Sint32 version( void ) const + inline Sint32 version() const { return m_version; } - inline const QString & vendorString( void ) const + inline const QString & vendorString() const { return m_vendorString; } - inline const QString & productString( void ) const + inline const QString & productString() const { return m_productString; } - const QMap & parameterDump( void ); + const QMap & parameterDump(); void setParameterDump( const QMap & _pdump ); @@ -94,7 +91,7 @@ public: virtual void loadSettings( const QDomElement & _this ); virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { return "vstplugin"; } @@ -102,12 +99,12 @@ public: public slots: void setTempo( bpm_t _bpm ); - void updateSampleRate( void ); + void updateSampleRate(); private: void loadChunk( const QByteArray & _chunk ); - QByteArray saveChunk( void ); + QByteArray saveChunk(); QString m_plugin; QWidget * m_pluginWidget; diff --git a/plugins/vst_base/communication.h b/plugins/vst_base/communication.h index 4fcf6a7bd..8b46b17ba 100644 --- a/plugins/vst_base/communication.h +++ b/plugins/vst_base/communication.h @@ -27,10 +27,10 @@ #ifndef _COMMUNICATION_H #define _COMMUNICATION_H -#include "remote_plugin.h" +#include "RemotePlugin.h" -struct vstParameterDumpItem +struct VstParameterDumpItem { int32_t index; std::string shortLabel; diff --git a/plugins/vst_base/remote_vst_plugin.cpp b/plugins/vst_base/remote_vst_plugin.cpp index 915333c8d..e2c96e971 100644 --- a/plugins/vst_base/remote_vst_plugin.cpp +++ b/plugins/vst_base/remote_vst_plugin.cpp @@ -1,5 +1,5 @@ /* - * remote_vst_plugin.cpp - LMMS VST Support Layer (remotePlugin client) + * remote_vst_plugin.cpp - LMMS VST Support Layer (RemotePlugin client) * * Copyright (c) 2005-2009 Tobias Doerffel * @@ -32,7 +32,7 @@ #define BUILD_REMOTE_PLUGIN_CLIENT -#include "remote_plugin.h" +#include "RemotePlugin.h" #ifdef LMMS_HAVE_PTHREAD_H #include @@ -108,7 +108,7 @@ DWORD __GuiThreadID = NULL; -class RemoteVstPlugin : public remotePluginClient +class RemoteVstPlugin : public RemotePluginClient { public: RemoteVstPlugin( key_t _shm_in, key_t _shm_out ); @@ -280,7 +280,7 @@ private: RemoteVstPlugin::RemoteVstPlugin( key_t _shm_in, key_t _shm_out ) : - remotePluginClient( _shm_in, _shm_out ), + RemotePluginClient( _shm_in, _shm_out ), m_shortName( "" ), m_libInst( NULL ), m_plugin( NULL ), @@ -390,7 +390,7 @@ bool RemoteVstPlugin::processMessage( const message & _m ) break; default: - return remotePluginClient::processMessage( _m ); + return RemotePluginClient::processMessage( _m ); } return true; } @@ -751,7 +751,7 @@ void RemoteVstPlugin::setParameterDump( const message & _m ) int p = 0; for( int i = 0; i < params; ++i ) { - vstParameterDumpItem item; + VstParameterDumpItem item; item.index = _m.getInt( ++p ); item.shortLabel = _m.getString( ++p ); item.value = _m.getFloat( ++p ); @@ -1216,7 +1216,7 @@ DWORD WINAPI RemoteVstPlugin::processingThread( LPVOID _param ) { RemoteVstPlugin * _this = static_cast( _param ); - remotePluginClient::message m; + RemotePluginClient::message m; while( ( m = _this->receiveMessage() ).id != IdQuit ) { if( m.id == IdStartProcessing || m.id == IdMidiEvent ) diff --git a/plugins/vst_base/vst_base.cpp b/plugins/vst_base/vst_base.cpp index 86e6a3065..51460fe19 100644 --- a/plugins/vst_base/vst_base.cpp +++ b/plugins/vst_base/vst_base.cpp @@ -1,11 +1,11 @@ /* - * vst_base.cpp - VST-base-code to be used by any LMMS-plugins dealing with VST- + * vst_base.cpp - VST-base-code to be used by any LMMS plugins dealing with VST- * plugins * - * Copyright (c) 2006-2008 Tobias Doerffel + * Copyright (c) 2006-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net - * + * * 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 @@ -24,21 +24,21 @@ */ -#include "plugin.h" +#include "Plugin.h" #include "embed.h" extern "C" { -plugin::descriptor vstbase_plugin_descriptor = +Plugin::Descriptor vstbase_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "VST Base", - "library for all LMMS-plugins dealing with VST-plugins", + "library for all LMMS plugins dealing with VST-plugins", "Tobias Doerffel ", 0x0100, - plugin::Library, + Plugin::Library, NULL, NULL } ; diff --git a/plugins/vst_effect/CMakeLists.txt b/plugins/vst_effect/CMakeLists.txt index 1c5ca523c..fbb3b2bea 100644 --- a/plugins/vst_effect/CMakeLists.txt +++ b/plugins/vst_effect/CMakeLists.txt @@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(../vst_base) LINK_DIRECTORIES(../vst_base) LINK_LIBRARIES(vstbase) -BUILD_PLUGIN(vsteffect vst_effect.cpp vst_effect_controls.cpp vst_effect_control_dialog.cpp vst_subplugin_features.cpp vst_effect.h vst_effect_controls.h vst_effect_control_dialog.h vst_subplugin_features.h MOCFILES vst_effect_controls.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png) +BUILD_PLUGIN(vsteffect VstEffect.cpp VstEffectControls.cpp VstEffectControlDialog.cpp VstSubPluginFeatures.cpp VstEffect.h VstEffectControls.h VstEffectControlDialog.h VstSubPluginFeatures.h MOCFILES VstEffectControls.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png) SET_TARGET_PROPERTIES(vsteffect PROPERTIES COMPILE_FLAGS "-Wno-attributes") diff --git a/plugins/vst_effect/vst_effect.cpp b/plugins/vst_effect/VstEffect.cpp similarity index 74% rename from plugins/vst_effect/vst_effect.cpp rename to plugins/vst_effect/VstEffect.cpp index 637c5ea1b..02283851c 100644 --- a/plugins/vst_effect/vst_effect.cpp +++ b/plugins/vst_effect/VstEffect.cpp @@ -1,8 +1,8 @@ /* - * vst_effect.cpp - class for handling VST effect plugins + * VstEffect.cpp - class for handling VST effect plugins * * Copyright (c) 2006-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,13 +22,12 @@ * */ -#include "vst_effect.h" - #include +#include "VstEffect.h" #include "song.h" #include "text_float.h" -#include "vst_subplugin_features.h" +#include "VstSubPluginFeatures.h" #include "embed.cpp" @@ -36,7 +35,7 @@ extern "C" { -plugin::descriptor vsteffect_plugin_descriptor = +Plugin::Descriptor vsteffect_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "VST Effect", @@ -45,18 +44,18 @@ plugin::descriptor vsteffect_plugin_descriptor = "inside LMMS." ), "Tobias Doerffel ", 0x0200, - plugin::Effect, - new pluginPixmapLoader( "logo" ), + Plugin::Effect, + new PluginPixmapLoader( "logo" ), NULL, - new vstSubPluginFeatures( plugin::Effect ) + new VstSubPluginFeatures( Plugin::Effect ) } ; } -vstEffect::vstEffect( model * _parent, - const descriptor::subPluginFeatures::key * _key ) : - effect( &vsteffect_plugin_descriptor, _parent, _key ), +VstEffect::VstEffect( Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ) : + Effect( &vsteffect_plugin_descriptor, _parent, _key ), m_plugin( NULL ), m_pluginMutex(), m_key( *_key ), @@ -72,7 +71,7 @@ vstEffect::vstEffect( model * _parent, -vstEffect::~vstEffect() +VstEffect::~VstEffect() { closePlugin(); } @@ -80,7 +79,7 @@ vstEffect::~vstEffect() -bool vstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) +bool VstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) { if( !isEnabled() || !isRunning () ) { @@ -89,7 +88,7 @@ bool vstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) if( m_plugin ) { - const float d = getDryLevel(); + const float d = dryLevel(); #ifdef __GNUC__ sampleFrame buf[_frames]; #else @@ -101,7 +100,7 @@ bool vstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) m_pluginMutex.unlock(); double out_sum = 0.0; - const float w = getWetLevel(); + const float w = wetLevel(); for( fpp_t f = 0; f < _frames; ++f ) { _buf[f][0] = w*buf[f][0] + d*_buf[f][0]; @@ -123,23 +122,23 @@ bool vstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) -void vstEffect::openPlugin( const QString & _plugin ) +void VstEffect::openPlugin( const QString & _plugin ) { textFloat * tf = textFloat::displayMessage( - vstPlugin::tr( "Loading plugin" ), - vstPlugin::tr( + VstPlugin::tr( "Loading plugin" ), + VstPlugin::tr( "Please wait while loading VST-plugin..." ), PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ), 0 ); m_pluginMutex.lock(); - m_plugin = new vstPlugin( _plugin ); + m_plugin = new VstPlugin( _plugin ); if( m_plugin->failed() ) { m_pluginMutex.unlock(); closePlugin(); delete tf; QMessageBox::information( NULL, - vstPlugin::tr( "Failed loading VST-plugin" ), - vstPlugin::tr( "The VST-plugin %1 could not " + VstPlugin::tr( "Failed loading VST-plugin" ), + VstPlugin::tr( "The VST-plugin %1 could not " "be loaded for some reason.\n" "If it runs with other VST-" "software under Linux, please " @@ -148,7 +147,7 @@ void vstEffect::openPlugin( const QString & _plugin ) QMessageBox::Ok ); return; } - vstPlugin::connect( engine::getSong(), + VstPlugin::connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), m_plugin, SLOT( setTempo( bpm_t ) ) ); m_plugin->setTempo( engine::getSong()->getTempo() ); @@ -160,7 +159,7 @@ void vstEffect::openPlugin( const QString & _plugin ) -void vstEffect::closePlugin( void ) +void VstEffect::closePlugin() { m_pluginMutex.lock(); delete m_plugin; @@ -176,10 +175,10 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * lmms_plugin_main( model * _parent, void * _data ) +Plugin * lmms_plugin_main( Model * _parent, void * _data ) { - return new vstEffect( _parent, - static_cast( + return new VstEffect( _parent, + static_cast( _data ) ); } diff --git a/plugins/vst_effect/vst_effect.h b/plugins/vst_effect/VstEffect.h similarity index 67% rename from plugins/vst_effect/vst_effect.h rename to plugins/vst_effect/VstEffect.h index 244a35995..5fdcfa224 100644 --- a/plugins/vst_effect/vst_effect.h +++ b/plugins/vst_effect/VstEffect.h @@ -1,8 +1,8 @@ /* - * vst_effect.h - class for handling VST effect plugins + * VstEffect.h - class for handling VST effect plugins * * Copyright (c) 2006-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,36 +22,33 @@ * */ - #ifndef _VST_EFFECT_H #define _VST_EFFECT_H #include -#include "effect.h" -#include "vst_plugin.h" -#include "vst_effect_control_dialog.h" -#include "vst_effect_controls.h" +#include "Effect.h" +#include "VstPlugin.h" +#include "VstEffectControlDialog.h" +#include "VstEffectControls.h" - -class vstEffect : public effect +class VstEffect : public Effect { public: - vstEffect( model * _parent, - const descriptor::subPluginFeatures::key * _key ); - virtual ~vstEffect(); + VstEffect( Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ); + virtual ~VstEffect(); virtual bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ); - virtual effectControls * getControls( void ) + virtual EffectControls * controls() { return &m_vstControls; } - - virtual inline QString publicName( void ) const + virtual inline QString publicName() const { return m_plugin->name(); } @@ -59,17 +56,17 @@ public: private: void openPlugin( const QString & _plugin ); - void closePlugin( void ); + void closePlugin(); - vstPlugin * m_plugin; + VstPlugin * m_plugin; QMutex m_pluginMutex; - effectKey m_key; + EffectKey m_key; - vstEffectControls m_vstControls; + VstEffectControls m_vstControls; - friend class vstEffectControls; - friend class vstEffectControlDialog; + friend class VstEffectControls; + friend class VstEffectControlDialog; } ; diff --git a/plugins/vst_effect/vst_effect_control_dialog.cpp b/plugins/vst_effect/VstEffectControlDialog.cpp similarity index 80% rename from plugins/vst_effect/vst_effect_control_dialog.cpp rename to plugins/vst_effect/VstEffectControlDialog.cpp index 1d0b0b7b5..2a918ff41 100644 --- a/plugins/vst_effect/vst_effect_control_dialog.cpp +++ b/plugins/vst_effect/VstEffectControlDialog.cpp @@ -1,5 +1,5 @@ /* - * vst_effect_control_dialog.cpp - dialog for displaying VST-effect GUI + * VstEffectControlDialog.cpp - dialog for displaying VST-effect GUI * * Copyright (c) 2006-2008 Tobias Doerffel * @@ -25,14 +25,13 @@ #include #include -#include "vst_effect_control_dialog.h" -#include "vst_effect.h" -#include "main_window.h" +#include "VstEffectControlDialog.h" +#include "VstEffect.h" -vstEffectControlDialog::vstEffectControlDialog( vstEffectControls * _ctl ) : - effectControlDialog( _ctl ) +VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) : + EffectControlDialog( _ctl ) { QVBoxLayout * l = new QVBoxLayout( this ); l->setMargin( 0 ); @@ -50,7 +49,7 @@ vstEffectControlDialog::vstEffectControlDialog( vstEffectControls * _ctl ) : -vstEffectControlDialog::~vstEffectControlDialog() +VstEffectControlDialog::~VstEffectControlDialog() { } diff --git a/plugins/vst_effect/vst_effect_control_dialog.h b/plugins/vst_effect/VstEffectControlDialog.h similarity index 77% rename from plugins/vst_effect/vst_effect_control_dialog.h rename to plugins/vst_effect/VstEffectControlDialog.h index 3302f838e..1fe950009 100644 --- a/plugins/vst_effect/vst_effect_control_dialog.h +++ b/plugins/vst_effect/VstEffectControlDialog.h @@ -1,5 +1,5 @@ /* - * vst_effect_control_dialog.h - dialog for displaying GUI of VST-effect-plugin + * VstEffectControlDialog.h - dialog for displaying GUI of VST-effect-plugin * * Copyright (c) 2006-2008 Tobias Doerffel * @@ -25,17 +25,17 @@ #ifndef _VST_EFFECT_CONTROL_DIALOG_H #define _VST_EFFECT_CONTROL_DIALOG_H -#include "effect_control_dialog.h" +#include "EffectControlDialog.h" -class vstEffectControls; +class VstEffectControls; -class vstEffectControlDialog : public effectControlDialog +class VstEffectControlDialog : public EffectControlDialog { public: - vstEffectControlDialog( vstEffectControls * _controls ); - virtual ~vstEffectControlDialog(); + VstEffectControlDialog( VstEffectControls * _controls ); + virtual ~VstEffectControlDialog(); } ; diff --git a/plugins/vst_effect/vst_effect_controls.cpp b/plugins/vst_effect/VstEffectControls.cpp similarity index 78% rename from plugins/vst_effect/vst_effect_controls.cpp rename to plugins/vst_effect/VstEffectControls.cpp index 278e0625b..da910f38d 100644 --- a/plugins/vst_effect/vst_effect_controls.cpp +++ b/plugins/vst_effect/VstEffectControls.cpp @@ -1,8 +1,8 @@ /* - * vst_effect_controls.cpp - controls for VST effect plugins + * VstEffectControls.cpp - controls for VST effect plugins * * Copyright (c) 2008-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,16 +22,15 @@ * */ - #include -#include "vst_effect_controls.h" -#include "vst_effect.h" +#include "VstEffectControls.h" +#include "VstEffect.h" -vstEffectControls::vstEffectControls( vstEffect * _eff ) : - effectControls( _eff ), +VstEffectControls::VstEffectControls( VstEffect * _eff ) : + EffectControls( _eff ), m_effect( _eff ) { } @@ -39,7 +38,7 @@ vstEffectControls::vstEffectControls( vstEffect * _eff ) : -void vstEffectControls::loadSettings( const QDomElement & _this ) +void VstEffectControls::loadSettings( const QDomElement & _this ) { m_effect->closePlugin(); m_effect->openPlugin( _this.attribute( "plugin" ) ); @@ -54,7 +53,7 @@ void vstEffectControls::loadSettings( const QDomElement & _this ) -void vstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void VstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) { _this.setAttribute( "plugin", m_effect->m_key.attributes["file"] ); m_effect->m_pluginMutex.lock(); @@ -68,7 +67,7 @@ void vstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) -int vstEffectControls::getControlCount( void ) +int VstEffectControls::controlCount() { return m_effect->m_plugin != NULL && m_effect->m_plugin->hasEditor() ? 1 : 0; @@ -76,5 +75,5 @@ int vstEffectControls::getControlCount( void ) -#include "moc_vst_effect_controls.cxx" +#include "moc_VstEffectControls.cxx" diff --git a/plugins/vst_effect/vst_effect_controls.h b/plugins/vst_effect/VstEffectControls.h similarity index 70% rename from plugins/vst_effect/vst_effect_controls.h rename to plugins/vst_effect/VstEffectControls.h index 36408fe3b..179593de0 100644 --- a/plugins/vst_effect/vst_effect_controls.h +++ b/plugins/vst_effect/VstEffectControls.h @@ -1,8 +1,8 @@ /* - * vst_effect_controls.h - controls for VST effect plugins + * VstEffectControls.h - controls for VST effect plugins * * Copyright (c) 2008-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,46 +22,44 @@ * */ - #ifndef _VST_EFFECT_CONTROLS_H #define _VST_EFFECT_CONTROLS_H -#include "effect_controls.h" -#include "vst_effect_control_dialog.h" +#include "EffectControls.h" +#include "VstEffectControlDialog.h" -class vstEffect; +class VstEffect; -class vstEffectControls : public effectControls +class VstEffectControls : public EffectControls { Q_OBJECT public: - vstEffectControls( vstEffect * _eff ); - virtual ~vstEffectControls() + VstEffectControls( VstEffect * _eff ); + virtual ~VstEffectControls() { } virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName( void ) const + inline virtual QString nodeName() const { return "vsteffectcontrols"; } - virtual int getControlCount( void ); + virtual int controlCount(); - virtual effectControlDialog * createView( void ) + virtual EffectControlDialog * createView() { - return new vstEffectControlDialog( this ); + return new VstEffectControlDialog( this ); } private: - vstEffect * m_effect; + VstEffect * m_effect; - - friend class vstEffectControlDialog; + friend class VstEffectControlDialog; } ; diff --git a/plugins/vst_effect/vst_subplugin_features.cpp b/plugins/vst_effect/VstSubPluginFeatures.cpp similarity index 65% rename from plugins/vst_effect/vst_subplugin_features.cpp rename to plugins/vst_effect/VstSubPluginFeatures.cpp index 7e6dc1b4c..3b89d7691 100644 --- a/plugins/vst_effect/vst_subplugin_features.cpp +++ b/plugins/vst_effect/VstSubPluginFeatures.cpp @@ -1,9 +1,9 @@ /* - * vst_subplugin_features.cpp - derivation from - * plugin::descriptor::subPluginFeatures for - * hosting VST-plugins + * VstSubPluginFeatures.cpp - derivation from + * Plugin::Descriptor::SubPluginFeatures for + * hosting VST-plugins * - * Copyright (c) 2006-2008 Tobias Doerffel + * Copyright (c) 2006-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -24,25 +24,23 @@ * */ - -#include "vst_subplugin_features.h" - #include #include +#include "VstSubPluginFeatures.h" #include "config_mgr.h" -vstSubPluginFeatures::vstSubPluginFeatures( plugin::PluginTypes _type ) : - subPluginFeatures( _type ) +VstSubPluginFeatures::VstSubPluginFeatures( Plugin::PluginTypes _type ) : + SubPluginFeatures( _type ) { } -void vstSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, - const key * _key ) +void VstSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, + const Key * _key ) { new QLabel( QWidget::tr( "Name: " ) + _key->name, _parent ); new QLabel( QWidget::tr( "File: " ) + _key->attributes["file"], @@ -52,19 +50,19 @@ void vstSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, -void vstSubPluginFeatures::listSubPluginKeys( plugin::descriptor * _desc, - keyList & _kl ) +void VstSubPluginFeatures::listSubPluginKeys( Plugin::Descriptor * _desc, + KeyList & _kl ) { QStringList dlls = QDir( configManager::inst()->vstDir() ). entryList( QStringList() << "*.dll", QDir::Files, QDir::Name ); // TODO: eval m_type - for( QStringList::const_iterator it = dlls.begin(); + for( QStringList::ConstIterator it = dlls.begin(); it != dlls.end(); ++it ) { - effectKey::attributeMap am; + EffectKey::AttributeMap am; am["file"] = *it; - _kl.push_back( key( _desc, QFileInfo( *it ).baseName(), am ) ); + _kl.push_back( Key( _desc, QFileInfo( *it ).baseName(), am ) ); } } diff --git a/plugins/vst_effect/vst_subplugin_features.h b/plugins/vst_effect/VstSubPluginFeatures.h similarity index 63% rename from plugins/vst_effect/vst_subplugin_features.h rename to plugins/vst_effect/VstSubPluginFeatures.h index 0a7dd3c98..0f1377427 100644 --- a/plugins/vst_effect/vst_subplugin_features.h +++ b/plugins/vst_effect/VstSubPluginFeatures.h @@ -1,10 +1,10 @@ /* - * vst_subplugin_features.h - derivation from - * plugin::descriptor::subPluginFeatures for - * hosting VST-plugins + * VstSubPluginFeatures.h - derivation from + * Plugin::Descriptor::SubPluginFeatures for + * hosting VST-plugins + * + * Copyright (c) 2006-2009 Tobias Doerffel * - * Copyright (c) 2006-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -24,23 +24,20 @@ * */ - #ifndef _VST_SUBPLUGIN_FEATURES_H #define _VST_SUBPLUGIN_FEATURES_H -#include "effect.h" +#include "Effect.h" -class vstSubPluginFeatures : public plugin::descriptor::subPluginFeatures +class VstSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures { public: - vstSubPluginFeatures( plugin::PluginTypes _type ); + VstSubPluginFeatures( Plugin::PluginTypes _type ); - virtual void fillDescriptionWidget( QWidget * _parent, - const key * _key ); + virtual void fillDescriptionWidget( QWidget * _parent, const Key * _key ); - virtual void listSubPluginKeys( plugin::descriptor * _desc, - keyList & _kl ); + virtual void listSubPluginKeys( Plugin::Descriptor * _desc, KeyList & _kl ); } ; diff --git a/plugins/zynaddsubfx/remote_zynaddsubfx.cpp b/plugins/zynaddsubfx/remote_zynaddsubfx.cpp index c6ab61dfc..9b27ad7a5 100644 --- a/plugins/zynaddsubfx/remote_zynaddsubfx.cpp +++ b/plugins/zynaddsubfx/remote_zynaddsubfx.cpp @@ -1,7 +1,7 @@ /* * remote_zynaddsubfx.cpp - ZynAddSubFX-embedding plugin * - * Copyright (c) 2008 Tobias Doerffel + * Copyright (c) 2008-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -30,7 +30,7 @@ #include "engine.h" #include "instrument_play_handle.h" #include "note_play_handle.h" -#include "remote_plugin.h" +#include "RemotePlugin.h" #include "remote_zynaddsubfx.h" @@ -48,14 +48,14 @@ std::string __presets_dir; static pthread_t __gui_thread_handle; static pthread_mutex_t __gui_mutex; -static std::queue __gui_messages; +static std::queue __gui_messages; -class RemoteZynAddSubFX : public remotePluginClient +class RemoteZynAddSubFX : public RemotePluginClient { public: RemoteZynAddSubFX( int _shm_in, int _shm_out ) : - remotePluginClient( _shm_in, _shm_out ) + RemotePluginClient( _shm_in, _shm_out ) { for( int i = 0; i < NumKeys; ++i ) { @@ -147,7 +147,7 @@ public: break; default: - return remotePluginClient::processMessage( _m ); + return RemotePluginClient::processMessage( _m ); } if( gui_message ) { @@ -255,7 +255,7 @@ void * guiThread( void * ) pthread_mutex_lock( &__gui_mutex ); while( __gui_messages.size() ) { - remotePluginClient::message m = __gui_messages.front(); + RemotePluginClient::message m = __gui_messages.front(); __gui_messages.pop(); switch( m.id ) { @@ -364,7 +364,7 @@ int main( int _argc, char * * _argv ) pthread_create( &__gui_thread_handle, NULL, guiThread, NULL ); - remotePluginClient::message m; + RemotePluginClient::message m; while( ( m = __remote_zasf->receiveMessage() ).id != IdQuit ) { pthread_mutex_lock( &master->mutex ); diff --git a/plugins/zynaddsubfx/remote_zynaddsubfx.h b/plugins/zynaddsubfx/remote_zynaddsubfx.h index 630f9e712..d4aa7fc19 100644 --- a/plugins/zynaddsubfx/remote_zynaddsubfx.h +++ b/plugins/zynaddsubfx/remote_zynaddsubfx.h @@ -26,7 +26,7 @@ #ifndef _REMOTE_ZYNADDSUBFX_H #define _REMOTE_ZYNADDSUBFX_H -#include "remote_plugin.h" +#include "RemotePlugin.h" enum ZasfRemoteMessageIDs { diff --git a/plugins/zynaddsubfx/zynaddsubfx.cpp b/plugins/zynaddsubfx/zynaddsubfx.cpp index c56230a49..94027ee9f 100644 --- a/plugins/zynaddsubfx/zynaddsubfx.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx.cpp @@ -34,7 +34,7 @@ #include "engine.h" #include "mmp.h" #include "instrument_play_handle.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "gui_templates.h" #include "string_pair_drag.h" #include "remote_zynaddsubfx.h" @@ -46,7 +46,7 @@ extern "C" { -plugin::descriptor PLUGIN_EXPORT zynaddsubfx_plugin_descriptor = +Plugin::Descriptor PLUGIN_EXPORT zynaddsubfx_plugin_descriptor = { STRINGIFY( PLUGIN_NAME ), "ZynAddSubFX", @@ -54,8 +54,8 @@ plugin::descriptor PLUGIN_EXPORT zynaddsubfx_plugin_descriptor = "Embedded ZynAddSubFX" ), "Tobias Doerffel ", 0x0100, - plugin::Instrument, - new pluginPixmapLoader( "logo" ), + Plugin::Instrument, + new PluginPixmapLoader( "logo" ), "xiz", NULL, } ; @@ -64,14 +64,14 @@ plugin::descriptor PLUGIN_EXPORT zynaddsubfx_plugin_descriptor = -zynAddSubFx::zynAddSubFx( instrumentTrack * _instrumentTrack ) : - instrument( _instrumentTrack, &zynaddsubfx_plugin_descriptor ), +zynAddSubFx::zynAddSubFx( InstrumentTrack * _instrumentTrack ) : + Instrument( _instrumentTrack, &zynaddsubfx_plugin_descriptor ), m_plugin( NULL ) { initRemotePlugin(); // now we need a play-handle which cares for calling play() - instrumentPlayHandle * iph = new instrumentPlayHandle( this ); + InstrumentPlayHandle * iph = new InstrumentPlayHandle( this ); engine::getMixer()->addPlayHandle( iph ); connect( engine::getMixer(), SIGNAL( sampleRateChanged() ), @@ -83,7 +83,7 @@ zynAddSubFx::zynAddSubFx( instrumentTrack * _instrumentTrack ) : zynAddSubFx::~zynAddSubFx() { - engine::getMixer()->removePlayHandles( getInstrumentTrack() ); + engine::getMixer()->removePlayHandles( instrumentTrack() ); m_pluginMutex.lock(); delete m_plugin; @@ -101,7 +101,7 @@ void zynAddSubFx::saveSettings( QDomDocument & _doc, { m_plugin->lock(); m_plugin->sendMessage( - remotePlugin::message( IdSaveSettingsToFile ). + RemotePlugin::message( IdSaveSettingsToFile ). addString( QSTR_TO_STDSTR( QDir::toNativeSeparators( tf.fileName() ) ) ) ); @@ -143,7 +143,7 @@ void zynAddSubFx::loadSettings( const QDomElement & _this ) tf.write( a ); m_plugin->lock(); m_plugin->sendMessage( - remotePlugin::message( IdLoadSettingsFromFile ). + RemotePlugin::message( IdLoadSettingsFromFile ). addString( QSTR_TO_STDSTR( QDir::toNativeSeparators( tf.fileName() ) ) ) ); @@ -161,7 +161,7 @@ void zynAddSubFx::loadFile( const QString & _file ) { m_plugin->lock(); m_plugin->sendMessage( - remotePlugin::message( IdLoadPresetFromFile ). + RemotePlugin::message( IdLoadPresetFromFile ). addString( QSTR_TO_STDSTR( _file ) ) ); m_plugin->waitForMessage( IdLoadPresetFromFile ); m_plugin->unlock(); @@ -172,7 +172,7 @@ void zynAddSubFx::loadFile( const QString & _file ) -QString zynAddSubFx::nodeName( void ) const +QString zynAddSubFx::nodeName() const { return zynaddsubfx_plugin_descriptor.name; } @@ -185,7 +185,7 @@ void zynAddSubFx::play( sampleFrame * _buf ) m_pluginMutex.lock(); m_plugin->process( NULL, _buf ); m_pluginMutex.unlock(); - getInstrumentTrack()->processAudioBuffer( _buf, + instrumentTrack()->processAudioBuffer( _buf, engine::getMixer()->framesPerPeriod(), NULL ); } @@ -205,7 +205,7 @@ bool zynAddSubFx::handleMidiEvent( const midiEvent & _me, -void zynAddSubFx::updateSampleRate( void ) +void zynAddSubFx::updateSampleRate() { m_pluginMutex.lock(); @@ -222,15 +222,15 @@ void zynAddSubFx::updateSampleRate( void ) -void zynAddSubFx::initRemotePlugin( void ) +void zynAddSubFx::initRemotePlugin() { delete m_plugin; - m_plugin = new remotePlugin( "remote_zynaddsubfx", false ); + m_plugin = new RemotePlugin( "remote_zynaddsubfx", false ); m_plugin->lock(); m_plugin->waitForInitDone( false ); m_plugin->sendMessage( - remotePlugin::message( IdZasfPresetDirectory ). + RemotePlugin::message( IdZasfPresetDirectory ). addString( QSTR_TO_STDSTR( QString( configManager::inst()->factoryPresetsDir() + @@ -241,9 +241,9 @@ void zynAddSubFx::initRemotePlugin( void ) -pluginView * zynAddSubFx::instantiateView( QWidget * _parent ) +PluginView * zynAddSubFx::instantiateView( QWidget * _parent ) { - return new zynAddSubFxView( this, _parent ); + return new ZynAddSubFxView( this, _parent ); } @@ -252,8 +252,8 @@ pluginView * zynAddSubFx::instantiateView( QWidget * _parent ) -zynAddSubFxView::zynAddSubFxView( instrument * _instrument, QWidget * _parent ) : - instrumentView( _instrument, _parent ) +ZynAddSubFxView::ZynAddSubFxView( Instrument * _instrument, QWidget * _parent ) : + InstrumentView( _instrument, _parent ) { setAutoFillBackground( true ); QPalette pal; @@ -279,14 +279,14 @@ zynAddSubFxView::zynAddSubFxView( instrument * _instrument, QWidget * _parent ) -zynAddSubFxView::~zynAddSubFxView() +ZynAddSubFxView::~ZynAddSubFxView() { } -void zynAddSubFxView::dragEnterEvent( QDragEnterEvent * _dee ) +void ZynAddSubFxView::dragEnterEvent( QDragEnterEvent * _dee ) { if( _dee->mimeData()->hasFormat( stringPairDrag::mimeType() ) ) { @@ -310,7 +310,7 @@ void zynAddSubFxView::dragEnterEvent( QDragEnterEvent * _dee ) -void zynAddSubFxView::dropEvent( QDropEvent * _de ) +void ZynAddSubFxView::dropEvent( QDropEvent * _de ) { const QString type = stringPairDrag::decodeKey( _de ); const QString value = stringPairDrag::decodeValue( _de ); @@ -326,7 +326,7 @@ void zynAddSubFxView::dropEvent( QDropEvent * _de ) -void zynAddSubFxView::modelChanged( void ) +void ZynAddSubFxView::modelChanged() { toggleUI(); } @@ -334,7 +334,7 @@ void zynAddSubFxView::modelChanged( void ) -void zynAddSubFxView::toggleUI( void ) +void ZynAddSubFxView::toggleUI() { if( m_toggleUIButton->isChecked() ) { @@ -355,10 +355,10 @@ extern "C" { // neccessary for getting instance out of shared lib -plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) { - return new zynAddSubFx( static_cast( _data ) ); + return new zynAddSubFx( static_cast( _data ) ); } diff --git a/plugins/zynaddsubfx/zynaddsubfx.h b/plugins/zynaddsubfx/zynaddsubfx.h index 91e59146f..a79cd9df3 100644 --- a/plugins/zynaddsubfx/zynaddsubfx.h +++ b/plugins/zynaddsubfx/zynaddsubfx.h @@ -29,22 +29,22 @@ #include #include -#include "instrument.h" -#include "instrument_view.h" -#include "remote_plugin.h" +#include "Instrument.h" +#include "InstrumentView.h" +#include "RemotePlugin.h" class QPushButton; -class zynAddSubFxView; +class ZynAddSubFxView; class notePlayHandle; -class zynAddSubFx : public instrument +class zynAddSubFx : public Instrument { Q_OBJECT public: - zynAddSubFx( instrumentTrack * _instrument_track ); + zynAddSubFx( InstrumentTrack * _instrument_track ); virtual ~zynAddSubFx(); virtual void play( sampleFrame * _working_buffer ); @@ -58,42 +58,42 @@ public: virtual void loadFile( const QString & _file ); - virtual QString nodeName( void ) const; + virtual QString nodeName() const; - virtual bool isMidiBased( void ) const + virtual bool isMidiBased() const { return true; } - virtual pluginView * instantiateView( QWidget * _parent ); + virtual PluginView * instantiateView( QWidget * _parent ); private slots: - void updateSampleRate( void ); + void updateSampleRate(); private: - void initRemotePlugin( void ); + void initRemotePlugin(); QMutex m_pluginMutex; - remotePlugin * m_plugin; + RemotePlugin * m_plugin; - friend class zynAddSubFxView; + friend class ZynAddSubFxView; signals: - void settingsChanged( void ); + void settingsChanged(); } ; -class zynAddSubFxView : public instrumentView +class ZynAddSubFxView : public InstrumentView { Q_OBJECT public: - zynAddSubFxView( instrument * _instrument, QWidget * _parent ); - virtual ~zynAddSubFxView(); + ZynAddSubFxView( Instrument * _instrument, QWidget * _parent ); + virtual ~ZynAddSubFxView(); protected: @@ -102,13 +102,13 @@ protected: private: - void modelChanged( void ); + void modelChanged(); QPushButton * m_toggleUIButton; private slots: - void toggleUI( void ); + void toggleUI(); } ; diff --git a/src/core/automatable_model.cpp b/src/core/AutomatableModel.cpp similarity index 77% rename from src/core/automatable_model.cpp rename to src/core/AutomatableModel.cpp index 2723bfe57..11dab02de 100644 --- a/src/core/automatable_model.cpp +++ b/src/core/AutomatableModel.cpp @@ -1,5 +1,5 @@ /* - * automatable_model.cpp - some implementations of automatableModel-class + * AutomatableModel.cpp - some implementations of AutomatableModel-class * * Copyright (c) 2008-2009 Tobias Doerffel * @@ -22,29 +22,27 @@ * */ - #include - -#include "automatable_model.h" +#include "AutomatableModel.h" #include "automation_pattern.h" #include "ControllerConnection.h" -float automatableModel::__copiedValue = 0; +float AutomatableModel::__copiedValue = 0; -automatableModel::automatableModel( DataType _type, +AutomatableModel::AutomatableModel( DataType _type, const float _val, const float _min, const float _max, const float _step, - ::model * _parent, + ::Model * _parent, const QString & _display_name, bool _default_constructed ) : - model( _parent, _display_name, _default_constructed ), + Model( _parent, _display_name, _default_constructed ), m_dataType( _type ), m_value( _val ), m_initValue( _val ), @@ -62,7 +60,7 @@ automatableModel::automatableModel( DataType _type, -automatableModel::~automatableModel() +AutomatableModel::~AutomatableModel() { while( m_linkedModels.empty() == false ) { @@ -81,7 +79,7 @@ automatableModel::~automatableModel() -bool automatableModel::isAutomated( void ) const +bool AutomatableModel::isAutomated() const { return automationPattern::isAutomated( this ); } @@ -89,7 +87,7 @@ bool automatableModel::isAutomated( void ) const -void automatableModel::saveSettings( QDomDocument & _doc, QDomElement & _this, +void AutomatableModel::saveSettings( QDomDocument & _doc, QDomElement & _this, const QString & _name ) { if( isAutomated() ) @@ -126,7 +124,7 @@ void automatableModel::saveSettings( QDomDocument & _doc, QDomElement & _this, -void automatableModel::loadSettings( const QDomElement & _this, +void AutomatableModel::loadSettings( const QDomElement & _this, const QString & _name ) { // compat code @@ -176,7 +174,7 @@ void automatableModel::loadSettings( const QDomElement & _this, -void automatableModel::setValue( const float _value ) +void AutomatableModel::setValue( const float _value ) { ++m_setValueDepth; const float old_val = m_value; @@ -185,10 +183,10 @@ void automatableModel::setValue( const float _value ) if( old_val != m_value ) { // add changes to history so user can undo it - addJournalEntry( journalEntry( 0, m_value - old_val ) ); + addJournalEntry( JournalEntry( 0, m_value - old_val ) ); // notify linked models - for( autoModelVector::iterator it = + for( AutoModelVector::Iterator it = m_linkedModels.begin(); it != m_linkedModels.end(); ++it ) { @@ -214,7 +212,7 @@ void automatableModel::setValue( const float _value ) -void automatableModel::setAutomatedValue( const float _value ) +void AutomatableModel::setAutomatedValue( const float _value ) { ++m_setValueDepth; const float old_val = m_value; @@ -223,9 +221,8 @@ void automatableModel::setAutomatedValue( const float _value ) if( old_val != m_value ) { // notify linked models - for( autoModelVector::iterator it = - m_linkedModels.begin(); - it != m_linkedModels.end(); ++it ) + for( AutoModelVector::Iterator it = m_linkedModels.begin(); + it != m_linkedModels.end(); ++it ) { if( (*it)->m_setValueDepth < 1 && !(*it)->fittedValue( m_value ) != @@ -242,7 +239,7 @@ void automatableModel::setAutomatedValue( const float _value ) -void automatableModel::setRange( const float _min, const float _max, +void AutomatableModel::setRange( const float _min, const float _max, const float _step ) { if( ( m_maxValue != _max ) || ( m_minValue != _min ) ) @@ -266,7 +263,7 @@ void automatableModel::setRange( const float _min, const float _max, -void automatableModel::setStep( const float _step ) +void AutomatableModel::setStep( const float _step ) { if( m_step != _step ) { @@ -278,7 +275,7 @@ void automatableModel::setStep( const float _step ) -float automatableModel::fittedValue( float _value ) const +float AutomatableModel::fittedValue( float _value ) const { _value = tLimit( _value, m_minValue, m_maxValue ); @@ -321,7 +318,7 @@ float automatableModel::fittedValue( float _value ) const -void automatableModel::redoStep( journalEntry & _je ) +void AutomatableModel::redoStep( JournalEntry & _je ) { bool journalling = testAndSetJournalling( false ); setValue( value() + (float) _je.data().toDouble() ); @@ -331,16 +328,16 @@ void automatableModel::redoStep( journalEntry & _je ) -void automatableModel::undoStep( journalEntry & _je ) +void AutomatableModel::undoStep( JournalEntry & _je ) { - journalEntry je( _je.actionID(), -_je.data().toDouble() ); + JournalEntry je( _je.actionID(), -_je.data().toDouble() ); redoStep( je ); } -void automatableModel::prepareJournalEntryFromOldVal( void ) +void AutomatableModel::prepareJournalEntryFromOldVal() { m_oldValue = value(); saveJournallingState( false ); @@ -350,14 +347,14 @@ void automatableModel::prepareJournalEntryFromOldVal( void ) -void automatableModel::addJournalEntryFromOldToCurVal( void ) +void AutomatableModel::addJournalEntryFromOldToCurVal() { if( m_journalEntryReady ) { restoreJournallingState(); if( value() != m_oldValue ) { - addJournalEntry( journalEntry( 0, value() - + addJournalEntry( JournalEntry( 0, value() - m_oldValue ) ); } m_journalEntryReady = false; @@ -367,7 +364,7 @@ void automatableModel::addJournalEntryFromOldToCurVal( void ) -void automatableModel::linkModel( automatableModel * _model ) +void AutomatableModel::linkModel( AutomatableModel * _model ) { if( !m_linkedModels.contains( _model ) ) { @@ -384,10 +381,10 @@ void automatableModel::linkModel( automatableModel * _model ) -void automatableModel::unlinkModel( automatableModel * _model ) +void AutomatableModel::unlinkModel( AutomatableModel * _model ) { - autoModelVector::iterator it = qFind( m_linkedModels.begin(), - m_linkedModels.end(), _model ); + AutoModelVector::Iterator it = + qFind( m_linkedModels.begin(), m_linkedModels.end(), _model ); if( it != m_linkedModels.end() ) { m_linkedModels.erase( it ); @@ -400,8 +397,8 @@ void automatableModel::unlinkModel( automatableModel * _model ) -void automatableModel::linkModels( automatableModel * _model1, - automatableModel * _model2 ) +void AutomatableModel::linkModels( AutomatableModel * _model1, + AutomatableModel * _model2 ) { _model1->linkModel( _model2 ); _model2->linkModel( _model1 ); @@ -410,8 +407,8 @@ void automatableModel::linkModels( automatableModel * _model1, -void automatableModel::unlinkModels( automatableModel * _model1, - automatableModel * _model2 ) +void AutomatableModel::unlinkModels( AutomatableModel * _model1, + AutomatableModel * _model2 ) { _model1->unlinkModel( _model2 ); _model2->unlinkModel( _model1 ); @@ -420,7 +417,7 @@ void automatableModel::unlinkModels( automatableModel * _model1, -void automatableModel::setControllerConnection( ControllerConnection * _c ) +void AutomatableModel::setControllerConnection( ControllerConnection * _c ) { m_controllerConnection = _c; if( _c ) @@ -437,7 +434,7 @@ void automatableModel::setControllerConnection( ControllerConnection * _c ) -float automatableModel::controllerValue( int _frameOffset ) const +float AutomatableModel::controllerValue( int _frameOffset ) const { if( m_controllerConnection ) { @@ -450,7 +447,7 @@ float automatableModel::controllerValue( int _frameOffset ) const } return v; } - automatableModel * lm = m_linkedModels.first(); + AutomatableModel * lm = m_linkedModels.first(); if( lm->m_controllerConnection ) { return lm->controllerValue( _frameOffset ); @@ -461,7 +458,7 @@ float automatableModel::controllerValue( int _frameOffset ) const -void automatableModel::unlinkControllerConnection( void ) +void AutomatableModel::unlinkControllerConnection() { if( m_controllerConnection ) { @@ -474,7 +471,7 @@ void automatableModel::unlinkControllerConnection( void ) -void automatableModel::setInitValue( const float _value ) +void AutomatableModel::setInitValue( const float _value ) { m_initValue = _value; bool journalling = testAndSetJournalling( false ); @@ -486,7 +483,7 @@ void automatableModel::setInitValue( const float _value ) -void automatableModel::reset( void ) +void AutomatableModel::reset() { setValue( initValue() ); } @@ -494,7 +491,7 @@ void automatableModel::reset( void ) -void automatableModel::copyValue( void ) +void AutomatableModel::copyValue() { __copiedValue = value(); } @@ -502,7 +499,7 @@ void automatableModel::copyValue( void ) -void automatableModel::pasteValue( void ) +void AutomatableModel::pasteValue() { setValue( __copiedValue ); } @@ -510,5 +507,5 @@ void automatableModel::pasteValue( void ) -#include "moc_automatable_model.cxx" +#include "moc_AutomatableModel.cxx" diff --git a/src/core/clipboard.cpp b/src/core/Clipboard.cpp similarity index 70% rename from src/core/clipboard.cpp rename to src/core/Clipboard.cpp index c2130a11e..ede9e1bce 100644 --- a/src/core/clipboard.cpp +++ b/src/core/Clipboard.cpp @@ -1,8 +1,8 @@ /* - * clipboard.cpp - the clipboard for patterns, notes etc. + * Clipboard.cpp - the clipboard for patterns, notes etc. + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2007 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,22 +22,17 @@ * */ - -#include "clipboard.h" -#include "journalling_object.h" +#include "Clipboard.h" +#include "JournallingObject.h" +Clipboard::Map Clipboard::content; -clipboard::map clipboard::content; - - - - -void clipboard::copy( journallingObject * _obj ) +void Clipboard::copy( JournallingObject * _obj ) { QDomDocument doc; - QDomElement parent = doc.createElement( "clipboard" ); + QDomElement parent = doc.createElement( "Clipboard" ); _obj->saveState( doc, parent ); content[_obj->nodeName()] = parent.firstChild().toElement(); } @@ -45,15 +40,14 @@ void clipboard::copy( journallingObject * _obj ) -const QDomElement * clipboard::getContent( const QString & _node_name ) +const QDomElement * Clipboard::getContent( const QString & _node_name ) { if( content.find( _node_name ) != content.end() ) { - return( &content[_node_name] ); + return &content[_node_name]; } - return( NULL ); + return NULL; } - diff --git a/src/core/combobox_model.cpp b/src/core/ComboBoxModel.cpp similarity index 69% rename from src/core/combobox_model.cpp rename to src/core/ComboBoxModel.cpp index aeccc6159..1b8efb3fc 100644 --- a/src/core/combobox_model.cpp +++ b/src/core/ComboBoxModel.cpp @@ -1,8 +1,8 @@ /* - * combobox_model.cpp - implementation of comboBoxModel + * ComboBoxModel.cpp - implementation of ComboBoxModel + * + * Copyright (c) 2008-2009 Tobias Doerffel * - * Copyright (c) 2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -21,14 +21,13 @@ * Boston, MA 02110-1301 USA. * */ - -#include "combobox_model.h" +#include "ComboBoxModel.h" #include "embed.h" -void comboBoxModel::addItem( const QString & _item, pixmapLoader * _pl ) +void ComboBoxModel::addItem( const QString & _item, PixmapLoader * _pl ) { m_items.push_back( qMakePair( _item, _pl ) ); setRange( 0, m_items.size() - 1 ); @@ -37,10 +36,10 @@ void comboBoxModel::addItem( const QString & _item, pixmapLoader * _pl ) -void comboBoxModel::clear( void ) +void ComboBoxModel::clear() { setRange( 0, 0 ); - foreach( const item & _i, m_items ) + foreach( const Item & _i, m_items ) { delete _i.second; } @@ -51,21 +50,20 @@ void comboBoxModel::clear( void ) -int comboBoxModel::findText( const QString & _txt ) const +int ComboBoxModel::findText( const QString & _txt ) const { - for( QVector::const_iterator it = m_items.begin(); + for( QVector::ConstIterator it = m_items.begin(); it != m_items.end(); ++it ) { if( ( *it ).first == _txt ) { - return( it - m_items.begin() ); + return it - m_items.begin(); } } - return( -1 ); + return -1; } - -#include "moc_combobox_model.cxx" +#include "moc_ComboBoxModel.cxx" diff --git a/src/core/Controller.cpp b/src/core/Controller.cpp index 826c5a572..e414713ee 100644 --- a/src/core/Controller.cpp +++ b/src/core/Controller.cpp @@ -1,6 +1,6 @@ /* * Controller.cpp - implementation of class controller which handles - * remote-control of automatableModels + * remote-control of AutomatableModels * * Copyright (c) 2008 Paul Giblock * @@ -44,10 +44,10 @@ QVector Controller::s_controllers; -Controller::Controller( ControllerTypes _type, model * _parent, +Controller::Controller( ControllerTypes _type, Model * _parent, const QString & _display_name ) : - model( _parent, _display_name ), - journallingObject(), + Model( _parent, _display_name ), + JournallingObject(), m_type( _type ) { if( _type != DummyController && _type != MidiController ) @@ -138,7 +138,7 @@ void Controller::resetFrameCounter( void ) -Controller * Controller::create( ControllerTypes _ct, model * _parent ) +Controller * Controller::create( ControllerTypes _ct, Model * _parent ) { static Controller * dummy = NULL; Controller * c = NULL; @@ -174,7 +174,7 @@ Controller * Controller::create( ControllerTypes _ct, model * _parent ) -Controller * Controller::create( const QDomElement & _this, model * _parent ) +Controller * Controller::create( const QDomElement & _this, Model * _parent ) { Controller * c = create( static_cast( _this.attribute( "type" ).toInt() ), @@ -189,13 +189,13 @@ Controller * Controller::create( const QDomElement & _this, model * _parent ) -bool Controller::hasModel( const model * m ) +bool Controller::hasModel( const Model * m ) { QObjectList chldren = children(); for( int i = 0; i < chldren.size(); ++i ) { QObject * c = chldren.at(i); - automatableModel * am = qobject_cast(c); + AutomatableModel * am = qobject_cast(c); if( am != NULL ) { if( am == m ) diff --git a/src/core/ControllerConnection.cpp b/src/core/ControllerConnection.cpp index 4e121c9bb..097ec79fd 100644 --- a/src/core/ControllerConnection.cpp +++ b/src/core/ControllerConnection.cpp @@ -1,6 +1,6 @@ /* * ControllerConnection.cpp - implementation of class controller connection - * which handles the link between automatableModels and controllers + * which handles the link between AutomatableModels and controllers * * Copyright (c) 2008 Paul Giblock * diff --git a/src/core/effect.cpp b/src/core/Effect.cpp similarity index 68% rename from src/core/effect.cpp rename to src/core/Effect.cpp index e3aa634ba..f848aacea 100644 --- a/src/core/effect.cpp +++ b/src/core/Effect.cpp @@ -1,9 +1,9 @@ /* - * effect.cpp - base-class for effects + * Effect.cpp - base-class for effects * * Copyright (c) 2006-2007 Danny McRae - * Copyright (c) 2006-2008 Tobias Doerffel - * + * Copyright (c) 2006-2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -28,24 +28,24 @@ #include -#include "effect.h" +#include "Effect.h" #include "engine.h" -#include "dummy_effect.h" -#include "effect_chain.h" -#include "effect_view.h" +#include "DummyEffect.h" +#include "EffectChain.h" +#include "EffectView.h" -effect::effect( const plugin::descriptor * _desc, - model * _parent, - const descriptor::subPluginFeatures::key * _key ) : - plugin( _desc, _parent ), - m_key( _key ? *_key : descriptor::subPluginFeatures::key() ), +Effect::Effect( const Plugin::Descriptor * _desc, + Model * _parent, + const Descriptor::SubPluginFeatures::Key * _key ) : + Plugin( _desc, _parent ), + m_key( _key ? *_key : Descriptor::SubPluginFeatures::Key() ), m_processors( 1 ), - m_okay( TRUE ), - m_noRun( FALSE ), - m_running( FALSE ), + m_okay( true ), + m_noRun( false ), + m_running( false ), m_bufferCount( 0 ), - m_enabledModel( TRUE, this, tr( "Effect enabled" ) ), + m_enabledModel( true, this, tr( "Effect enabled" ) ), m_wetDryModel( 1.0f, -1.0f, 1.0f, 0.01f, this, tr( "Wet/Dry mix" ) ), m_gateModel( 0.0f, 0.0f, 1.0f, 0.01f, this, tr( "Gate" ) ), m_autoQuitModel( 1.0f, 1.0f, 8000.0f, 100.0f, 1.0f, this, tr( "Decay" ) ) @@ -57,7 +57,7 @@ effect::effect( const plugin::descriptor * _desc, -effect::~effect() +Effect::~Effect() { for( int i = 0; i < 2; ++i ) { @@ -71,19 +71,19 @@ effect::~effect() -void effect::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void Effect::saveSettings( QDomDocument & _doc, QDomElement & _this ) { m_enabledModel.saveSettings( _doc, _this, "on" ); m_wetDryModel.saveSettings( _doc, _this, "wet" ); m_autoQuitModel.saveSettings( _doc, _this, "autoquit" ); m_gateModel.saveSettings( _doc, _this, "gate" ); - getControls()->saveState( _doc, _this ); + controls()->saveState( _doc, _this ); } -void effect::loadSettings( const QDomElement & _this ) +void Effect::loadSettings( const QDomElement & _this ) { m_enabledModel.loadSettings( _this, "on" ); m_wetDryModel.loadSettings( _this, "wet" ); @@ -95,9 +95,9 @@ void effect::loadSettings( const QDomElement & _this ) { if( node.isElement() ) { - if( getControls()->nodeName() == node.nodeName() ) + if( controls()->nodeName() == node.nodeName() ) { - getControls()->restoreState( node.toElement() ); + controls()->restoreState( node.toElement() ); } } node = node.nextSibling(); @@ -108,34 +108,34 @@ void effect::loadSettings( const QDomElement & _this ) -effect * effect::instantiate( const QString & _plugin_name, - model * _parent, - descriptor::subPluginFeatures::key * _key ) +Effect * Effect::instantiate( const QString & _plugin_name, + Model * _parent, + Descriptor::SubPluginFeatures::Key * _key ) { - plugin * p = plugin::instantiate( _plugin_name, _parent, _key ); + Plugin * p = Plugin::instantiate( _plugin_name, _parent, _key ); // check whether instantiated plugin is an effect - if( dynamic_cast( p ) != NULL ) + if( dynamic_cast( p ) != NULL ) { // everything ok, so return pointer - return( dynamic_cast( p ) ); + return dynamic_cast( p ); } // not quite... so delete plugin and return dummy effect delete p; - return( new dummyEffect( _parent ) ); + return new DummyEffect( _parent ); } -void effect::checkGate( double _out_sum ) +void Effect::checkGate( double _out_sum ) { // Check whether we need to continue processing input. Restart the // counter if the threshold has been exceeded. - if( _out_sum <= getGate()+0.000001 ) + if( _out_sum <= gate()+0.000001 ) { incrementBufferCount(); - if( getBufferCount() > getTimeout() ) + if( bufferCount() > timeout() ) { stopRunning(); resetBufferCount(); @@ -150,15 +150,15 @@ void effect::checkGate( double _out_sum ) -pluginView * effect::instantiateView( QWidget * _parent ) +PluginView * Effect::instantiateView( QWidget * _parent ) { - return( new effectView( this, _parent ) ); + return new EffectView( this, _parent ); } -void effect::reinitSRC( void ) +void Effect::reinitSRC() { for( int i = 0; i < 2; ++i ) { @@ -180,7 +180,7 @@ void effect::reinitSRC( void ) -void effect::resample( int _i, const sampleFrame * _src_buf, +void Effect::resample( int _i, const sampleFrame * _src_buf, sample_rate_t _src_sr, sampleFrame * _dst_buf, sample_rate_t _dst_sr, f_cnt_t _frames ) @@ -198,7 +198,7 @@ void effect::resample( int _i, const sampleFrame * _src_buf, int error; if( ( error = src_process( m_srcState[_i], &m_srcData[_i] ) ) ) { - fprintf( stderr, "effect::resample(): error while resampling: %s\n", + fprintf( stderr, "Effect::resample(): error while resampling: %s\n", src_strerror( error ) ); } } diff --git a/src/core/effect_chain.cpp b/src/core/EffectChain.cpp similarity index 65% rename from src/core/effect_chain.cpp rename to src/core/EffectChain.cpp index b1951bef6..fa8d50f89 100644 --- a/src/core/effect_chain.cpp +++ b/src/core/EffectChain.cpp @@ -1,9 +1,9 @@ /* - * effect_chain.cpp - class for processing and effects chain + * EffectChain.cpp - class for processing and effects chain * * Copyright (c) 2006-2008 Danny McRae * Copyright (c) 2008-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -26,25 +26,25 @@ #include -#include "effect_chain.h" -#include "effect.h" +#include "EffectChain.h" +#include "Effect.h" #include "engine.h" #include "debug.h" -#include "dummy_effect.h" +#include "DummyEffect.h" -effectChain::effectChain( model * _parent ) : - model( _parent ), - serializingObject(), - m_enabledModel( FALSE, NULL, tr( "Effects enabled" ) ) +EffectChain::EffectChain( Model * _parent ) : + Model( _parent ), + SerializingObject(), + m_enabledModel( false, NULL, tr( "Effects enabled" ) ) { } -effectChain::~effectChain() +EffectChain::~EffectChain() { clear(); } @@ -52,23 +52,23 @@ effectChain::~effectChain() -void effectChain::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void EffectChain::saveSettings( QDomDocument & _doc, QDomElement & _this ) { _this.setAttribute( "enabled", m_enabledModel.value() ); _this.setAttribute( "numofeffects", m_effects.count() ); - for( effectList::iterator it = m_effects.begin(); + for( EffectList::Iterator it = m_effects.begin(); it != m_effects.end(); it++ ) { QDomElement ef = ( *it )->saveState( _doc, _this ); - ef.setAttribute( "name", ( *it )->getDescriptor()->name ); - ef.appendChild( ( *it )->getKey().saveXML( _doc ) ); + ef.setAttribute( "name", ( *it )->descriptor()->name ); + ef.appendChild( ( *it )->key().saveXML( _doc ) ); } } -void effectChain::loadSettings( const QDomElement & _this ) +void EffectChain::loadSettings( const QDomElement & _this ) { clear(); @@ -84,23 +84,23 @@ void effectChain::loadSettings( const QDomElement & _this ) { QDomElement cn = node.toElement(); const QString name = cn.attribute( "name" ); - effectKey key( cn.elementsByTagName( "key" ). + EffectKey key( cn.elementsByTagName( "key" ). item( 0 ).toElement() ); - effect * e = effect::instantiate( name, this, &key ); + Effect * e = Effect::instantiate( name, this, &key ); if( e->isOkay() ) { if( node.isElement() ) { if( e->nodeName() == node.nodeName() ) { - e->restoreState( node.toElement() ); + e->restoreState( node.toElement() ); } } } else { delete e; - e = new dummyEffect( parentModel() ); + e = new DummyEffect( parentModel() ); } m_effects.push_back( e ); ++fx_loaded; @@ -114,7 +114,7 @@ void effectChain::loadSettings( const QDomElement & _this ) -void effectChain::appendEffect( effect * _effect ) +void EffectChain::appendEffect( Effect * _effect ) { engine::getMixer()->lock(); m_effects.append( _effect ); @@ -126,7 +126,7 @@ void effectChain::appendEffect( effect * _effect ) -void effectChain::removeEffect( effect * _effect ) +void EffectChain::removeEffect( Effect * _effect ) { engine::getMixer()->lock(); m_effects.erase( qFind( m_effects.begin(), m_effects.end(), _effect ) ); @@ -136,12 +136,12 @@ void effectChain::removeEffect( effect * _effect ) -void effectChain::moveDown( effect * _effect ) +void EffectChain::moveDown( Effect * _effect ) { if( _effect != m_effects.last() ) { int i = 0; - for( effectList::iterator it = m_effects.begin(); + for( EffectList::Iterator it = m_effects.begin(); it != m_effects.end(); it++, i++ ) { if( *it == _effect ) @@ -150,7 +150,7 @@ void effectChain::moveDown( effect * _effect ) } } - effect * temp = m_effects[i + 1]; + Effect * temp = m_effects[i + 1]; m_effects[i + 1] = _effect; m_effects[i] = temp; } @@ -159,12 +159,12 @@ void effectChain::moveDown( effect * _effect ) -void effectChain::moveUp( effect * _effect ) +void EffectChain::moveUp( Effect * _effect ) { if( _effect != m_effects.first() ) { int i = 0; - for( effectList::iterator it = m_effects.begin(); + for( EffectList::Iterator it = m_effects.begin(); it != m_effects.end(); it++, i++ ) { if( *it == _effect ) @@ -173,7 +173,7 @@ void effectChain::moveUp( effect * _effect ) } } - effect * temp = m_effects[i - 1]; + Effect * temp = m_effects[i - 1]; m_effects[i - 1] = _effect; m_effects[i] = temp; } @@ -182,17 +182,17 @@ void effectChain::moveUp( effect * _effect ) -bool effectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) +bool EffectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) { - if( m_enabledModel.value() == FALSE ) + if( m_enabledModel.value() == false ) { - return( FALSE ); + return false; } - bool more_effects = FALSE; - for( effectList::iterator it = m_effects.begin(); + bool moreEffects = false; + for( EffectList::Iterator it = m_effects.begin(); it != m_effects.end(); ++it ) { - more_effects |= ( *it )->processAudioBuffer( _buf, _frames ); + moreEffects |= ( *it )->processAudioBuffer( _buf, _frames ); #ifdef LMMS_DEBUG for( int f = 0; f < _frames; ++f ) { @@ -207,20 +207,20 @@ bool effectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) } #endif } - return( more_effects ); + return moreEffects; } -void effectChain::startRunning( void ) +void EffectChain::startRunning() { - if( m_enabledModel.value() == FALSE ) + if( m_enabledModel.value() == false ) { return; } - for( effectList::iterator it = m_effects.begin(); + for( EffectList::Iterator it = m_effects.begin(); it != m_effects.end(); it++ ) { ( *it )->startRunning(); @@ -230,27 +230,27 @@ void effectChain::startRunning( void ) -bool effectChain::isRunning( void ) +bool EffectChain::isRunning() { - if( m_enabledModel.value() == FALSE ) + if( m_enabledModel.value() == false ) { - return( FALSE ); + return false; } - bool running = FALSE; + bool running = false; - for( effectList::iterator it = m_effects.begin(); + for( EffectList::Iterator it = m_effects.begin(); it != m_effects.end() || !running; it++ ) { running = ( *it )->isRunning() && running; } - return( running ); + return running; } -void effectChain::clear( void ) +void EffectChain::clear() { emit aboutToClear(); @@ -264,5 +264,5 @@ void effectChain::clear( void ) -#include "moc_effect_chain.cxx" +#include "moc_EffectChain.cxx" diff --git a/src/core/envelope_and_lfo_parameters.cpp b/src/core/EnvelopeAndLfoParameters.cpp similarity index 86% rename from src/core/envelope_and_lfo_parameters.cpp rename to src/core/EnvelopeAndLfoParameters.cpp index 850c10aa4..dbf3c37d4 100644 --- a/src/core/envelope_and_lfo_parameters.cpp +++ b/src/core/EnvelopeAndLfoParameters.cpp @@ -1,5 +1,5 @@ /* - * envelope_and_lfo_parameters.cpp - class envelopeAndLFOParameters + * EnvelopeAndLfoParameters.cpp - class EnvelopeAndLfoParameters * * Copyright (c) 2004-2008 Tobias Doerffel * @@ -22,18 +22,14 @@ * */ - -#include "envelope_and_lfo_parameters.h" - - #include +#include "EnvelopeAndLfoParameters.h" #include "debug.h" #include "engine.h" #include "mixer.h" #include "mmp.h" -#include "oscillator.h" - +#include "Oscillator.h" // how long should be each envelope-segment maximal (e.g. attack)? @@ -42,14 +38,14 @@ extern const float SECS_PER_ENV_SEGMENT = 5.0f; extern const float SECS_PER_LFO_OSCILLATION = 20.0f; -QVector envelopeAndLFOParameters::s_EaLParametersInstances; +QVector EnvelopeAndLfoParameters::s_EaLParametersInstances; -envelopeAndLFOParameters::envelopeAndLFOParameters( +EnvelopeAndLfoParameters::EnvelopeAndLfoParameters( float _value_for_zero_amount, - model * _parent ) : - model( _parent ), + Model * _parent ) : + Model( _parent ), m_used( false ), m_predelayModel( 0.0, 0.0, 1.0, 0.001, this, tr( "Predelay" ) ), m_attackModel( 0.0, 0.0, 1.0, 0.001, this, tr( "Attack" ) ), @@ -61,16 +57,13 @@ envelopeAndLFOParameters::envelopeAndLFOParameters( m_valueForZeroAmount( _value_for_zero_amount ), m_pahdEnv( NULL ), m_rEnv( NULL ), - m_lfoPredelayModel( 0.0, 0.0, 1.0, 0.001, this, - tr( "LFO Predelay" ) ), + m_lfoPredelayModel( 0.0, 0.0, 1.0, 0.001, this, tr( "LFO Predelay" ) ), m_lfoAttackModel( 0.0, 0.0, 1.0, 0.001, this, tr( "LFO Attack" ) ), m_lfoSpeedModel( 0.1, 0.001, 1.0, 0.0001, SECS_PER_LFO_OSCILLATION * 1000.0, this, tr( "LFO speed" ) ), - m_lfoAmountModel( 0.0, -1.0, 1.0, 0.005, this, - tr( "LFO Modulation" ) ), - m_lfoWaveModel( SineWave, 0, NumLfoShapes, this, - tr( "LFO Wave Shape" ) ), + m_lfoAmountModel( 0.0, -1.0, 1.0, 0.005, this, tr( "LFO Modulation" ) ), + m_lfoWaveModel( SineWave, 0, NumLfoShapes, this, tr( "LFO Wave Shape" ) ), m_x100Model( false, this, tr( "Freq x 100" ) ), m_controlEnvAmountModel( false, this, tr( "Modulate Env-Amount" ) ), m_lfoFrame( 0 ), @@ -120,7 +113,7 @@ envelopeAndLFOParameters::envelopeAndLFOParameters( -envelopeAndLFOParameters::~envelopeAndLFOParameters() +EnvelopeAndLfoParameters::~EnvelopeAndLfoParameters() { m_predelayModel.disconnect( this ); m_attackModel.disconnect( this ); @@ -140,7 +133,7 @@ envelopeAndLFOParameters::~envelopeAndLFOParameters() delete[] m_rEnv; delete[] m_lfoShapeData; - QVector & v = s_EaLParametersInstances; + QVector & v = s_EaLParametersInstances; if( qFind( v.begin(), v.end(), this ) != v.end() ) { v.erase( qFind( v.begin(), v.end(), this ) ); @@ -150,7 +143,7 @@ envelopeAndLFOParameters::~envelopeAndLFOParameters() -inline sample_t envelopeAndLFOParameters::lfoShapeSample( fpp_t _frame_offset ) +inline sample_t EnvelopeAndLfoParameters::lfoShapeSample( fpp_t _frame_offset ) { f_cnt_t frame = ( m_lfoFrame + _frame_offset ) % m_lfoOscillationFrames; const float phase = frame / static_cast( @@ -159,29 +152,29 @@ inline sample_t envelopeAndLFOParameters::lfoShapeSample( fpp_t _frame_offset ) switch( m_lfoWaveModel.value() ) { case TriangleWave: - shape_sample = oscillator::triangleSample( phase ); + shape_sample = Oscillator::triangleSample( phase ); break; case SquareWave: - shape_sample = oscillator::squareSample( phase ); + shape_sample = Oscillator::squareSample( phase ); break; case SawWave: - shape_sample = oscillator::sawSample( phase ); + shape_sample = Oscillator::sawSample( phase ); break; case UserDefinedWave: shape_sample = m_userWave.userWaveSample( phase ); break; case SineWave: default: - shape_sample = oscillator::sinSample( phase ); + shape_sample = Oscillator::sinSample( phase ); break; } - return( shape_sample * m_lfoAmount ); + return shape_sample * m_lfoAmount; } -void envelopeAndLFOParameters::updateLFOShapeData( void ) +void EnvelopeAndLfoParameters::updateLfoShapeData() { const fpp_t frames = engine::getMixer()->framesPerPeriod(); for( fpp_t offset = 0; offset < frames; ++offset ) @@ -194,10 +187,10 @@ void envelopeAndLFOParameters::updateLFOShapeData( void ) -void envelopeAndLFOParameters::triggerLFO( void ) +void EnvelopeAndLfoParameters::triggerLfo() { - QVector & v = s_EaLParametersInstances; - for( QVector::iterator it = v.begin(); + QVector & v = s_EaLParametersInstances; + for( QVector::iterator it = v.begin(); it != v.end(); ++it ) { ( *it )->m_lfoFrame += @@ -209,10 +202,10 @@ void envelopeAndLFOParameters::triggerLFO( void ) -void envelopeAndLFOParameters::resetLFO( void ) +void EnvelopeAndLfoParameters::resetLfo() { - QVector & v = s_EaLParametersInstances; - for( QVector::iterator it = v.begin(); + QVector & v = s_EaLParametersInstances; + for( QVector::iterator it = v.begin(); it != v.end(); ++it ) { ( *it )->m_lfoFrame = 0; @@ -223,7 +216,7 @@ void envelopeAndLFOParameters::resetLFO( void ) -inline void envelopeAndLFOParameters::fillLFOLevel( float * _buf, +inline void EnvelopeAndLfoParameters::fillLfoLevel( float * _buf, f_cnt_t _frame, const fpp_t _frames ) { @@ -239,7 +232,7 @@ inline void envelopeAndLFOParameters::fillLFOLevel( float * _buf, if( m_bad_lfoShapeData ) { - updateLFOShapeData(); + updateLfoShapeData(); } fpp_t offset = 0; @@ -258,7 +251,7 @@ inline void envelopeAndLFOParameters::fillLFOLevel( float * _buf, -void envelopeAndLFOParameters::fillLevel( float * _buf, f_cnt_t _frame, +void EnvelopeAndLfoParameters::fillLevel( float * _buf, f_cnt_t _frame, const f_cnt_t _release_begin, const fpp_t _frames ) { @@ -267,7 +260,7 @@ void envelopeAndLFOParameters::fillLevel( float * _buf, f_cnt_t _frame, return; } - fillLFOLevel( _buf, _frame, _frames ); + fillLfoLevel( _buf, _frame, _frames ); for( fpp_t offset = 0; offset < _frames; ++offset, ++_buf, ++_frame ) { @@ -304,7 +297,7 @@ void envelopeAndLFOParameters::fillLevel( float * _buf, f_cnt_t _frame, -void envelopeAndLFOParameters::saveSettings( QDomDocument & _doc, +void EnvelopeAndLfoParameters::saveSettings( QDomDocument & _doc, QDomElement & _parent ) { m_predelayModel.saveSettings( _doc, _parent, "pdel" ); @@ -327,7 +320,7 @@ void envelopeAndLFOParameters::saveSettings( QDomDocument & _doc, -void envelopeAndLFOParameters::loadSettings( const QDomElement & _this ) +void EnvelopeAndLfoParameters::loadSettings( const QDomElement & _this ) { m_predelayModel.loadSettings( _this, "pdel" ); m_attackModel.loadSettings( _this, "att" ); @@ -349,7 +342,7 @@ void envelopeAndLFOParameters::loadSettings( const QDomElement & _this ) if( _this.hasAttribute( "lfosyncmode" ) ) { m_lfoSpeedKnob->setSyncMode( - ( tempoSyncKnob::tempoSyncMode ) _this.attribute( + ( TempoSyncKnob::TtempoSyncMode ) _this.attribute( "lfosyncmode" ).toInt() ); }*/ @@ -361,7 +354,7 @@ void envelopeAndLFOParameters::loadSettings( const QDomElement & _this ) -void envelopeAndLFOParameters::updateSampleVars( void ) +void EnvelopeAndLfoParameters::updateSampleVars() { engine::getMixer()->lock(); @@ -494,6 +487,6 @@ void envelopeAndLFOParameters::updateSampleVars( void ) -#include "moc_envelope_and_lfo_parameters.cxx" +#include "moc_EnvelopeAndLfoParameters.cxx" diff --git a/src/core/fx_mixer.cpp b/src/core/FxMixer.cpp similarity index 89% rename from src/core/fx_mixer.cpp rename to src/core/FxMixer.cpp index edf168bcb..53d0340c7 100644 --- a/src/core/fx_mixer.cpp +++ b/src/core/FxMixer.cpp @@ -1,7 +1,7 @@ #ifndef SINGLE_SOURCE_COMPILE /* - * fx_mixer.cpp - effect-mixer for LMMS + * FxMixer.cpp - effect mixer for LMMS * * Copyright (c) 2008 Tobias Doerffel * @@ -27,12 +27,12 @@ #include -#include "fx_mixer.h" -#include "effect.h" +#include "FxMixer.h" +#include "Effect.h" #include "song.h" -fxChannel::fxChannel( model * _parent ) : +FxChannel::FxChannel( Model * _parent ) : m_fxChain( NULL ), m_used( false ), m_stillRunning( false ), @@ -51,7 +51,7 @@ fxChannel::fxChannel( model * _parent ) : -fxChannel::~fxChannel() +FxChannel::~FxChannel() { delete[] m_buffer; } @@ -61,13 +61,13 @@ fxChannel::~fxChannel() -fxMixer::fxMixer() : - journallingObject(), - model( NULL ) +FxMixer::FxMixer() : + JournallingObject(), + Model( NULL ) { for( int i = 0; i < NumFxChannels+1; ++i ) { - m_fxChannels[i] = new fxChannel( this ); + m_fxChannels[i] = new FxChannel( this ); } // reset name etc. clear(); @@ -76,7 +76,7 @@ fxMixer::fxMixer() : -fxMixer::~fxMixer() +FxMixer::~FxMixer() { for( int i = 0; i < NumFxChannels+1; ++i ) { @@ -87,7 +87,7 @@ fxMixer::~fxMixer() -void fxMixer::mixToChannel( const sampleFrame * _buf, fx_ch_t _ch ) +void FxMixer::mixToChannel( const sampleFrame * _buf, fx_ch_t _ch ) { if( m_fxChannels[_ch]->m_muteModel.value() == false ) { @@ -107,7 +107,7 @@ void fxMixer::mixToChannel( const sampleFrame * _buf, fx_ch_t _ch ) -void fxMixer::processChannel( fx_ch_t _ch, sampleFrame * _buf ) +void FxMixer::processChannel( fx_ch_t _ch, sampleFrame * _buf ) { if( m_fxChannels[_ch]->m_muteModel.value() == false && ( m_fxChannels[_ch]->m_used || @@ -141,7 +141,7 @@ void fxMixer::processChannel( fx_ch_t _ch, sampleFrame * _buf ) -void fxMixer::prepareMasterMix( void ) +void FxMixer::prepareMasterMix( void ) { engine::getMixer()->clearAudioBuffer( m_fxChannels[0]->m_buffer, engine::getMixer()->framesPerPeriod() ); @@ -150,7 +150,7 @@ void fxMixer::prepareMasterMix( void ) -void fxMixer::masterMix( sampleFrame * _buf ) +void FxMixer::masterMix( sampleFrame * _buf ) { const int fpp = engine::getMixer()->framesPerPeriod(); memcpy( _buf, m_fxChannels[0]->m_buffer, sizeof( sampleFrame ) * fpp ); @@ -195,7 +195,7 @@ void fxMixer::masterMix( sampleFrame * _buf ) -void fxMixer::clear() +void FxMixer::clear() { for( int i = 0; i <= NumFxChannels; ++i ) { @@ -213,7 +213,7 @@ void fxMixer::clear() -void fxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void FxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this ) { for( int i = 0; i <= NumFxChannels; ++i ) { @@ -232,7 +232,7 @@ void fxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this ) -void fxMixer::loadSettings( const QDomElement & _this ) +void FxMixer::loadSettings( const QDomElement & _this ) { clear(); QDomNode node = _this.firstChild(); diff --git a/src/core/import_filter.cpp b/src/core/ImportFilter.cpp similarity index 64% rename from src/core/import_filter.cpp rename to src/core/ImportFilter.cpp index 17535845e..cfe061fd6 100644 --- a/src/core/import_filter.cpp +++ b/src/core/ImportFilter.cpp @@ -1,5 +1,5 @@ /* - * import_filter.cpp - base-class for all import-filters (MIDI, FLP etc) + * ImportFilter.cpp - base-class for all import-filters (MIDI, FLP etc) * * Copyright (c) 2006-2009 Tobias Doerffel * @@ -25,16 +25,16 @@ #include -#include "import_filter.h" +#include "ImportFilter.h" #include "engine.h" #include "track_container.h" -#include "project_journal.h" +#include "ProjectJournal.h" -importFilter::importFilter( const QString & _file_name, - const descriptor * _descriptor ) : - plugin( _descriptor, NULL ), +ImportFilter::ImportFilter( const QString & _file_name, + const Descriptor * _descriptor ) : + Plugin( _descriptor, NULL ), m_file( _file_name ) { } @@ -42,50 +42,50 @@ importFilter::importFilter( const QString & _file_name, -importFilter::~importFilter() +ImportFilter::~ImportFilter() { } -void importFilter::import( const QString & _file_to_import, - trackContainer * _tc ) +void ImportFilter::import( const QString & _file_to_import, + trackContainer * _tc ) { - QVector d; - plugin::getDescriptorsOfAvailPlugins( d ); + QVector d; + Plugin::getDescriptorsOfAvailPlugins( d ); - bool successful = FALSE; + bool successful = false; char * s = qstrdup( _file_to_import.toUtf8().constData() ); // do not record changes while importing files - const bool j = engine::getProjectJournal()->isJournalling(); - engine::getProjectJournal()->setJournalling( FALSE ); + const bool j = engine::projectJournal()->isJournalling(); + engine::projectJournal()->setJournalling( false ); - for( QVector::iterator it = d.begin(); + for( QVector::Iterator it = d.begin(); it != d.end(); ++it ) { - if( it->type == plugin::ImportFilter ) + if( it->type == Plugin::ImportFilter ) { - plugin * p = plugin::instantiate( it->name, NULL, s ); - if( dynamic_cast( p ) != NULL && - dynamic_cast( p )->tryImport( - _tc ) == TRUE ) + Plugin * p = Plugin::instantiate( it->name, NULL, s ); + if( dynamic_cast( p ) != NULL && + dynamic_cast( p )->tryImport( + _tc ) == true ) { delete p; - successful = TRUE; + successful = true; break; } delete p; } } - engine::getProjectJournal()->setJournalling( j ); + engine::projectJournal()->setJournalling( j ); delete[] s; - if( successful == FALSE ) + if( successful == false ) { QMessageBox::information( NULL, trackContainer::tr( "Couldn't import file" ), @@ -103,9 +103,9 @@ void importFilter::import( const QString & _file_to_import, -bool importFilter::openFile( void ) +bool ImportFilter::openFile() { - if( m_file.open( QFile::ReadOnly ) == FALSE ) + if( m_file.open( QFile::ReadOnly ) == false ) { QMessageBox::critical( NULL, trackContainer::tr( "Couldn't open file" ), @@ -118,9 +118,9 @@ bool importFilter::openFile( void ) m_file.fileName() ), QMessageBox::Ok, QMessageBox::NoButton ); - return( FALSE ); + return false; } - return( TRUE ); + return true; } diff --git a/src/core/Instrument.cpp b/src/core/Instrument.cpp new file mode 100644 index 000000000..daaebb2f6 --- /dev/null +++ b/src/core/Instrument.cpp @@ -0,0 +1,128 @@ +/* + * Instrument.cpp - base-class for all instrument-plugins (synths, samplers etc) + * + * Copyright (c) 2005-2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + */ + +#include "Instrument.h" +#include "InstrumentTrack.h" +#include "DummyInstrument.h" +#include "note_play_handle.h" +#include "embed.h" + + +Instrument::Instrument( InstrumentTrack * _instrument_track, + const Descriptor * _descriptor ) : + Plugin( _descriptor, NULL/* _instrument_track*/ ), + m_instrumentTrack( _instrument_track ) +{ +} + + + + +Instrument::~Instrument() +{ +} + + + + +void Instrument::play( sampleFrame * ) +{ +} + + + + +void Instrument::deleteNotePluginData( notePlayHandle * ) +{ +} + + + + +f_cnt_t Instrument::beatLen( notePlayHandle * ) const +{ + return( 0 ); +} + + + + +Instrument * Instrument::instantiate( const QString & _plugin_name, + InstrumentTrack * _instrument_track ) +{ + Plugin * p = Plugin::instantiate( _plugin_name, _instrument_track, + _instrument_track ); + // check whether instantiated plugin is an instrument + if( dynamic_cast( p ) != NULL ) + { + // everything ok, so return pointer + return dynamic_cast( p ); + } + + // not quite... so delete plugin and return dummy instrument + delete p; + return( new DummyInstrument( _instrument_track ) ); +} + + + + +bool Instrument::isFromTrack( const track * _track ) const +{ + return( m_instrumentTrack == _track ); +} + + + +void Instrument::applyRelease( sampleFrame * buf, const notePlayHandle * _n ) +{ + const fpp_t frames = _n->framesLeftForCurrentPeriod(); + const fpp_t fpp = engine::getMixer()->framesPerPeriod(); + const f_cnt_t fl = _n->framesLeft(); + if( fl <= desiredReleaseFrames()+fpp ) + { + for( fpp_t f = (fpp_t)( ( fl > desiredReleaseFrames() ) ? + ( qMax( fpp - desiredReleaseFrames(), 0 ) + + fl % fpp ) : 0 ); f < frames; ++f ) + { + const float fac = (float)( fl-f-1 ) / + desiredReleaseFrames(); + for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch ) + { + buf[f][ch] *= fac; + } + } + } +} + + + + +QString Instrument::fullDisplayName() const +{ + return instrumentTrack()->displayName(); +} + + + diff --git a/src/core/instrument_functions.cpp b/src/core/InstrumentFunctions.cpp similarity index 56% rename from src/core/instrument_functions.cpp rename to src/core/InstrumentFunctions.cpp index 13c8d30e8..fbba29812 100644 --- a/src/core/instrument_functions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -1,10 +1,8 @@ -#ifndef SINGLE_SOURCE_COMPILE - /* - * instrument_functions.cpp - models for instrument-function-tab + * InstrumentFunctions.cpp - models for instrument-function-tab * * Copyright (c) 2004-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -24,125 +22,123 @@ * */ - #include - -#include "instrument_functions.h" +#include "InstrumentFunctions.h" #include "embed.h" #include "engine.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "note_play_handle.h" #include "preset_preview_play_handle.h" -chordCreator::chord chordCreator::s_chordTable[] = +ChordCreator::Chord ChordCreator::s_chordTable[] = { - { chordCreator::tr( "octave" ), { 0, -1 } }, - { chordCreator::tr( "Major" ), { 0, 4, 7, -1 } }, - { chordCreator::tr( "Majb5" ), { 0, 4, 6, -1 } }, - { chordCreator::tr( "minor" ), { 0, 3, 7, -1 } }, - { chordCreator::tr( "minb5" ), { 0, 3, 6, -1 } }, - { chordCreator::tr( "sus2" ), { 0, 2, 7, -1 } }, - { chordCreator::tr( "sus4" ), { 0, 5, 7, -1 } }, - { chordCreator::tr( "aug" ), { 0, 4, 8, -1 } }, - { chordCreator::tr( "augsus4" ), { 0, 5, 8, -1 } }, - { chordCreator::tr( "tri" ), { 0, 3, 6, 9, -1 } }, + { ChordCreator::tr( "octave" ), { 0, -1 } }, + { ChordCreator::tr( "Major" ), { 0, 4, 7, -1 } }, + { ChordCreator::tr( "Majb5" ), { 0, 4, 6, -1 } }, + { ChordCreator::tr( "minor" ), { 0, 3, 7, -1 } }, + { ChordCreator::tr( "minb5" ), { 0, 3, 6, -1 } }, + { ChordCreator::tr( "sus2" ), { 0, 2, 7, -1 } }, + { ChordCreator::tr( "sus4" ), { 0, 5, 7, -1 } }, + { ChordCreator::tr( "aug" ), { 0, 4, 8, -1 } }, + { ChordCreator::tr( "augsus4" ), { 0, 5, 8, -1 } }, + { ChordCreator::tr( "tri" ), { 0, 3, 6, 9, -1 } }, - { chordCreator::tr( "6" ), { 0, 4, 7, 9, -1 } }, - { chordCreator::tr( "6sus4" ), { 0, 5, 7, 9, -1 } }, - { chordCreator::tr( "6add9" ), { 0, 4, 7, 12, -1 } }, - { chordCreator::tr( "m6" ), { 0, 3, 7, 9, -1 } }, - { chordCreator::tr( "m6add9" ), { 0, 3, 7, 9, 14, -1 } }, + { ChordCreator::tr( "6" ), { 0, 4, 7, 9, -1 } }, + { ChordCreator::tr( "6sus4" ), { 0, 5, 7, 9, -1 } }, + { ChordCreator::tr( "6add9" ), { 0, 4, 7, 12, -1 } }, + { ChordCreator::tr( "m6" ), { 0, 3, 7, 9, -1 } }, + { ChordCreator::tr( "m6add9" ), { 0, 3, 7, 9, 14, -1 } }, - { chordCreator::tr( "7" ), { 0, 4, 7, 10, -1 } }, - { chordCreator::tr( "7sus4" ), { 0, 5, 7, 10, -1 } }, - { chordCreator::tr( "7#5" ), { 0, 4, 8, 10, -1 } }, - { chordCreator::tr( "7b5" ), { 0, 4, 6, 10, -1 } }, - { chordCreator::tr( "7#9" ), { 0, 4, 7, 10, 13, 18, -1 } }, - { chordCreator::tr( "7b9" ), { 0, 4, 7, 10, 13, 16, -1 } }, - { chordCreator::tr( "7#5#9" ), { 0, 4, 8, 12, 14, 19, -1 } }, - { chordCreator::tr( "7#5b9" ), { 0, 4, 8, 12, 14, 17, -1 } }, - { chordCreator::tr( "7b5b9" ), { 0, 4, 6, 10, 12, 15, -1 } }, - { chordCreator::tr( "7add11" ), { 0, 4, 7, 10, 17, -1 } }, - { chordCreator::tr( "7add13" ), { 0, 4, 7, 10, 21, -1 } }, - { chordCreator::tr( "7#11" ), { 0, 4, 7, 10, 18, -1 } }, - { chordCreator::tr( "Maj7" ), { 0, 4, 7, 11, -1 } }, - { chordCreator::tr( "Maj7b5" ), { 0, 4, 6, 11, -1 } }, - { chordCreator::tr( "Maj7#5" ), { 0, 4, 8, 11, -1 } }, - { chordCreator::tr( "Maj7#11" ), { 0, 4, 7, 11, 18, -1 } }, - { chordCreator::tr( "Maj7add13" ), { 0, 4, 7, 11, 21, -1 } }, - { chordCreator::tr( "m7" ), { 0, 3, 7, 10, -1 } }, - { chordCreator::tr( "m7b5" ), { 0, 3, 6, 10, -1 } }, - { chordCreator::tr( "m7b9" ), { 0, 3, 7, 10, 13, -1 } }, - { chordCreator::tr( "m7add11" ), { 0, 3, 7, 10, 17, -1 } }, - { chordCreator::tr( "m7add13" ), { 0, 3, 7, 10, 21, -1 } }, - { chordCreator::tr( "m-Maj7" ), { 0, 3, 7, 11, -1 } }, - { chordCreator::tr( "m-Maj7add11" ), { 0, 3, 7, 11, 17, -1 } }, - { chordCreator::tr( "m-Maj7add13" ), { 0, 3, 7, 11, 21, -1 } }, + { ChordCreator::tr( "7" ), { 0, 4, 7, 10, -1 } }, + { ChordCreator::tr( "7sus4" ), { 0, 5, 7, 10, -1 } }, + { ChordCreator::tr( "7#5" ), { 0, 4, 8, 10, -1 } }, + { ChordCreator::tr( "7b5" ), { 0, 4, 6, 10, -1 } }, + { ChordCreator::tr( "7#9" ), { 0, 4, 7, 10, 13, 18, -1 } }, + { ChordCreator::tr( "7b9" ), { 0, 4, 7, 10, 13, 16, -1 } }, + { ChordCreator::tr( "7#5#9" ), { 0, 4, 8, 12, 14, 19, -1 } }, + { ChordCreator::tr( "7#5b9" ), { 0, 4, 8, 12, 14, 17, -1 } }, + { ChordCreator::tr( "7b5b9" ), { 0, 4, 6, 10, 12, 15, -1 } }, + { ChordCreator::tr( "7add11" ), { 0, 4, 7, 10, 17, -1 } }, + { ChordCreator::tr( "7add13" ), { 0, 4, 7, 10, 21, -1 } }, + { ChordCreator::tr( "7#11" ), { 0, 4, 7, 10, 18, -1 } }, + { ChordCreator::tr( "Maj7" ), { 0, 4, 7, 11, -1 } }, + { ChordCreator::tr( "Maj7b5" ), { 0, 4, 6, 11, -1 } }, + { ChordCreator::tr( "Maj7#5" ), { 0, 4, 8, 11, -1 } }, + { ChordCreator::tr( "Maj7#11" ), { 0, 4, 7, 11, 18, -1 } }, + { ChordCreator::tr( "Maj7add13" ), { 0, 4, 7, 11, 21, -1 } }, + { ChordCreator::tr( "m7" ), { 0, 3, 7, 10, -1 } }, + { ChordCreator::tr( "m7b5" ), { 0, 3, 6, 10, -1 } }, + { ChordCreator::tr( "m7b9" ), { 0, 3, 7, 10, 13, -1 } }, + { ChordCreator::tr( "m7add11" ), { 0, 3, 7, 10, 17, -1 } }, + { ChordCreator::tr( "m7add13" ), { 0, 3, 7, 10, 21, -1 } }, + { ChordCreator::tr( "m-Maj7" ), { 0, 3, 7, 11, -1 } }, + { ChordCreator::tr( "m-Maj7add11" ), { 0, 3, 7, 11, 17, -1 } }, + { ChordCreator::tr( "m-Maj7add13" ), { 0, 3, 7, 11, 21, -1 } }, - { chordCreator::tr( "9" ), { 0, 4, 7, 10, 14, -1 } }, - { chordCreator::tr( "9sus4" ), { 0, 5, 7, 10, 14, -1 } }, - { chordCreator::tr( "add9" ), { 0, 4, 7, 14, -1 } }, - { chordCreator::tr( "9#5" ), { 0, 4, 8, 10, 14, -1 } }, - { chordCreator::tr( "9b5" ), { 0, 4, 6, 10, 14, -1 } }, - { chordCreator::tr( "9#11" ), { 0, 4, 7, 10, 14, 18, -1 } }, - { chordCreator::tr( "9b13" ), { 0, 4, 7, 10, 14, 20, -1 } }, - { chordCreator::tr( "Maj9" ), { 0, 4, 7, 11, 14, -1 } }, - { chordCreator::tr( "Maj9sus4" ), { 0, 5, 7, 11, 15, -1 } }, - { chordCreator::tr( "Maj9#5" ), { 0, 4, 8, 11, 14, -1 } }, - { chordCreator::tr( "Maj9#11" ), { 0, 4, 7, 11, 14, 18, -1 } }, - { chordCreator::tr( "m9" ), { 0, 3, 7, 10, 14, -1 } }, - { chordCreator::tr( "madd9" ), { 0, 3, 7, 14, -1 } }, - { chordCreator::tr( "m9b5" ), { 0, 3, 6, 10, 14, -1 } }, - { chordCreator::tr( "m9-Maj7" ), { 0, 3, 7, 11, 14, -1 } }, + { ChordCreator::tr( "9" ), { 0, 4, 7, 10, 14, -1 } }, + { ChordCreator::tr( "9sus4" ), { 0, 5, 7, 10, 14, -1 } }, + { ChordCreator::tr( "add9" ), { 0, 4, 7, 14, -1 } }, + { ChordCreator::tr( "9#5" ), { 0, 4, 8, 10, 14, -1 } }, + { ChordCreator::tr( "9b5" ), { 0, 4, 6, 10, 14, -1 } }, + { ChordCreator::tr( "9#11" ), { 0, 4, 7, 10, 14, 18, -1 } }, + { ChordCreator::tr( "9b13" ), { 0, 4, 7, 10, 14, 20, -1 } }, + { ChordCreator::tr( "Maj9" ), { 0, 4, 7, 11, 14, -1 } }, + { ChordCreator::tr( "Maj9sus4" ), { 0, 5, 7, 11, 15, -1 } }, + { ChordCreator::tr( "Maj9#5" ), { 0, 4, 8, 11, 14, -1 } }, + { ChordCreator::tr( "Maj9#11" ), { 0, 4, 7, 11, 14, 18, -1 } }, + { ChordCreator::tr( "m9" ), { 0, 3, 7, 10, 14, -1 } }, + { ChordCreator::tr( "madd9" ), { 0, 3, 7, 14, -1 } }, + { ChordCreator::tr( "m9b5" ), { 0, 3, 6, 10, 14, -1 } }, + { ChordCreator::tr( "m9-Maj7" ), { 0, 3, 7, 11, 14, -1 } }, - { chordCreator::tr( "11" ), { 0, 4, 7, 10, 14, 17, -1 } }, - { chordCreator::tr( "11b9" ), { 0, 4, 7, 10, 13, 17, -1 } }, - { chordCreator::tr( "Maj11" ), { 0, 4, 7, 11, 14, 17, -1 } }, - { chordCreator::tr( "m11" ), { 0, 3, 7, 10, 14, 17, -1 } }, - { chordCreator::tr( "m-Maj11" ), { 0, 3, 7, 11, 14, 17, -1 } }, + { ChordCreator::tr( "11" ), { 0, 4, 7, 10, 14, 17, -1 } }, + { ChordCreator::tr( "11b9" ), { 0, 4, 7, 10, 13, 17, -1 } }, + { ChordCreator::tr( "Maj11" ), { 0, 4, 7, 11, 14, 17, -1 } }, + { ChordCreator::tr( "m11" ), { 0, 3, 7, 10, 14, 17, -1 } }, + { ChordCreator::tr( "m-Maj11" ), { 0, 3, 7, 11, 14, 17, -1 } }, - { chordCreator::tr( "13" ), { 0, 4, 7, 10, 14, 21, -1 } }, - { chordCreator::tr( "13#9" ), { 0, 4, 7, 10, 15, 21, -1 } }, - { chordCreator::tr( "13b9" ), { 0, 4, 7, 10, 13, 21, -1 } }, - { chordCreator::tr( "13b5b9" ), { 0, 4, 6, 10, 13, 21, -1 } }, - { chordCreator::tr( "Maj13" ), { 0, 4, 7, 11, 14, 21, -1 } }, - { chordCreator::tr( "m13" ), { 0, 3, 7, 10, 14, 21, -1 } }, - { chordCreator::tr( "m-Maj13" ), { 0, 3, 7, 11, 14, 21, -1 } }, + { ChordCreator::tr( "13" ), { 0, 4, 7, 10, 14, 21, -1 } }, + { ChordCreator::tr( "13#9" ), { 0, 4, 7, 10, 15, 21, -1 } }, + { ChordCreator::tr( "13b9" ), { 0, 4, 7, 10, 13, 21, -1 } }, + { ChordCreator::tr( "13b5b9" ), { 0, 4, 6, 10, 13, 21, -1 } }, + { ChordCreator::tr( "Maj13" ), { 0, 4, 7, 11, 14, 21, -1 } }, + { ChordCreator::tr( "m13" ), { 0, 3, 7, 10, 14, 21, -1 } }, + { ChordCreator::tr( "m-Maj13" ), { 0, 3, 7, 11, 14, 21, -1 } }, - { chordCreator::tr( "Major" ), { 0, 2, 4, 5, 7, 9, 11, -1 } }, - { chordCreator::tr( "Harmonic minor" ), { 0, 2, 3, 5, 7, 8, 11, -1 } }, - { chordCreator::tr( "Melodic minor" ), { 0, 2, 3, 5, 7, 9, 11, -1 } }, - { chordCreator::tr( "Whole tone" ), { 0, 2, 4, 6, 8, 10, -1 } }, - { chordCreator::tr( "Diminished" ), { 0, 2, 3, 5, 6, 8, 9, 11, -1 } }, - { chordCreator::tr( "Major pentatonic" ), { 0, 2, 4, 7, 10, -1 } }, - { chordCreator::tr( "Minor pentatonic" ), { 0, 3, 5, 7, 10, -1 } }, - { chordCreator::tr( "Jap in sen" ), { 0, 1, 5, 7, 10, -1 } }, - { chordCreator::tr( "Major bebop" ), { 0, 2, 4, 5, 7, 8, 9, 11, -1 } }, - { chordCreator::tr( "Dominant bebop" ), { 0, 2, 4, 5, 7, 9, 10, 11, -1 } }, - { chordCreator::tr( "Blues" ), { 0, 3, 5, 6, 7, 10, -1 } }, - { chordCreator::tr( "Arabic" ), { 0, 1, 4, 5, 7, 8, 11, -1 } }, - { chordCreator::tr( "Enigmatic" ), { 0, 1, 4, 6, 8, 10, 11, -1 } }, - { chordCreator::tr( "Neopolitan" ), { 0, 1, 3, 5, 7, 9, 11, -1 } }, - { chordCreator::tr( "Neopolitan minor" ), { 0, 1, 3, 5, 7, 9, 11, -1 } }, - { chordCreator::tr( "Hungarian minor" ), { 0, 2, 3, 6, 7, 9, 11, -1 } }, - { chordCreator::tr( "Dorian" ), { 0, 2, 3, 5, 7, 9, 10, -1 } }, - { chordCreator::tr( "Phrygolydian" ), { 0, 1, 3, 5, 7, 8, 10, -1 } }, - { chordCreator::tr( "Lydian" ), { 0, 2, 4, 6, 7, 9, 11, -1 } }, - { chordCreator::tr( "Mixolydian" ), { 0, 2, 4, 5, 7, 9, 10, -1 } }, - { chordCreator::tr( "Aeolian" ), { 0, 2, 3, 5, 7, 8, 10, -1 } }, - { chordCreator::tr( "Locrian" ), { 0, 1, 3, 5, 6, 8, 10, -1 } }, + { ChordCreator::tr( "Major" ), { 0, 2, 4, 5, 7, 9, 11, -1 } }, + { ChordCreator::tr( "Harmonic minor" ), { 0, 2, 3, 5, 7, 8, 11, -1 } }, + { ChordCreator::tr( "Melodic minor" ), { 0, 2, 3, 5, 7, 9, 11, -1 } }, + { ChordCreator::tr( "Whole tone" ), { 0, 2, 4, 6, 8, 10, -1 } }, + { ChordCreator::tr( "Diminished" ), { 0, 2, 3, 5, 6, 8, 9, 11, -1 } }, + { ChordCreator::tr( "Major pentatonic" ), { 0, 2, 4, 7, 10, -1 } }, + { ChordCreator::tr( "Minor pentatonic" ), { 0, 3, 5, 7, 10, -1 } }, + { ChordCreator::tr( "Jap in sen" ), { 0, 1, 5, 7, 10, -1 } }, + { ChordCreator::tr( "Major bebop" ), { 0, 2, 4, 5, 7, 8, 9, 11, -1 } }, + { ChordCreator::tr( "Dominant bebop" ), { 0, 2, 4, 5, 7, 9, 10, 11, -1 } }, + { ChordCreator::tr( "Blues" ), { 0, 3, 5, 6, 7, 10, -1 } }, + { ChordCreator::tr( "Arabic" ), { 0, 1, 4, 5, 7, 8, 11, -1 } }, + { ChordCreator::tr( "Enigmatic" ), { 0, 1, 4, 6, 8, 10, 11, -1 } }, + { ChordCreator::tr( "Neopolitan" ), { 0, 1, 3, 5, 7, 9, 11, -1 } }, + { ChordCreator::tr( "Neopolitan minor" ), { 0, 1, 3, 5, 7, 9, 11, -1 } }, + { ChordCreator::tr( "Hungarian minor" ), { 0, 2, 3, 6, 7, 9, 11, -1 } }, + { ChordCreator::tr( "Dorian" ), { 0, 2, 3, 5, 7, 9, 10, -1 } }, + { ChordCreator::tr( "Phrygolydian" ), { 0, 1, 3, 5, 7, 8, 10, -1 } }, + { ChordCreator::tr( "Lydian" ), { 0, 2, 4, 6, 7, 9, 11, -1 } }, + { ChordCreator::tr( "Mixolydian" ), { 0, 2, 4, 5, 7, 9, 10, -1 } }, + { ChordCreator::tr( "Aeolian" ), { 0, 2, 3, 5, 7, 8, 10, -1 } }, + { ChordCreator::tr( "Locrian" ), { 0, 1, 3, 5, 6, 8, 10, -1 } }, { "", { -1, -1 } } } ; -chordCreator::chordCreator( model * _parent ) : - model( _parent, tr( "Chords" ) ), - m_chordsEnabledModel( FALSE, this ), +ChordCreator::ChordCreator( Model * _parent ) : + Model( _parent, tr( "Chords" ) ), + m_chordsEnabledModel( false, this ), m_chordsModel( this, tr( "Chord type" ) ), m_chordRangeModel( 1.0f, 1.0f, 9.0f, 1.0f, this, tr( "Chord range" ) ) { @@ -156,14 +152,14 @@ chordCreator::chordCreator( model * _parent ) : -chordCreator::~chordCreator() +ChordCreator::~ChordCreator() { } -void chordCreator::processNote( notePlayHandle * _n ) +void ChordCreator::processNote( notePlayHandle * _n ) { const int base_note_key = _n->key(); // we add chord-subnotes to note if either note is a base-note and @@ -172,10 +168,10 @@ void chordCreator::processNote( notePlayHandle * _n ) // played yet, because otherwise we would add chord-subnotes every // time an audio-buffer is rendered... if( ( ( _n->isBaseNote() && - _n->getInstrumentTrack()->arpeggiatorEnabled() == FALSE ) || + _n->instrumentTrack()->isArpeggiatorEnabled() == false ) || _n->isPartOfArpeggio() ) && _n->totalFramesPlayed() == 0 && - m_chordsEnabledModel.value() == TRUE ) + m_chordsEnabledModel.value() == true ) { // then insert sub-notes for chord const int selected_chord = m_chordsModel.value(); @@ -210,7 +206,7 @@ void chordCreator::processNote( notePlayHandle * _n ) _n->detuning() ); // create sub-note-play-handle, only note is // different - new notePlayHandle( _n->getInstrumentTrack(), + new notePlayHandle( _n->instrumentTrack(), _n->offset(), _n->frames(), note_copy, _n ); @@ -224,7 +220,7 @@ void chordCreator::processNote( notePlayHandle * _n ) -void chordCreator::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void ChordCreator::saveSettings( QDomDocument & _doc, QDomElement & _this ) { m_chordsEnabledModel.saveSettings( _doc, _this, "chord-enabled" ); m_chordsModel.saveSettings( _doc, _this, "chord" ); @@ -234,7 +230,7 @@ void chordCreator::saveSettings( QDomDocument & _doc, QDomElement & _this ) -void chordCreator::loadSettings( const QDomElement & _this ) +void ChordCreator::loadSettings( const QDomElement & _this ) { m_chordsEnabledModel.loadSettings( _this, "chord-enabled" ); m_chordsModel.loadSettings( _this, "chord" ); @@ -247,9 +243,9 @@ void chordCreator::loadSettings( const QDomElement & _this ) -arpeggiator::arpeggiator( model * _parent ) : - model( _parent, tr( "Arpeggio" ) ), - m_arpEnabledModel( FALSE ), +Arpeggiator::Arpeggiator( Model * _parent ) : + Model( _parent, tr( "Arpeggio" ) ), + m_arpEnabledModel( false ), m_arpModel( this, tr( "Arpeggio type" ) ), m_arpRangeModel( 1.0f, 1.0f, 9.0f, 1.0f, this, tr( "Arpeggio range" ) ), m_arpTimeModel( 100.0f, 25.0f, 2000.0f, 1.0f, 2000, this, @@ -259,42 +255,40 @@ arpeggiator::arpeggiator( model * _parent ) : m_arpDirectionModel( this, tr( "Arpeggio direction" ) ), m_arpModeModel( this, tr( "Arpeggio mode" ) ) { - for( int i = 0; chordCreator::s_chordTable[i].interval[0] != -1; ++i ) + for( int i = 0; ChordCreator::s_chordTable[i].interval[0] != -1; ++i ) { - m_arpModel.addItem( chordCreator::tr( - chordCreator::s_chordTable[i]. + m_arpModel.addItem( ChordCreator::tr( + ChordCreator::s_chordTable[i]. name.toUtf8().constData() ) ); } - m_arpDirectionModel.addItem( tr( "Up" ), - new pixmapLoader( "arp_up" ) ); - m_arpDirectionModel.addItem( tr( "Down" ), - new pixmapLoader( "arp_down" ) ); + m_arpDirectionModel.addItem( tr( "Up" ), new PixmapLoader( "arp_up" ) ); + m_arpDirectionModel.addItem( tr( "Down" ), new PixmapLoader( "arp_down" ) ); m_arpDirectionModel.addItem( tr( "Up and down" ), - new pixmapLoader( "arp_up_and_down" ) ); + new PixmapLoader( "arp_up_and_down" ) ); m_arpDirectionModel.addItem( tr( "Random" ), - new pixmapLoader( "arp_random" ) ); + new PixmapLoader( "arp_random" ) ); m_arpDirectionModel.setInitValue( ArpDirUp ); - m_arpModeModel.addItem( tr( "Free" ), new pixmapLoader( "arp_free" ) ); - m_arpModeModel.addItem( tr( "Sort" ), new pixmapLoader( "arp_sort" ) ); - m_arpModeModel.addItem( tr( "Sync" ), new pixmapLoader( "arp_sync" ) ); + m_arpModeModel.addItem( tr( "Free" ), new PixmapLoader( "arp_free" ) ); + m_arpModeModel.addItem( tr( "Sort" ), new PixmapLoader( "arp_sort" ) ); + m_arpModeModel.addItem( tr( "Sync" ), new PixmapLoader( "arp_sync" ) ); } -arpeggiator::~arpeggiator() +Arpeggiator::~Arpeggiator() { } -void arpeggiator::processNote( notePlayHandle * _n ) +void Arpeggiator::processNote( notePlayHandle * _n ) { const int base_note_key = _n->key(); - if( _n->isBaseNote() == FALSE || + if( _n->isBaseNote() == false || !m_arpEnabledModel.value() || ( _n->released() && _n->releaseFramesDone() >= _n->actualReleaseFramesToDo() ) ) @@ -306,12 +300,12 @@ void arpeggiator::processNote( notePlayHandle * _n ) const int selected_arp = m_arpModel.value(); ConstNotePlayHandleList cnphv = notePlayHandle::nphsOfInstrumentTrack( - _n->getInstrumentTrack() ); + _n->instrumentTrack() ); if( m_arpModeModel.value() != FreeMode && cnphv.size() == 0 ) { // maybe we're playing only a preset-preview-note? cnphv = presetPreviewPlayHandle::nphsOfInstrumentTrack( - _n->getInstrumentTrack() ); + _n->instrumentTrack() ); if( cnphv.size() == 0 ) { // still nothing found here, so lets return @@ -320,8 +314,8 @@ void arpeggiator::processNote( notePlayHandle * _n ) } } - const int cur_chord_size = chordCreator::getChordSize( - chordCreator::s_chordTable[selected_arp] ); + const int cur_chord_size = ChordCreator::getChordSize( + ChordCreator::s_chordTable[selected_arp] ); const int range = (int)( cur_chord_size * m_arpRangeModel.value() ); const int total_range = range * cnphv.size(); @@ -407,7 +401,7 @@ void arpeggiator::processNote( notePlayHandle * _n ) const int sub_note_key = base_note_key + (cur_arp_idx / cur_chord_size ) * KeysPerOctave + - chordCreator::s_chordTable[selected_arp]. + ChordCreator::s_chordTable[selected_arp]. interval[cur_arp_idx % cur_chord_size]; // range-checking @@ -432,15 +426,15 @@ void arpeggiator::processNote( notePlayHandle * _n ) _n->getPanning(), _n->detuning() ); // create sub-note-play-handle, only ptr to note is different - // and is_arp_note=TRUE - new notePlayHandle( _n->getInstrumentTrack(), + // and is_arp_note=true + new notePlayHandle( _n->instrumentTrack(), ( ( m_arpModeModel.value() != FreeMode ) ? cnphv.first()->offset() : _n->offset() ) + frames_processed, gated_frames, new_note, - _n, TRUE ); + _n, true ); // update counters frames_processed += arp_frames; @@ -458,7 +452,7 @@ void arpeggiator::processNote( notePlayHandle * _n ) -void arpeggiator::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void Arpeggiator::saveSettings( QDomDocument & _doc, QDomElement & _this ) { m_arpEnabledModel.saveSettings( _doc, _this, "arp-enabled" ); m_arpModel.saveSettings( _doc, _this, "arp" ); @@ -473,7 +467,7 @@ void arpeggiator::saveSettings( QDomDocument & _doc, QDomElement & _this ) -void arpeggiator::loadSettings( const QDomElement & _this ) +void Arpeggiator::loadSettings( const QDomElement & _this ) { m_arpEnabledModel.loadSettings( _this, "arp-enabled" ); m_arpModel.loadSettings( _this, "arp" ); @@ -494,6 +488,4 @@ void arpeggiator::loadSettings( const QDomElement & _this ) } -#include "moc_instrument_functions.cxx" - -#endif +#include "moc_InstrumentFunctions.cxx" diff --git a/src/core/instrument_sound_shaping.cpp b/src/core/InstrumentSoundShaping.cpp similarity index 63% rename from src/core/instrument_sound_shaping.cpp rename to src/core/InstrumentSoundShaping.cpp index 7492c7ff0..7351aac37 100644 --- a/src/core/instrument_sound_shaping.cpp +++ b/src/core/InstrumentSoundShaping.cpp @@ -1,8 +1,8 @@ /* - * instrument_sound_shaping.cpp - class instrumentSoundShaping + * InstrumentSoundShaping.cpp - implementation of class InstrumentSoundShaping + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,17 +22,15 @@ * */ - #include - -#include "instrument_sound_shaping.h" +#include "InstrumentSoundShaping.h" #include "basic_filters.h" #include "embed.h" #include "engine.h" -#include "envelope_and_lfo_parameters.h" -#include "instrument.h" -#include "instrument_track.h" +#include "EnvelopeAndLfoParameters.h" +#include "Instrument.h" +#include "InstrumentTrack.h" #include "note_play_handle.h" @@ -44,30 +42,28 @@ const float RES_PRECISION = 1000.0f; // names for env- and lfo-targets - first is name being displayed to user // and second one is used internally, e.g. for saving/restoring settings -const QString __targetNames[instrumentSoundShaping::NumTargets][3] = +const QString __targetNames[InstrumentSoundShaping::NumTargets][3] = { - { instrumentSoundShaping::tr( "VOLUME" ), "vol", - instrumentSoundShaping::tr( "Volume" ) }, -/* instrumentSoundShaping::tr( "Pan" ), - instrumentSoundShaping::tr( "Pitch" ),*/ - { instrumentSoundShaping::tr( "CUTOFF" ), "cut", - instrumentSoundShaping::tr( "Cutoff frequency" ) }, - { instrumentSoundShaping::tr( "RESO" ), "res", - instrumentSoundShaping::tr( "Resonance" ) } + { InstrumentSoundShaping::tr( "VOLUME" ), "vol", + InstrumentSoundShaping::tr( "Volume" ) }, +/* InstrumentSoundShaping::tr( "Pan" ), + InstrumentSoundShaping::tr( "Pitch" ),*/ + { InstrumentSoundShaping::tr( "CUTOFF" ), "cut", + InstrumentSoundShaping::tr( "Cutoff frequency" ) }, + { InstrumentSoundShaping::tr( "RESO" ), "res", + InstrumentSoundShaping::tr( "Resonance" ) } } ; -instrumentSoundShaping::instrumentSoundShaping( - instrumentTrack * _instrument_track ) : - model( _instrument_track, tr( "Envelopes/LFOs" ) ), +InstrumentSoundShaping::InstrumentSoundShaping( + InstrumentTrack * _instrument_track ) : + Model( _instrument_track, tr( "Envelopes/LFOs" ) ), m_instrumentTrack( _instrument_track ), m_filterEnabledModel( false, this ), m_filterModel( this, tr( "Filter type" ) ), - m_filterCutModel( 14000.0, 1.0, 14000.0, 1.0, this, - tr( "Cutoff frequency" ) ), - m_filterResModel( 0.5, basicFilters<>::minQ(), 10.0, 0.01, this, - tr( "Q/Resonance" ) ) + m_filterCutModel( 14000.0, 1.0, 14000.0, 1.0, this, tr( "Cutoff frequency" ) ), + m_filterResModel( 0.5, basicFilters<>::minQ(), 10.0, 0.01, this, tr( "Q/Resonance" ) ) { for( int i = 0; i < NumTargets; ++i ) { @@ -76,42 +72,34 @@ instrumentSoundShaping::instrumentSoundShaping( { value_for_zero_amount = 1.0; } - m_envLFOParameters[i] = new envelopeAndLFOParameters( - value_for_zero_amount, - this ); - m_envLFOParameters[i]->setDisplayName( + m_envLfoParameters[i] = new EnvelopeAndLfoParameters( + value_for_zero_amount, + this ); + m_envLfoParameters[i]->setDisplayName( tr( __targetNames[i][2].toUtf8().constData() ) ); } - m_filterModel.addItem( tr( "LowPass" ), - new pixmapLoader( "filter_lp" ) ); - m_filterModel.addItem( tr( "HiPass" ), - new pixmapLoader( "filter_hp" ) ); - m_filterModel.addItem( tr( "BandPass csg" ), - new pixmapLoader( "filter_bp" ) ); - m_filterModel.addItem( tr( "BandPass czpg" ), - new pixmapLoader( "filter_bp" ) ); - m_filterModel.addItem( tr( "Notch" ), - new pixmapLoader( "filter_notch" ) ); - m_filterModel.addItem( tr( "Allpass" ), - new pixmapLoader( "filter_ap" ) ); - m_filterModel.addItem( tr( "Moog" ), - new pixmapLoader( "filter_lp" ) ); - m_filterModel.addItem( tr( "2x LowPass" ), - new pixmapLoader( "filter_2lp" ) ); + m_filterModel.addItem( tr( "LowPass" ), new PixmapLoader( "filter_lp" ) ); + m_filterModel.addItem( tr( "HiPass" ), new PixmapLoader( "filter_hp" ) ); + m_filterModel.addItem( tr( "BandPass csg" ), new PixmapLoader( "filter_bp" ) ); + m_filterModel.addItem( tr( "BandPass czpg" ), new PixmapLoader( "filter_bp" ) ); + m_filterModel.addItem( tr( "Notch" ), new PixmapLoader( "filter_notch" ) ); + m_filterModel.addItem( tr( "Allpass" ), new PixmapLoader( "filter_ap" ) ); + m_filterModel.addItem( tr( "Moog" ), new PixmapLoader( "filter_lp" ) ); + m_filterModel.addItem( tr( "2x LowPass" ), new PixmapLoader( "filter_2lp" ) ); } -instrumentSoundShaping::~instrumentSoundShaping() +InstrumentSoundShaping::~InstrumentSoundShaping() { } -float instrumentSoundShaping::volumeLevel( notePlayHandle * _n, +float InstrumentSoundShaping::volumeLevel( notePlayHandle * _n, const f_cnt_t _frame ) { f_cnt_t release_begin = _frame - _n->releaseFramesDone() + @@ -123,16 +111,16 @@ float instrumentSoundShaping::volumeLevel( notePlayHandle * _n, } float volume_level; - m_envLFOParameters[Volume]->fillLevel( &volume_level, _frame, + m_envLfoParameters[Volume]->fillLevel( &volume_level, _frame, release_begin, 1 ); - return( volume_level ); + return volume_level; } -void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab, +void InstrumentSoundShaping::processAudioBuffer( sampleFrame * _ab, const fpp_t _frames, notePlayHandle * _n ) { @@ -173,20 +161,20 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab, float * res_buf = NULL; #endif - if( m_envLFOParameters[Cut]->used() ) + if( m_envLfoParameters[Cut]->isUsed() ) { #ifndef __GNUC__ cut_buf = new float[_frames]; #endif - m_envLFOParameters[Cut]->fillLevel( cut_buf, total_frames, + m_envLfoParameters[Cut]->fillLevel( cut_buf, total_frames, release_begin, _frames ); } - if( m_envLFOParameters[Resonance]->used() ) + if( m_envLfoParameters[Resonance]->isUsed() ) { #ifndef __GNUC__ res_buf = new float[_frames]; #endif - m_envLFOParameters[Resonance]->fillLevel( res_buf, + m_envLfoParameters[Resonance]->fillLevel( res_buf, total_frames, release_begin, _frames ); } @@ -194,12 +182,12 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab, const float fcv = m_filterCutModel.value(); const float frv = m_filterResModel.value(); - if( m_envLFOParameters[Cut]->used() && - m_envLFOParameters[Resonance]->used() ) + if( m_envLfoParameters[Cut]->isUsed() && + m_envLfoParameters[Resonance]->isUsed() ) { for( fpp_t frame = 0; frame < _frames; ++frame ) { - const float new_cut_val = envelopeAndLFOParameters::expKnobVal( cut_buf[frame] ) * + const float new_cut_val = EnvelopeAndLfoParameters::expKnobVal( cut_buf[frame] ) * CUT_FREQ_MULTIPLIER + fcv; const float new_res_val = frv + RES_MULTIPLIER * res_buf[frame]; @@ -216,11 +204,11 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab, _ab[frame][1] = _n->m_filter->update( _ab[frame][1], 1 ); } } - else if( m_envLFOParameters[Cut]->used() ) + else if( m_envLfoParameters[Cut]->isUsed() ) { for( fpp_t frame = 0; frame < _frames; ++frame ) { - float new_cut_val = envelopeAndLFOParameters::expKnobVal( cut_buf[frame] ) * + float new_cut_val = EnvelopeAndLfoParameters::expKnobVal( cut_buf[frame] ) * CUT_FREQ_MULTIPLIER + fcv; if( static_cast( new_cut_val ) != old_filter_cut ) @@ -233,7 +221,7 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab, _ab[frame][1] = _n->m_filter->update( _ab[frame][1], 1 ); } } - else if( m_envLFOParameters[Resonance]->used() ) + else if( m_envLfoParameters[Resonance]->isUsed() ) { for( fpp_t frame = 0; frame < _frames; ++frame ) { @@ -266,14 +254,14 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab, #endif } - if( m_envLFOParameters[Volume]->used() ) + if( m_envLfoParameters[Volume]->isUsed() ) { #ifdef __GNUC__ float vol_buf[_frames]; #else float * vol_buf = new float[_frames]; #endif - m_envLFOParameters[Volume]->fillLevel( vol_buf, total_frames, + m_envLfoParameters[Volume]->fillLevel( vol_buf, total_frames, release_begin, _frames ); for( fpp_t frame = 0; frame < _frames; ++frame ) @@ -288,7 +276,7 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab, #endif } -/* else if( m_envLFOParameters[Volume]->used() == false && m_envLFOParameters[PANNING]->used() ) +/* else if( m_envLfoParameters[Volume]->isUsed() == false && m_envLfoParameters[PANNING]->isUsed() ) { // only use panning-envelope... for( fpp_t frame = 0; frame < _frames; ++frame ) @@ -306,18 +294,18 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab, -f_cnt_t instrumentSoundShaping::envFrames( const bool _only_vol ) const +f_cnt_t InstrumentSoundShaping::envFrames( const bool _only_vol ) const { - f_cnt_t ret_val = m_envLFOParameters[Volume]->PAHD_Frames(); + f_cnt_t ret_val = m_envLfoParameters[Volume]->PAHD_Frames(); if( _only_vol == false ) { for( int i = Volume+1; i < NumTargets; ++i ) { - if( m_envLFOParameters[i]->used() && - m_envLFOParameters[i]->PAHD_Frames() > ret_val ) + if( m_envLfoParameters[i]->isUsed() && + m_envLfoParameters[i]->PAHD_Frames() > ret_val ) { - ret_val = m_envLFOParameters[i]->PAHD_Frames(); + ret_val = m_envLfoParameters[i]->PAHD_Frames(); } } } @@ -327,26 +315,23 @@ f_cnt_t instrumentSoundShaping::envFrames( const bool _only_vol ) const -f_cnt_t instrumentSoundShaping::releaseFrames( void ) const +f_cnt_t InstrumentSoundShaping::releaseFrames() const { - f_cnt_t ret_val = m_envLFOParameters[Volume]->used() ? - m_envLFOParameters[Volume]->releaseFrames() : 0; - if( m_instrumentTrack->getInstrument()->desiredReleaseFrames() > - ret_val ) + f_cnt_t ret_val = m_envLfoParameters[Volume]->isUsed() ? + m_envLfoParameters[Volume]->releaseFrames() : 0; + if( m_instrumentTrack->instrument()->desiredReleaseFrames() > ret_val ) { - ret_val = m_instrumentTrack->getInstrument()-> - desiredReleaseFrames(); + ret_val = m_instrumentTrack->instrument()->desiredReleaseFrames(); } - if( m_envLFOParameters[Volume]->used() == false ) + if( m_envLfoParameters[Volume]->isUsed() == false ) { for( int i = Volume+1; i < NumTargets; ++i ) { - if( m_envLFOParameters[i]->used() && - m_envLFOParameters[i]->releaseFrames() > - ret_val ) + if( m_envLfoParameters[i]->isUsed() && + m_envLfoParameters[i]->releaseFrames() > ret_val ) { - ret_val = m_envLFOParameters[i]->releaseFrames(); + ret_val = m_envLfoParameters[i]->releaseFrames(); } } } @@ -356,7 +341,7 @@ f_cnt_t instrumentSoundShaping::releaseFrames( void ) const -void instrumentSoundShaping::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void InstrumentSoundShaping::saveSettings( QDomDocument & _doc, QDomElement & _this ) { m_filterModel.saveSettings( _doc, _this, "ftype" ); m_filterCutModel.saveSettings( _doc, _this, "fcut" ); @@ -365,8 +350,8 @@ void instrumentSoundShaping::saveSettings( QDomDocument & _doc, QDomElement & _t for( int i = 0; i < NumTargets; ++i ) { - m_envLFOParameters[i]->saveState( _doc, _this ).setTagName( - m_envLFOParameters[i]->nodeName() + + m_envLfoParameters[i]->saveState( _doc, _this ).setTagName( + m_envLfoParameters[i]->nodeName() + QString( __targetNames[i][1] ).toLower() ); } } @@ -374,7 +359,7 @@ void instrumentSoundShaping::saveSettings( QDomDocument & _doc, QDomElement & _t -void instrumentSoundShaping::loadSettings( const QDomElement & _this ) +void InstrumentSoundShaping::loadSettings( const QDomElement & _this ) { m_filterModel.loadSettings( _this, "ftype" ); m_filterCutModel.loadSettings( _this, "fcut" ); @@ -389,12 +374,11 @@ void instrumentSoundShaping::loadSettings( const QDomElement & _this ) for( int i = 0; i < NumTargets; ++i ) { if( node.nodeName() == - m_envLFOParameters[i]->nodeName() + + m_envLfoParameters[i]->nodeName() + QString( __targetNames[i][1] ). toLower() ) { - m_envLFOParameters[i]->restoreState( - node.toElement() ); + m_envLfoParameters[i]->restoreState( node.toElement() ); } } } @@ -405,5 +389,5 @@ void instrumentSoundShaping::loadSettings( const QDomElement & _this ) -#include "moc_instrument_sound_shaping.cxx" +#include "moc_InstrumentSoundShaping.cxx" diff --git a/src/core/journalling_object.cpp b/src/core/JournallingObject.cpp similarity index 72% rename from src/core/journalling_object.cpp rename to src/core/JournallingObject.cpp index 0241b2c0c..b2a4bc575 100644 --- a/src/core/journalling_object.cpp +++ b/src/core/JournallingObject.cpp @@ -1,8 +1,8 @@ /* - * journalling_object.cpp - implementation of journalling-object related stuff + * JournallingObject.cpp - implementation of journalling-object related stuff * * Copyright (c) 2006-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,21 +22,21 @@ * */ - #include #include -#include "journalling_object.h" -#include "automatable_model.h" -#include "project_journal.h" +#include "JournallingObject.h" +#include "AutomatableModel.h" +#include "ProjectJournal.h" #include "base64.h" #include "engine.h" -journallingObject::journallingObject() : - m_id( engine::getProjectJournal()->allocID( this ) ), +JournallingObject::JournallingObject() : + SerializingObject(), + m_id( engine::projectJournal()->allocID( this ) ), m_journalEntries(), m_currentJournalEntry( m_journalEntries.end() ), m_journalling( true ), @@ -47,18 +47,18 @@ journallingObject::journallingObject() : -journallingObject::~journallingObject() +JournallingObject::~JournallingObject() { - if( engine::getProjectJournal() ) + if( engine::projectJournal() ) { - engine::getProjectJournal()->freeID( id() ); + engine::projectJournal()->freeID( id() ); } } -void journallingObject::undo() +void JournallingObject::undo() { if( m_journalEntries.empty() == true ) { @@ -74,7 +74,7 @@ void journallingObject::undo() -void journallingObject::redo() +void JournallingObject::redo() { if( m_journalEntries.empty() == true ) { @@ -90,10 +90,10 @@ void journallingObject::redo() -QDomElement journallingObject::saveState( QDomDocument & _doc, +QDomElement JournallingObject::saveState( QDomDocument & _doc, QDomElement & _parent ) { - QDomElement _this = serializingObject::saveState( _doc, _parent ); + QDomElement _this = SerializingObject::saveState( _doc, _parent ); saveJournal( _doc, _this ); return _this; } @@ -101,9 +101,9 @@ QDomElement journallingObject::saveState( QDomDocument & _doc, -void journallingObject::restoreState( const QDomElement & _this ) +void JournallingObject::restoreState( const QDomElement & _this ) { - serializingObject::restoreState( _this ); + SerializingObject::restoreState( _this ); saveJournallingState( false ); @@ -124,43 +124,43 @@ void journallingObject::restoreState( const QDomElement & _this ) -void journallingObject::addJournalEntry( const journalEntry & _je ) +void JournallingObject::addJournalEntry( const JournalEntry & _je ) { - if( engine::getProjectJournal()->isJournalling() && isJournalling() ) + if( engine::projectJournal()->isJournalling() && isJournalling() ) { m_journalEntries.erase( m_currentJournalEntry, m_journalEntries.end() ); m_journalEntries.push_back( _je ); m_currentJournalEntry = m_journalEntries.end(); - engine::getProjectJournal()->journalEntryAdded( id() ); + engine::projectJournal()->journalEntryAdded( id() ); } } -void journallingObject::changeID( jo_id_t _id ) +void JournallingObject::changeID( jo_id_t _id ) { if( id() != _id ) { - journallingObject * jo = engine::getProjectJournal()-> - getJournallingObject( _id ); + JournallingObject * jo = engine::projectJournal()-> + journallingObject( _id ); if( jo != NULL ) { QString used_by = jo->nodeName(); if( used_by == "automatablemodel" && - dynamic_cast( jo ) ) + dynamic_cast( jo ) ) { used_by += ":" + - dynamic_cast( jo )-> + dynamic_cast( jo )-> displayName(); } fprintf( stderr, "JO-ID %d already in use by %s!\n", (int) _id, used_by.toUtf8().constData() ); return; } - engine::getProjectJournal()->forgetAboutID( id() ); - engine::getProjectJournal()->reallocID( _id, this ); + engine::projectJournal()->forgetAboutID( id() ); + engine::projectJournal()->reallocID( _id, this ); m_id = _id; } } @@ -168,7 +168,7 @@ void journallingObject::changeID( jo_id_t _id ) -void journallingObject::saveJournal( QDomDocument & _doc, +void JournallingObject::saveJournal( QDomDocument & _doc, QDomElement & _parent ) { /* // avoid creating empty journal-nodes @@ -183,7 +183,7 @@ void journallingObject::saveJournal( QDomDocument & _doc, m_journalEntries.begin() ) ); journal_de.setAttribute( "metadata", true ); - for( journalEntryVector::const_iterator it = m_journalEntries.begin(); + for( JournalEntryVector::const_iterator it = m_journalEntries.begin(); it != m_journalEntries.end(); ++it ) { QDomElement je_de = _doc.createElement( "entry" ); @@ -200,7 +200,7 @@ void journallingObject::saveJournal( QDomDocument & _doc, -void journallingObject::loadJournal( const QDomElement & _this ) +void JournallingObject::loadJournal( const QDomElement & _this ) { clear(); @@ -222,7 +222,7 @@ void journallingObject::loadJournal( const QDomElement & _this ) { const QDomElement & je = node.toElement(); m_journalEntries[je.attribute( "pos" ).toInt()] = - journalEntry( + JournalEntry( je.attribute( "actionid" ).toInt(), base64::decode( je.attribute( "data" ) ) ); } diff --git a/src/core/ladspa_control.cpp b/src/core/LadspaControl.cpp similarity index 61% rename from src/core/ladspa_control.cpp rename to src/core/LadspaControl.cpp index 630894ec5..663dde687 100644 --- a/src/core/ladspa_control.cpp +++ b/src/core/LadspaControl.cpp @@ -1,9 +1,9 @@ /* - * ladspa_control.cpp - model for controlling a LADSPA port + * LadspaControl.cpp - model for controlling a LADSPA port * * Copyright (c) 2008-2009 Tobias Doerffel * Copyright (c) 2006-2008 Danny McRae - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -25,17 +25,17 @@ #include -#include "ladspa_control.h" -#include "ladspa_base.h" +#include "LadspaControl.h" +#include "LadspaBase.h" -ladspaControl::ladspaControl( model * _parent, port_desc_t * _port, +LadspaControl::LadspaControl( Model * _parent, port_desc_t * _port, bool _link ) : - model( _parent ), + Model( _parent ), m_link( _link ), m_port( _port ), m_linkEnabledModel( _link, this, tr( "Link channels" ) ), - m_toggledModel( FALSE, this, m_port->name ), + m_toggledModel( false, this, m_port->name ), m_knobModel( 0, 0, 0, 1, this, m_port->name ), m_tempoSyncKnobModel( 0, 0, 0, 1, m_port->max, this, m_port->name ) { @@ -44,7 +44,7 @@ ladspaControl::ladspaControl( model * _parent, port_desc_t * _port, connect( &m_linkEnabledModel, SIGNAL( dataChanged() ), this, SLOT( linkStateChanged() ) ); } - + switch( m_port->data_type ) { case TOGGLED: @@ -52,16 +52,16 @@ ladspaControl::ladspaControl( model * _parent, port_desc_t * _port, this, SLOT( ledChanged() ) ); if( m_port->def == 1.0f ) { - m_toggledModel.setValue( TRUE ); + m_toggledModel.setValue( true ); } break; case INTEGER: - m_knobModel.setRange( static_cast( m_port->max ), - static_cast( m_port->min ), - 1 + static_cast( m_port->max - + m_knobModel.setRange( static_cast( m_port->max ), + static_cast( m_port->min ), + 1 + static_cast( m_port->max - m_port->min ) / 400 ); - m_knobModel.setInitValue( + m_knobModel.setInitValue( static_cast( m_port->def ) ); connect( &m_knobModel, SIGNAL( dataChanged() ), this, SLOT( knobChanged() ) ); @@ -79,8 +79,8 @@ ladspaControl::ladspaControl( model * _parent, port_desc_t * _port, break; case TIME: - m_tempoSyncKnobModel.setRange( m_port->min, m_port->max, - ( m_port->max - + m_tempoSyncKnobModel.setRange( m_port->min, m_port->max, + ( m_port->max - m_port->min ) / 400.0f ); m_tempoSyncKnobModel.setInitValue( m_port->def ); connect( &m_tempoSyncKnobModel, SIGNAL( dataChanged() ), @@ -95,44 +95,36 @@ ladspaControl::ladspaControl( model * _parent, port_desc_t * _port, -ladspaControl::~ladspaControl() +LadspaControl::~LadspaControl() { } -LADSPA_Data ladspaControl::getValue( void ) +LADSPA_Data LadspaControl::value() { - LADSPA_Data value = 0.0f; - switch( m_port->data_type ) { case TOGGLED: - value = static_cast( - m_toggledModel.value() ); - break; + return static_cast( m_toggledModel.value() ); case INTEGER: case FLOATING: - value = static_cast( - m_knobModel.value() ); - break; + return static_cast( m_knobModel.value() ); case TIME: - value = static_cast( - m_tempoSyncKnobModel.value() ); - break; + return static_cast( m_tempoSyncKnobModel.value() ); default: - printf( "ladspaControl::getValue BAD BAD BAD\n" ); + qWarning( "LadspaControl::value(): BAD BAD BAD\n" ); break; } - - return( value ); + + return 0; } -void ladspaControl::setValue( LADSPA_Data _value ) +void LadspaControl::setValue( LADSPA_Data _value ) { switch( m_port->data_type ) { @@ -150,7 +142,7 @@ void ladspaControl::setValue( LADSPA_Data _value ) _value ) ); break; default: - printf("ladspaControl::setValue BAD BAD BAD\n"); + printf("LadspaControl::setValue BAD BAD BAD\n"); break; } } @@ -158,8 +150,8 @@ void ladspaControl::setValue( LADSPA_Data _value ) -void ladspaControl::saveSettings( QDomDocument & _doc, - QDomElement & _this, +void LadspaControl::saveSettings( QDomDocument & _doc, + QDomElement & _this, const QString & _name ) { if( m_link ) @@ -179,7 +171,7 @@ void ladspaControl::saveSettings( QDomDocument & _doc, m_tempoSyncKnobModel.saveSettings( _doc, _this, _name ); break; default: - printf("ladspaControl::saveSettings BAD BAD BAD\n"); + printf("LadspaControl::saveSettings BAD BAD BAD\n"); break; } } @@ -187,7 +179,7 @@ void ladspaControl::saveSettings( QDomDocument & _doc, -void ladspaControl::loadSettings( const QDomElement & _this, +void LadspaControl::loadSettings( const QDomElement & _this, const QString & _name ) { if( m_link ) @@ -207,7 +199,7 @@ void ladspaControl::loadSettings( const QDomElement & _this, m_tempoSyncKnobModel.loadSettings( _this, _name ); break; default: - printf("ladspaControl::loadSettings BAD BAD BAD\n"); + printf("LadspaControl::loadSettings BAD BAD BAD\n"); break; } } @@ -215,22 +207,20 @@ void ladspaControl::loadSettings( const QDomElement & _this, -void ladspaControl::linkControls( ladspaControl * _control ) +void LadspaControl::linkControls( LadspaControl * _control ) { switch( m_port->data_type ) { case TOGGLED: - boolModel::linkModels( &m_toggledModel, - _control->getToggledModel() ); + BoolModel::linkModels( &m_toggledModel, _control->toggledModel() ); break; case INTEGER: case FLOATING: - knobModel::linkModels( &m_knobModel, - _control->getKnobModel() ); + FloatModel::linkModels( &m_knobModel, _control->knobModel() ); break; case TIME: - tempoSyncKnobModel::linkModels( &m_tempoSyncKnobModel, - _control->getTempoSyncKnobModel() ); + TempoSyncKnobModel::linkModels( &m_tempoSyncKnobModel, + _control->tempoSyncKnobModel() ); break; default: break; @@ -240,49 +230,47 @@ void ladspaControl::linkControls( ladspaControl * _control ) -void ladspaControl::ledChanged( void ) +void LadspaControl::ledChanged() { - emit( changed( m_port->port_id, static_cast( - m_toggledModel.value() ) ) ); + emit changed( m_port->port_id, static_cast( + m_toggledModel.value() ) ); } -void ladspaControl::knobChanged( void ) +void LadspaControl::knobChanged() { - emit( changed( m_port->port_id, static_cast( - m_knobModel.value() ) ) ); + emit changed( m_port->port_id, static_cast( + m_knobModel.value() ) ); } -void ladspaControl::tempoKnobChanged( void ) +void LadspaControl::tempoKnobChanged() { - emit( changed( m_port->port_id, static_cast( - m_tempoSyncKnobModel.value() ) ) ); + emit changed( m_port->port_id, static_cast( + m_tempoSyncKnobModel.value() ) ); } -void ladspaControl::unlinkControls( ladspaControl * _control ) +void LadspaControl::unlinkControls( LadspaControl * _control ) { switch( m_port->data_type ) { case TOGGLED: - boolModel::unlinkModels( &m_toggledModel, - _control->getToggledModel() ); + BoolModel::unlinkModels( &m_toggledModel, _control->toggledModel() ); break; case INTEGER: case FLOATING: - knobModel::unlinkModels( &m_knobModel, - _control->getKnobModel() ); + FloatModel::unlinkModels( &m_knobModel, _control->knobModel() ); break; case TIME: - tempoSyncKnobModel::unlinkModels( &m_tempoSyncKnobModel, - _control->getTempoSyncKnobModel() ); + TempoSyncKnobModel::unlinkModels( &m_tempoSyncKnobModel, + _control->tempoSyncKnobModel() ); break; default: break; @@ -292,19 +280,19 @@ void ladspaControl::unlinkControls( ladspaControl * _control ) -void ladspaControl::linkStateChanged( void ) +void LadspaControl::linkStateChanged() { - emit( linkChanged( m_port->control_id, m_linkEnabledModel.value() ) ); + emit linkChanged( m_port->control_id, m_linkEnabledModel.value() ); } -void ladspaControl::setLink( bool _state ) +void LadspaControl::setLink( bool _state ) { m_linkEnabledModel.setValue( _state ); } -#include "moc_ladspa_control.cxx" +#include "moc_LadspaControl.cxx" diff --git a/src/core/LfoController.cpp b/src/core/LfoController.cpp index 205a252d1..706476f97 100644 --- a/src/core/LfoController.cpp +++ b/src/core/LfoController.cpp @@ -1,6 +1,6 @@ /* * LfoController.cpp - implementation of class controller which handles - * remote-control of automatableModels + * remote-control of AutomatableModels * * Copyright (c) 2008 Paul Giblock * @@ -37,19 +37,19 @@ //const float TWO_PI = 6.28318531f; -LfoController::LfoController( model * _parent ) : +LfoController::LfoController( Model * _parent ) : Controller( Controller::LfoController, _parent, tr( "LFO Controller" ) ), m_baseModel( 0.5, 0.0, 1.0, 0.001, this, tr( "Base value" ) ), m_speedModel( 2.0, 0.01, 20.0, 0.0001, 20000.0, this, tr( "Oscillator speed" ) ), m_amountModel( 1.0, -1.0, 1.0, 0.005, this, tr( "Oscillator amount" ) ), m_phaseModel( 0.0, 0.0, 360.0, 4.0, this, tr( "Oscillator phase" ) ), - m_waveModel( oscillator::SineWave, 0, oscillator::NumWaveShapes, + m_waveModel( Oscillator::SineWave, 0, Oscillator::NumWaveShapes, this, tr( "Oscillator waveform" ) ), m_multiplierModel( 0, 0, 2, this, tr( "Frequency Multiplier" ) ), m_duration( 1000 ), m_phaseCorrection( 0 ), m_phaseOffset( 0 ), - m_sampleFunction( &oscillator::sinSample ) + m_sampleFunction( &Oscillator::sinSample ) { connect( &m_waveModel, SIGNAL( dataChanged() ), @@ -175,26 +175,26 @@ void LfoController::updateSampleFunction( void ) { switch( m_waveModel.value() ) { - case oscillator::SineWave: - m_sampleFunction = &oscillator::sinSample; + case Oscillator::SineWave: + m_sampleFunction = &Oscillator::sinSample; break; - case oscillator::TriangleWave: - m_sampleFunction = &oscillator::triangleSample; + case Oscillator::TriangleWave: + m_sampleFunction = &Oscillator::triangleSample; break; - case oscillator::SawWave: - m_sampleFunction = &oscillator::sawSample; + case Oscillator::SawWave: + m_sampleFunction = &Oscillator::sawSample; break; - case oscillator::SquareWave: - m_sampleFunction = &oscillator::squareSample; + case Oscillator::SquareWave: + m_sampleFunction = &Oscillator::squareSample; break; - case oscillator::MoogSawWave: - m_sampleFunction = &oscillator::moogSawSample; + case Oscillator::MoogSawWave: + m_sampleFunction = &Oscillator::moogSawSample; break; - case oscillator::ExponentialWave: - m_sampleFunction = &oscillator::expSample; + case Oscillator::ExponentialWave: + m_sampleFunction = &Oscillator::expSample; break; - case oscillator::WhiteNoise: - m_sampleFunction = &oscillator::noiseSample; + case Oscillator::WhiteNoise: + m_sampleFunction = &Oscillator::noiseSample; break; } } diff --git a/src/core/meter_model.cpp b/src/core/MeterModel.cpp similarity index 75% rename from src/core/meter_model.cpp rename to src/core/MeterModel.cpp index f1e9565ba..06d3c8046 100644 --- a/src/core/meter_model.cpp +++ b/src/core/MeterModel.cpp @@ -1,8 +1,8 @@ /* - * meter_model.cpp - model for meter specification + * MeterModel.cpp - model for meter specification + * + * Copyright (c) 2008-2009 Tobias Doerffel * - * Copyright (c) 2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,11 +23,11 @@ */ -#include "meter_model.h" +#include "MeterModel.h" -meterModel::meterModel( ::model * _parent ) : - model( _parent ), +MeterModel::MeterModel( ::Model * _parent ) : + Model( _parent ), m_numeratorModel( 4, 1, 32, this, tr( "Numerator" ) ), m_denominatorModel( 4, 1, 32, this, tr( "Denominator" ) ) { @@ -40,14 +40,14 @@ meterModel::meterModel( ::model * _parent ) : -meterModel::~meterModel() +MeterModel::~MeterModel() { } -void meterModel::reset( void ) +void MeterModel::reset() { m_numeratorModel.setValue( 4 ); m_denominatorModel.setValue( 4 ); @@ -56,8 +56,8 @@ void meterModel::reset( void ) -void meterModel::saveSettings( QDomDocument & _doc, QDomElement & _this, - const QString & _name ) +void MeterModel::saveSettings( QDomDocument & _doc, QDomElement & _this, + const QString & _name ) { m_numeratorModel.saveSettings( _doc, _this, _name + "_numerator" ); m_denominatorModel.saveSettings( _doc, _this, _name + "_denominator" ); @@ -66,8 +66,8 @@ void meterModel::saveSettings( QDomDocument & _doc, QDomElement & _this, -void meterModel::loadSettings( const QDomElement & _this, - const QString & _name ) +void MeterModel::loadSettings( const QDomElement & _this, + const QString & _name ) { m_numeratorModel.loadSettings( _this, _name + "_numerator" ); m_denominatorModel.loadSettings( _this, _name + "_denominator" ); @@ -75,5 +75,5 @@ void meterModel::loadSettings( const QDomElement & _this, -#include "moc_meter_model.cxx" +#include "moc_MeterModel.cxx" diff --git a/src/core/Model.cpp b/src/core/Model.cpp new file mode 100644 index 000000000..db909ecc8 --- /dev/null +++ b/src/core/Model.cpp @@ -0,0 +1,50 @@ +/* + * Model.cpp - implementation of Model base class + * + * Copyright (c) 2007-2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + */ + +#include "Model.h" + + +QString Model::fullDisplayName() const +{ + const QString & n = displayName(); + if( parentModel() ) + { + const QString p = parentModel()->fullDisplayName(); + if( n.isEmpty() && p.isEmpty() ) + { + return QString::null; + } + else if( p.isEmpty() ) + { + return n; + } + return p + ">" + n; + } + return n; +} + + + +#include "moc_Model.cxx" + diff --git a/src/core/oscillator.cpp b/src/core/Oscillator.cpp similarity index 83% rename from src/core/oscillator.cpp rename to src/core/Oscillator.cpp index e3253c569..b9b466269 100644 --- a/src/core/oscillator.cpp +++ b/src/core/Oscillator.cpp @@ -1,8 +1,8 @@ /* - * oscillator.cpp - implementation of powerful oscillator-class + * Oscillator.cpp - implementation of powerful oscillator-class + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,21 +22,20 @@ * */ - -#include "oscillator.h" +#include "Oscillator.h" #include "engine.h" #include "mixer.h" -#include "automatable_model.h" +#include "AutomatableModel.h" -oscillator::oscillator( const intModel * _wave_shape_model, - const intModel * _mod_algo_model, +Oscillator::Oscillator( const IntModel * _wave_shape_model, + const IntModel * _mod_algo_model, const float & _freq, const float & _detuning, const float & _phase_offset, const float & _volume, - oscillator * _sub_osc ) : + Oscillator * _sub_osc ) : m_waveShapeModel( _wave_shape_model ), m_modulationAlgoModel( _mod_algo_model ), m_freq( _freq ), @@ -53,7 +52,7 @@ oscillator::oscillator( const intModel * _wave_shape_model, -void oscillator::update( sampleFrame * _ab, const fpp_t _frames, +void Oscillator::update( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { if( m_freq >= engine::getMixer()->processingSampleRate() / 2 ) @@ -90,7 +89,7 @@ void oscillator::update( sampleFrame * _ab, const fpp_t _frames, -void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames, +void Oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { switch( m_waveShapeModel->value() ) @@ -126,7 +125,7 @@ void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames, -void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames, +void Oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { switch( m_waveShapeModel->value() ) @@ -162,7 +161,7 @@ void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames, -void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames, +void Oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { switch( m_waveShapeModel->value() ) @@ -198,7 +197,7 @@ void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames, -void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames, +void Oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { switch( m_waveShapeModel->value() ) @@ -234,7 +233,7 @@ void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames, -void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames, +void Oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { switch( m_waveShapeModel->value() ) @@ -270,7 +269,7 @@ void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames, -void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames, +void Oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { switch( m_waveShapeModel->value() ) @@ -307,7 +306,7 @@ void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames, // should be called every time phase-offset is changed... -inline void oscillator::recalcPhase( void ) +inline void Oscillator::recalcPhase( void ) { if( !typeInfo::isEqual( m_phaseOffset, m_ext_phaseOffset ) ) { @@ -322,7 +321,7 @@ inline void oscillator::recalcPhase( void ) -inline bool oscillator::syncOk( float _osc_coeff ) +inline bool Oscillator::syncOk( float _osc_coeff ) { const float v1 = m_phase; m_phase += _osc_coeff; @@ -333,7 +332,7 @@ inline bool oscillator::syncOk( float _osc_coeff ) -float oscillator::syncInit( sampleFrame * _ab, const fpp_t _frames, +float Oscillator::syncInit( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { if( m_subOsc != NULL ) @@ -348,8 +347,8 @@ float oscillator::syncInit( sampleFrame * _ab, const fpp_t _frames, // if we have no sub-osc, we can't do any modulation... just get our samples -template -void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames, +template +void Oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { recalcPhase(); @@ -366,8 +365,8 @@ void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames, // do pm by using sub-osc as modulator -template -void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames, +template +void Oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { m_subOsc->update( _ab, _frames, _chnl ); @@ -387,8 +386,8 @@ void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames, // do am by using sub-osc as modulator -template -void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames, +template +void Oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { m_subOsc->update( _ab, _frames, _chnl ); @@ -406,8 +405,8 @@ void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames, // do mix by using sub-osc as mix-sample -template -void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames, +template +void Oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { m_subOsc->update( _ab, _frames, _chnl ); @@ -426,8 +425,8 @@ void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames, // sync with sub-osc (every time sub-osc starts new period, we also start new // period) -template -void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames, +template +void Oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { const float sub_osc_coeff = m_subOsc->syncInit( _ab, _frames, _chnl ); @@ -449,8 +448,8 @@ void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames, // do fm by using sub-osc as modulator -template -void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames, +template +void Oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { m_subOsc->update( _ab, _frames, _chnl ); @@ -471,7 +470,7 @@ void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames, template<> -inline sample_t oscillator::getSample( +inline sample_t Oscillator::getSample( const float _sample ) { return( sinSample( _sample ) ); @@ -481,7 +480,7 @@ inline sample_t oscillator::getSample( template<> -inline sample_t oscillator::getSample( +inline sample_t Oscillator::getSample( const float _sample ) { return( triangleSample( _sample ) ); @@ -491,7 +490,7 @@ inline sample_t oscillator::getSample( template<> -inline sample_t oscillator::getSample( +inline sample_t Oscillator::getSample( const float _sample ) { return( sawSample( _sample ) ); @@ -501,7 +500,7 @@ inline sample_t oscillator::getSample( template<> -inline sample_t oscillator::getSample( +inline sample_t Oscillator::getSample( const float _sample ) { return( squareSample( _sample ) ); @@ -511,7 +510,7 @@ inline sample_t oscillator::getSample( template<> -inline sample_t oscillator::getSample( +inline sample_t Oscillator::getSample( const float _sample ) { return( moogSawSample( _sample ) ); @@ -521,7 +520,7 @@ inline sample_t oscillator::getSample( template<> -inline sample_t oscillator::getSample( +inline sample_t Oscillator::getSample( const float _sample ) { return( expSample( _sample ) ); @@ -531,7 +530,7 @@ inline sample_t oscillator::getSample( template<> -inline sample_t oscillator::getSample( +inline sample_t Oscillator::getSample( const float _sample ) { return( noiseSample( _sample ) ); @@ -541,7 +540,7 @@ inline sample_t oscillator::getSample( template<> -inline sample_t oscillator::getSample( +inline sample_t Oscillator::getSample( const float _sample ) { return( userWaveSample( _sample ) ); diff --git a/src/core/PeakController.cpp b/src/core/PeakController.cpp index a61e3bf19..6efcbb08d 100644 --- a/src/core/PeakController.cpp +++ b/src/core/PeakController.cpp @@ -1,6 +1,6 @@ /* * PeakController.cpp - implementation of class controller which handles - * remote-control of automatableModels + * remote-control of AutomatableModels * * Copyright (c) 2008 Paul Giblock * @@ -38,11 +38,11 @@ #include "plugins/peak_controller_effect/peak_controller_effect.h" int PeakController::s_lastEffectId = 0; -peakControllerEffectVector PeakController::s_effects; +PeakControllerEffectVector PeakController::s_effects; -PeakController::PeakController( model * _parent, - peakControllerEffect * _peak_effect ) : +PeakController::PeakController( Model * _parent, + PeakControllerEffect * _peak_effect ) : Controller( Controller::PeakController, _parent, tr( "Peak Controller" ) ), m_peakEffect( _peak_effect ) { @@ -102,12 +102,11 @@ void PeakController::loadSettings( const QDomElement & _this ) { int effectId = _this.attribute( "effectId" ).toInt(); - peakControllerEffectVector::iterator i; + PeakControllerEffectVector::Iterator i; for( i = s_effects.begin(); i != s_effects.end(); ++i ) { if( (*i)->m_effectId == effectId ) { - if( (*i)->m_effectId == effectId ) m_peakEffect = *i; return; } @@ -116,7 +115,7 @@ void PeakController::loadSettings( const QDomElement & _this ) -QString PeakController::nodeName( void ) const +QString PeakController::nodeName() const { return( "Peakcontroller" ); } diff --git a/src/core/Piano.cpp b/src/core/Piano.cpp new file mode 100644 index 000000000..657505728 --- /dev/null +++ b/src/core/Piano.cpp @@ -0,0 +1,117 @@ +/* + * Piano.cpp - implementation of piano-widget used in instrument-track-window + * for testing + according model class + * + * Copyright (c) 2004-2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + */ + +/** \file Piano.cpp + * \brief A piano keyboard to play notes on in the instrument plugin window. + */ + +/* + * \mainpage Instrument plugin keyboard display classes + * + * \section introduction Introduction + * + * \todo fill this out + * \todo write isWhite inline function and replace throughout + */ + +#include "Piano.h" +#include "InstrumentTrack.h" +#include "MidiEventProcessor.h" + + +/*! \brief Create a new keyboard display + * + * \param _it the InstrumentTrack window to attach to + */ +Piano::Piano( InstrumentTrack * _it ) : + Model( NULL ), /*!< base class ctor */ + m_instrumentTrack( _it ), + m_midiEvProc( _it ) /*!< the InstrumentTrack Model */ +{ + for( int i = 0; i < NumKeys; ++i ) + { + m_pressedKeys[i] = false; + } + +} + + + + +/*! \brief Destroy this new keyboard display + * + */ +Piano::~Piano() +{ +} + + + + +/*! \brief Turn a key on or off + * + * \param _key the key number to change + * \param _on the state to set the key to + */ +void Piano::setKeyState( int _key, bool _on ) +{ + m_pressedKeys[tLimit( _key, 0, NumKeys-1 )] = _on; + emit dataChanged(); +} + + + + +/*! \brief Handle a note being pressed on our keyboard display + * + * \param _key the key being pressed + */ +void Piano::handleKeyPress( int _key ) +{ + m_midiEvProc->processInEvent( midiEvent( MidiNoteOn, 0, _key, + MidiMaxVelocity ), midiTime() ); + m_pressedKeys[_key] = true; +} + + + + + +/*! \brief Handle a note being released on our keyboard display + * + * \param _key the key being releassed + */ +void Piano::handleKeyRelease( int _key ) +{ + m_midiEvProc->processInEvent( midiEvent( MidiNoteOff, 0, _key, 0 ), + midiTime() ); + m_pressedKeys[_key] = false; +} + + + + +#include "moc_Piano.cxx" + diff --git a/src/core/plugin.cpp b/src/core/Plugin.cpp similarity index 76% rename from src/core/plugin.cpp rename to src/core/Plugin.cpp index 53cb55c62..3615df109 100644 --- a/src/core/plugin.cpp +++ b/src/core/Plugin.cpp @@ -1,10 +1,10 @@ #ifndef SINGLE_SOURCE_COMPILE /* - * plugin.cpp - implementation of plugin-class including plugin-loader + * Plugin.cpp - implementation of plugin-class including plugin-loader * * Copyright (c) 2005-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -24,31 +24,29 @@ * */ - #include #include #include - -#include "plugin.h" +#include "Plugin.h" #include "embed.h" #include "engine.h" #include "mixer.h" #include "config_mgr.h" -#include "dummy_plugin.h" -#include "automatable_model.h" +#include "DummyPlugin.h" +#include "AutomatableModel.h" -static pixmapLoader __dummy_loader; +static PixmapLoader __dummy_loader; -static plugin::descriptor dummy_plugin_descriptor = +static Plugin::Descriptor dummy_plugin_descriptor = { "dummy", "dummy", QT_TRANSLATE_NOOP( "pluginBrowser", "no description" ), "Tobias Doerffel ", 0x0100, - plugin::Undefined, + Plugin::Undefined, &__dummy_loader, NULL } ; @@ -56,9 +54,9 @@ static plugin::descriptor dummy_plugin_descriptor = -plugin::plugin( const descriptor * _descriptor, model * _parent ) : - journallingObject(), - model( _parent ), +Plugin::Plugin( const Descriptor * _descriptor, Model * _parent ) : + JournallingObject(), + Model( _parent ), m_descriptor( _descriptor ) { if( m_descriptor == NULL ) @@ -70,30 +68,30 @@ plugin::plugin( const descriptor * _descriptor, model * _parent ) : -plugin::~plugin() +Plugin::~Plugin() { } -void plugin::loadFile( const QString & ) +void Plugin::loadFile( const QString & ) { } -automatableModel * plugin::getChildModel( const QString & ) +AutomatableModel * Plugin::childModel( const QString & ) { - static floatModel fm; + static FloatModel fm; return &fm; } -plugin * plugin::instantiate( const QString & _plugin_name, model * _parent, +Plugin * Plugin::instantiate( const QString & _plugin_name, Model * _parent, void * _data ) { QLibrary plugin_lib( configManager::inst()->pluginDir() + @@ -111,7 +109,7 @@ plugin * plugin::instantiate( const QString & _plugin_name, model * _parent, QMessageBox::Ok | QMessageBox::Default ); } - return( new dummyPlugin() ); + return new DummyPlugin(); } instantiationHook inst_hook = ( instantiationHook ) plugin_lib.resolve( "lmms_plugin_main" ); @@ -126,16 +124,16 @@ plugin * plugin::instantiate( const QString & _plugin_name, model * _parent, QMessageBox::Ok | QMessageBox::Default ); } - return( new dummyPlugin() ); + return new DummyPlugin(); } - plugin * inst = inst_hook( _parent, _data ); + Plugin * inst = inst_hook( _parent, _data ); return inst; } -void plugin::getDescriptorsOfAvailPlugins( QVector & _plugin_descs ) +void Plugin::getDescriptorsOfAvailPlugins( QVector & _plugin_descs ) { QDir directory( configManager::inst()->pluginDir() ); #ifdef LMMS_BUILD_WIN32 @@ -164,13 +162,13 @@ void plugin::getDescriptorsOfAvailPlugins( QVector & _plugin_descs ) { desc_name = desc_name.mid( 3 ); } - descriptor * plugin_desc = - (descriptor *) plugin_lib.resolve( + Descriptor * plugin_desc = + (Descriptor *) plugin_lib.resolve( desc_name.toUtf8().constData() ); if( plugin_desc == NULL ) { - printf( "LMMS-plugin %s does not have a " - "plugin-descriptor named %s!\n", + printf( "LMMS plugin %s does not have a " + "plugin descriptor named %s!\n", f.absoluteFilePath().toUtf8().constData(), desc_name.toUtf8().constData() ); continue; @@ -183,9 +181,9 @@ void plugin::getDescriptorsOfAvailPlugins( QVector & _plugin_descs ) -pluginView * plugin::createView( QWidget * _parent ) +PluginView * Plugin::createView( QWidget * _parent ) { - pluginView * pv = instantiateView( _parent ); + PluginView * pv = instantiateView( _parent ); if( pv != NULL ) { pv->setModel( this ); @@ -195,7 +193,7 @@ pluginView * plugin::createView( QWidget * _parent ) -plugin::descriptor::subPluginFeatures::key::key( +Plugin::Descriptor::SubPluginFeatures::Key::Key( const QDomElement & _key ) : desc( NULL ), name( _key.attribute( "key" ) ), @@ -213,12 +211,12 @@ plugin::descriptor::subPluginFeatures::key::key( -QDomElement plugin::descriptor::subPluginFeatures::key::saveXML( +QDomElement Plugin::Descriptor::SubPluginFeatures::Key::saveXML( QDomDocument & _doc ) const { QDomElement e = _doc.createElement( "key" ); - for( attributeMap::const_iterator it = attributes.begin(); - it != attributes.end(); ++it ) + for( AttributeMap::ConstIterator it = attributes.begin(); + it != attributes.end(); ++it ) { QDomElement a = _doc.createElement( "attribute" ); a.setAttribute( "name", it.key() ); diff --git a/src/core/project_journal.cpp b/src/core/ProjectJournal.cpp similarity index 73% rename from src/core/project_journal.cpp rename to src/core/ProjectJournal.cpp index 951b51a74..dffd60eee 100644 --- a/src/core/project_journal.cpp +++ b/src/core/ProjectJournal.cpp @@ -1,8 +1,8 @@ /* - * project_journal.cpp - implementation of project-journal + * ProjectJournal.cpp - implementation of ProjectJournal + * + * Copyright (c) 2006-2009 Tobias Doerffel * - * Copyright (c) 2006-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,41 +22,40 @@ * */ - #include -#include "project_journal.h" +#include "ProjectJournal.h" #include "engine.h" -#include "journalling_object.h" +#include "JournallingObject.h" #include "song.h" -projectJournal::projectJournal( void ) : +ProjectJournal::ProjectJournal() : m_joIDs(), m_journalEntries(), m_currentJournalEntry( m_journalEntries.end() ), - m_journalling( FALSE ) + m_journalling( false ) { } -projectJournal::~projectJournal() +ProjectJournal::~ProjectJournal() { } -void projectJournal::undo( void ) +void ProjectJournal::undo() { - if( m_journalEntries.empty() == TRUE ) + if( m_journalEntries.empty() == true ) { return; } - journallingObject * jo; + JournallingObject * jo; if( m_currentJournalEntry - 1 >= m_journalEntries.begin() && ( jo = m_joIDs[*--m_currentJournalEntry] ) != NULL ) @@ -69,14 +68,14 @@ void projectJournal::undo( void ) -void projectJournal::redo( void ) +void ProjectJournal::redo() { - if( m_journalEntries.empty() == TRUE ) + if( m_journalEntries.empty() == true ) { return; } - journallingObject * jo; + JournallingObject * jo; //printf("%d\n", m_joIDs[*(m_currentJournalEntry+1)] ); if( m_currentJournalEntry < m_journalEntries.end() && @@ -90,7 +89,7 @@ void projectJournal::redo( void ) -void projectJournal::journalEntryAdded( const jo_id_t _id ) +void ProjectJournal::journalEntryAdded( const jo_id_t _id ) { m_journalEntries.erase( m_currentJournalEntry, m_journalEntries.end() ); m_journalEntries.push_back( _id ); @@ -101,7 +100,7 @@ void projectJournal::journalEntryAdded( const jo_id_t _id ) -jo_id_t projectJournal::allocID( journallingObject * _obj ) +jo_id_t ProjectJournal::allocID( JournallingObject * _obj ) { const jo_id_t EO_ID_MAX = (1 << 23)-1; jo_id_t id; @@ -113,13 +112,13 @@ jo_id_t projectJournal::allocID( journallingObject * _obj ) m_joIDs[id] = _obj; //printf("new id: %d\n", id ); - return( id ); + return id; } -void projectJournal::reallocID( const jo_id_t _id, journallingObject * _obj ) +void ProjectJournal::reallocID( const jo_id_t _id, JournallingObject * _obj ) { //printf("realloc %d %d\n", _id, _obj ); // if( m_joIDs.contains( _id ) ) @@ -131,10 +130,10 @@ void projectJournal::reallocID( const jo_id_t _id, journallingObject * _obj ) -void projectJournal::forgetAboutID( const jo_id_t _id ) +void ProjectJournal::forgetAboutID( const jo_id_t _id ) { //printf("forget about %d\n", _id ); - journalEntryVector::iterator it; + JournalEntryVector::Iterator it; while( ( it = qFind( m_journalEntries.begin(), m_journalEntries.end(), _id ) ) != m_journalEntries.end() ) { @@ -150,11 +149,11 @@ void projectJournal::forgetAboutID( const jo_id_t _id ) -void projectJournal::clearJournal( void ) +void ProjectJournal::clearJournal() { m_journalEntries.clear(); m_currentJournalEntry = m_journalEntries.end(); - for( joIDMap::iterator it = m_joIDs.begin(); it != m_joIDs.end(); ) + for( JoIdMap::Iterator it = m_joIDs.begin(); it != m_joIDs.end(); ) { if( it.value() == NULL ) { diff --git a/src/core/remote_plugin.cpp b/src/core/RemotePlugin.cpp similarity index 89% rename from src/core/remote_plugin.cpp rename to src/core/RemotePlugin.cpp index 265d26380..8dd022e6f 100644 --- a/src/core/remote_plugin.cpp +++ b/src/core/RemotePlugin.cpp @@ -1,8 +1,8 @@ /* - * remote_plugin.cpp - base class providing RPC like mechanisms + * RemotePlugin.cpp - base class providing RPC like mechanisms * * Copyright (c) 2008-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -25,7 +25,7 @@ #define COMPILE_REMOTE_PLUGIN_BASE -#include "remote_plugin.h" +#include "RemotePlugin.h" #include "mixer.h" #include "engine.h" #include "config_mgr.h" @@ -42,9 +42,9 @@ #endif -// simple helper thread monitoring our remotePlugin - if process terminates +// simple helper thread monitoring our RemotePlugin - if process terminates // unexpectedly invalidate plugin so LMMS doesn't lock up -processWatcher::processWatcher( remotePlugin * _p ) : +ProcessWatcher::ProcessWatcher( RemotePlugin * _p ) : QThread(), m_plugin( _p ), m_quit( false ) @@ -52,7 +52,7 @@ processWatcher::processWatcher( remotePlugin * _p ) : } -void processWatcher::run( void ) +void ProcessWatcher::run() { while( !m_quit && m_plugin->isRunning() ) { @@ -70,9 +70,9 @@ void processWatcher::run( void ) -remotePlugin::remotePlugin( const QString & _plugin_executable, +RemotePlugin::RemotePlugin( const QString & _plugin_executable, bool _wait_for_init_done ) : - remotePluginBase( new shmFifo(), new shmFifo() ), + RemotePluginBase( new shmFifo(), new shmFifo() ), m_failed( true ), m_watcher( this ), m_commMutex( QMutex::Recursive ), @@ -115,7 +115,7 @@ remotePlugin::remotePlugin( const QString & _plugin_executable, -remotePlugin::~remotePlugin() +RemotePlugin::~RemotePlugin() { m_watcher.quit(); m_watcher.wait(); @@ -147,7 +147,7 @@ remotePlugin::~remotePlugin() -bool remotePlugin::process( const sampleFrame * _in_buf, +bool RemotePlugin::process( const sampleFrame * _in_buf, sampleFrame * _out_buf ) { const fpp_t frames = engine::getMixer()->framesPerPeriod(); @@ -270,7 +270,7 @@ bool remotePlugin::process( const sampleFrame * _in_buf, -void remotePlugin::processMidiEvent( const midiEvent & _e, +void RemotePlugin::processMidiEvent( const midiEvent & _e, const f_cnt_t _offset ) { message m( IdMidiEvent ); @@ -287,7 +287,7 @@ void remotePlugin::processMidiEvent( const midiEvent & _e, -void remotePlugin::resizeSharedProcessingMemory( void ) +void RemotePlugin::resizeSharedProcessingMemory() { const size_t s = ( m_inputCount+m_outputCount ) * engine::getMixer()->framesPerPeriod() * @@ -327,7 +327,7 @@ void remotePlugin::resizeSharedProcessingMemory( void ) -bool remotePlugin::processMessage( const message & _m ) +bool RemotePlugin::processMessage( const message & _m ) { lock(); message reply_message( _m.id ); @@ -343,14 +343,12 @@ bool remotePlugin::processMessage( const message & _m ) case IdSampleRateInformation: reply = true; - reply_message.addInt( - engine::getMixer()->processingSampleRate() ); + reply_message.addInt( engine::getMixer()->processingSampleRate() ); break; case IdBufferSizeInformation: reply = true; - reply_message.addInt( - engine::getMixer()->framesPerPeriod() ); + reply_message.addInt( engine::getMixer()->framesPerPeriod() ); break; case IdChangeInputCount: @@ -385,5 +383,5 @@ bool remotePlugin::processMessage( const message & _m ) -#include "moc_remote_plugin.cxx" +#include "moc_RemotePlugin.cxx" diff --git a/src/core/serializing_object.cpp b/src/core/SerializingObject.cpp similarity index 70% rename from src/core/serializing_object.cpp rename to src/core/SerializingObject.cpp index f7779e5af..2ed0e1c7a 100644 --- a/src/core/serializing_object.cpp +++ b/src/core/SerializingObject.cpp @@ -1,8 +1,8 @@ /* - * serializing_object.cpp - implementation of serializingObject + * SerializingObject.cpp - implementation of SerializingObject + * + * Copyright (c) 2008-2009 Tobias Doerffel * - * Copyright (c) 2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,14 +22,13 @@ * */ - #include -#include "serializing_object.h" +#include "SerializingObject.h" -serializingObject::serializingObject( void ) : +SerializingObject::SerializingObject() : m_hook( NULL ) { } @@ -37,7 +36,7 @@ serializingObject::serializingObject( void ) : -serializingObject::~serializingObject() +SerializingObject::~SerializingObject() { if( m_hook ) { @@ -48,7 +47,7 @@ serializingObject::~serializingObject() -QDomElement serializingObject::saveState( QDomDocument & _doc, +QDomElement SerializingObject::saveState( QDomDocument & _doc, QDomElement & _parent ) { QDomElement _this = _doc.createElement( nodeName() ); @@ -58,13 +57,13 @@ QDomElement serializingObject::saveState( QDomDocument & _doc, { getHook()->saveSettings( _doc, _this ); } - return( _this ); + return _this; } -void serializingObject::restoreState( const QDomElement & _this ) +void SerializingObject::restoreState( const QDomElement & _this ) { loadSettings( _this ); if( getHook() ) @@ -76,7 +75,7 @@ void serializingObject::restoreState( const QDomElement & _this ) -void serializingObject::setHook( serializingObjectHook * _hook ) +void SerializingObject::setHook( SerializingObjectHook * _hook ) { if( m_hook ) { @@ -92,7 +91,7 @@ void serializingObject::setHook( serializingObjectHook * _hook ) -void serializingObject::saveSettings( QDomDocument &/* _doc*/, +void SerializingObject::saveSettings( QDomDocument &/* _doc*/, QDomElement &/* _this*/ ) { } @@ -100,7 +99,7 @@ void serializingObject::saveSettings( QDomDocument &/* _doc*/, -void serializingObject::loadSettings( const QDomElement & /* _this*/ ) +void SerializingObject::loadSettings( const QDomElement & /* _this*/ ) { } diff --git a/src/core/TempoSyncKnobModel.cpp b/src/core/TempoSyncKnobModel.cpp new file mode 100644 index 000000000..d317f99fa --- /dev/null +++ b/src/core/TempoSyncKnobModel.cpp @@ -0,0 +1,186 @@ +/* + * TempoSyncKnobModel.cpp - adds bpm to ms conversion for knob class + * + * Copyright (c) 2005-2007 Danny McRae + * Copyright (c) 2005-2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + */ + +#include +#include + +#include "TempoSyncKnobModel.h" +#include "engine.h" +#include "song.h" + + +TempoSyncKnobModel::TempoSyncKnobModel( const float _val, const float _min, + const float _max, const float _step, + const float _scale, Model * _parent, + const QString & _display_name ) : + FloatModel( _val, _min, _max, _step, _parent, _display_name ), + m_tempoSyncMode( SyncNone ), + m_tempoLastSyncMode( SyncNone ), + m_scale( _scale ), + m_custom( _parent ) +{ + connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), + this, SLOT( calculateTempoSyncTime( bpm_t ) ) ); +} + + + + +TempoSyncKnobModel::~TempoSyncKnobModel() +{ +} + + + + +void TempoSyncKnobModel::setTempoSync( QAction * _item ) +{ + setTempoSync( _item->data().toInt() ); +} + + + + +void TempoSyncKnobModel::setTempoSync( int _note_type ) +{ + setSyncMode( ( TempoSyncMode ) _note_type ); + engine::getSong()->setModified(); +} + + + + +void TempoSyncKnobModel::calculateTempoSyncTime( bpm_t _bpm ) +{ + float conversionFactor = 1.0; + + if( m_tempoSyncMode ) + { + switch( m_tempoSyncMode ) + { + case SyncCustom: + conversionFactor = + static_cast( m_custom.getDenominator() ) / + static_cast( m_custom.getNumerator() ); + break; + case SyncDoubleWholeNote: + conversionFactor = 0.125; + break; + case SyncWholeNote: + conversionFactor = 0.25; + break; + case SyncHalfNote: + conversionFactor = 0.5; + break; + case SyncQuarterNote: + conversionFactor = 1.0; + break; + case SyncEighthNote: + conversionFactor = 2.0; + break; + case SyncSixteenthNote: + conversionFactor = 4.0; + break; + case SyncThirtysecondNote: + conversionFactor = 8.0; + break; + default: ; + } + bool journalling = testAndSetJournalling( FALSE ); + float oneUnit = 60000.0 / ( _bpm * conversionFactor * m_scale ); + setValue( oneUnit * maxValue() ); + setJournalling( journalling ); + } + + if( m_tempoSyncMode != m_tempoLastSyncMode ) + { + emit syncModeChanged( m_tempoSyncMode ); + m_tempoLastSyncMode = m_tempoSyncMode; + } +} + + + + +void TempoSyncKnobModel::saveSettings( QDomDocument & _doc, QDomElement & _this, + const QString & _name ) +{ + _this.setAttribute( "syncmode", (int) syncMode() ); + m_custom.saveSettings( _doc, _this, _name ); + FloatModel::saveSettings( _doc, _this, _name ); +} + + + + +void TempoSyncKnobModel::loadSettings( const QDomElement & _this, + const QString & _name ) +{ + setSyncMode( ( TempoSyncMode ) _this.attribute( "syncmode" ).toInt() ); + m_custom.loadSettings( _this, _name ); + FloatModel::loadSettings( _this, _name ); +} + + + + +void TempoSyncKnobModel::setSyncMode( TempoSyncMode _new_mode ) +{ + if( m_tempoSyncMode != _new_mode ) + { + m_tempoSyncMode = _new_mode; + if( _new_mode == SyncCustom ) + { + connect( &m_custom, SIGNAL( dataChanged() ), + this, SLOT( updateCustom() ) ); + } + } + calculateTempoSyncTime( engine::getSong()->getTempo() ); +} + + + + +void TempoSyncKnobModel::setScale( float _new_scale ) +{ + m_scale = _new_scale; + calculateTempoSyncTime( engine::getSong()->getTempo() ); + emit scaleChanged( _new_scale ); +} + + + + +void TempoSyncKnobModel::updateCustom() +{ + setSyncMode( SyncCustom ); +} + + + + +#include "moc_TempoSyncKnobModel.cxx" + + diff --git a/src/core/tool.cpp b/src/core/ToolPlugin.cpp similarity index 56% rename from src/core/tool.cpp rename to src/core/ToolPlugin.cpp index c7cf082bd..e2d520b49 100644 --- a/src/core/tool.cpp +++ b/src/core/ToolPlugin.cpp @@ -1,8 +1,9 @@ /* - * tool.cpp - base class for all tool plugins (graphs, extensions, etc) + * ToolPlugin.cpp - base class for all tool plugins (graphs, extensions, etc) * * Copyright (c) 2006-2008 Javier Serrano Polo - * + * Copyright (c) 2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,61 +23,36 @@ * */ - -#include "tool.h" - -#include -#include - -#include "embed.h" -#include "engine.h" -#include "main_window.h" +#include "ToolPlugin.h" - - -tool::tool( const descriptor * _descriptor, model * _parent ) : - plugin( _descriptor, _parent ) +ToolPlugin::ToolPlugin( const Descriptor * _descriptor, Model * _parent ) : + Plugin( _descriptor, _parent ) { } -tool::~tool() +ToolPlugin::~ToolPlugin() { } -tool * tool::instantiate( const QString & _plugin_name, model * _parent ) +ToolPlugin * ToolPlugin::instantiate( const QString & _plugin_name, Model * _parent ) { - plugin * p = plugin::instantiate( _plugin_name, _parent, NULL ); + Plugin * p = Plugin::instantiate( _plugin_name, _parent, NULL ); // check whether instantiated plugin is a tool - if( p->type() == Tool ) + if( p->type() == Plugin::Tool ) { // everything ok, so return pointer - return( dynamic_cast( p ) ); + return dynamic_cast( p ); } // not quite... so delete plugin delete p; - return( NULL ); + return NULL; } - - - - -toolView::toolView( tool * _tool ) : - pluginView( _tool, NULL ) -{ - engine::getMainWindow()->workspace()->addSubWindow( this ); - parentWidget()->setAttribute( Qt::WA_DeleteOnClose, FALSE ); - - setWindowTitle( _tool->displayName() ); - setWindowIcon( _tool->getDescriptor()->logo->pixmap() ); -} - - diff --git a/src/core/audio/AudioJack.cpp b/src/core/audio/AudioJack.cpp index 5bd9fb4a9..0dfe58f09 100644 --- a/src/core/audio/AudioJack.cpp +++ b/src/core/audio/AudioJack.cpp @@ -39,7 +39,7 @@ #include "config_mgr.h" #include "lcd_spinbox.h" #include "AudioPort.h" -#include "main_window.h" +#include "MainWindow.h" @@ -100,7 +100,7 @@ void AudioJack::restartAfterZombified() { m_active = false; startProcessing(); - QMessageBox::information( engine::getMainWindow(), + QMessageBox::information( engine::mainWindow(), tr( "JACK client restarted" ), tr( "LMMS was kicked by JACK for some reason. " "Therefore the JACK backend of LMMS has been " @@ -109,7 +109,7 @@ void AudioJack::restartAfterZombified() } else { - QMessageBox::information( engine::getMainWindow(), + QMessageBox::information( engine::mainWindow(), tr( "JACK server down" ), tr( "The JACK server seems to have been shutdown " "and starting a new instance failed. " diff --git a/src/core/audio/AudioPort.cpp b/src/core/audio/AudioPort.cpp index dd4782484..2bc27050d 100644 --- a/src/core/audio/AudioPort.cpp +++ b/src/core/audio/AudioPort.cpp @@ -24,7 +24,7 @@ #include "AudioPort.h" #include "AudioDevice.h" -#include "effect_chain.h" +#include "EffectChain.h" #include "engine.h" @@ -36,7 +36,7 @@ AudioPort::AudioPort( const QString & _name, bool _has_effect_chain ) : m_extOutputEnabled( false ), m_nextFxChannel( 0 ), m_name( "unnamed port" ), - m_effects( _has_effect_chain ? new effectChain( NULL ) : NULL ) + m_effects( _has_effect_chain ? new EffectChain( NULL ) : NULL ) { engine::getMixer()->clearAudioBuffer( m_firstBuffer, engine::getMixer()->framesPerPeriod() ); diff --git a/src/core/automation_pattern.cpp b/src/core/automation_pattern.cpp index 604070914..03cbe0cc1 100644 --- a/src/core/automation_pattern.cpp +++ b/src/core/automation_pattern.cpp @@ -33,7 +33,7 @@ #include "automation_pattern_view.h" #include "automation_editor.h" #include "automation_track.h" -#include "project_journal.h" +#include "ProjectJournal.h" #include "bb_track_container.h" #include "song.h" @@ -80,7 +80,7 @@ automationPattern::~automationPattern() -void automationPattern::addObject( automatableModel * _obj, bool _search_dup ) +void automationPattern::addObject( AutomatableModel * _obj, bool _search_dup ) { bool addIt = true; @@ -117,15 +117,15 @@ void automationPattern::addObject( automatableModel * _obj, bool _search_dup ) -const automatableModel * automationPattern::firstObject( void ) const +const AutomatableModel * automationPattern::firstObject( void ) const { - automatableModel * m; + AutomatableModel * m; if( !m_objects.isEmpty() && ( m = m_objects.first() ) != NULL ) { return m; } - static floatModel _fm( 0, 0, 1, 0.001 ); + static FloatModel _fm( 0, 0, 1, 0.001 ); return &_fm; } @@ -395,7 +395,7 @@ trackContentObjectView * automationPattern::createView( trackView * _tv ) -bool automationPattern::isAutomated( const automatableModel * _m ) +bool automationPattern::isAutomated( const AutomatableModel * _m ) { trackContainer::trackList l = engine::getSong()->tracks() + engine::getBBTrackContainer()->tracks(); @@ -435,7 +435,7 @@ bool automationPattern::isAutomated( const automatableModel * _m ) automationPattern * automationPattern::globalAutomationPattern( - automatableModel * _m ) + AutomatableModel * _m ) { automationTrack * t = engine::getSong()->globalAutomationTrack(); track::tcoVector v = t->getTCOs(); @@ -483,14 +483,14 @@ void automationPattern::resolveAllIDs( void ) dynamic_cast( *j ); if( a ) { - for( QVector::iterator k = a->m_idsToResolve.begin(); + for( QVector::Iterator k = a->m_idsToResolve.begin(); k != a->m_idsToResolve.end(); ++k ) { - journallingObject * o = engine::getProjectJournal()-> - getJournallingObject( *k ); - if( o && dynamic_cast( o ) ) + JournallingObject * o = engine::projectJournal()-> + journallingObject( *k ); + if( o && dynamic_cast( o ) ) { - a->addObject( dynamic_cast( o ), false ); + a->addObject( dynamic_cast( o ), false ); } } a->m_idsToResolve.clear(); diff --git a/src/core/config_mgr.cpp b/src/core/config_mgr.cpp index 2e11d72b3..e899bd390 100644 --- a/src/core/config_mgr.cpp +++ b/src/core/config_mgr.cpp @@ -33,7 +33,7 @@ #include "config_mgr.h" -#include "main_window.h" +#include "MainWindow.h" static inline QString ensureTrailingSlash( const QString & _s ) @@ -331,8 +331,8 @@ void configManager::loadConfigFile( void ) if( !QDir( m_workingDir ).exists() ) { if( QMessageBox::question( 0, - mainWindow::tr( "Working directory" ), - mainWindow::tr( "The LMMS working directory %1 does not " + MainWindow::tr( "Working directory" ), + MainWindow::tr( "The LMMS working directory %1 does not " "exist. Create it now? You can change the directory " "later via Edit -> Settings." ).arg( m_workingDir ), QMessageBox::Yes, QMessageBox::No ) == @@ -402,8 +402,8 @@ void configManager::saveConfigFile( void ) if( !outfile.open( QIODevice::WriteOnly | QIODevice::Truncate ) ) { QMessageBox::critical( NULL, - mainWindow::tr( "Could not save config-file" ), - mainWindow::tr( "Could not save configuration file %1. " + MainWindow::tr( "Could not save config-file" ), + MainWindow::tr( "Could not save configuration file %1. " "You're probably not permitted to " "write to this file.\n" "Please make sure you have write-" diff --git a/src/core/engine.cpp b/src/core/engine.cpp index 299acc459..4daccc894 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -31,18 +31,18 @@ #include "bb_track_container.h" #include "config_mgr.h" #include "ControllerRackView.h" -#include "fx_mixer.h" -#include "fx_mixer_view.h" -#include "instrument_track.h" +#include "FxMixer.h" +#include "FxMixerView.h" +#include "InstrumentTrack.h" #include "ladspa_2_lmms.h" -#include "main_window.h" +#include "MainWindow.h" #include "mixer.h" #include "pattern.h" #include "piano_roll.h" #include "preset_preview_play_handle.h" -#include "project_journal.h" +#include "ProjectJournal.h" #include "project_notes.h" -#include "plugin.h" +#include "Plugin.h" #include "song_editor.h" #include "song.h" @@ -51,9 +51,9 @@ bool engine::s_hasGUI = true; bool engine::s_suppressMessages = false; float engine::s_framesPerTick; mixer * engine::s_mixer = NULL; -fxMixer * engine::s_fxMixer = NULL; -fxMixerView * engine::s_fxMixerView = NULL; -mainWindow * engine::s_mainWindow = NULL; +FxMixer * engine::s_fxMixer = NULL; +FxMixerView * engine::s_fxMixerView = NULL; +MainWindow * engine::s_mainWindow = NULL; bbTrackContainer * engine::s_bbTrackContainer = NULL; song * engine::s_song = NULL; songEditor * engine::s_songEditor = NULL; @@ -61,9 +61,9 @@ automationEditor * engine::s_automationEditor = NULL; bbEditor * engine::s_bbEditor = NULL; pianoRoll * engine::s_pianoRoll = NULL; projectNotes * engine::s_projectNotes = NULL; -projectJournal * engine::s_projectJournal = NULL; +ProjectJournal * engine::s_projectJournal = NULL; ladspa2LMMS * engine::s_ladspaManager = NULL; -dummyTrackContainer * engine::s_dummyTC = NULL; +DummyTrackContainer * engine::s_dummyTC = NULL; ControllerRackView * engine::s_controllerRackView = NULL; QMap engine::s_pluginFileHandling; @@ -76,10 +76,10 @@ void engine::init( const bool _has_gui ) initPluginFileHandling(); - s_projectJournal = new projectJournal; + s_projectJournal = new ProjectJournal; s_mixer = new mixer; s_song = new song; - s_fxMixer = new fxMixer; + s_fxMixer = new FxMixer; s_bbTrackContainer = new bbTrackContainer; s_ladspaManager = new ladspa2LMMS; @@ -90,9 +90,9 @@ void engine::init( const bool _has_gui ) if( s_hasGUI ) { - s_mainWindow = new mainWindow; + s_mainWindow = new MainWindow; s_songEditor = new songEditor( s_song, s_songEditor ); - s_fxMixerView = new fxMixerView; + s_fxMixerView = new FxMixerView; s_controllerRackView = new ControllerRackView; s_projectNotes = new projectNotes; s_bbEditor = new bbEditor( s_bbTrackContainer ); @@ -103,7 +103,7 @@ void engine::init( const bool _has_gui ) } presetPreviewPlayHandle::init(); - s_dummyTC = new dummyTrackContainer; + s_dummyTC = new DummyTrackContainer; s_mixer->startProcessing(); } @@ -111,7 +111,7 @@ void engine::init( const bool _has_gui ) -void engine::destroy( void ) +void engine::destroy() { s_mixer->stopProcessing(); @@ -130,7 +130,7 @@ void engine::destroy( void ) s_fxMixerView = NULL; presetPreviewPlayHandle::cleanup(); - instrumentTrackView::cleanupWindowPool(); + InstrumentTrackView::cleanupWindowPool(); s_song->clearProject(); delete s_bbTrackContainer; @@ -159,7 +159,7 @@ void engine::destroy( void ) -void engine::updateFramesPerTick( void ) +void engine::updateFramesPerTick() { s_framesPerTick = s_mixer->processingSampleRate() * 60.0f * 4 / DefaultTicksPerTact / s_song->getTempo(); @@ -168,15 +168,14 @@ void engine::updateFramesPerTick( void ) -void engine::initPluginFileHandling( void ) +void engine::initPluginFileHandling() { - QVector pluginDescriptors; - plugin::getDescriptorsOfAvailPlugins( pluginDescriptors ); - for( QVector::iterator it = - pluginDescriptors.begin(); - it != pluginDescriptors.end(); ++it ) + QVector pluginDescriptors; + Plugin::getDescriptorsOfAvailPlugins( pluginDescriptors ); + for( QVector::Iterator it = pluginDescriptors.begin(); + it != pluginDescriptors.end(); ++it ) { - if( it->type == plugin::Instrument ) + if( it->type == Plugin::Instrument ) { const QStringList & ext = QString( it->supportedFileTypes ). diff --git a/src/core/instrument.cpp b/src/core/instrument.cpp deleted file mode 100644 index e27e79759..000000000 --- a/src/core/instrument.cpp +++ /dev/null @@ -1,180 +0,0 @@ -#ifndef SINGLE_SOURCE_COMPILE - -/* - * instrument.cpp - base-class for all instrument-plugins (synths, samplers etc) - * - * Copyright (c) 2005-2008 Tobias Doerffel - * - * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net - * - * 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. - * - */ - - -#include "instrument.h" -#include "instrument_view.h" -#include "instrument_track.h" -#include "dummy_instrument.h" -#include "note_play_handle.h" -#include "embed.h" - - -instrument::instrument( instrumentTrack * _instrument_track, - const descriptor * _descriptor ) : - plugin( _descriptor, NULL/* _instrument_track*/ ), - m_instrumentTrack( _instrument_track ) -{ -} - - - - -instrument::~instrument() -{ -} - - - - -void instrument::play( sampleFrame * ) -{ -} - - - - -void instrument::deleteNotePluginData( notePlayHandle * ) -{ -} - - - - -f_cnt_t instrument::beatLen( notePlayHandle * ) const -{ - return( 0 ); -} - - - - -instrument * instrument::instantiate( const QString & _plugin_name, - instrumentTrack * _instrument_track ) -{ - plugin * p = plugin::instantiate( _plugin_name, _instrument_track, - _instrument_track ); - // check whether instantiated plugin is an instrument - if( dynamic_cast( p ) != NULL ) - { - // everything ok, so return pointer - return( dynamic_cast( p ) ); - } - - // not quite... so delete plugin and return dummy instrument - delete p; - return( new dummyInstrument( _instrument_track ) ); -} - - - - -bool instrument::isFromTrack( const track * _track ) const -{ - return( m_instrumentTrack == _track ); -} - - - -void instrument::applyRelease( sampleFrame * buf, const notePlayHandle * _n ) -{ - const fpp_t frames = _n->framesLeftForCurrentPeriod(); - const fpp_t fpp = engine::getMixer()->framesPerPeriod(); - const f_cnt_t fl = _n->framesLeft(); - if( fl <= desiredReleaseFrames()+fpp ) - { - for( fpp_t f = (fpp_t)( ( fl > desiredReleaseFrames() ) ? - ( qMax( fpp - desiredReleaseFrames(), 0 ) + - fl % fpp ) : 0 ); f < frames; ++f ) - { - const float fac = (float)( fl-f-1 ) / - desiredReleaseFrames(); - for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch ) - { - buf[f][ch] *= fac; - } - } - } -} - - - - -QString instrument::fullDisplayName() const -{ - return getInstrumentTrack()->displayName(); -} - - - - - - - -instrumentView::instrumentView( instrument * _instrument, QWidget * _parent ) : - pluginView( _instrument, _parent ) -{ - setModel( _instrument ); - setFixedSize( 250, 250 ); - setAttribute( Qt::WA_DeleteOnClose, TRUE ); -} - - - - -instrumentView::~instrumentView() -{ - if( getInstrumentTrackWindow() ) - { - getInstrumentTrackWindow()->m_instrumentView = NULL; - } -} - - - - -void instrumentView::setModel( ::model * _model, bool ) -{ - if( dynamic_cast( _model ) != NULL ) - { - modelView::setModel( _model ); - getInstrumentTrackWindow()->setWindowIcon( - model()->getDescriptor()->logo->pixmap() ); - connect( model(), SIGNAL( destroyed( QObject * ) ), - this, SLOT( close() ) ); - } -} - - - - -instrumentTrackWindow * instrumentView::getInstrumentTrackWindow( void ) -{ - return( dynamic_cast( - parentWidget()->parentWidget() ) ); -} - -#endif diff --git a/src/core/main.cpp b/src/core/main.cpp index b8f60ab48..337f5fd44 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -55,9 +55,9 @@ #include "config_mgr.h" #include "embed.h" #include "engine.h" -#include "import_filter.h" #include "lmms_style.h" -#include "main_window.h" +#include "ImportFilter.h" +#include "MainWindow.h" #include "ProjectRenderer.h" #include "song.h" @@ -417,26 +417,25 @@ int main( int argc, char * * argv ) // we try to load given file if( !file_to_load.isEmpty() ) { - engine::getMainWindow()->show(); + engine::mainWindow()->show(); if( fullscreen ) { - engine::getMainWindow()->showMaximized(); + engine::mainWindow()->showMaximized(); } engine::getSong()->loadProject( file_to_load ); } else if( !file_to_import.isEmpty() ) { - importFilter::import( file_to_import, - engine::getSong() ); + ImportFilter::import( file_to_import, engine::getSong() ); if( exit_after_import ) { return 0; } - engine::getMainWindow()->show(); + engine::mainWindow()->show(); if( fullscreen ) { - engine::getMainWindow()->showMaximized(); + engine::mainWindow()->showMaximized(); } } else @@ -445,10 +444,10 @@ int main( int argc, char * * argv ) // [Settel] workaround: showMaximized() doesn't work with // FVWM2 unless the window is already visible -> show() first - engine::getMainWindow()->show(); + engine::mainWindow()->show(); if( fullscreen ) { - engine::getMainWindow()->showMaximized(); + engine::mainWindow()->showMaximized(); } } } diff --git a/src/core/midi/MidiController.cpp b/src/core/midi/MidiController.cpp index 2b3b707a7..eead69b83 100644 --- a/src/core/midi/MidiController.cpp +++ b/src/core/midi/MidiController.cpp @@ -34,7 +34,7 @@ #include "MidiController.h" -MidiController::MidiController( model * _parent ) : +MidiController::MidiController( Model * _parent ) : Controller( Controller::MidiController, _parent, tr( "MIDI Controller" ) ), MidiEventProcessor(), m_midiPort( tr( "unnamed_midi_controller" ), diff --git a/src/core/midi/MidiPort.cpp b/src/core/midi/MidiPort.cpp index dd0e6116b..4cbc78ef9 100644 --- a/src/core/midi/MidiPort.cpp +++ b/src/core/midi/MidiPort.cpp @@ -32,9 +32,9 @@ MidiPort::MidiPort( const QString & _name, MidiClient * _mc, - MidiEventProcessor * _mep, model * _parent, + MidiEventProcessor * _mep, Model * _parent, Modes _mode ) : - model( _parent ), + Model( _parent ), m_readablePortsMenu( NULL ), m_writablePortsMenu( NULL ), m_midiClient( _mc ), diff --git a/src/core/mixer.cpp b/src/core/mixer.cpp index 38f72120a..5a3931496 100644 --- a/src/core/mixer.cpp +++ b/src/core/mixer.cpp @@ -26,14 +26,13 @@ #include #include "mixer.h" -#include "fx_mixer.h" +#include "FxMixer.h" #include "play_handle.h" -#include "effect.h" #include "song.h" #include "templates.h" -#include "envelope_and_lfo_parameters.h" +#include "EnvelopeAndLfoParameters.h" #include "note_play_handle.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "debug.h" #include "engine.h" #include "config_mgr.h" @@ -224,14 +223,14 @@ void MixerWorkerThread::processJobQueue() const bool me = a->processEffects(); if( me || a->m_bufferUsage != AudioPort::NoUsage ) { - engine::getFxMixer()->mixToChannel( a->firstBuffer(), + engine::fxMixer()->mixToChannel( a->firstBuffer(), a->nextFxChannel() ); a->nextPeriod(); } } break; case EffectChannel: - engine::getFxMixer()->processChannel( (fx_ch_t) it->param ); + engine::fxMixer()->processChannel( (fx_ch_t) it->param ); break; default: break; @@ -607,7 +606,7 @@ const surroundSampleFrame * mixer::renderNextBuffer() clearAudioBuffer( m_writeBuf, m_framesPerPeriod ); // prepare master mix (clear internal buffers etc.) - engine::getFxMixer()->prepareMasterMix(); + engine::fxMixer()->prepareMasterMix(); // create play-handles for new notes, samples etc. engine::getSong()->processNextBuffer(); @@ -657,7 +656,7 @@ const surroundSampleFrame * mixer::renderNextBuffer() // STAGE 4: do master mix in FX mixer - engine::getFxMixer()->masterMix( m_writeBuf ); + engine::fxMixer()->masterMix( m_writeBuf ); unlock(); @@ -665,7 +664,7 @@ const surroundSampleFrame * mixer::renderNextBuffer() emit nextAudioBuffer(); // and trigger LFOs - envelopeAndLFOParameters::triggerLFO(); + EnvelopeAndLfoParameters::triggerLfo(); Controller::triggerFrameCounter(); const float new_cpu_load = timer.elapsed() / 10000.0f * diff --git a/src/core/mmp.cpp b/src/core/mmp.cpp index 72e88545a..8f48beee2 100644 --- a/src/core/mmp.cpp +++ b/src/core/mmp.cpp @@ -36,7 +36,7 @@ #include "config_mgr.h" #include "project_version.h" #include "song_editor.h" -#include "effect.h" +#include "Effect.h" @@ -604,28 +604,25 @@ void multimediaProject::upgrade( void ) if( !k.isEmpty() ) { const QList l = - base64::decode( k, QVariant::List ). - toList(); + base64::decode( k, QVariant::List ).toList(); if( !l.isEmpty() ) { QString name = l[0].toString(); QVariant u = l[1]; - effectKey::attributeMap m; + EffectKey::AttributeMap m; // VST-effect? if( u.type() == QVariant::String ) { m["file"] = u.toString(); } // LADSPA-effect? - else if( u.type() == - QVariant::StringList ) + else if( u.type() == QVariant::StringList ) { - const QStringList sl = - u.toStringList(); + const QStringList sl = u.toStringList(); m["plugin"] = sl.value( 0 ); m["file"] = sl.value( 1 ); } - effectKey key( NULL, name, m ); + EffectKey key( NULL, name, m ); el.appendChild( key.saveXML( *this ) ); } } diff --git a/src/core/note.cpp b/src/core/note.cpp index 5bf1b8320..ee68c3362 100644 --- a/src/core/note.cpp +++ b/src/core/note.cpp @@ -67,7 +67,7 @@ note::note( const midiTime & _length, const midiTime & _pos, note::note( const note & _note ) : - serializingObject( _note ), + SerializingObject( _note ), m_selected( _note.m_selected ), m_oldKey( _note.m_oldKey ), m_oldPos( _note.m_oldPos ), diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index b3cfd4b0e..f2f437000 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -23,13 +23,12 @@ * */ - #include "note_play_handle.h" #include "basic_filters.h" #include "config_mgr.h" #include "detuning_helper.h" -#include "instrument_sound_shaping.h" -#include "instrument_track.h" +#include "InstrumentSoundShaping.h" +#include "InstrumentTrack.h" #include "MidiPort.h" #include "song.h" @@ -46,7 +45,7 @@ inline notePlayHandle::baseDetuning::baseDetuning( -notePlayHandle::notePlayHandle( instrumentTrack * _it, +notePlayHandle::notePlayHandle( InstrumentTrack * _it, const f_cnt_t _offset, const f_cnt_t _frames, const note & _n, @@ -100,7 +99,7 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it, setFrames( _frames ); - if( !isBaseNote() || !getInstrumentTrack()->arpeggiatorEnabled() ) + if( !isBaseNote() || !instrumentTrack()->isArpeggiatorEnabled() ) { // send MIDI-note-on-event m_instrumentTrack->processOutEvent( midiEvent( MidiNoteOn, @@ -325,7 +324,7 @@ void notePlayHandle::noteOff( const f_cnt_t _s ) m_releaseFramesToDo = qMax( 0, // 10, m_instrumentTrack->m_soundShaping.releaseFrames() ); - if( !isBaseNote() || !getInstrumentTrack()->arpeggiatorEnabled() ) + if( !isBaseNote() || !instrumentTrack()->isArpeggiatorEnabled() ) { // send MIDI-note-off-event m_instrumentTrack->processOutEvent( midiEvent( MidiNoteOff, @@ -374,7 +373,7 @@ float notePlayHandle::volumeLevel( const f_cnt_t _frame ) bool notePlayHandle::isArpeggioBaseNote() const { return isBaseNote() && ( m_partOfArpeggio || - m_instrumentTrack->arpeggiatorEnabled() ); + m_instrumentTrack->isArpeggiatorEnabled() ); } @@ -423,7 +422,7 @@ int notePlayHandle::index() const ConstNotePlayHandleList notePlayHandle::nphsOfInstrumentTrack( - const instrumentTrack * _it, bool _all_ph ) + const InstrumentTrack * _it, bool _all_ph ) { const PlayHandleList & playHandles = engine::getMixer()->playHandles(); ConstNotePlayHandleList cnphv; diff --git a/src/core/preset_preview_play_handle.cpp b/src/core/preset_preview_play_handle.cpp index b70affa50..fa9b2fd9f 100644 --- a/src/core/preset_preview_play_handle.cpp +++ b/src/core/preset_preview_play_handle.cpp @@ -29,12 +29,12 @@ #include "preset_preview_play_handle.h" #include "debug.h" #include "engine.h" -#include "instrument.h" -#include "instrument_track.h" +#include "Instrument.h" +#include "InstrumentTrack.h" #include "MidiPort.h" #include "mmp.h" #include "note_play_handle.h" -#include "project_journal.h" +#include "ProjectJournal.h" #include "track_container.h" @@ -49,7 +49,7 @@ public: m_dataMutex() { setJournalling( FALSE ); - m_previewInstrumentTrack = dynamic_cast( + m_previewInstrumentTrack = dynamic_cast( track::create( track::InstrumentTrack, this ) ); m_previewInstrumentTrack->setJournalling( FALSE ); @@ -64,7 +64,7 @@ public: return "bbtrackcontainer"; } - instrumentTrack * previewInstrumentTrack() + InstrumentTrack * previewInstrumentTrack() { return m_previewInstrumentTrack; } @@ -91,7 +91,7 @@ public: private: - instrumentTrack * m_previewInstrumentTrack; + InstrumentTrack * m_previewInstrumentTrack; notePlayHandle * m_previewNote; QMutex m_dataMutex; @@ -115,18 +115,17 @@ presetPreviewPlayHandle::presetPreviewPlayHandle( const QString & _preset_file, } - const bool j = engine::getProjectJournal()->isJournalling(); - engine::getProjectJournal()->setJournalling( FALSE ); + const bool j = engine::projectJournal()->isJournalling(); + engine::projectJournal()->setJournalling( FALSE ); engine::setSuppressMessages( true ); if( _load_by_plugin ) { - instrument * i = s_previewTC->previewInstrumentTrack()-> - getInstrument(); + Instrument * i = s_previewTC->previewInstrumentTrack()->instrument(); const QString ext = QFileInfo( _preset_file ). suffix().toLower(); - if( i == NULL || !i->getDescriptor()->supportsFileType( ext ) ) + if( i == NULL || !i->descriptor()->supportsFileType( ext ) ) { i = s_previewTC->previewInstrumentTrack()-> loadInstrument( @@ -162,7 +161,7 @@ presetPreviewPlayHandle::presetPreviewPlayHandle( const QString & _preset_file, s_previewTC->setPreviewNote( m_previewNote ); s_previewTC->unlockData(); - engine::getProjectJournal()->setJournalling( j ); + engine::projectJournal()->setJournalling( j ); } @@ -229,12 +228,12 @@ void presetPreviewPlayHandle::cleanup() ConstNotePlayHandleList presetPreviewPlayHandle::nphsOfInstrumentTrack( - const instrumentTrack * _it ) + const InstrumentTrack * _it ) { ConstNotePlayHandleList cnphv; s_previewTC->lockData(); if( s_previewTC->previewNote() != NULL && - s_previewTC->previewNote()->getInstrumentTrack() == _it ) + s_previewTC->previewNote()->instrumentTrack() == _it ) { cnphv.push_back( s_previewTC->previewNote() ); } diff --git a/src/core/sample_play_handle.cpp b/src/core/sample_play_handle.cpp index 1f80e7bd8..2e088c4e2 100644 --- a/src/core/sample_play_handle.cpp +++ b/src/core/sample_play_handle.cpp @@ -22,12 +22,11 @@ * */ - #include "sample_play_handle.h" #include "AudioPort.h" #include "bb_track.h" #include "engine.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "pattern.h" #include "sample_buffer.h" #include "sample_track.h" @@ -87,14 +86,14 @@ samplePlayHandle::samplePlayHandle( sampleTCO * _tco ) : samplePlayHandle::samplePlayHandle( pattern * _pattern ) : playHandle( SamplePlayHandle ), - m_sampleBuffer( sharedObject::ref( _pattern->getFrozenPattern() ) ), + m_sampleBuffer( sharedObject::ref( _pattern->frozenPattern() ) ), m_doneMayReturnTrue( true ), m_frame( 0 ), - m_audioPort( _pattern->getInstrumentTrack()->audioPort() ), + m_audioPort( _pattern->instrumentTrack()->audioPort() ), m_ownAudioPort( false ), m_defaultVolumeModel( DefaultVolume, MinVolume, MaxVolume, 1 ), m_volumeModel( &m_defaultVolumeModel ), - m_track( _pattern->getInstrumentTrack() ), + m_track( _pattern->instrumentTrack() ), m_bbTrack( NULL ) { } diff --git a/src/core/sample_record_handle.cpp b/src/core/sample_record_handle.cpp index 35469b5d2..22e573488 100644 --- a/src/core/sample_record_handle.cpp +++ b/src/core/sample_record_handle.cpp @@ -26,7 +26,7 @@ #include "sample_record_handle.h" #include "bb_track.h" #include "engine.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "pattern.h" #include "sample_buffer.h" #include "sample_track.h" diff --git a/src/core/song.cpp b/src/core/song.cpp index 8b4f7fef5..cf6900589 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -22,7 +22,7 @@ * */ - +#include #include #include #include @@ -40,19 +40,19 @@ #include "ControllerRackView.h" #include "ControllerConnection.h" #include "embed.h" -#include "envelope_and_lfo_parameters.h" +#include "EnvelopeAndLfoParameters.h" #include "export_project_dialog.h" -#include "fx_mixer.h" -#include "fx_mixer_view.h" -#include "import_filter.h" -#include "instrument_track.h" -#include "main_window.h" +#include "FxMixer.h" +#include "FxMixerView.h" +#include "ImportFilter.h" +#include "InstrumentTrack.h" +#include "MainWindow.h" #include "MidiClient.h" #include "mmp.h" #include "note_play_handle.h" #include "pattern.h" #include "piano_roll.h" -#include "project_journal.h" +#include "ProjectJournal.h" #include "project_notes.h" #include "ProjectRenderer.h" #include "rename_dialog.h" @@ -300,7 +300,7 @@ void song::processNextBuffer() // at song-start we have to reset the LFOs if( m_playPos[Mode_PlaySong] == 0 ) { - envelopeAndLFOParameters::resetLFO(); + EnvelopeAndLfoParameters::resetLfo(); } break; @@ -718,7 +718,7 @@ automationPattern * song::tempoAutomationPattern() void song::clearProject() { - engine::getProjectJournal()->setJournalling( false ); + engine::projectJournal()->setJournalling( false ); if( m_playing ) { @@ -734,15 +734,15 @@ void song::clearProject() { engine::getSongEditor()->clearAllTracks(); } - if( engine::getFxMixerView() ) + if( engine::fxMixerView() ) { - engine::getFxMixerView()->clear(); + engine::fxMixerView()->clear(); } QCoreApplication::sendPostedEvents(); engine::getBBTrackContainer()->clearAllTracks(); clearAllTracks(); - engine::getFxMixer()->clear(); + engine::fxMixer()->clear(); if( engine::getAutomationEditor() ) { @@ -769,9 +769,9 @@ void song::clearProject() emit dataChanged(); - engine::getProjectJournal()->clearJournal(); + engine::projectJournal()->clearJournal(); - engine::getProjectJournal()->setJournalling( true ); + engine::projectJournal()->setJournalling( true ); } @@ -801,17 +801,17 @@ void song::createNewProject() clearProject(); - engine::getProjectJournal()->setJournalling( false ); + engine::projectJournal()->setJournalling( false ); m_fileName = m_oldFileName = ""; track * t; t = track::create( track::InstrumentTrack, this ); - dynamic_cast( t )->loadInstrument( + dynamic_cast( t )->loadInstrument( "tripleoscillator" ); t = track::create( track::InstrumentTrack, engine::getBBTrackContainer() ); - dynamic_cast( t )->loadInstrument( + dynamic_cast( t )->loadInstrument( "tripleoscillator" ); track::create( track::SampleTrack, this ); track::create( track::BBTrack, this ); @@ -828,15 +828,15 @@ void song::createNewProject() engine::getBBTrackContainer()->updateAfterTrackAdd(); - engine::getProjectJournal()->setJournalling( true ); + engine::projectJournal()->setJournalling( true ); QCoreApplication::sendPostedEvents(); m_modified = false; - if( engine::getMainWindow() ) + if( engine::mainWindow() ) { - engine::getMainWindow()->resetWindowTitle(); + engine::mainWindow()->resetWindowTitle(); } } @@ -850,9 +850,9 @@ void song::createNewProjectFromTemplate( const QString & _template ) // saving... m_fileName = m_oldFileName = ""; // update window title - if( engine::getMainWindow() ) + if( engine::mainWindow() ) { - engine::getMainWindow()->resetWindowTitle(); + engine::mainWindow()->resetWindowTitle(); } } @@ -867,7 +867,7 @@ void song::loadProject( const QString & _file_name ) clearProject(); - engine::getProjectJournal()->setJournalling( false ); + engine::projectJournal()->setJournalling( false ); m_fileName = _file_name; m_oldFileName = _file_name; @@ -907,18 +907,16 @@ void song::loadProject( const QString & _file_name ) { if( node.nodeName() == "trackcontainer" ) { - ( (journallingObject *)( this ) )-> + ( (JournallingObject *)( this ) )-> restoreState( node.toElement() ); } else if( node.nodeName() == "controllers" ) { restoreControllerStates( node.toElement() ); } - else if( node.nodeName() == - engine::getFxMixer()->nodeName() ) + else if( node.nodeName() == engine::fxMixer()->nodeName() ) { - engine::getFxMixer()->restoreState( - node.toElement() ); + engine::fxMixer()->restoreState( node.toElement() ); } else if( engine::hasGUI() ) { @@ -946,7 +944,7 @@ void song::loadProject( const QString & _file_name ) nodeName() ) { engine::getProjectNotes()-> - serializingObject::restoreState( node.toElement() ); + SerializingObject::restoreState( node.toElement() ); } else if( node.nodeName() == m_playPos[Mode_PlaySong]. @@ -977,14 +975,14 @@ void song::loadProject( const QString & _file_name ) configManager::inst()->addRecentlyOpenedProject( _file_name ); - engine::getProjectJournal()->setJournalling( true ); + engine::projectJournal()->setJournalling( true ); m_loadingProject = false; m_modified = false; - if( engine::getMainWindow() ) + if( engine::mainWindow() ) { - engine::getMainWindow()->resetWindowTitle(); + engine::mainWindow()->resetWindowTitle(); } if( engine::getSongEditor() ) { @@ -1009,14 +1007,14 @@ bool song::saveProject() saveState( mmp, mmp.content() ); m_globalAutomationTrack->saveState( mmp, mmp.content() ); - engine::getFxMixer()->saveState( mmp, mmp.content() ); + engine::fxMixer()->saveState( mmp, mmp.content() ); if( engine::hasGUI() ) { engine::getControllerRackView()->saveState( mmp, mmp.content() ); engine::getPianoRoll()->saveState( mmp, mmp.content() ); engine::getAutomationEditor()->saveState( mmp, mmp.content() ); engine::getProjectNotes()-> - serializingObject::saveState( mmp, mmp.content() ); + SerializingObject::saveState( mmp, mmp.content() ); m_playPos[Mode_PlaySong].m_timeLine->saveState( mmp, mmp.content() ); } @@ -1033,7 +1031,7 @@ bool song::saveProject() 2000 ); configManager::inst()->addRecentlyOpenedProject( m_fileName ); m_modified = false; - engine::getMainWindow()->resetWindowTitle(); + engine::mainWindow()->resetWindowTitle(); } else if( engine::hasGUI() ) { @@ -1077,7 +1075,7 @@ void song::importProject() ofd.setFileMode( QFileDialog::ExistingFiles ); if( ofd.exec () == QDialog::Accepted && !ofd.selectedFiles().isEmpty() ) { - importFilter::import( ofd.selectedFiles()[0], this ); + ImportFilter::import( ofd.selectedFiles()[0], this ); } } @@ -1116,7 +1114,7 @@ void song::exportProject() { if( isEmpty() ) { - QMessageBox::information( engine::getMainWindow(), + QMessageBox::information( engine::mainWindow(), tr( "Empty project" ), tr( "This project is empty so exporting makes " "no sense. Please put some items into " @@ -1124,7 +1122,7 @@ void song::exportProject() return; } - QFileDialog efd( engine::getMainWindow() ); + QFileDialog efd( engine::mainWindow() ); efd.setFileMode( QFileDialog::AnyFile ); efd.setAcceptMode( QFileDialog::AcceptSave ); int idx = 0; @@ -1156,7 +1154,7 @@ void song::exportProject() { const QString export_file_name = efd.selectedFiles()[0]; exportProjectDialog epd( export_file_name, - engine::getMainWindow() ); + engine::mainWindow() ); epd.exec(); } } @@ -1177,11 +1175,11 @@ void song::setModified() if( !m_loadingProject ) { m_modified = true; - if( engine::getMainWindow() && + if( engine::mainWindow() && QThread::currentThread() == - engine::getMainWindow()->thread() ) + engine::mainWindow()->thread() ) { - engine::getMainWindow()->resetWindowTitle(); + engine::mainWindow()->resetWindowTitle(); } } } diff --git a/src/core/surround_area.cpp b/src/core/surround_area.cpp index cb7fe45b1..605d1537e 100644 --- a/src/core/surround_area.cpp +++ b/src/core/surround_area.cpp @@ -2,8 +2,8 @@ * surround_area.cpp - a widget for setting position of a channel + * calculation of volume for each speaker * - * Copyright (c) 2004-2008 Tobias Doerffel - * + * Copyright (c) 2004-2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,168 +23,15 @@ * */ - -#include "surround_area.h" - - -#include -#include -#include #include - -#include "caption_menu.h" -#include "embed.h" +#include "surround_area.h" #include "templates.h" -#include "tooltip.h" - -/* -QPixmap * surroundArea::s_backgroundArtwork = NULL; - - - - -surroundArea::surroundArea( QWidget * _parent, const QString & _name ) : - QWidget( _parent ), - modelView( new surroundAreaModel( NULL, NULL, TRUE ) ) -{ - if( s_backgroundArtwork == NULL ) - { - s_backgroundArtwork = new QPixmap( embed::getIconPixmap( - "surround_area" ) ); - } - - setFixedSize( s_backgroundArtwork->width(), - s_backgroundArtwork->height() ); - setAccessibleName( _name ); - toolTip::add( this, - tr( "click to where this channel should be audible" ) ); -} - - - - -surroundArea::~surroundArea() -{ -} - - - - - - -void surroundArea::contextMenuEvent( QContextMenuEvent * ) -{ - // for the case, the user clicked right while pressing left mouse- - // button, the context-menu appears while mouse-cursor is still hidden - // and it isn't shown again until user does something which causes - // an QApplication::restoreOverrideCursor()-call... - mouseReleaseEvent( NULL ); - - captionMenu contextMenu( accessibleName() ); - contextMenu.addAction( embed::getIconPixmap( "automation" ), - tr( "Open &X in automation editor" ), - model()->automationPatternX(), - SLOT( openInAutomationEditor() ) ); - contextMenu.addAction( embed::getIconPixmap( "automation" ), - tr( "Open &Y in automation editor" ), - model()->automationPatternY(), - SLOT( openInAutomationEditor() ) ); - contextMenu.exec( QCursor::pos() ); -} - - - - -void surroundArea::paintEvent( QPaintEvent * ) -{ - QPainter p( this ); - if( s_backgroundArtwork->size() != size() ) - { - p.drawPixmap( 0, 0, *s_backgroundArtwork ); - } - else - { - p.drawPixmap( 0, 0, s_backgroundArtwork->scaled( - width(), height(), - Qt::IgnoreAspectRatio, - Qt::SmoothTransformation ) ); - } - const int x = ( width() + model()->x() * ( width() - 4 ) / - SURROUND_AREA_SIZE ) / 2; - const int y = ( height() + model()->y() * ( height() - 4 ) / - SURROUND_AREA_SIZE ) / 2; - p.setPen( QColor( 64, 255, 64 ) ); - p.drawPoint( x, y - 1 ); - p.drawPoint( x - 1, y ); - p.drawPoint( x, y ); - p.drawPoint( x + 1, y ); - p.drawPoint( x, y + 1 ); -} - - - - -void surroundArea::mousePressEvent( QMouseEvent * _me ) -{ - if( _me->button() == Qt::RightButton ) - { - return; - } - - model()->prepareJournalEntryFromOldVal(); - - const int w = width();//s_backgroundArtwork->width(); - const int h = height();//s_backgroundArtwork->height(); - if( _me->x() > 1 && _me->x() < w-1 && _me->y() > 1 && _me->y() < h-1 ) - { - model()->setX( ( _me->x() * 2 - w ) * SURROUND_AREA_SIZE / - ( w - 4 ) ); - model()->setY( ( _me->y() * 2 - h ) * SURROUND_AREA_SIZE / - ( h - 4 ) ); - //update(); - if( _me->button() != Qt::NoButton ) - { - QApplication::setOverrideCursor( Qt::BlankCursor ); - } - } - else - { - int x = tLimit( _me->x(), 2, w - 2 ); - int y = tLimit( _me->y(), 2, h - 2 ); - QCursor::setPos( mapToGlobal( QPoint( x, y ) ) ); - } -} - - - - -void surroundArea::mouseMoveEvent( QMouseEvent * _me ) -{ - mousePressEvent( _me ); -} - - - - -void surroundArea::mouseReleaseEvent( QMouseEvent * ) -{ - model()->addJournalEntryFromOldToCurVal(); - QApplication::restoreOverrideCursor(); -} -*/ - - - - - - - -surroundAreaModel::surroundAreaModel( ::model * _parent, +surroundAreaModel::surroundAreaModel( ::Model * _parent, bool _default_constructed ) : - model( _parent, QString::null, _default_constructed ), + Model( _parent, QString::null, _default_constructed ), m_posX( 0, -SURROUND_AREA_SIZE, SURROUND_AREA_SIZE, _parent ), m_posY( 0, -SURROUND_AREA_SIZE, SURROUND_AREA_SIZE, _parent ) { @@ -266,20 +113,6 @@ void surroundAreaModel::loadSettings( const QDomElement & _this, } - -/* -automationPattern * surroundAreaModel::automationPatternX( void ) -{ - return( m_posX.getAutomationPattern() ); -} - -automationPattern * surroundAreaModel::automationPatternY( void ) -{ - return( m_posY.getAutomationPattern() ); -} -*/ - - #include "moc_surround_area.cxx" diff --git a/src/core/timeline.cpp b/src/core/timeline.cpp index 34333d222..13c664cc7 100644 --- a/src/core/timeline.cpp +++ b/src/core/timeline.cpp @@ -36,7 +36,7 @@ #include "engine.h" #include "templates.h" #include "nstate_button.h" -#include "main_window.h" +#include "MainWindow.h" #include "text_float.h" diff --git a/src/core/track.cpp b/src/core/track.cpp index 773fa0b0f..c4cb7a2b3 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -52,15 +52,15 @@ #include "bb_editor.h" #include "bb_track.h" #include "bb_track_container.h" -#include "clipboard.h" +#include "Clipboard.h" #include "embed.h" #include "engine.h" #include "gui_templates.h" -#include "instrument_track.h" -#include "main_window.h" +#include "InstrumentTrack.h" +#include "MainWindow.h" #include "mmp.h" #include "pixmap_button.h" -#include "project_journal.h" +#include "ProjectJournal.h" #include "sample_track.h" #include "song.h" #include "string_pair_drag.h" @@ -106,7 +106,7 @@ textFloat * trackContentObjectView::s_textFloat = NULL; * \param _track The track that will contain the new object */ trackContentObject::trackContentObject( track * _track ) : - model( _track ), + Model( _track ), m_track( _track ), m_name( QString::null ), m_startPosition(), @@ -155,7 +155,7 @@ void trackContentObject::movePosition( const midiTime & _pos ) { if( m_startPosition != _pos ) { - addJournalEntry( journalEntry( Move, m_startPosition - _pos ) ); + addJournalEntry( JournalEntry( Move, m_startPosition - _pos ) ); m_startPosition = _pos; engine::getSong()->updateLength(); } @@ -176,7 +176,7 @@ void trackContentObject::changeLength( const midiTime & _length ) { if( m_length != _length ) { - addJournalEntry( journalEntry( Resize, m_length - _length ) ); + addJournalEntry( JournalEntry( Resize, m_length - _length ) ); m_length = _length; engine::getSong()->updateLength(); } @@ -194,7 +194,7 @@ void trackContentObject::changeLength( const midiTime & _length ) * * \param _je The journal entry to undo */ -void trackContentObject::undoStep( journalEntry & _je ) +void trackContentObject::undoStep( JournalEntry & _je ) { saveJournallingState( false ); switch( _je.actionID() ) @@ -218,9 +218,9 @@ void trackContentObject::undoStep( journalEntry & _je ) * * \param _je The journal entry to redo */ -void trackContentObject::redoStep( journalEntry & _je ) +void trackContentObject::redoStep( JournalEntry & _je ) { - journalEntry je( _je.actionID(), -_je.data().toInt() ); + JournalEntry je( _je.actionID(), -_je.data().toInt() ); undoStep( je ); } @@ -231,9 +231,9 @@ void trackContentObject::redoStep( journalEntry & _je ) * * Copies this track content object to the clipboard. */ -void trackContentObject::copy( void ) +void trackContentObject::copy() { - clipboard::copy( this ); + Clipboard::copy( this ); } @@ -245,11 +245,11 @@ void trackContentObject::copy( void ) * * \param _je The journal entry to undo */ -void trackContentObject::paste( void ) +void trackContentObject::paste() { - if( clipboard::getContent( nodeName() ) != NULL ) + if( Clipboard::getContent( nodeName() ) != NULL ) { - restoreState( *( clipboard::getContent( nodeName() ) ) ); + restoreState( *( Clipboard::getContent( nodeName() ) ) ); } } @@ -264,7 +264,7 @@ void trackContentObject::paste( void ) * * \param _je The journal entry to undo */ -void trackContentObject::toggleMute( void ) +void trackContentObject::toggleMute() { m_mutedModel.setValue( !m_mutedModel.value() ); emit dataChanged(); @@ -290,7 +290,7 @@ void trackContentObject::toggleMute( void ) trackContentObjectView::trackContentObjectView( trackContentObject * _tco, trackView * _tv ) : selectableObject( _tv->getTrackContentWidget() ), - modelView( NULL, this ), + ModelView( NULL, this ), m_tco( _tco ), m_trackView( _tv ), m_action( NoAction ), @@ -354,9 +354,9 @@ trackContentObjectView::~trackContentObjectView() * \todo What the hell is a TCO here - track content object? And in * what circumstance are they fixed? */ -bool trackContentObjectView::fixedTCOs( void ) +bool trackContentObjectView::fixedTCOs() { - return( m_trackView->getTrackContainerView()->fixedTCOs() ); + return m_trackView->getTrackContainerView()->fixedTCOs(); } @@ -369,10 +369,10 @@ bool trackContentObjectView::fixedTCOs( void ) * * \return Boolean state of whether the QWidget was able to close. */ -bool trackContentObjectView::close( void ) +bool trackContentObjectView::close() { m_trackView->getTrackContentWidget()->removeTCOView( this ); - return( QWidget::close() ); + return QWidget::close(); } @@ -385,7 +385,7 @@ bool trackContentObjectView::close( void ) * scheduled for later deletion rather than closed immediately. * */ -void trackContentObjectView::remove( void ) +void trackContentObjectView::remove() { // delete ourself close(); @@ -400,7 +400,7 @@ void trackContentObjectView::remove( void ) * Perform the 'cut' action of the clipboard - copies the track content * object to the clipboard and then removes it from the track. */ -void trackContentObjectView::cut( void ) +void trackContentObjectView::cut() { m_tco->copy(); remove(); @@ -416,7 +416,7 @@ void trackContentObjectView::cut( void ) * the track content object's length in pixels adding in the border. * */ -void trackContentObjectView::updateLength( void ) +void trackContentObjectView::updateLength() { if( fixedTCOs() ) { @@ -442,7 +442,7 @@ void trackContentObjectView::updateLength( void ) * view's length. * */ -void trackContentObjectView::updatePosition( void ) +void trackContentObjectView::updatePosition() { m_trackView->getTrackContentWidget()->changePosition(); // moving a TCO can result in change of song-length etc., @@ -578,7 +578,7 @@ void trackContentObjectView::mousePressEvent( QMouseEvent * _me ) mmp.toString(), thumbnail, this ); } else if( _me->button() == Qt::LeftButton && - /* engine::getMainWindow()->isShiftPressed() == false &&*/ + /* engine::mainWindow()->isShiftPressed() == false &&*/ fixedTCOs() == false ) { // move or resize @@ -777,7 +777,7 @@ void trackContentObjectView::mouseReleaseEvent( QMouseEvent * _me ) if( m_action == Move || m_action == Resize ) { m_tco->setJournalling( true ); - m_tco->addJournalEntry( journalEntry( m_action, m_oldTime - + m_tco->addJournalEntry( JournalEntry( m_action, m_oldTime - ( ( m_action == Move ) ? m_tco->startPosition() : m_tco->length() ) ) ); } @@ -832,9 +832,9 @@ void trackContentObjectView::contextMenuEvent( QContextMenuEvent * _cme ) * * \return the number of pixels per tact (bar). */ -float trackContentObjectView::pixelsPerTact( void ) +float trackContentObjectView::pixelsPerTact() { - return( m_trackView->getTrackContainerView()->pixelsPerTact() ); + return m_trackView->getTrackContainerView()->pixelsPerTact(); } @@ -901,7 +901,7 @@ void trackContentWidget::addTCOView( trackContentObjectView * _tcov ) trackContentObject * tco = _tcov->getTrackContentObject(); /* QMap map; map["id"] = tco->id(); - addJournalEntry( journalEntry( AddTrackContentObject, map ) );*/ + addJournalEntry( JournalEntry( AddTrackContentObject, map ) );*/ m_tcoViews.push_back( _tcov ); @@ -931,7 +931,7 @@ void trackContentWidget::removeTCOView( trackContentObjectView * _tcov ) _tcov->getTrackContentObject()->saveState( mmp, mmp.content() ); map["id"] = _tcov->getTrackContentObject()->id(); map["state"] = mmp.toString(); - addJournalEntry( journalEntry( RemoveTrackContentObject, + addJournalEntry( JournalEntry( RemoveTrackContentObject, map ) );*/ m_tcoViews.erase( it ); @@ -945,7 +945,7 @@ void trackContentWidget::removeTCOView( trackContentObjectView * _tcov ) /*! \brief Update ourselves by updating all the tCOViews attached. * */ -void trackContentWidget::update( void ) +void trackContentWidget::update() { for( tcoViewVector::iterator it = m_tcoViews.begin(); it != m_tcoViews.end(); ++it ) @@ -1154,7 +1154,6 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe ) */ void trackContentWidget::resizeEvent( QResizeEvent * _re ) { - // Update backgroud const int tactsPerBar = 4; const trackContainerView * tcv = m_trackView->getTrackContainerView(); @@ -1211,7 +1210,7 @@ void trackContentWidget::resizeEvent( QResizeEvent * _re ) * * \param _je the details of the edit journal */ -void trackContentWidget::undoStep( journalEntry & _je ) +void trackContentWidget::undoStep( JournalEntry & _je ) { saveJournallingState( false ); switch( _je.actionID() ) @@ -1221,10 +1220,8 @@ void trackContentWidget::undoStep( journalEntry & _je ) QMap map = _je.data().toMap(); trackContentObject * tco = dynamic_cast( - engine::getProjectJournal()->getJournallingObject( - map["id"].toInt() ) ); - multimediaProject mmp( - multimediaProject::JournalData ); + engine::projectJournal()->journallingObject( map["id"].toInt() ) ); + multimediaProject mmp( multimediaProject::JournalData ); tco->saveState( mmp, mmp.content() ); map["state"] = mmp.toString(); _je.data() = map; @@ -1234,13 +1231,11 @@ void trackContentWidget::undoStep( journalEntry & _je ) case RemoveTrackContentObject: { - trackContentObject * tco = getTrack()->createTCO( - midiTime( 0 ) ); + trackContentObject * tco = getTrack()->createTCO( midiTime( 0 ) ); multimediaProject mmp( _je.data().toMap()["state"]. toString().toUtf8() ); - tco->restoreState( - mmp.content().firstChild().toElement() ); + tco->restoreState( mmp.content().firstChild().toElement() ); break; } } @@ -1254,7 +1249,7 @@ void trackContentWidget::undoStep( journalEntry & _je ) * * \param _je the entry in the edit journal to redo. */ -void trackContentWidget::redoStep( journalEntry & _je ) +void trackContentWidget::redoStep( JournalEntry & _je ) { switch( _je.actionID() ) { @@ -1279,9 +1274,9 @@ void trackContentWidget::redoStep( journalEntry & _je ) /*! \brief Return the track shown by the trackContentWidget * */ -track * trackContentWidget::getTrack( void ) +track * trackContentWidget::getTrack() { - return( m_trackView->getTrack() ); + return m_trackView->getTrack(); } @@ -1293,11 +1288,11 @@ track * trackContentWidget::getTrack( void ) */ midiTime trackContentWidget::getPosition( int _mouse_x ) { - return( midiTime( m_trackView->getTrackContainerView()-> + return midiTime( m_trackView->getTrackContainerView()-> currentPosition() + _mouse_x * midiTime::ticksPerTact() / static_cast( m_trackView-> - getTrackContainerView()->pixelsPerTact() ) ) ); + getTrackContainerView()->pixelsPerTact() ) ); } @@ -1310,8 +1305,7 @@ midiTime trackContentWidget::endPosition( const midiTime & _pos_start ) { const float ppt = m_trackView->getTrackContainerView()->pixelsPerTact(); const int w = width(); - return( _pos_start + static_cast( w * midiTime::ticksPerTact() / - ppt ) ); + return _pos_start + static_cast( w * midiTime::ticksPerTact() / ppt ); } @@ -1466,7 +1460,7 @@ void trackOperationsWidget::paintEvent( QPaintEvent * _pe ) /*! \brief Clone this track * */ -void trackOperationsWidget::cloneTrack( void ) +void trackOperationsWidget::cloneTrack() { engine::getMixer()->lock(); m_trackView->getTrack()->clone(); @@ -1479,7 +1473,7 @@ void trackOperationsWidget::cloneTrack( void ) /*! \brief Remove this track from the track list * */ -void trackOperationsWidget::removeTrack( void ) +void trackOperationsWidget::removeTrack() { emit trackRemovalScheduled( m_trackView ); } @@ -1492,7 +1486,7 @@ void trackOperationsWidget::removeTrack( void ) * For all track types, we have the Clone and Remove options. * For instrument-tracks we also offer the MIDI-control-menu */ -void trackOperationsWidget::updateMenu( void ) +void trackOperationsWidget::updateMenu() { QMenu * to_menu = m_trackOps->menu(); to_menu->clear(); @@ -1503,10 +1497,10 @@ void trackOperationsWidget::updateMenu( void ) tr( "Remove this track" ), this, SLOT( removeTrack() ) ); - if( dynamic_cast( m_trackView ) ) + if( dynamic_cast( m_trackView ) ) { to_menu->addSeparator(); - to_menu->addMenu( dynamic_cast( + to_menu->addMenu( dynamic_cast( m_trackView )->midiMenu() ); } } @@ -1530,7 +1524,7 @@ void trackOperationsWidget::updateMenu( void ) * \todo check the definitions of all the properties - are they OK? */ track::track( TrackTypes _type, trackContainer * _tc ) : - model( _tc ), /*!< The track model */ + Model( _tc ), /*!< The track Model */ m_trackContainer( _tc ), /*!< The track container object */ m_type( _type ), /*!< The track type */ m_name(), /*!< The track's name */ @@ -1583,7 +1577,7 @@ track * track::create( TrackTypes _tt, trackContainer * _tc ) switch( _tt ) { - case InstrumentTrack: t = new instrumentTrack( _tc ); break; + case InstrumentTrack: t = new ::InstrumentTrack( _tc ); break; case BBTrack: t = new bbTrack( _tc ); break; case SampleTrack: t = new sampleTrack( _tc ); break; // case EVENT_TRACK: @@ -1596,7 +1590,7 @@ track * track::create( TrackTypes _tt, trackContainer * _tc ) _tc->updateAfterTrackAdd(); - return( t ); + return t; } @@ -1616,7 +1610,7 @@ track * track::create( const QDomElement & _this, trackContainer * _tc ) { t->restoreState( _this ); } - return( t ); + return t; } @@ -1625,7 +1619,7 @@ track * track::create( const QDomElement & _this, trackContainer * _tc ) /*! \brief Clone a track from this track * */ -void track::clone( void ) +void track::clone() { QDomDocument doc; QDomElement parent = doc.createElement( "clone" ); @@ -1662,7 +1656,7 @@ void track::saveSettings( QDomDocument & _doc, QDomElement & _this ) // _this.setAttribute( "height", m_trackView->height() ); QDomElement ts_de = _doc.createElement( nodeName() ); - // let actual track (instrumentTrack, bbTrack, sampleTrack etc.) save + // let actual track (InstrumentTrack, bbTrack, sampleTrack etc.) save // its settings _this.appendChild( ts_de ); saveTrackSpecificSettings( _doc, ts_de ); @@ -1803,9 +1797,9 @@ void track::removeTCO( trackContentObject * _tco ) * * \return the number of trackContentObjects we currently contain. */ -int track::numOfTCOs( void ) +int track::numOfTCOs() { - return( m_trackContentObjects.size() ); + return m_trackContentObjects.size(); } @@ -1827,11 +1821,11 @@ trackContentObject * track::getTCO( int _tco_num ) { if( _tco_num < m_trackContentObjects.size() ) { - return( m_trackContentObjects[_tco_num] ); + return m_trackContentObjects[_tco_num]; } printf( "called track::getTCO( %d ), " "but TCO %d doesn't exist\n", _tco_num, _tco_num ); - return( createTCO( _tco_num * midiTime::ticksPerTact() ) ); + return createTCO( _tco_num * midiTime::ticksPerTact() ); } @@ -1853,12 +1847,12 @@ int track::getTCONum( trackContentObject * _tco ) { /* if( getTCO( i ) == _tco ) { - return( i ); + return i; }*/ - return( it - m_trackContentObjects.begin() ); + return it - m_trackContentObjects.begin(); } qWarning( "track::getTCONum(...) -> _tco not found!\n" ); - return( 0 ); + return 0; } @@ -1990,7 +1984,7 @@ void track::removeTact( const midiTime & _pos ) * keeping track of the latest time found in ticks. Then we return * that in bars by dividing by the number of ticks per bar. */ -tact_t track::length( void ) const +tact_t track::length() const { // find last end-position tick_t last = 0; @@ -2015,7 +2009,7 @@ tact_t track::length( void ) const * is already soloed. Then we have to save the mute state of all tracks, * and set our mute state to on and all the others to off. */ -void track::toggleSolo( void ) +void track::toggleSolo() { const trackContainer::trackList & tl = m_trackContainer->tracks(); @@ -2077,7 +2071,7 @@ void track::toggleSolo( void ) */ trackView::trackView( track * _track, trackContainerView * _tcv ) : QWidget( _tcv->contentWidget() ), /*!< The Track Container View's content widget. */ - modelView( NULL, this ), /*!< The model view of this track */ + ModelView( NULL, this ), /*!< The model view of this track */ m_track( _track ), /*!< The track we're displaying */ m_trackContainerView( _tcv ), /*!< The track Container View we're displayed in */ m_trackOperationsWidget( this ), /*!< Our trackOperationsWidget */ @@ -2158,7 +2152,7 @@ void trackView::resizeEvent( QResizeEvent * _re ) /*! \brief Update this track View and all its content objects. * */ -void trackView::update( void ) +void trackView::update() { m_trackContentWidget.update(); if( !m_trackContainerView->fixedTCOs() ) @@ -2174,10 +2168,10 @@ void trackView::update( void ) /*! \brief Close this track View. * */ -bool trackView::close( void ) +bool trackView::close() { m_trackContainerView->removeTrackView( this ); - return( QWidget::close() ); + return QWidget::close(); } @@ -2186,14 +2180,14 @@ bool trackView::close( void ) /*! \brief Register that the model of this track View has changed. * */ -void trackView::modelChanged( void ) +void trackView::modelChanged() { m_track = castModel(); assert( m_track != NULL ); connect( m_track, SIGNAL( destroyedTrack() ), this, SLOT( close() ) ); m_trackOperationsWidget.m_muteBtn->setModel( &m_track->m_mutedModel ); m_trackOperationsWidget.m_soloBtn->setModel( &m_track->m_soloModel ); - modelView::modelChanged(); + ModelView::modelChanged(); } @@ -2203,7 +2197,7 @@ void trackView::modelChanged( void ) * * \param _je the Journal Entry to undo. */ -void trackView::undoStep( journalEntry & _je ) +void trackView::undoStep( JournalEntry & _je ) { saveJournallingState( false ); switch( _je.actionID() ) @@ -2235,9 +2229,9 @@ void trackView::undoStep( journalEntry & _je ) * * \param _je the Journal Event to redo. */ -void trackView::redoStep( journalEntry & _je ) +void trackView::redoStep( JournalEntry & _je ) { - journalEntry je( _je.actionID(), -_je.data().toInt() ); + JournalEntry je( _je.actionID(), -_je.data().toInt() ); undoStep( je ); } @@ -2376,7 +2370,7 @@ void trackView::mouseMoveEvent( QMouseEvent * _me ) { m_trackContainerView->moveTrackViewDown( this ); } - addJournalEntry( journalEntry( MoveTrack, _me->y() ) ); + addJournalEntry( JournalEntry( MoveTrack, _me->y() ) ); } } else if( m_action == ResizeTrack ) diff --git a/src/core/track_container.cpp b/src/core/track_container.cpp index 136c2768e..fe61202ce 100644 --- a/src/core/track_container.cpp +++ b/src/core/track_container.cpp @@ -29,15 +29,15 @@ #include #include "track_container.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "engine.h" -#include "main_window.h" +#include "MainWindow.h" #include "song.h" -trackContainer::trackContainer( void ) : - model( NULL ), - journallingObject(), +trackContainer::trackContainer() : + Model( NULL ), + JournallingObject(), m_tracksMutex(), m_tracks() { @@ -83,7 +83,7 @@ void trackContainer::loadSettings( const QDomElement & _this ) pd = new QProgressDialog( tr( "Loading project..." ), tr( "Cancel" ), 0, _this.childNodes().count(), - engine::getMainWindow() ); + engine::mainWindow() ); pd->setWindowModality( Qt::ApplicationModal ); pd->setWindowTitle( tr( "Please wait..." ) ); pd->show(); @@ -183,14 +183,14 @@ void trackContainer::removeTrack( track * _track ) -void trackContainer::updateAfterTrackAdd( void ) +void trackContainer::updateAfterTrackAdd() { } -void trackContainer::clearAllTracks( void ) +void trackContainer::clearAllTracks() { //m_tracksMutex.lockForWrite(); while( !m_tracks.isEmpty() ) @@ -203,7 +203,7 @@ void trackContainer::clearAllTracks( void ) -bool trackContainer::isEmpty( void ) const +bool trackContainer::isEmpty() const { for( trackList::const_iterator it = m_tracks.begin(); it != m_tracks.end(); ++it ) @@ -221,15 +221,15 @@ bool trackContainer::isEmpty( void ) const -dummyTrackContainer::dummyTrackContainer( void ) : +DummyTrackContainer::DummyTrackContainer() : trackContainer(), m_dummyInstrumentTrack( NULL ) { setJournalling( FALSE ); - m_dummyInstrumentTrack = dynamic_cast( + m_dummyInstrumentTrack = dynamic_cast( track::create( track::InstrumentTrack, this ) ); - m_dummyInstrumentTrack->setJournalling( FALSE ); + m_dummyInstrumentTrack->setJournalling( false ); } diff --git a/src/gui/automatable_model_view.cpp b/src/gui/AutomatableModelView.cpp similarity index 72% rename from src/gui/automatable_model_view.cpp rename to src/gui/AutomatableModelView.cpp index 8387623d4..c1dea1bc8 100644 --- a/src/gui/automatable_model_view.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -1,5 +1,5 @@ /* - * automatable_model_view.cpp - implementation of automatableModelView + * automatable_model_view.cpp - implementation of AutomatableModelView * * Copyright (c) 2008 Tobias Doerffel * @@ -25,67 +25,68 @@ #include #include -#include "automatable_model_view.h" + +#include "AutomatableModelView.h" #include "automation_pattern.h" #include "ControllerConnectionDialog.h" #include "ControllerConnection.h" #include "embed.h" -#include "main_window.h" +#include "MainWindow.h" #include "string_pair_drag.h" -automatableModelView::automatableModelView( ::model * _model, +AutomatableModelView::AutomatableModelView( ::Model * _model, QWidget * _this ) : - modelView( _model, _this ), + ModelView( _model, _this ), m_description( QString::null ), m_unit( QString::null ) { - widget()->setAcceptDrops( TRUE ); + widget()->setAcceptDrops( true ); widget()->setCursor( QCursor( embed::getIconPixmap( "hand" ), 0, 0 ) ); } -automatableModelView::~automatableModelView() +AutomatableModelView::~AutomatableModelView() { } -void automatableModelView::addDefaultActions( QMenu * _menu ) +void AutomatableModelView::addDefaultActions( QMenu * _menu ) { - automatableModel * _model = modelUntyped(); + AutomatableModel * _model = modelUntyped(); - automatableModelViewSlots * amvSlots = - new automatableModelViewSlots( this, _menu ); + AutomatableModelViewSlots * amvSlots = + new AutomatableModelViewSlots( this, _menu ); _menu->addAction( embed::getIconPixmap( "reload" ), - automatableModel::tr( "&Reset (%1%2)" ). + AutomatableModel::tr( "&Reset (%1%2)" ). arg( _model->displayValue( _model->initValue() ) ). arg( m_unit ), _model, SLOT( reset() ) ); _menu->addSeparator(); _menu->addAction( embed::getIconPixmap( "edit_copy" ), - automatableModel::tr( "&Copy value (%1%2)" ). + AutomatableModel::tr( "&Copy value (%1%2)" ). arg( _model->displayValue( _model->value() ) ). arg( m_unit ), _model, SLOT( copyValue() ) ); _menu->addAction( embed::getIconPixmap( "edit_paste" ), - automatableModel::tr( "&Paste value (%1%2)"). + AutomatableModel::tr( "&Paste value (%1%2)"). arg( _model->displayValue( - automatableModel::copiedValue() ) ). + AutomatableModel::copiedValue() ) ). arg( m_unit ), _model, SLOT( pasteValue() ) ); _menu->addSeparator(); _menu->addAction( embed::getIconPixmap( "automation" ), - automatableModel::tr( "Edit song-global automation" ), + AutomatableModel::tr( "Edit song-global automation" ), amvSlots, SLOT( editSongGlobalAutomation() ) ); _menu->addSeparator(); @@ -98,12 +99,12 @@ void automatableModelView::addDefaultActions( QMenu * _menu ) if( cont ) { controllerTxt = - automatableModel::tr( "Connected to %1" ). + AutomatableModel::tr( "Connected to %1" ). arg( cont->name() ); } else { - controllerTxt = automatableModel::tr( + controllerTxt = AutomatableModel::tr( "Connected to controller" ); } @@ -112,18 +113,18 @@ void automatableModelView::addDefaultActions( QMenu * _menu ) controllerTxt ); contMenu->addAction( embed::getIconPixmap( "controller" ), - automatableModel::tr("Edit connection..."), + AutomatableModel::tr("Edit connection..."), amvSlots, SLOT( execConnectionDialog() ) ); contMenu->addAction( embed::getIconPixmap( "cancel" ), - automatableModel::tr("Remove connection"), + AutomatableModel::tr("Remove connection"), amvSlots, SLOT( removeConnection() ) ); } else { _menu->addAction( embed::getIconPixmap( "controller" ), - automatableModel::tr("Connect to controller..."), + AutomatableModel::tr("Connect to controller..."), amvSlots, SLOT( execConnectionDialog() ) ); } @@ -132,16 +133,16 @@ void automatableModelView::addDefaultActions( QMenu * _menu ) -void automatableModelView::setModel( model * _model, bool _old_model_valid ) +void AutomatableModelView::setModel( Model * _model, bool _old_model_valid ) { - modelView::setModel( _model, _old_model_valid ); + ModelView::setModel( _model, _old_model_valid ); //setAccessibleName( _model->displayName(); } -void automatableModelView::mousePressEvent( QMouseEvent * _me ) +void AutomatableModelView::mousePressEvent( QMouseEvent * _me ) { if( _me->button() == Qt::LeftButton && _me->modifiers() & Qt::ControlModifier ) @@ -162,8 +163,8 @@ void automatableModelView::mousePressEvent( QMouseEvent * _me ) -automatableModelViewSlots::automatableModelViewSlots( - automatableModelView * _amv, +AutomatableModelViewSlots::AutomatableModelViewSlots( + AutomatableModelView * _amv, QObject * _parent ) : QObject(), amv( _amv ) @@ -176,15 +177,15 @@ automatableModelViewSlots::automatableModelViewSlots( -void automatableModelViewSlots::execConnectionDialog( void ) +void AutomatableModelViewSlots::execConnectionDialog() { // TODO[pg]: Display a dialog with list of controllers currently in the song // in addition to any system MIDI controllers - automatableModel * m = amv->modelUntyped(); + AutomatableModel * m = amv->modelUntyped(); m->displayName(); ControllerConnectionDialog * d = new ControllerConnectionDialog( - (QWidget*)engine::getMainWindow(), m ); + (QWidget*)engine::mainWindow(), m ); if( d->exec() == 1) { @@ -220,9 +221,9 @@ void automatableModelViewSlots::execConnectionDialog( void ) -void automatableModelViewSlots::removeConnection( void ) +void AutomatableModelViewSlots::removeConnection() { - automatableModel * m = amv->modelUntyped(); + AutomatableModel * m = amv->modelUntyped(); if( m->getControllerConnection() ) { @@ -234,7 +235,7 @@ void automatableModelViewSlots::removeConnection( void ) -void automatableModelViewSlots::editSongGlobalAutomation( void ) +void AutomatableModelViewSlots::editSongGlobalAutomation() { automationPattern::globalAutomationPattern( amv->modelUntyped() )-> openInAutomationEditor(); @@ -242,5 +243,4 @@ void automatableModelViewSlots::editSongGlobalAutomation( void ) - -#include "moc_automatable_model_view.cxx" +#include "moc_AutomatableModelView.cxx" diff --git a/src/gui/ControllerConnectionDialog.cpp b/src/gui/ControllerConnectionDialog.cpp index e91ec1f96..9c0db85ab 100644 --- a/src/gui/ControllerConnectionDialog.cpp +++ b/src/gui/ControllerConnectionDialog.cpp @@ -2,8 +2,8 @@ * ControllerConnectionDialog.cpp - dialog allowing the user to create and * modify links between controllers and models * - * Copyright (c) 2008 Paul Giblock - * + * Copyright (c) 2008 Paul Giblock + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,7 +23,6 @@ * */ - #include #include #include @@ -46,10 +45,11 @@ #include "gui_templates.h" #include "embed.h" + class AutoDetectMidiController : public MidiController { public: - AutoDetectMidiController( model * _parent ) : + AutoDetectMidiController( Model * _parent ) : MidiController( _parent ), m_detectedMidiChannel( 0 ), m_detectedMidiController( 0 ) @@ -82,7 +82,7 @@ public: // Would be a nice copy ctor, but too hard to add copy ctor because // model has none. - MidiController * copyToMidiController( model * _parent ) + MidiController * copyToMidiController( Model * _parent ) { MidiController * c = new MidiController( _parent ); c->m_midiPort.setInputChannel( m_midiPort.inputChannel() ); @@ -127,8 +127,7 @@ private: ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, - const automatableModel * _target_model - ) : + const AutomatableModel * _target_model ) : QDialog( _parent ), m_readablePorts( NULL ), m_midiAutoDetect( false ), diff --git a/src/gui/ControllerDialog.cpp b/src/gui/ControllerDialog.cpp index 8222b5f5c..de7d49653 100644 --- a/src/gui/ControllerDialog.cpp +++ b/src/gui/ControllerDialog.cpp @@ -1,9 +1,9 @@ /* * ControllerDialog.cpp - per-controller-specific view for changing a - * controller's settings + * controller's settings * * Copyright (c) 2008 Paul Giblock - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -32,7 +32,7 @@ ControllerDialog::ControllerDialog( Controller * _controller, QWidget * _parent ) : QWidget( _parent ), - modelView( _controller, this ) + ModelView( _controller, this ) { } diff --git a/src/gui/effect_control_dialog.cpp b/src/gui/EffectControlDialog.cpp similarity index 67% rename from src/gui/effect_control_dialog.cpp rename to src/gui/EffectControlDialog.cpp index 2ce9b53f3..e5f590f7c 100644 --- a/src/gui/effect_control_dialog.cpp +++ b/src/gui/EffectControlDialog.cpp @@ -1,6 +1,6 @@ /* - * effect_control_dialog.cpp - base-class for effect-dialogs for displaying - * and editing control port values + * EffectControlDialog.cpp - base-class for effect-dialogs for displaying + * and editing control port values * * Copyright (c) 2006-2009 Tobias Doerffel * @@ -26,31 +26,30 @@ #include #include -#include "effect_control_dialog.h" -#include "effect_controls.h" -#include "effect.h" +#include "EffectControlDialog.h" +#include "EffectControls.h" +#include "Effect.h" -effectControlDialog::effectControlDialog( effectControls * _controls ) : +EffectControlDialog::EffectControlDialog( EffectControls * _controls ) : QWidget( NULL ), - modelView( _controls, this ), + ModelView( _controls, this ), m_effectControls( _controls ) { - setWindowTitle( m_effectControls->getEffect()->displayName() ); - + setWindowTitle( m_effectControls->effect()->displayName() ); } -effectControlDialog::~effectControlDialog() +EffectControlDialog::~EffectControlDialog() { } -void effectControlDialog::closeEvent( QCloseEvent * _ce ) +void EffectControlDialog::closeEvent( QCloseEvent * _ce ) { _ce->ignore(); emit closed(); @@ -58,5 +57,5 @@ void effectControlDialog::closeEvent( QCloseEvent * _ce ) -#include "moc_effect_control_dialog.cxx" +#include "moc_EffectControlDialog.cxx" diff --git a/src/gui/effect_select_dialog.cpp b/src/gui/EffectSelectDialog.cpp similarity index 82% rename from src/gui/effect_select_dialog.cpp rename to src/gui/EffectSelectDialog.cpp index 0af07aaf4..07e42095f 100644 --- a/src/gui/effect_select_dialog.cpp +++ b/src/gui/EffectSelectDialog.cpp @@ -1,8 +1,8 @@ /* - * effect_select_dialog.cpp - dialog to choose effect plugin + * EffectSelectDialog.cpp - dialog to choose effect plugin + * + * Copyright (c) 2006-2009 Tobias Doerffel * - * Copyright (c) 2006-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ * */ - #include #include #include @@ -30,24 +29,24 @@ #include #include -#include "effect_select_dialog.h" +#include "EffectSelectDialog.h" #include "gui_templates.h" #include "embed.h" -effectSelectDialog::effectSelectDialog( QWidget * _parent ) : +EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) : QDialog( _parent ) { setWindowIcon( embed::getIconPixmap( "setup_audio" ) ); setWindowTitle( tr( "Effects Selector" ) ); - setModal( TRUE ); + setModal( true ); QVBoxLayout * vlayout = new QVBoxLayout( this ); vlayout->setSpacing( 10 ); vlayout->setMargin( 10 ); - effectListWidget * elist = new effectListWidget( this ); + EffectListWidget * elist = new EffectListWidget( this ); elist->setMinimumSize( 540, 400 ); connect( elist, SIGNAL( doubleClicked( const effectKey & ) ), this, SLOT( selectPlugin() ) ); @@ -92,20 +91,20 @@ effectSelectDialog::effectSelectDialog( QWidget * _parent ) : -effectSelectDialog::~effectSelectDialog() +EffectSelectDialog::~EffectSelectDialog() { } -effect * effectSelectDialog::instantiateSelectedPlugin( effectChain * _parent ) +Effect * EffectSelectDialog::instantiateSelectedPlugin( EffectChain * _parent ) { if( !m_currentSelection.name.isEmpty() && m_currentSelection.desc ) { - return( effect::instantiate( m_currentSelection.desc->name, + return Effect::instantiate( m_currentSelection.desc->name, _parent, - &m_currentSelection ) ); + &m_currentSelection ); } return( NULL ); } @@ -113,7 +112,7 @@ effect * effectSelectDialog::instantiateSelectedPlugin( effectChain * _parent ) -void effectSelectDialog::setSelection( const effectKey & _selection ) +void EffectSelectDialog::setSelection( const EffectKey & _selection ) { m_currentSelection = _selection; } @@ -121,7 +120,7 @@ void effectSelectDialog::setSelection( const effectKey & _selection ) -void effectSelectDialog::selectPlugin( void ) +void EffectSelectDialog::selectPlugin() { if( m_currentSelection.isValid() ) { @@ -135,19 +134,19 @@ void effectSelectDialog::selectPlugin( void ) -effectListWidget::effectListWidget( QWidget * _parent ) : +EffectListWidget::EffectListWidget( QWidget * _parent ) : QWidget( _parent ), m_sourceModel(), m_model(), m_descriptionWidget( NULL ) { - plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors ); + Plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors ); - for( QVector::iterator it = + for( QVector::iterator it = m_pluginDescriptors.begin(); it != m_pluginDescriptors.end(); ++it ) { - if( it->type != plugin::Effect ) + if( it->type != Plugin::Effect ) { continue; } @@ -164,13 +163,13 @@ effectListWidget::effectListWidget( QWidget * _parent ) : } else { - m_effectKeys << effectKey( &( *it ), it->name ); + m_effectKeys << EffectKey( &( *it ), it->name ); } } QStringList plugin_names; - for( effectKeyList::const_iterator it = m_effectKeys.begin(); + for( EffectKeyList::ConstIterator it = m_effectKeys.begin(); it != m_effectKeys.end(); ++it ) { plugin_names += QString( ( *it ).desc->displayName ) + @@ -237,15 +236,14 @@ effectListWidget::effectListWidget( QWidget * _parent ) : -effectListWidget::~effectListWidget() +EffectListWidget::~EffectListWidget() { } -void effectListWidget::rowChanged( const QModelIndex & _idx, - const QModelIndex & ) +void EffectListWidget::rowChanged( const QModelIndex & _idx, const QModelIndex & ) { delete m_descriptionWidget; m_descriptionWidget = NULL; @@ -254,7 +252,7 @@ void effectListWidget::rowChanged( const QModelIndex & _idx, { // invalidate current selection m_currentSelection = - plugin::descriptor::subPluginFeatures::key(); + Plugin::Descriptor::SubPluginFeatures::Key(); } else { @@ -285,21 +283,21 @@ void effectListWidget::rowChanged( const QModelIndex & _idx, l->setSizeConstraint( QLayout::SetFixedSize ); m_descriptionWidget->show(); } - emit( highlighted( m_currentSelection ) ); + emit highlighted( m_currentSelection ); } -void effectListWidget::onDoubleClicked( const QModelIndex & ) +void EffectListWidget::onDoubleClicked( const QModelIndex & ) { - emit( doubleClicked( m_currentSelection ) ); + emit doubleClicked( m_currentSelection ); } -void effectListWidget::updateSelection( void ) +void EffectListWidget::updateSelection() { // no valid selection anymore due to changed filter? if( m_pluginList->selectionModel()->selection().size() <= 0 ) @@ -312,5 +310,5 @@ void effectListWidget::updateSelection( void ) } -#include "moc_effect_select_dialog.cxx" +#include "moc_EffectSelectDialog.cxx" diff --git a/src/gui/fx_mixer_view.cpp b/src/gui/FxMixerView.cpp similarity index 85% rename from src/gui/fx_mixer_view.cpp rename to src/gui/FxMixerView.cpp index 0276693dd..14c9d9ebd 100644 --- a/src/gui/fx_mixer_view.cpp +++ b/src/gui/FxMixerView.cpp @@ -1,8 +1,8 @@ /* - * fx_mixer_view.cpp - effect-mixer-view for LMMS + * FxMixerView.cpp - effect-mixer-view for LMMS * * Copyright (c) 2008-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ * */ - #include #include #include @@ -33,12 +32,12 @@ #include #include -#include "fx_mixer_view.h" +#include "FxMixerView.h" #include "fader.h" -#include "effect_rack_view.h" +#include "EffectRackView.h" #include "engine.h" #include "embed.h" -#include "main_window.h" +#include "MainWindow.h" #include "lcd_spinbox.h" #include "gui_templates.h" #include "tooltip.h" @@ -46,10 +45,10 @@ -class fxLine : public QWidget +class FxLine : public QWidget { public: - fxLine( QWidget * _parent, fxMixerView * _mv, QString & _name ) : + FxLine( QWidget * _parent, FxMixerView * _mv, QString & _name ) : QWidget( _parent ), m_mv( _mv ), m_name( _name ) @@ -86,8 +85,8 @@ public: { bool ok; QString new_name = QInputDialog::getText( this, - fxMixerView::tr( "Rename FX channel" ), - fxMixerView::tr( "Enter the new name for this " + FxMixerView::tr( "Rename FX channel" ), + FxMixerView::tr( "Enter the new name for this " "FX channel" ), QLineEdit::Normal, m_name, &ok ); if( ok && !new_name.isEmpty() ) @@ -99,7 +98,7 @@ public: private: - fxMixerView * m_mv; + FxMixerView * m_mv; QString & m_name; } ; @@ -107,12 +106,12 @@ private: -fxMixerView::fxMixerView() : +FxMixerView::FxMixerView() : QWidget(), - modelView( NULL, this ), - serializingObjectHook() + ModelView( NULL, this ), + SerializingObjectHook() { - fxMixer * m = engine::getFxMixer(); + FxMixer * m = engine::fxMixer(); m->setHook( this ); QPalette pal = palette(); @@ -151,10 +150,10 @@ fxMixerView::fxMixerView() : for( int i = 0; i < NumFxChannels+1; ++i ) { - fxChannelView * cv = &m_fxChannelViews[i]; + FxChannelView * cv = &m_fxChannelViews[i]; if( i == 0 ) { - cv->m_fxLine = new fxLine( NULL, this, + cv->m_fxLine = new FxLine( NULL, this, m->m_fxChannels[i]->m_name ); ml->addWidget( cv->m_fxLine ); ml->addSpacing( 10 ); @@ -162,7 +161,7 @@ fxMixerView::fxMixerView() : else { const int bank = (i-1) / 16; - cv->m_fxLine = new fxLine( NULL, this, + cv->m_fxLine = new FxLine( NULL, this, m->m_fxChannels[i]->m_name ); banks[bank]->addWidget( cv->m_fxLine ); } @@ -190,7 +189,7 @@ fxMixerView::fxMixerView() : cv->m_muteBtn->move( 9, cv->m_fader->y()-16); toolTip::add( cv->m_muteBtn, tr( "Mute this FX channel" ) ); - cv->m_rackView = new effectRackView( + cv->m_rackView = new EffectRackView( &m->m_fxChannels[i]->m_fxChain, this ); m_fxRacksLayout->addWidget( cv->m_rackView ); if( i == 0 ) @@ -228,13 +227,13 @@ fxMixerView::fxMixerView() : setCurrentFxLine( m_fxChannelViews[0].m_fxLine ); // timer for updating faders - connect( engine::getMainWindow(), SIGNAL( periodicUpdate() ), + connect( engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( updateFaders() ) ); // add ourself to workspace QMdiSubWindow * subWin = - engine::getMainWindow()->workspace()->addSubWindow( this ); + engine::mainWindow()->workspace()->addSubWindow( this ); Qt::WindowFlags flags = subWin->windowFlags(); flags |= Qt::MSWindowsFixedSizeDialogHint; flags &= ~Qt::WindowMaximizeButtonHint; @@ -251,30 +250,30 @@ fxMixerView::fxMixerView() : -fxMixerView::~fxMixerView() +FxMixerView::~FxMixerView() { } -void fxMixerView::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void FxMixerView::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - mainWindow::saveWidgetState( this, _this ); + MainWindow::saveWidgetState( this, _this ); } -void fxMixerView::loadSettings( const QDomElement & _this ) +void FxMixerView::loadSettings( const QDomElement & _this ) { - mainWindow::restoreWidgetState( this, _this ); + MainWindow::restoreWidgetState( this, _this ); } -void fxMixerView::setCurrentFxLine( fxLine * _line ) +void FxMixerView::setCurrentFxLine( FxLine * _line ) { m_currentFxLine = _line; for( int i = 0; i < NumFxChannels+1; ++i ) @@ -289,7 +288,7 @@ void fxMixerView::setCurrentFxLine( fxLine * _line ) -void fxMixerView::setCurrentFxLine( int _line ) +void FxMixerView::setCurrentFxLine( int _line ) { if ( _line >= 0 && _line < NumFxChannels+1 ) { @@ -302,7 +301,7 @@ void fxMixerView::setCurrentFxLine( int _line ) -void fxMixerView::clear( void ) +void FxMixerView::clear() { for( int i = 0; i <= NumFxChannels; ++i ) { @@ -313,9 +312,9 @@ void fxMixerView::clear( void ) -void fxMixerView::updateFaders( void ) +void FxMixerView::updateFaders() { - fxMixer * m = engine::getFxMixer(); + FxMixer * m = engine::fxMixer(); for( int i = 0; i < NumFxChannels+1; ++i ) { const float opl = m_fxChannelViews[i].m_fader->getPeak_L(); @@ -344,5 +343,5 @@ void fxMixerView::updateFaders( void ) -#include "moc_fx_mixer_view.cxx" +#include "moc_FxMixerView.cxx" diff --git a/src/gui/InstrumentView.cpp b/src/gui/InstrumentView.cpp new file mode 100644 index 000000000..e822529e4 --- /dev/null +++ b/src/gui/InstrumentView.cpp @@ -0,0 +1,74 @@ +/* + * InstrumentView.cpp - base-class for views of all Instruments + * + * Copyright (c) 2008-2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + */ + +#include "InstrumentView.h" +#include "embed.h" +#include "Instrument.h" +#include "InstrumentTrack.h" +#include "string_pair_drag.h" + + +InstrumentView::InstrumentView( Instrument * _Instrument, QWidget * _parent ) : + PluginView( _Instrument, _parent ) +{ + setModel( _Instrument ); + setFixedSize( 250, 250 ); + setAttribute( Qt::WA_DeleteOnClose, TRUE ); +} + + + + +InstrumentView::~InstrumentView() +{ + if( instrumentTrackWindow() ) + { + instrumentTrackWindow()->m_instrumentView = NULL; + } +} + + + + +void InstrumentView::setModel( Model * _model, bool ) +{ + if( dynamic_cast( _model ) != NULL ) + { + ModelView::setModel( _model ); + instrumentTrackWindow()->setWindowIcon( + model()->descriptor()->logo->pixmap() ); + connect( model(), SIGNAL( destroyed( QObject * ) ), + this, SLOT( close() ) ); + } +} + + + + +InstrumentTrackWindow * InstrumentView::instrumentTrackWindow( void ) +{ + return( dynamic_cast( + parentWidget()->parentWidget() ) ); +} + diff --git a/src/gui/LfoControllerDialog.cpp b/src/gui/LfoControllerDialog.cpp index d354d0807..eeef7e2f8 100644 --- a/src/gui/LfoControllerDialog.cpp +++ b/src/gui/LfoControllerDialog.cpp @@ -34,15 +34,14 @@ #include "embed.h" #include "engine.h" #include "led_checkbox.h" -#include "main_window.h" +#include "MainWindow.h" #include "tooltip.h" #include "LfoController.h" #include "ControllerDialog.h" -#include "mv_base.h" #include "knob.h" -#include "tempo_sync_knob.h" +#include "TempoSyncKnob.h" #include "pixmap_button.h" const int CD_ENV_KNOBS_LBL_Y = 20; @@ -80,7 +79,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent m_baseKnob->setWhatsThis( tr("todo") ); - m_speedKnob = new tempoSyncKnob( knobBright_26, this ); + m_speedKnob = new TempoSyncKnob( knobBright_26, this ); m_speedKnob->setLabel( tr( "SPD" ) ); m_speedKnob->move( CD_LFO_SPEED_CD_KNOB_X, CD_LFO_CD_KNOB_Y ); m_speedKnob->setHintText( tr( "LFO-speed:" ) + " ", "" ); diff --git a/src/gui/main_window.cpp b/src/gui/MainWindow.cpp similarity index 90% rename from src/gui/main_window.cpp rename to src/gui/MainWindow.cpp index 5595a1ce0..d480fe109 100644 --- a/src/gui/main_window.cpp +++ b/src/gui/MainWindow.cpp @@ -37,14 +37,14 @@ #include #include -#include "main_window.h" +#include "MainWindow.h" #include "bb_editor.h" #include "song_editor.h" #include "song.h" #include "piano_roll.h" #include "embed.h" #include "engine.h" -#include "fx_mixer_view.h" +#include "FxMixerView.h" #include "about_dialog.h" #include "ControllerRackView.h" #include "file_browser.h" @@ -52,20 +52,20 @@ #include "side_bar.h" #include "config_mgr.h" #include "mixer.h" -#include "plugin_view.h" +#include "PluginView.h" #include "project_notes.h" #include "setup_dialog.h" #include "AudioDummy.h" -#include "tool.h" +#include "ToolPlugin.h" #include "tool_button.h" -#include "project_journal.h" +#include "ProjectJournal.h" #include "automation_editor.h" #include "templates.h" -mainWindow::mainWindow( void ) : +MainWindow::MainWindow( void ) : m_workspace( NULL ), m_templatesMenu( NULL ), m_recentlyOpenedProjectsMenu( NULL ), @@ -187,12 +187,12 @@ mainWindow::mainWindow( void ) : -mainWindow::~mainWindow() +MainWindow::~MainWindow() { - for( QList::iterator it = m_tools.begin(); + for( QList::iterator it = m_tools.begin(); it != m_tools.end(); ++it ) { - model * m = ( *it )->getModel(); + Model * m = ( *it )->model(); delete *it; delete m; } @@ -204,7 +204,7 @@ mainWindow::~mainWindow() -void mainWindow::finalize( void ) +void MainWindow::finalize( void ) { resetWindowTitle(); setWindowIcon( embed::getIconPixmap( "icon" ) ); @@ -273,17 +273,17 @@ void mainWindow::finalize( void ) m_toolsMenu = new QMenu( this ); - QVector pluginDescriptors; - plugin::getDescriptorsOfAvailPlugins( pluginDescriptors ); - for( QVector::iterator it = + QVector pluginDescriptors; + Plugin::getDescriptorsOfAvailPlugins( pluginDescriptors ); + for( QVector::iterator it = pluginDescriptors.begin(); it != pluginDescriptors.end(); ++it ) { - if( it->type == plugin::Tool ) + if( it->type == Plugin::Tool ) { m_toolsMenu->addAction( it->logo->pixmap(), it->displayName ); - m_tools.push_back( tool::instantiate( it->name, + m_tools.push_back( ToolPlugin::instantiate( it->name, /*this*/NULL )->createView( this ) ); } } @@ -502,7 +502,7 @@ void mainWindow::finalize( void ) -int mainWindow::addWidgetToToolBar( QWidget * _w, int _row, int _col ) +int MainWindow::addWidgetToToolBar( QWidget * _w, int _row, int _col ) { int col = ( _col == -1 ) ? m_toolBarLayout->columnCount() + 7 : _col; if( _w->height() > 32 || _row == -1 ) @@ -519,7 +519,7 @@ int mainWindow::addWidgetToToolBar( QWidget * _w, int _row, int _col ) -void mainWindow::addSpacingToToolBar( int _size ) +void MainWindow::addSpacingToToolBar( int _size ) { m_toolBarLayout->setColumnMinimumWidth( m_toolBarLayout->columnCount() + 7, _size ); @@ -528,7 +528,7 @@ void mainWindow::addSpacingToToolBar( int _size ) -void mainWindow::resetWindowTitle( void ) +void MainWindow::resetWindowTitle( void ) { QString title = ""; if( engine::getSong()->projectFileName() != "" ) @@ -550,7 +550,7 @@ void mainWindow::resetWindowTitle( void ) -bool mainWindow::mayChangeProject( void ) +bool MainWindow::mayChangeProject( void ) { if( !engine::getSong()->isModified() ) { @@ -583,7 +583,7 @@ bool mainWindow::mayChangeProject( void ) -void mainWindow::clearKeyModifiers( void ) +void MainWindow::clearKeyModifiers( void ) { m_keyMods.m_ctrl = FALSE; m_keyMods.m_shift = FALSE; @@ -593,7 +593,7 @@ void mainWindow::clearKeyModifiers( void ) -void mainWindow::saveWidgetState( QWidget * _w, QDomElement & _de ) +void MainWindow::saveWidgetState( QWidget * _w, QDomElement & _de ) { if( _w->parentWidget() != NULL && _w->parentWidget()->inherits( "QMdiSubWindow" ) ) @@ -614,7 +614,7 @@ void mainWindow::saveWidgetState( QWidget * _w, QDomElement & _de ) -void mainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de ) +void MainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de ) { QRect r( qMax( 0, _de.attribute( "x" ).toInt() ), qMax( 0, _de.attribute( "y" ).toInt() ), @@ -643,7 +643,7 @@ void mainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de ) -void mainWindow::createNewProject( void ) +void MainWindow::createNewProject( void ) { if( mayChangeProject() ) { @@ -654,7 +654,7 @@ void mainWindow::createNewProject( void ) -void mainWindow::createNewProjectFromTemplate( QAction * _idx ) +void MainWindow::createNewProjectFromTemplate( QAction * _idx ) { if( m_templatesMenu != NULL && mayChangeProject() ) { @@ -671,7 +671,7 @@ void mainWindow::createNewProjectFromTemplate( QAction * _idx ) -void mainWindow::openProject( void ) +void MainWindow::openProject( void ) { if( mayChangeProject() ) { @@ -693,7 +693,7 @@ void mainWindow::openProject( void ) -void mainWindow::updateRecentlyOpenedProjectsMenu( void ) +void MainWindow::updateRecentlyOpenedProjectsMenu( void ) { m_recentlyOpenedProjectsMenu->clear(); QStringList rup = configManager::inst()->recentlyOpenedProjects(); @@ -707,7 +707,7 @@ void mainWindow::updateRecentlyOpenedProjectsMenu( void ) -void mainWindow::openRecentlyOpenedProject( QAction * _action ) +void MainWindow::openRecentlyOpenedProject( QAction * _action ) { const QString & f = _action->text(); setCursor( Qt::WaitCursor ); @@ -719,7 +719,7 @@ void mainWindow::openRecentlyOpenedProject( QAction * _action ) -bool mainWindow::saveProject( void ) +bool MainWindow::saveProject( void ) { if( engine::getSong()->projectFileName() == "" ) { @@ -735,7 +735,7 @@ bool mainWindow::saveProject( void ) -bool mainWindow::saveProjectAs( void ) +bool MainWindow::saveProjectAs( void ) { QFileDialog sfd( this, tr( "Save project" ), "", tr( "MultiMedia Project (*.mmp *.mmpz);;" @@ -766,7 +766,7 @@ bool mainWindow::saveProjectAs( void ) -void mainWindow::showSettingsDialog( void ) +void MainWindow::showSettingsDialog( void ) { setupDialog sd; sd.exec(); @@ -775,7 +775,7 @@ void mainWindow::showSettingsDialog( void ) -void mainWindow::aboutLMMS( void ) +void MainWindow::aboutLMMS( void ) { aboutDialog().exec(); } @@ -783,7 +783,7 @@ void mainWindow::aboutLMMS( void ) -void mainWindow::help( void ) +void MainWindow::help( void ) { QMessageBox::information( this, tr( "Help not available" ), tr( "Currently there's no help " @@ -797,7 +797,7 @@ void mainWindow::help( void ) -void mainWindow::toggleWindow( QWidget * _w ) +void MainWindow::toggleWindow( QWidget * _w ) { if( m_workspace->activeSubWindow() != _w->parentWidget() || _w->parentWidget()->isHidden() ) @@ -815,7 +815,7 @@ void mainWindow::toggleWindow( QWidget * _w ) -void mainWindow::toggleBBEditorWin( void ) +void MainWindow::toggleBBEditorWin( void ) { toggleWindow( engine::getBBEditor() ); } @@ -823,7 +823,7 @@ void mainWindow::toggleBBEditorWin( void ) -void mainWindow::toggleSongEditorWin( void ) +void MainWindow::toggleSongEditorWin( void ) { toggleWindow( engine::getSongEditor() ); } @@ -831,7 +831,7 @@ void mainWindow::toggleSongEditorWin( void ) -void mainWindow::toggleProjectNotesWin( void ) +void MainWindow::toggleProjectNotesWin( void ) { toggleWindow( engine::getProjectNotes() ); } @@ -839,7 +839,7 @@ void mainWindow::toggleProjectNotesWin( void ) -void mainWindow::togglePianoRollWin( void ) +void MainWindow::togglePianoRollWin( void ) { toggleWindow( engine::getPianoRoll() ); } @@ -847,7 +847,7 @@ void mainWindow::togglePianoRollWin( void ) -void mainWindow::toggleAutomationEditorWin( void ) +void MainWindow::toggleAutomationEditorWin( void ) { toggleWindow( engine::getAutomationEditor() ); } @@ -855,15 +855,15 @@ void mainWindow::toggleAutomationEditorWin( void ) -void mainWindow::toggleFxMixerWin( void ) +void MainWindow::toggleFxMixerWin( void ) { - toggleWindow( engine::getFxMixerView() ); + toggleWindow( engine::fxMixerView() ); } -void mainWindow::toggleControllerRack( void ) +void MainWindow::toggleControllerRack( void ) { toggleWindow( engine::getControllerRackView() ); } @@ -871,23 +871,23 @@ void mainWindow::toggleControllerRack( void ) -void mainWindow::undo( void ) +void MainWindow::undo( void ) { - engine::getProjectJournal()->undo(); + engine::projectJournal()->undo(); } -void mainWindow::redo( void ) +void MainWindow::redo( void ) { - engine::getProjectJournal()->redo(); + engine::projectJournal()->redo(); } -void mainWindow::closeEvent( QCloseEvent * _ce ) +void MainWindow::closeEvent( QCloseEvent * _ce ) { if( mayChangeProject() ) { @@ -902,7 +902,7 @@ void mainWindow::closeEvent( QCloseEvent * _ce ) -void mainWindow::focusOutEvent( QFocusEvent * _fe ) +void MainWindow::focusOutEvent( QFocusEvent * _fe ) { // when loosing focus we do not receive key-(release!)-events anymore, // so we might miss release-events of one the modifiers we're watching! @@ -913,7 +913,7 @@ void mainWindow::focusOutEvent( QFocusEvent * _fe ) -void mainWindow::keyPressEvent( QKeyEvent * _ke ) +void MainWindow::keyPressEvent( QKeyEvent * _ke ) { switch( _ke->key() ) { @@ -928,7 +928,7 @@ void mainWindow::keyPressEvent( QKeyEvent * _ke ) -void mainWindow::keyReleaseEvent( QKeyEvent * _ke ) +void MainWindow::keyReleaseEvent( QKeyEvent * _ke ) { switch( _ke->key() ) { @@ -943,7 +943,7 @@ void mainWindow::keyReleaseEvent( QKeyEvent * _ke ) -void mainWindow::timerEvent( QTimerEvent * ) +void MainWindow::timerEvent( QTimerEvent * ) { emit periodicUpdate(); } @@ -951,7 +951,7 @@ void mainWindow::timerEvent( QTimerEvent * ) -void mainWindow::fillTemplatesMenu( void ) +void MainWindow::fillTemplatesMenu( void ) { m_templatesMenu->clear(); @@ -989,9 +989,9 @@ void mainWindow::fillTemplatesMenu( void ) -void mainWindow::showTool( QAction * _idx ) +void MainWindow::showTool( QAction * _idx ) { - pluginView * p = m_tools[m_toolsMenu->actions().indexOf( _idx )]; + PluginView * p = m_tools[m_toolsMenu->actions().indexOf( _idx )]; p->show(); p->parentWidget()->show(); p->setFocus(); @@ -1000,7 +1000,7 @@ void mainWindow::showTool( QAction * _idx ) -void mainWindow::browseHelp( void ) +void MainWindow::browseHelp( void ) { // file:// alternative for offline help QString url = "http://lmms.sf.net/wiki/index.php?title=Main_Page"; @@ -1011,7 +1011,7 @@ void mainWindow::browseHelp( void ) -#include "moc_main_window.cxx" +#include "moc_MainWindow.cxx" #endif diff --git a/src/core/mv_base.cpp b/src/gui/ModelView.cpp similarity index 67% rename from src/core/mv_base.cpp rename to src/gui/ModelView.cpp index 6ee6137bb..c8be075f4 100644 --- a/src/core/mv_base.cpp +++ b/src/gui/ModelView.cpp @@ -1,8 +1,8 @@ /* - * mv_base.cpp - base for M/V-architecture of LMMS + * ModelView.cpp - implementation of ModelView.cpp + * + * Copyright (c) 2007-2009 Tobias Doerffel * - * Copyright (c) 2007-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,39 +22,13 @@ * */ -#include - #include - -#include "mv_base.h" +#include "ModelView.h" -QString model::fullDisplayName( void ) const -{ - const QString & n = displayName(); - if( parentModel() ) - { - const QString p = parentModel()->fullDisplayName(); - if( n.isEmpty() && p.isEmpty() ) - { - return QString::null; - } - else if( p.isEmpty() ) - { - return( n ); - } - return p + ">" + n; - } - return n; -} - - - - - -modelView::modelView( model * _model, QWidget * _this ) : +ModelView::ModelView( Model * _model, QWidget * _this ) : m_widget( _this ), m_model( _model ) { @@ -63,7 +37,7 @@ modelView::modelView( model * _model, QWidget * _this ) : -modelView::~modelView() +ModelView::~ModelView() { if( m_model != NULL && m_model->defaultConstructed() ) { @@ -74,7 +48,7 @@ modelView::~modelView() -void modelView::setModel( model * _model, bool _old_model_valid ) +void ModelView::setModel( Model * _model, bool _old_model_valid ) { if( _old_model_valid && m_model != NULL ) { @@ -99,7 +73,7 @@ void modelView::setModel( model * _model, bool _old_model_valid ) -void modelView::doConnections( void ) +void ModelView::doConnections() { if( m_model != NULL ) { @@ -112,5 +86,3 @@ void modelView::doConnections( void ) } -#include "moc_mv_base.cxx" - diff --git a/src/gui/PeakControllerDialog.cpp b/src/gui/PeakControllerDialog.cpp index 6180bbf40..f2ca2beab 100644 --- a/src/gui/PeakControllerDialog.cpp +++ b/src/gui/PeakControllerDialog.cpp @@ -34,17 +34,16 @@ #include "gui_templates.h" #include "embed.h" #include "engine.h" -#include "main_window.h" +#include "MainWindow.h" #include "tooltip.h" - #include "PeakController.h" #include "ControllerDialog.h" -#include "mv_base.h" #include "knob.h" -#include "tempo_sync_knob.h" +#include "TempoSyncKnob.h" #include "pixmap_button.h" + PeakControllerDialog::PeakControllerDialog( Controller * _model, QWidget * _parent ) : ControllerDialog( _model, _parent ) { diff --git a/src/core/piano.cpp b/src/gui/PianoView.cpp similarity index 79% rename from src/core/piano.cpp rename to src/gui/PianoView.cpp index 48817bea6..baeacea71 100644 --- a/src/core/piano.cpp +++ b/src/gui/PianoView.cpp @@ -1,10 +1,8 @@ -#ifndef SINGLE_SOURCE_COMPILE - /* - * piano.cpp - implementation of piano-widget used in instrument-track-window - * for testing + * Piano.cpp - implementation of piano-widget used in instrument-track-window + * for testing + according model class * - * Copyright (c) 2004-2008 Tobias Doerffel + * Copyright (c) 2004-2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -38,24 +36,23 @@ * \todo write isWhite inline function and replace throughout */ -#include "piano.h" - #include #include #include #include +#include -#include "automation_pattern.h" +#include "PianoView.h" #include "caption_menu.h" #include "embed.h" #include "engine.h" #include "gui_templates.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "knob.h" #include "string_pair_drag.h" -#include "main_window.h" +#include "MainWindow.h" #include "midi.h" #include "templates.h" #include "update_event.h" @@ -68,12 +65,14 @@ /*! The black / white order of keys as they appear on the keyboard. */ -const KeyTypes KEY_ORDER[] = +const Piano::KeyTypes KEY_ORDER[] = { - // C CIS D DIS E F - WhiteKey, BlackKey, WhiteKey, BlackKey, WhiteKey, WhiteKey, - // FIS G GIS A B H - BlackKey, WhiteKey, BlackKey, WhiteKey, BlackKey, WhiteKey +// C CIS D DIS + Piano::WhiteKey, Piano::BlackKey, Piano::WhiteKey, Piano::BlackKey, +// E F FIS G + Piano::WhiteKey, Piano::WhiteKey, Piano::BlackKey, Piano::WhiteKey, +// GIS A B H + Piano::BlackKey, Piano::WhiteKey, Piano::BlackKey, Piano::WhiteKey } ; @@ -85,10 +84,10 @@ Keys WhiteKeys[] = } ; -QPixmap * pianoView::s_whiteKeyPm = NULL; /*!< A white key released */ -QPixmap * pianoView::s_blackKeyPm = NULL; /*!< A black key released */ -QPixmap * pianoView::s_whiteKeyPressedPm = NULL; /*!< A white key pressed */ -QPixmap * pianoView::s_blackKeyPressedPm = NULL; /*!< A black key pressed */ +QPixmap * PianoView::s_whiteKeyPm = NULL; /*!< A white key released */ +QPixmap * PianoView::s_blackKeyPm = NULL; /*!< A black key released */ +QPixmap * PianoView::s_whiteKeyPressedPm = NULL; /*!< A white key pressed */ +QPixmap * PianoView::s_blackKeyPressedPm = NULL; /*!< A black key pressed */ const int PIANO_BASE = 11; /*!< The height of the root note display */ @@ -101,127 +100,55 @@ const int LABEL_TEXT_SIZE = 7; /*!< The height of the key label text */ -/*! \brief Create a new keyboard display - * - * \param _it the InstrumentTrack window to attach to - */ -piano::piano( instrumentTrack * _it ) : - model( _it ), /*!< our model */ - m_instrumentTrack( _it ) /*!< the instrumentTrack model */ -{ - for( int i = 0; i < KeysPerOctave * NumOctaves; ++i ) - { - m_pressedKeys[i] = FALSE; - } - -} - - - - -/*! \brief Destroy this new keyboard display - * - */ -piano::~piano() -{ -} - - - - -/*! \brief Turn a key on or off - * - * \param _key the key number to change - * \param _on the state to set the key to - */ -void piano::setKeyState( int _key, bool _on ) -{ - m_pressedKeys[tLimit( _key, 0, KeysPerOctave * NumOctaves - 1 )] = _on; - emit dataChanged(); -} - - - - -/*! \brief Handle a note being pressed on our keyboard display - * - * \param _key the key being pressed - */ -void piano::handleKeyPress( int _key ) -{ - m_instrumentTrack->processInEvent( midiEvent( MidiNoteOn, 0, _key, - MidiMaxVelocity ), midiTime() ); - m_pressedKeys[_key] = TRUE; -} - - - - - -/*! \brief Handle a note being released on our keyboard display - * - * \param _key the key being releassed - */ -void piano::handleKeyRelease( int _key ) -{ - m_instrumentTrack->processInEvent( midiEvent( MidiNoteOff, 0, _key, 0 ), - midiTime() ); - m_pressedKeys[_key] = FALSE; -} - - - - - - - /*! \brief Create a new keyboard display view * * \param _parent the parent instrument plugin window * \todo are the descriptions of the m_startkey and m_lastkey properties correct? */ -pianoView::pianoView( QWidget * _parent ) : +PianoView::PianoView( QWidget * _parent ) : QWidget( _parent ), /*!< Our parent */ - modelView( NULL, this ), /*!< Our view model */ - m_piano( NULL ), /*!< Our piano model */ + ModelView( NULL, this ), /*!< Our view Model */ + m_piano( NULL ), /*!< Our piano Model */ m_startKey( Key_C + Octave_3*KeysPerOctave ), /*!< The first key displayed? */ m_lastKey( -1 ) /*!< The last key displayed? */ { if( s_whiteKeyPm == NULL ) { - s_whiteKeyPm = new QPixmap( embed::getIconPixmap( - "white_key" ) ); + s_whiteKeyPm = new QPixmap( embed::getIconPixmap( "white_key" ) ); } if( s_blackKeyPm == NULL ) { - s_blackKeyPm = new QPixmap( embed::getIconPixmap( - "black_key" ) ); + s_blackKeyPm = new QPixmap( embed::getIconPixmap( "black_key" ) ); } if( s_whiteKeyPressedPm == NULL ) { - s_whiteKeyPressedPm = new QPixmap( embed::getIconPixmap( - "white_key_pressed" ) ); + s_whiteKeyPressedPm = new QPixmap( embed::getIconPixmap( "white_key_pressed" ) ); } if ( s_blackKeyPressedPm == NULL ) { - s_blackKeyPressedPm = new QPixmap( embed::getIconPixmap( - "black_key_pressed" ) ); + s_blackKeyPressedPm = new QPixmap( embed::getIconPixmap( "black_key_pressed" ) ); } setAttribute( Qt::WA_OpaquePaintEvent, true ); setFocusPolicy( Qt::StrongFocus ); + setMaximumWidth( WhiteKeysPerOctave * NumOctaves * PW_WHITE_KEY_WIDTH ); + // create scrollbar at the bottom m_pianoScroll = new QScrollBar( Qt::Horizontal, this ); - m_pianoScroll->setRange( 0, WhiteKeysPerOctave * ( NumOctaves - 3 ) - - 5 ); m_pianoScroll->setSingleStep( 1 ); m_pianoScroll->setPageStep( 20 ); m_pianoScroll->setValue( Octave_3 * WhiteKeysPerOctave ); - m_pianoScroll->setGeometry( 0, PIANO_BASE + PW_WHITE_KEY_HEIGHT, 250, - 16 ); - // ...and connect it to this widget... + + // and connect it to this widget connect( m_pianoScroll, SIGNAL( valueChanged( int ) ), - this, SLOT( pianoScrolled( int ) ) ); + this, SLOT( pianoScrolled( int ) ) ); + + // create a layout for ourselves + QVBoxLayout * layout = new QVBoxLayout( this ); + layout->setSpacing( 0 ); + layout->setMargin( 0 ); + layout->addSpacing( PIANO_BASE+PW_WHITE_KEY_HEIGHT ); + layout->addWidget( m_pianoScroll ); } @@ -231,7 +158,7 @@ pianoView::pianoView( QWidget * _parent ) : /*! \brief Destroy this piano display view * */ -pianoView::~pianoView() +PianoView::~PianoView() { } @@ -244,7 +171,7 @@ pianoView::~pianoView() * \todo check the scan codes for ',' = c, 'L' = c#, '.' = d, ':' = d#, * '/' = d, '[' = f', '=' = f'#, ']' = g' - Paul's additions */ -int pianoView::getKeyFromKeyEvent( QKeyEvent * _ke ) +int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke ) { #ifdef LMMS_BUILD_APPLE const int k = _ke->nativeVirtualKey(); @@ -379,9 +306,9 @@ int pianoView::getKeyFromKeyEvent( QKeyEvent * _ke ) /*! \brief Register a change to this piano display view * */ -void pianoView::modelChanged( void ) +void PianoView::modelChanged() { - m_piano = castModel(); + m_piano = castModel(); if( m_piano != NULL ) { connect( m_piano->m_instrumentTrack->baseNoteModel(), @@ -413,13 +340,14 @@ void pianoView::modelChanged( void ) * * \param _p The point that the mouse was pressed. */ -int pianoView::getKeyFromMouse( const QPoint & _p ) const +int PianoView::getKeyFromMouse( const QPoint & _p ) const { int key_num = (int)( (float) _p.x() / (float) PW_WHITE_KEY_WIDTH ); for( int i = 0; i <= key_num; ++i ) { - if( KEY_ORDER[( m_startKey+i ) % KeysPerOctave] == BlackKey ) + if( KEY_ORDER[( m_startKey+i ) % KeysPerOctave] == + Piano::BlackKey ) { ++key_num; } @@ -432,17 +360,17 @@ int pianoView::getKeyFromMouse( const QPoint & _p ) const { // then do extra checking whether the mouse-cursor is over // a black key - if( key_num > 0 && KEY_ORDER[( key_num - 1 ) % KeysPerOctave] == - BlackKey && + if( key_num > 0 && KEY_ORDER[(key_num-1 ) % KeysPerOctave] == + Piano::BlackKey && _p.x() % PW_WHITE_KEY_WIDTH <= ( PW_WHITE_KEY_WIDTH / 2 ) - ( PW_BLACK_KEY_WIDTH / 2 ) ) { --key_num; } - if( key_num < KeysPerOctave * NumOctaves - 1 && + if( key_num < NumKeys - 1 && KEY_ORDER[( key_num + 1 ) % KeysPerOctave] == - BlackKey && + Piano::BlackKey && _p.x() % PW_WHITE_KEY_WIDTH >= ( PW_WHITE_KEY_WIDTH - PW_BLACK_KEY_WIDTH / 2 ) ) @@ -452,7 +380,7 @@ int pianoView::getKeyFromMouse( const QPoint & _p ) const } // some range-checking-stuff - return tLimit( key_num, 0, KeysPerOctave * NumOctaves - 1 ); + return tLimit( key_num, 0, NumKeys - 1 ); } @@ -465,7 +393,7 @@ int pianoView::getKeyFromMouse( const QPoint & _p ) const * * \param _new_pos the new key position. */ -void pianoView::pianoScrolled( int _new_pos ) +void PianoView::pianoScrolled( int _new_pos ) { m_startKey = WhiteKeys[_new_pos % WhiteKeysPerOctave]+ ( _new_pos / WhiteKeysPerOctave ) * KeysPerOctave; @@ -481,7 +409,7 @@ void pianoView::pianoScrolled( int _new_pos ) * \param _me the ContextMenuEvent to handle. * \todo Is this right, or does this create the context menu? */ -void pianoView::contextMenuEvent( QContextMenuEvent * _me ) +void PianoView::contextMenuEvent( QContextMenuEvent * _me ) { if( _me->pos().y() > PIANO_BASE || m_piano == NULL ) { @@ -490,7 +418,7 @@ void pianoView::contextMenuEvent( QContextMenuEvent * _me ) } captionMenu contextMenu( tr( "Base note" ) ); - automatableModelView amv( m_piano->m_instrumentTrack->baseNoteModel(), + AutomatableModelView amv( m_piano->m_instrumentTrack->baseNoteModel(), &contextMenu ); amv.addDefaultActions( &contextMenu ); contextMenu.exec( QCursor::pos() ); @@ -517,7 +445,7 @@ void pianoView::contextMenuEvent( QContextMenuEvent * _me ) * * \param _me the mouse click to handle. */ -void pianoView::mousePressEvent( QMouseEvent * _me ) +void PianoView::mousePressEvent( QMouseEvent * _me ) { if( _me->button() == Qt::LeftButton && m_piano != NULL ) { @@ -528,16 +456,16 @@ void pianoView::mousePressEvent( QMouseEvent * _me ) int y_diff = _me->pos().y() - PIANO_BASE; int velocity = (int)( ( float ) y_diff / ( ( KEY_ORDER[key_num % KeysPerOctave] == - WhiteKey ) ? + Piano::WhiteKey ) ? PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) * (float) MidiMaxVelocity ); if( y_diff < 0 ) { velocity = 0; } - else if( y_diff > ( ( KEY_ORDER[key_num % - KeysPerOctave] == - WhiteKey ) ? + else if( y_diff > + ( ( KEY_ORDER[key_num % KeysPerOctave] == + Piano::WhiteKey ) ? PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) ) { velocity = MidiMaxVelocity; @@ -547,8 +475,10 @@ void pianoView::mousePressEvent( QMouseEvent * _me ) midiEvent( MidiNoteOn, 0, key_num, velocity ), midiTime() ); - m_piano->m_pressedKeys[key_num] = TRUE; + m_piano->m_pressedKeys[key_num] = true; m_lastKey = key_num; + + emit keyPressed( key_num ); } else { @@ -566,6 +496,8 @@ void pianoView::mousePressEvent( QMouseEvent * _me ) m_piano->m_instrumentTrack-> baseNoteModel()-> setInitValue( (float) key_num ); + + emit baseNoteChanged(); } } @@ -585,16 +517,16 @@ void pianoView::mousePressEvent( QMouseEvent * _me ) * * \param _me the mousePressEvent to handle. */ -void pianoView::mouseReleaseEvent( QMouseEvent * ) +void PianoView::mouseReleaseEvent( QMouseEvent * ) { if( m_lastKey != -1 ) { if( m_piano != NULL ) { - m_piano->m_instrumentTrack->processInEvent( + m_piano->m_midiEvProc->processInEvent( midiEvent( MidiNoteOff, 0, m_lastKey, 0 ), midiTime() ); - m_piano->m_pressedKeys[m_lastKey] = FALSE; + m_piano->m_pressedKeys[m_lastKey] = false; } // and let the user see that he released a key... :) @@ -621,7 +553,7 @@ void pianoView::mouseReleaseEvent( QMouseEvent * ) * reduce or remove the duplication between this, the mousePressEvent() * and mouseReleaseEvent() methods. */ -void pianoView::mouseMoveEvent( QMouseEvent * _me ) +void PianoView::mouseMoveEvent( QMouseEvent * _me ) { if( m_piano == NULL ) { @@ -631,7 +563,7 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me ) int key_num = getKeyFromMouse( _me->pos() ); int y_diff = _me->pos().y() - PIANO_BASE; int velocity = (int)( (float) y_diff / - ( ( KEY_ORDER[key_num % KeysPerOctave] == WhiteKey ) ? + ( ( KEY_ORDER[key_num % KeysPerOctave] == Piano::WhiteKey ) ? PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) * (float) MidiMaxVelocity ); // maybe the user moved the mouse-cursor above or under the @@ -642,7 +574,7 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me ) velocity = 0; } else if( y_diff > - ( ( KEY_ORDER[key_num % KeysPerOctave] == WhiteKey ) ? + ( ( KEY_ORDER[key_num % KeysPerOctave] == Piano::WhiteKey ) ? PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) ) { velocity = MidiMaxVelocity; @@ -654,21 +586,21 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me ) { if( m_lastKey != -1 ) { - m_piano->m_instrumentTrack->processInEvent( + m_piano->m_midiEvProc->processInEvent( midiEvent( MidiNoteOff, 0, m_lastKey, 0 ), midiTime() ); - m_piano->m_pressedKeys[m_lastKey] = FALSE; + m_piano->m_pressedKeys[m_lastKey] = false; m_lastKey = -1; } if( _me->buttons() & Qt::LeftButton ) { if( _me->pos().y() > PIANO_BASE ) { - m_piano->m_instrumentTrack->processInEvent( + m_piano->m_midiEvProc->processInEvent( midiEvent( MidiNoteOn, 0, key_num, velocity ), midiTime() ); - m_piano->m_pressedKeys[key_num] = TRUE; + m_piano->m_pressedKeys[key_num] = true; m_lastKey = key_num; } else @@ -681,9 +613,9 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me ) // and let the user see that he pressed a key... :) update(); } - else if( m_piano->m_pressedKeys[key_num] == TRUE ) + else if( m_piano->m_pressedKeys[key_num] == true ) { - m_piano->m_instrumentTrack->processInEvent( + m_piano->m_midiEvProc->processInEvent( midiEvent( MidiKeyPressure, 0, key_num, velocity ), midiTime() ); @@ -702,12 +634,12 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me ) * * \param _ke the KeyEvent to handle. */ -void pianoView::keyPressEvent( QKeyEvent * _ke ) +void PianoView::keyPressEvent( QKeyEvent * _ke ) { const int key_num = getKeyFromKeyEvent( _ke ) + ( DefaultOctave - 1 ) * KeysPerOctave; - if( _ke->isAutoRepeat() == FALSE && key_num > -1 ) + if( _ke->isAutoRepeat() == false && key_num > -1 ) { if( m_piano != NULL ) { @@ -730,11 +662,11 @@ void pianoView::keyPressEvent( QKeyEvent * _ke ) * * \param _ke the KeyEvent to handle. */ -void pianoView::keyReleaseEvent( QKeyEvent * _ke ) +void PianoView::keyReleaseEvent( QKeyEvent * _ke ) { const int key_num = getKeyFromKeyEvent( _ke ) + ( DefaultOctave - 1 ) * KeysPerOctave; - if( _ke->isAutoRepeat() == FALSE && key_num > -1 ) + if( _ke->isAutoRepeat() == false && key_num > -1 ) { if( m_piano != NULL ) { @@ -757,7 +689,7 @@ void pianoView::keyReleaseEvent( QKeyEvent * _ke ) * * \todo Is there supposed to be a parameter given here? */ -void pianoView::focusOutEvent( QFocusEvent * ) +void PianoView::focusOutEvent( QFocusEvent * ) { if( m_piano == NULL ) { @@ -779,14 +711,14 @@ void pianoView::focusOutEvent( QFocusEvent * ) // if we loose focus, we HAVE to note off all running notes because // we don't receive key-release-events anymore and so the notes would // hang otherwise - for( int i = 0; i < KeysPerOctave * NumOctaves; ++i ) + for( int i = 0; i < NumKeys; ++i ) { - if( m_piano->m_pressedKeys[i] == TRUE ) + if( m_piano->m_pressedKeys[i] == true ) { - m_piano->m_instrumentTrack->processInEvent( + m_piano->m_midiEvProc->processInEvent( midiEvent( MidiNoteOff, 0, i, 0 ), midiTime() ); - m_piano->m_pressedKeys[i] = FALSE; + m_piano->m_pressedKeys[i] = false; } } update(); @@ -795,6 +727,24 @@ void pianoView::focusOutEvent( QFocusEvent * ) +/*! \brief update scrollbar range after resize + * + * After resizing we need to adjust range of scrollbar for not allowing + * to scroll too far to the right. + * + * \param _event resize-event object (unused) + */ +void PianoView::resizeEvent( QResizeEvent * _event ) +{ + QWidget::resizeEvent( _event ); + m_pianoScroll->setRange( 0, WhiteKeysPerOctave * NumOctaves - + (int) ceil( (float) width() / + PW_WHITE_KEY_WIDTH ) ); +} + + + + /*! \brief Convert a key number to an X coordinate in the piano display view * * We can immediately discard the trivial case of when the key number is @@ -809,7 +759,7 @@ void pianoView::focusOutEvent( QFocusEvent * ) * \todo is this description of what the method does correct? * \todo replace the final subtract with initialising x to width/2. */ -int pianoView::getKeyX( int _key_num ) const +int PianoView::getKeyX( int _key_num ) const { int k = m_startKey; if( _key_num < m_startKey ) @@ -822,7 +772,7 @@ int pianoView::getKeyX( int _key_num ) const while( k <= _key_num ) { - if( KEY_ORDER[k % KeysPerOctave] == WhiteKey ) + if( KEY_ORDER[k % KeysPerOctave] == Piano::WhiteKey ) { ++white_cnt; if( white_cnt > 1 ) @@ -858,7 +808,7 @@ int pianoView::getKeyX( int _key_num ) const * * \todo Is there supposed to be a parameter given here? */ -void pianoView::paintEvent( QPaintEvent * ) +void PianoView::paintEvent( QPaintEvent * ) { QPainter p( this ); @@ -886,7 +836,7 @@ void pianoView::paintEvent( QPaintEvent * ) g.setColorAt( 0, QColor( 0, 96, 0 ) ); g.setColorAt( 0.1, QColor( 64, 255, 64 ) ); g.setColorAt( 1, QColor( 0, 96, 0 ) ); - if( KEY_ORDER[base_key % KeysPerOctave] == WhiteKey ) + if( KEY_ORDER[base_key % KeysPerOctave] == Piano::WhiteKey ) { p.fillRect( QRect( getKeyX( base_key ), 1, PW_WHITE_KEY_WIDTH-1, PIANO_BASE-2 ), g ); @@ -903,14 +853,14 @@ void pianoView::paintEvent( QPaintEvent * ) // draw all white keys... for( int x = 0; x < width(); ) { - while( KEY_ORDER[cur_key%KeysPerOctave] != WhiteKey ) + while( KEY_ORDER[cur_key%KeysPerOctave] != Piano::WhiteKey ) { ++cur_key; } // draw pressed or not pressed key, depending on state of // current key - if( m_piano && m_piano->m_pressedKeys[cur_key] == TRUE ) + if( m_piano && m_piano->m_pressedKeys[cur_key] == true ) { p.drawPixmap( x, PIANO_BASE, *s_whiteKeyPressedPm ); } @@ -939,9 +889,9 @@ void pianoView::paintEvent( QPaintEvent * ) int s_key = m_startKey; if( s_key > 0 && - KEY_ORDER[(Keys)( --s_key ) % KeysPerOctave] == BlackKey ) + KEY_ORDER[(Keys)(--s_key) % KeysPerOctave] == Piano::BlackKey ) { - if( m_piano && m_piano->m_pressedKeys[s_key] == TRUE ) + if( m_piano && m_piano->m_pressedKeys[s_key] == true ) { p.drawPixmap( 0 - PW_WHITE_KEY_WIDTH / 2, PIANO_BASE, *s_blackKeyPressedPm ); @@ -956,11 +906,11 @@ void pianoView::paintEvent( QPaintEvent * ) // now draw all black keys... for( int x = 0; x < width(); ) { - if( KEY_ORDER[cur_key%KeysPerOctave] == BlackKey ) + if( KEY_ORDER[cur_key%KeysPerOctave] == Piano::BlackKey ) { // draw pressed or not pressed key, depending on // state of current key - if( m_piano && m_piano->m_pressedKeys[cur_key] == TRUE ) + if( m_piano && m_piano->m_pressedKeys[cur_key] == true ) { p.drawPixmap( x + PW_WHITE_KEY_WIDTH / 2, PIANO_BASE, @@ -991,8 +941,5 @@ void pianoView::paintEvent( QPaintEvent * ) +#include "moc_PianoView.cxx" -#include "moc_piano.cxx" - - -#endif diff --git a/src/gui/ToolPluginView.cpp b/src/gui/ToolPluginView.cpp new file mode 100644 index 000000000..d3402a888 --- /dev/null +++ b/src/gui/ToolPluginView.cpp @@ -0,0 +1,47 @@ +/* + * ToolPluginView.cpp - implementation of ToolPluginView + * + * Copyright (c) 2006-2008 Javier Serrano Polo + * Copyright (c) 2009 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + */ + +#include "ToolPlugin.h" +#include "ToolPluginView.h" + +#include +#include + +#include "embed.h" +#include "engine.h" +#include "MainWindow.h" + + +ToolPluginView::ToolPluginView( ToolPlugin * _toolPlugin ) : + PluginView( _toolPlugin, NULL ) +{ + engine::mainWindow()->workspace()->addSubWindow( this ); + parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false ); + + setWindowTitle( _toolPlugin->displayName() ); + setWindowIcon( _toolPlugin->descriptor()->logo->pixmap() ); +} + + diff --git a/src/gui/about_dialog.cpp b/src/gui/about_dialog.cpp index 159c77ff6..819bb7cdf 100644 --- a/src/gui/about_dialog.cpp +++ b/src/gui/about_dialog.cpp @@ -27,7 +27,7 @@ #include "about_dialog.h" #include "embed.h" #include "engine.h" -#include "main_window.h" +#include "MainWindow.h" #ifdef __GNUC__ @@ -62,7 +62,7 @@ aboutDialog::aboutDialog() : - QDialog( engine::getMainWindow() ), + QDialog( engine::mainWindow() ), Ui::AboutDialog() { setupUi( this ); diff --git a/src/gui/automation_editor.cpp b/src/gui/automation_editor.cpp index 7d5a20a53..87d626034 100644 --- a/src/gui/automation_editor.cpp +++ b/src/gui/automation_editor.cpp @@ -48,7 +48,7 @@ #include "song_editor.h" -#include "main_window.h" +#include "MainWindow.h" #include "embed.h" #include "engine.h" #include "pixmap_button.h" @@ -308,7 +308,7 @@ automationEditor::automationEditor( void ) : m_quantizeComboBox->setFixedSize( 60, 22 ); // TODO: leak - comboBoxModel * quantize_model = new comboBoxModel( /* this */ ); + ComboBoxModel * quantize_model = new ComboBoxModel( /* this */ ); for( int i = 0; i < 7; ++i ) { quantize_model->addItem( "1/" + QString::number( 1 << i ) ); @@ -357,9 +357,9 @@ automationEditor::automationEditor( void ) : setMinimumSize( tb_layout->minimumSize().width(), 128 ); // add us to workspace - if( engine::getMainWindow()->workspace() ) + if( engine::mainWindow()->workspace() ) { - engine::getMainWindow()->workspace()->addSubWindow( this ); + engine::mainWindow()->workspace()->addSubWindow( this ); parentWidget()->resize( INITIAL_WIDTH, INITIAL_HEIGHT ); parentWidget()->hide(); } @@ -414,7 +414,7 @@ void automationEditor::setCurrentPattern( automationPattern * _new_pattern ) void automationEditor::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - mainWindow::saveWidgetState( this, _this ); + MainWindow::saveWidgetState( this, _this ); } @@ -422,7 +422,7 @@ void automationEditor::saveSettings( QDomDocument & _doc, QDomElement & _this ) void automationEditor::loadSettings( const QDomElement & _this ) { - mainWindow::restoreWidgetState( this, _this ); + MainWindow::restoreWidgetState( this, _this ); } diff --git a/src/gui/automation_pattern_view.cpp b/src/gui/automation_pattern_view.cpp index 1ae774206..03a6fc7c5 100644 --- a/src/gui/automation_pattern_view.cpp +++ b/src/gui/automation_pattern_view.cpp @@ -33,7 +33,7 @@ #include "embed.h" #include "engine.h" #include "gui_templates.h" -#include "project_journal.h" +#include "ProjectJournal.h" #include "rename_dialog.h" #include "string_pair_drag.h" #include "tooltip.h" @@ -69,7 +69,7 @@ automationPatternView::~automationPatternView() -void automationPatternView::update( void ) +void automationPatternView::update() { m_needsUpdate = true; if( fixedTCOs() ) @@ -82,7 +82,7 @@ void automationPatternView::update( void ) -void automationPatternView::resetName( void ) +void automationPatternView::resetName() { m_pat->setName( QString::null ); } @@ -90,7 +90,7 @@ void automationPatternView::resetName( void ) -void automationPatternView::changeName( void ) +void automationPatternView::changeName() { QString s = m_pat->name(); renameDialog rename_dlg( s ); @@ -104,13 +104,13 @@ void automationPatternView::changeName( void ) void automationPatternView::disconnectObject( QAction * _a ) { - journallingObject * j = engine::getProjectJournal()-> - getJournallingObject( _a->data().toInt() ); - if( j && dynamic_cast( j ) ) + JournallingObject * j = engine::projectJournal()-> + journallingObject( _a->data().toInt() ); + if( j && dynamic_cast( j ) ) { m_pat->m_objects.erase( qFind( m_pat->m_objects.begin(), m_pat->m_objects.end(), - dynamic_cast( j ) ) ); + dynamic_cast( j ) ) ); update(); } } @@ -309,9 +309,9 @@ void automationPatternView::dropEvent( QDropEvent * _de ) QString val = stringPairDrag::decodeValue( _de ); if( type == "automatable_model" ) { - automatableModel * mod = dynamic_cast( - engine::getProjectJournal()-> - getJournallingObject( val.toInt() ) ); + AutomatableModel * mod = dynamic_cast( + engine::projectJournal()-> + journallingObject( val.toInt() ) ); if( mod != NULL ) { m_pat->addObject( mod ); diff --git a/src/gui/bb_editor.cpp b/src/gui/bb_editor.cpp index 5760c22be..08cce140d 100644 --- a/src/gui/bb_editor.cpp +++ b/src/gui/bb_editor.cpp @@ -31,7 +31,7 @@ #include "bb_editor.h" #include "bb_track_container.h" #include "embed.h" -#include "main_window.h" +#include "MainWindow.h" #include "song.h" #include "tool_button.h" @@ -112,7 +112,7 @@ bbEditor::bbEditor( bbTrackContainer * _tc ) : tb_layout->addWidget( l ); tb_layout->addSpacing( 15 ); - engine::getMainWindow()->workspace()->addSubWindow( this ); + engine::mainWindow()->workspace()->addSubWindow( this ); parentWidget()->setAttribute( Qt::WA_DeleteOnClose, FALSE ); parentWidget()->layout()->setSizeConstraint( QLayout::SetMinimumSize ); parentWidget()->resize( minimumWidth(), 300 ); diff --git a/src/gui/export_project_dialog.cpp b/src/gui/export_project_dialog.cpp index f6574e48f..3db5b6d98 100644 --- a/src/gui/export_project_dialog.cpp +++ b/src/gui/export_project_dialog.cpp @@ -27,7 +27,7 @@ #include "export_project_dialog.h" #include "engine.h" -#include "main_window.h" +#include "MainWindow.h" #include "ProjectRenderer.h" @@ -149,7 +149,7 @@ void exportProjectDialog::startBtnClicked() connect( m_renderer, SIGNAL( finished() ), this, SLOT( accept() ) ); connect( m_renderer, SIGNAL( finished() ), - engine::getMainWindow(), SLOT( resetWindowTitle() ) ); + engine::mainWindow(), SLOT( resetWindowTitle() ) ); m_renderer->startProcessing(); } @@ -164,7 +164,7 @@ void exportProjectDialog::startBtnClicked() void exportProjectDialog::updateTitleBar( int _prog ) { - engine::getMainWindow()->setWindowTitle( + engine::mainWindow()->setWindowTitle( tr( "Rendering: %1%" ).arg( _prog ) ); } diff --git a/src/gui/file_browser.cpp b/src/gui/file_browser.cpp index 19f935683..6726fbd0f 100644 --- a/src/gui/file_browser.cpp +++ b/src/gui/file_browser.cpp @@ -39,10 +39,10 @@ #include "embed.h" #include "engine.h" #include "gui_templates.h" -#include "import_filter.h" -#include "instrument.h" -#include "instrument_track.h" -#include "main_window.h" +#include "ImportFilter.h" +#include "Instrument.h" +#include "InstrumentTrack.h" +#include "MainWindow.h" #include "mmp.h" #include "preset_preview_play_handle.h" #include "sample_play_handle.h" @@ -542,13 +542,13 @@ void fileBrowserTreeWidget::mouseReleaseEvent( QMouseEvent * _me ) -void fileBrowserTreeWidget::handleFile( fileItem * f, instrumentTrack * _it ) +void fileBrowserTreeWidget::handleFile( fileItem * f, InstrumentTrack * _it ) { engine::getMixer()->lock(); switch( f->handling() ) { case fileItem::LoadAsProject: - if( engine::getMainWindow()->mayChangeProject() ) + if( engine::mainWindow()->mayChangeProject() ) { engine::getSong()->loadProject( f->fullName() ); } @@ -557,9 +557,9 @@ void fileBrowserTreeWidget::handleFile( fileItem * f, instrumentTrack * _it ) case fileItem::LoadByPlugin: { const QString e = f->extension(); - instrument * i = _it->getInstrument(); + Instrument * i = _it->instrument(); if( i == NULL || - !i->getDescriptor()->supportsFileType( e ) ) + !i->descriptor()->supportsFileType( e ) ) { i = _it->loadInstrument( engine::pluginFileHandling()[e] ); @@ -571,7 +571,7 @@ void fileBrowserTreeWidget::handleFile( fileItem * f, instrumentTrack * _it ) case fileItem::LoadAsPreset: { multimediaProject mmp( f->fullName() ); - instrumentTrack::removeMidiPortNode( mmp ); + InstrumentTrack::removeMidiPortNode( mmp ); _it->setSimpleSerializing(); _it->loadSettings( mmp.content().toElement() ); break; @@ -579,11 +579,11 @@ void fileBrowserTreeWidget::handleFile( fileItem * f, instrumentTrack * _it ) case fileItem::ImportAsProject: if( f->type() == fileItem::FlpFile && - !engine::getMainWindow()->mayChangeProject() ) + !engine::mainWindow()->mayChangeProject() ) { break; } - importFilter::import( f->fullName(), + ImportFilter::import( f->fullName(), engine::getSong() ); break; @@ -615,7 +615,7 @@ void fileBrowserTreeWidget::activateListItem( QTreeWidgetItem * _item, else if( f->handling() != fileItem::NotSupported ) { engine::getMixer()->lock(); - instrumentTrack * it = dynamic_cast( + InstrumentTrack * it = dynamic_cast( track::create( track::InstrumentTrack, engine::getBBTrackContainer() ) ); handleFile( f, it ); @@ -632,7 +632,7 @@ void fileBrowserTreeWidget::openInNewInstrumentTrack( trackContainer * _tc ) m_contextMenuItem->handling() == fileItem::LoadByPlugin ) { engine::getMixer()->lock(); - instrumentTrack * it = dynamic_cast( + InstrumentTrack * it = dynamic_cast( track::create( track::InstrumentTrack, _tc ) ); handleFile( m_contextMenuItem, it ); engine::getMixer()->unlock(); @@ -662,7 +662,7 @@ void fileBrowserTreeWidget::sendToActiveInstrumentTrack( void ) { // get all windows opened in the workspace QList pl = - engine::getMainWindow()->workspace()-> + engine::mainWindow()->workspace()-> subWindowList( QMdiArea::StackingOrder ); QListIterator w( pl ); w.toBack(); @@ -670,8 +670,8 @@ void fileBrowserTreeWidget::sendToActiveInstrumentTrack( void ) // instrument-track while( w.hasPrevious() ) { - instrumentTrackWindow * itw = - dynamic_cast( + InstrumentTrackWindow * itw = + dynamic_cast( w.previous()->widget() ); if( itw != NULL && itw->isHidden() == false ) { diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index ef9ceaa97..0f3095c1e 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -4,7 +4,7 @@ * * Copyright (c) 2004-2009 Tobias Doerffel * Copyright (c) 2008 Andrew Kelley - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -24,9 +24,6 @@ * */ - -#include "piano_roll.h" - #include #include #include @@ -35,32 +32,32 @@ #include #include #include +#include #include #include #include #include - #ifndef __USE_XOPEN #define __USE_XOPEN #endif #include - +#include "piano_roll.h" #include "bb_track_container.h" -#include "clipboard.h" +#include "Clipboard.h" #include "combobox.h" #include "debug.h" #include "detuning_helper.h" #include "embed.h" #include "gui_templates.h" -#include "instrument_track.h" -#include "main_window.h" +#include "InstrumentTrack.h" +#include "MainWindow.h" #include "midi.h" #include "mmp.h" #include "pattern.h" -#include "piano.h" +#include "Piano.h" #include "pixmap_button.h" #include "song.h" #include "song_editor.h" @@ -137,7 +134,7 @@ pianoRoll::pianoRollKeyTypes pianoRoll::prKeyOrder[] = const int DEFAULT_PR_PPT = KEY_LINE_HEIGHT * DefaultStepsPerTact; -pianoRoll::pianoRoll( void ) : +pianoRoll::pianoRoll() : m_nemStr( QVector() ), m_noteEditMenu( NULL ), m_signalMapper( NULL ), @@ -449,7 +446,7 @@ pianoRoll::pianoRoll( void ) : note_len_lbl->setPixmap( embed::getIconPixmap( "note" ) ); m_noteLenModel.addItem( tr( "Last note" ), - new pixmapLoader( "edit_draw" ) ); + new PixmapLoader( "edit_draw" ) ); const QString pixmaps[] = { "whole", "half", "quarter", "eighth", "sixteenth", "thirtysecond", "triplethalf", "tripletquarter", "tripleteighth", @@ -458,12 +455,12 @@ pianoRoll::pianoRoll( void ) : for( int i = 0; i < NUM_EVEN_LENGTHS; ++i ) { m_noteLenModel.addItem( "1/" + QString::number( 1 << i ), - new pixmapLoader( "note_" + pixmaps[i] ) ); + new PixmapLoader( "note_" + pixmaps[i] ) ); } for( int i = 0; i < NUM_TRIPLET_LENGTHS; ++i ) { m_noteLenModel.addItem( "1/" + QString::number( (1 << i) * 3 ), - new pixmapLoader( "note_" + pixmaps[i+NUM_EVEN_LENGTHS] ) ); + new PixmapLoader( "note_" + pixmaps[i+NUM_EVEN_LENGTHS] ) ); } m_noteLenModel.setValue( 0 ); m_noteLenComboBox = new comboBox( m_toolBar ); @@ -515,9 +512,9 @@ pianoRoll::pianoRoll( void ) : setMinimumSize( tb_layout->minimumSize().width(), 160 ); // add us to workspace - if( engine::getMainWindow()->workspace() ) + if( engine::mainWindow()->workspace() ) { - engine::getMainWindow()->workspace()->addSubWindow( this ); + engine::mainWindow()->workspace()->addSubWindow( this ); parentWidget()->resize( INITIAL_PIANOROLL_WIDTH, INITIAL_PIANOROLL_HEIGHT ); parentWidget()->hide(); @@ -549,7 +546,7 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern ) { if( validPattern() ) { - m_pattern->getInstrumentTrack()->disconnect( this ); + m_pattern->instrumentTrack()->disconnect( this ); } m_pattern = _new_pattern; @@ -597,10 +594,10 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern ) // of start-notes and so on...) resizeEvent( NULL ); - connect( m_pattern->getInstrumentTrack(), + connect( m_pattern->instrumentTrack(), SIGNAL( noteOn( const note & ) ), this, SLOT( startRecordNote( const note & ) ) ); - connect( m_pattern->getInstrumentTrack(), + connect( m_pattern->instrumentTrack(), SIGNAL( noteOff( const note & ) ), this, SLOT( finishRecordNote( const note & ) ) ); @@ -614,7 +611,7 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern ) void pianoRoll::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - mainWindow::saveWidgetState( this, _this ); + MainWindow::saveWidgetState( this, _this ); } @@ -622,7 +619,7 @@ void pianoRoll::saveSettings( QDomDocument & _doc, QDomElement & _this ) void pianoRoll::loadSettings( const QDomElement & _this ) { - mainWindow::restoreWidgetState( this, _this ); + MainWindow::restoreWidgetState( this, _this ); } @@ -746,7 +743,7 @@ inline void pianoRoll::drawDetuningInfo( QPainter & _p, note * _n, int _x, -void pianoRoll::removeSelection( void ) +void pianoRoll::removeSelection() { m_selectStartTick = 0; m_selectedTick = 0; @@ -759,7 +756,7 @@ void pianoRoll::removeSelection( void ) -void pianoRoll::clearSelectedNotes( void ) +void pianoRoll::clearSelectedNotes() { if( m_pattern != NULL ) { @@ -856,7 +853,7 @@ void pianoRoll::shiftPos( int amount ) //shift notes pos by amount -bool pianoRoll::isSelection( void ) const // are any notes selected? +bool pianoRoll::isSelection() const // are any notes selected? { const NoteVector & notes = m_pattern->notes(); for( NoteVector::ConstIterator it = notes.begin(); it != notes.end(); @@ -873,7 +870,7 @@ bool pianoRoll::isSelection( void ) const // are any notes selected? -int pianoRoll::selectionCount( void ) const // how many notes are selected? +int pianoRoll::selectionCount() const // how many notes are selected? { int sum = 0; @@ -896,13 +893,13 @@ void pianoRoll::keyPressEvent( QKeyEvent * _ke ) { if( validPattern() && _ke->modifiers() == Qt::NoModifier ) { - const int key_num = pianoView::getKeyFromKeyEvent( _ke ) + + const int key_num = PianoView::getKeyFromKeyEvent( _ke ) + ( DefaultOctave - 1 ) * KeysPerOctave; if( _ke->isAutoRepeat() == false && key_num > -1 ) { - m_pattern->getInstrumentTrack()-> - getPiano()->handleKeyPress( key_num ); + m_pattern->instrumentTrack()-> + getPiano()->handleKeyPress( key_num ); } } @@ -1202,13 +1199,13 @@ void pianoRoll::keyReleaseEvent( QKeyEvent * _ke ) { if( validPattern() && _ke->modifiers() == Qt::NoModifier ) { - const int key_num = pianoView::getKeyFromKeyEvent( _ke ) + + const int key_num = PianoView::getKeyFromKeyEvent( _ke ) + ( DefaultOctave - 1 ) * KeysPerOctave; if( _ke->isAutoRepeat() == false && key_num > -1 ) { - m_pattern->getInstrumentTrack()-> - getPiano()->handleKeyRelease( key_num ); + m_pattern->instrumentTrack()-> + getPiano()->handleKeyRelease( key_num ); } } switch( _ke->key() ) @@ -1608,7 +1605,7 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me ) if( ! m_recording && ! engine::getSong()->isPlaying() ) { int v = ( (float) x ) / ( (float) WHITE_KEY_WIDTH ) * 127; - m_pattern->getInstrumentTrack()->processInEvent( + m_pattern->instrumentTrack()->processInEvent( midiEvent( MidiNoteOn, 0, key_num, v ), midiTime() ); } @@ -1663,7 +1660,7 @@ void pianoRoll::testPlayNote( note * n ) ! engine::getSong()->isPlaying() ) { n->setIsPlaying( true ); - m_pattern->getInstrumentTrack()->processInEvent( + m_pattern->instrumentTrack()->processInEvent( midiEvent( MidiNoteOn, 0, n->key(), n->getVolume() * 127 / 100 ), midiTime() ); @@ -1671,7 +1668,7 @@ void pianoRoll::testPlayNote( note * n ) panningToMidi( n->getPanning() ) ); evt.m_metaEvent = MidiNotePanning; - m_pattern->getInstrumentTrack()->processInEvent( evt, midiTime() ); + m_pattern->instrumentTrack()->processInEvent( evt, midiTime() ); } } @@ -1689,7 +1686,7 @@ void pianoRoll::pauseTestNotes( bool _pause ) if( _pause ) { // stop note - m_pattern->getInstrumentTrack()-> + m_pattern->instrumentTrack()-> processInEvent( midiEvent( MidiNoteOff, 0, ( *it )->key(), 0 ), @@ -1713,7 +1710,7 @@ void pianoRoll::pauseTestNotes( bool _pause ) void pianoRoll::testPlayKey( int _key, int _vol, int _pan ) { // turn off old key - m_pattern->getInstrumentTrack()->processInEvent( + m_pattern->instrumentTrack()->processInEvent( midiEvent( MidiNoteOff, 0, m_lastKey, 0 ), midiTime() ); @@ -1721,7 +1718,7 @@ void pianoRoll::testPlayKey( int _key, int _vol, int _pan ) m_lastKey = _key; // play new key - m_pattern->getInstrumentTrack()->processInEvent( + m_pattern->instrumentTrack()->processInEvent( midiEvent( MidiNoteOn, 0, _key, _vol ), midiTime() ); @@ -1863,7 +1860,7 @@ void pianoRoll::mouseReleaseEvent( QMouseEvent * _me ) { if( ( *it )->isPlaying() ) { - m_pattern->getInstrumentTrack()-> + m_pattern->instrumentTrack()-> processInEvent( midiEvent( MidiNoteOff, 0, ( *it )->key(), 0 ), @@ -1875,7 +1872,7 @@ void pianoRoll::mouseReleaseEvent( QMouseEvent * _me ) } // stop playing keys that we let go of - m_pattern->getInstrumentTrack()->processInEvent( + m_pattern->instrumentTrack()->processInEvent( midiEvent( MidiNoteOff, 0, m_lastKey, 0 ), midiTime() ); @@ -2033,7 +2030,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) if( m_noteEditMode == NoteEditVolume ) { ( *it )->setVolume( vol ); - m_pattern->getInstrumentTrack()->processInEvent( + m_pattern->instrumentTrack()->processInEvent( midiEvent( MidiKeyPressure, 0, @@ -2047,7 +2044,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) midiEvent evt( MidiMetaEvent, 0, ( *it )->key(), panningToMidi( pan ) ); evt.m_metaEvent = MidiNotePanning; - m_pattern->getInstrumentTrack()->processInEvent( + m_pattern->instrumentTrack()->processInEvent( evt, midiTime() ); } } @@ -2056,7 +2053,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) if( ( *it )->isPlaying() ) { // mouse not over this note, stop playing it. - m_pattern->getInstrumentTrack()->processInEvent( + m_pattern->instrumentTrack()->processInEvent( midiEvent( MidiNoteOff, 0, ( *it )->key(), 0 ), midiTime() ); @@ -2989,7 +2986,7 @@ int pianoRoll::getKey( int _y ) const -song::PlayModes pianoRoll::desiredPlayModeForAccompany( void ) const +song::PlayModes pianoRoll::desiredPlayModeForAccompany() const { if( m_pattern->getTrack()->getTrackContainer() == engine::getBBTrackContainer() ) @@ -3002,7 +2999,7 @@ song::PlayModes pianoRoll::desiredPlayModeForAccompany( void ) const -void pianoRoll::play( void ) +void pianoRoll::play() { if( validPattern() == false ) { @@ -3039,7 +3036,7 @@ void pianoRoll::play( void ) -void pianoRoll::record( void ) +void pianoRoll::record() { if( engine::getSong()->isPlaying() ) { @@ -3058,7 +3055,7 @@ void pianoRoll::record( void ) -void pianoRoll::recordAccompany( void ) +void pianoRoll::recordAccompany() { if( engine::getSong()->isPlaying() ) { @@ -3085,7 +3082,7 @@ void pianoRoll::recordAccompany( void ) -void pianoRoll::stop( void ) +void pianoRoll::stop() { engine::getSong()->stop(); m_playButton->setIcon( embed::getIconPixmap( "play" ) ); @@ -3175,7 +3172,7 @@ void pianoRoll::verScrolled( int _new_pos ) -void pianoRoll::drawButtonToggled( void ) +void pianoRoll::drawButtonToggled() { m_editMode = ModeDraw; update(); @@ -3184,7 +3181,7 @@ void pianoRoll::drawButtonToggled( void ) -void pianoRoll::eraseButtonToggled( void ) +void pianoRoll::eraseButtonToggled() { m_editMode = ModeErase; update(); @@ -3193,7 +3190,7 @@ void pianoRoll::eraseButtonToggled( void ) -void pianoRoll::selectButtonToggled( void ) +void pianoRoll::selectButtonToggled() { m_editMode = ModeSelect; update(); @@ -3201,7 +3198,7 @@ void pianoRoll::selectButtonToggled( void ) -void pianoRoll::detuneButtonToggled( void ) +void pianoRoll::detuneButtonToggled() { m_editMode = ModeEditDetuning; update(); @@ -3209,7 +3206,7 @@ void pianoRoll::detuneButtonToggled( void ) -void pianoRoll::selectAll( void ) +void pianoRoll::selectAll() { if( validPattern() == false ) { @@ -3306,7 +3303,7 @@ void pianoRoll::copy_to_clipboard( const NoteVector & _notes ) const } QMimeData * clip_content = new QMimeData; - clip_content->setData( clipboard::mimeType(), mmp.toString().toUtf8() ); + clip_content->setData( Clipboard::mimeType(), mmp.toString().toUtf8() ); QApplication::clipboard()->setMimeData( clip_content, QClipboard::Clipboard ); } @@ -3314,7 +3311,7 @@ void pianoRoll::copy_to_clipboard( const NoteVector & _notes ) const -void pianoRoll::copySelectedNotes( void ) +void pianoRoll::copySelectedNotes() { NoteVector selected_notes; getSelectedNotes( selected_notes ); @@ -3328,7 +3325,7 @@ void pianoRoll::copySelectedNotes( void ) -void pianoRoll::cutSelectedNotes( void ) +void pianoRoll::cutSelectedNotes() { if( validPattern() == false ) { @@ -3360,7 +3357,7 @@ void pianoRoll::cutSelectedNotes( void ) -void pianoRoll::pasteNotes( void ) +void pianoRoll::pasteNotes() { if( validPattern() == false ) { @@ -3369,7 +3366,7 @@ void pianoRoll::pasteNotes( void ) QString value = QApplication::clipboard() ->mimeData( QClipboard::Clipboard ) - ->data( clipboard::mimeType() ); + ->data( Clipboard::mimeType() ); if( !value.isEmpty() ) { @@ -3408,7 +3405,7 @@ void pianoRoll::pasteNotes( void ) -void pianoRoll::deleteSelectedNotes( void ) +void pianoRoll::deleteSelectedNotes() { if( validPattern() == false ) { @@ -3511,7 +3508,7 @@ void pianoRoll::updatePositionAccompany( const midiTime & _t ) -void pianoRoll::zoomingChanged( void ) +void pianoRoll::zoomingChanged() { const QString & zfac = m_zoomingModel.currentText(); m_ppt = zfac.left( zfac.length() - 1 ).toInt() * DEFAULT_PR_PPT / 100; @@ -3526,7 +3523,7 @@ void pianoRoll::zoomingChanged( void ) -void pianoRoll::quantizeChanged( void ) +void pianoRoll::quantizeChanged() { if( m_quantizeModel.value() == 0 && m_noteLenModel.value() == 0 ) @@ -3539,7 +3536,7 @@ void pianoRoll::quantizeChanged( void ) } -int pianoRoll::quantization( void ) const +int pianoRoll::quantization() const { if( m_quantizeModel.value() == 0 ) { @@ -3553,7 +3550,7 @@ int pianoRoll::quantization( void ) const -midiTime pianoRoll::newNoteLen( void ) const +midiTime pianoRoll::newNoteLen() const { if( m_noteLenModel.value() == 0 ) { @@ -3567,7 +3564,7 @@ midiTime pianoRoll::newNoteLen( void ) const -bool pianoRoll::mouseOverNote( void ) +bool pianoRoll::mouseOverNote() { return validPattern() && noteUnderMouse() != NULL; } @@ -3575,7 +3572,7 @@ bool pianoRoll::mouseOverNote( void ) -note * pianoRoll::noteUnderMouse( void ) +note * pianoRoll::noteUnderMouse() { QPoint pos = mapFromGlobal( QCursor::pos() ); diff --git a/src/gui/plugin_browser.cpp b/src/gui/plugin_browser.cpp index be7bd41b2..49280b6d2 100644 --- a/src/gui/plugin_browser.cpp +++ b/src/gui/plugin_browser.cpp @@ -59,16 +59,16 @@ pluginBrowser::pluginBrowser( QWidget * _parent ) : "existing instrument track." ), m_view ); hint->setFont( pointSize<8>( hint->font() ) ); - hint->setWordWrap( TRUE ); + hint->setWordWrap( true ); view_layout->addWidget( hint ); - plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors ); + Plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors ); - for( QVector::iterator it = + for( QVector::iterator it = m_pluginDescriptors.begin(); it != m_pluginDescriptors.end(); ++it ) { - if( it->type == plugin::Instrument ) + if( it->type == Plugin::Instrument ) { pluginDescWidget * p = new pluginDescWidget( *it, m_view ); @@ -93,18 +93,18 @@ pluginBrowser::~pluginBrowser() -pluginDescWidget::pluginDescWidget( const plugin::descriptor & _pd, +pluginDescWidget::pluginDescWidget( const Plugin::Descriptor & _pd, QWidget * _parent ) : QWidget( _parent ), m_updateTimer( this ), m_pluginDescriptor( _pd ), m_logo( _pd.logo->pixmap() ), - m_mouseOver( FALSE ), + m_mouseOver( false ), m_targetHeight( 24 ) { connect( &m_updateTimer, SIGNAL( timeout() ), SLOT( updateHeight() ) ); setFixedHeight( m_targetHeight ); - setMouseTracking( TRUE ); + setMouseTracking( true ); setCursor( Qt::PointingHandCursor ); } @@ -136,14 +136,14 @@ void pluginDescWidget::paintEvent( QPaintEvent * ) p.drawPixmap( 4, 4, logo ); QFont f = pointSize<8>( p.font() ); - f.setBold( TRUE ); + f.setBold( true ); p.setFont( f ); p.drawText( 10 + logo_size.width(), 15, m_pluginDescriptor.displayName ); if( height() > 24 || m_mouseOver ) { - f.setBold( FALSE ); + f.setBold( false ); p.setFont( pointSize<7>( f ) ); QRect br; p.drawText( 10 + logo_size.width(), 20, width() - 58 - 5, 999, @@ -163,7 +163,7 @@ void pluginDescWidget::paintEvent( QPaintEvent * ) void pluginDescWidget::enterEvent( QEvent * _e ) { - m_mouseOver = TRUE; + m_mouseOver = true; m_targetHeight = height() + 1; updateHeight(); QWidget::enterEvent( _e ); @@ -174,7 +174,7 @@ void pluginDescWidget::enterEvent( QEvent * _e ) void pluginDescWidget::leaveEvent( QEvent * _e ) { - m_mouseOver = FALSE; + m_mouseOver = false; m_targetHeight = 24; updateHeight(); QWidget::leaveEvent( _e ); @@ -196,7 +196,7 @@ void pluginDescWidget::mousePressEvent( QMouseEvent * _me ) -void pluginDescWidget::updateHeight( void ) +void pluginDescWidget::updateHeight() { if( m_targetHeight > height() ) { diff --git a/src/gui/setup_dialog.cpp b/src/gui/setup_dialog.cpp index 391f419e0..e205d9561 100644 --- a/src/gui/setup_dialog.cpp +++ b/src/gui/setup_dialog.cpp @@ -38,7 +38,7 @@ #include "tab_widget.h" #include "gui_templates.h" #include "mixer.h" -#include "project_journal.h" +#include "ProjectJournal.h" #include "config_mgr.h" #include "embed.h" #include "engine.h" @@ -117,7 +117,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : setWindowTitle( tr( "Setup LMMS" ) ); setModal( true ); - engine::getProjectJournal()->setJournalling( false ); + engine::projectJournal()->setJournalling( false ); QVBoxLayout * vlayout = new QVBoxLayout( this ); vlayout->setSpacing( 0 ); @@ -700,7 +700,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : setupDialog::~setupDialog() { - engine::getProjectJournal()->setJournalling( true ); + engine::projectJournal()->setJournalling( true ); } diff --git a/src/gui/song_editor.cpp b/src/gui/song_editor.cpp index 17cde9e0a..b4c7cba37 100644 --- a/src/gui/song_editor.cpp +++ b/src/gui/song_editor.cpp @@ -39,8 +39,8 @@ #include "cpuload_widget.h" #include "embed.h" #include "lcd_spinbox.h" -#include "main_window.h" -#include "meter_dialog.h" +#include "MainWindow.h" +#include "MeterDialog.h" #include "mmp.h" #include "text_float.h" #include "timeline.h" @@ -100,9 +100,9 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : // add some essential widgets to global tool-bar - QWidget * tb = engine::getMainWindow()->toolBar(); + QWidget * tb = engine::mainWindow()->toolBar(); - engine::getMainWindow()->addSpacingToToolBar( 10 ); + engine::mainWindow()->addSpacingToToolBar( 10 ); m_tempoSpinBox = new lcdSpinBox( 3, tb, tr( "Tempo" ) ); m_tempoSpinBox->setModel( &m_s->m_tempoModel ); @@ -117,7 +117,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : "should be played within a minute (or how many measures " "should be played within four minutes)." ) ); - engine::getMainWindow()->addWidgetToToolBar( m_tempoSpinBox, 0 ); + engine::mainWindow()->addWidgetToToolBar( m_tempoSpinBox, 0 ); #if 0 toolButton * hq_btn = new toolButton( embed::getIconPixmap( "hq_mode" ), @@ -127,17 +127,17 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : connect( hq_btn, SIGNAL( toggled( bool ) ), this, SLOT( setHighQuality( bool ) ) ); hq_btn->setFixedWidth( 42 ); - engine::getMainWindow()->addWidgetToToolBar( hq_btn, 1, col ); + engine::mainWindow()->addWidgetToToolBar( hq_btn, 1, col ); #endif - engine::getMainWindow()->addSpacingToToolBar( 10 ); + engine::mainWindow()->addSpacingToToolBar( 10 ); - m_timeSigDisplay = new meterDialog( this, TRUE ); + m_timeSigDisplay = new MeterDialog( this, TRUE ); m_timeSigDisplay->setModel( &m_s->m_timeSigModel ); - engine::getMainWindow()->addWidgetToToolBar( m_timeSigDisplay ); + engine::mainWindow()->addWidgetToToolBar( m_timeSigDisplay ); - engine::getMainWindow()->addSpacingToToolBar( 10 ); + engine::mainWindow()->addSpacingToToolBar( 10 ); QLabel * master_vol_lbl = new QLabel( tb ); @@ -166,11 +166,11 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : m_mvsStatus->setTitle( tr( "Master volume" ) ); m_mvsStatus->setPixmap( embed::getIconPixmap( "master_volume" ) ); - engine::getMainWindow()->addWidgetToToolBar( master_vol_lbl ); - engine::getMainWindow()->addWidgetToToolBar( m_masterVolumeSlider ); + engine::mainWindow()->addWidgetToToolBar( master_vol_lbl ); + engine::mainWindow()->addWidgetToToolBar( m_masterVolumeSlider ); - engine::getMainWindow()->addSpacingToToolBar( 10 ); + engine::mainWindow()->addSpacingToToolBar( 10 ); QLabel * master_pitch_lbl = new QLabel( tb ); @@ -198,10 +198,10 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : m_mpsStatus->setTitle( tr( "Master pitch" ) ); m_mpsStatus->setPixmap( embed::getIconPixmap( "master_pitch" ) ); - engine::getMainWindow()->addWidgetToToolBar( master_pitch_lbl ); - engine::getMainWindow()->addWidgetToToolBar( m_masterPitchSlider ); + engine::mainWindow()->addWidgetToToolBar( master_pitch_lbl ); + engine::mainWindow()->addWidgetToToolBar( m_masterPitchSlider ); - engine::getMainWindow()->addSpacingToToolBar( 10 ); + engine::mainWindow()->addSpacingToToolBar( 10 ); // create widget for visualization- and cpu-load-widget QWidget * vc_w = new QWidget( tb ); @@ -216,7 +216,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : vcw_layout->addWidget( new cpuloadWidget( vc_w ) ); vcw_layout->addStretch(); - engine::getMainWindow()->addWidgetToToolBar( vc_w ); + engine::mainWindow()->addWidgetToToolBar( vc_w ); // create own toolbar @@ -374,7 +374,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : this, SLOT( updateScrollBar( int ) ) ); - engine::getMainWindow()->workspace()->addSubWindow( this ); + engine::mainWindow()->workspace()->addSubWindow( this ); parentWidget()->setAttribute( Qt::WA_DeleteOnClose, FALSE ); parentWidget()->resize( 600, 300 ); parentWidget()->move( 5, 5 ); @@ -456,13 +456,13 @@ void songEditor::stop( void ) void songEditor::keyPressEvent( QKeyEvent * _ke ) { if( /*_ke->modifiers() & Qt::ShiftModifier*/ - engine::getMainWindow()->isShiftPressed() == TRUE && + engine::mainWindow()->isShiftPressed() == TRUE && _ke->key() == Qt::Key_Insert ) { m_s->insertBar(); } else if(/* _ke->modifiers() & Qt::ShiftModifier &&*/ - engine::getMainWindow()->isShiftPressed() == TRUE && + engine::mainWindow()->isShiftPressed() == TRUE && _ke->key() == Qt::Key_Delete ) { m_s->removeBar(); @@ -509,7 +509,7 @@ void songEditor::keyPressEvent( QKeyEvent * _ke ) void songEditor::wheelEvent( QWheelEvent * _we ) { - if( engine::getMainWindow()->isCtrlPressed() == TRUE ) + if( engine::mainWindow()->isCtrlPressed() == TRUE ) { if( _we->delta() > 0 ) { @@ -533,7 +533,7 @@ void songEditor::wheelEvent( QWheelEvent * _we ) // and make sure, all TCO's are resized and relocated realignTracks(); } - else if( engine::getMainWindow()->isShiftPressed() == TRUE ) + else if( engine::mainWindow()->isShiftPressed() == TRUE ) { m_leftRightScroll->setValue( m_leftRightScroll->value() - _we->delta() / 30 ); diff --git a/src/gui/string_pair_drag.cpp b/src/gui/string_pair_drag.cpp index 26e975336..611421e99 100644 --- a/src/gui/string_pair_drag.cpp +++ b/src/gui/string_pair_drag.cpp @@ -32,7 +32,7 @@ #include "string_pair_drag.h" #include "engine.h" -#include "main_window.h" +#include "MainWindow.h" stringPairDrag::stringPairDrag( const QString & _key, const QString & _value, @@ -64,9 +64,9 @@ stringPairDrag::~stringPairDrag() { // during a drag, we might have lost key-press-events, so reset // modifiers of main-win - if( engine::getMainWindow() ) + if( engine::mainWindow() ) { - engine::getMainWindow()->clearKeyModifiers(); + engine::mainWindow()->clearKeyModifiers(); } } diff --git a/src/gui/track_container_view.cpp b/src/gui/track_container_view.cpp index 7a55b48be..e240f8b16 100644 --- a/src/gui/track_container_view.cpp +++ b/src/gui/track_container_view.cpp @@ -34,14 +34,13 @@ #include "track_container_view.h" #include "track_container.h" #include "bb_track.h" -#include "main_window.h" +#include "MainWindow.h" #include "debug.h" #include "file_browser.h" -#include "import_filter.h" -#include "instrument.h" -#include "instrument_track.h" +#include "ImportFilter.h" +#include "Instrument.h" +#include "InstrumentTrack.h" #include "mmp.h" -#include "project_journal.h" #include "rubberband.h" #include "song.h" #include "string_pair_drag.h" @@ -50,9 +49,9 @@ trackContainerView::trackContainerView( trackContainer * _tc ) : QWidget(), - modelView( NULL, this ), - journallingObject(), - serializingObjectHook(), + ModelView( NULL, this ), + JournallingObject(), + SerializingObjectHook(), m_currentPosition( 0, 0 ), m_tc( _tc ), m_trackViews(), @@ -106,7 +105,7 @@ trackContainerView::~trackContainerView() void trackContainerView::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - mainWindow::saveWidgetState( this, _this ); + MainWindow::saveWidgetState( this, _this ); } @@ -114,7 +113,7 @@ void trackContainerView::saveSettings( QDomDocument & _doc, void trackContainerView::loadSettings( const QDomElement & _this ) { - mainWindow::restoreWidgetState( this, _this ); + MainWindow::restoreWidgetState( this, _this ); } @@ -124,7 +123,7 @@ trackView * trackContainerView::addTrackView( trackView * _tv ) { /* QMap map; map["id"] = _tv->getTrack()->id(); - addJournalEntry( journalEntry( AddTrack, map ) );*/ + addJournalEntry( JournalEntry( AddTrack, map ) );*/ m_trackViews.push_back( _tv ); m_scrollLayout->addWidget( _tv ); @@ -148,7 +147,7 @@ void trackContainerView::removeTrackView( trackView * _tv ) _tv->getTrack()->saveState( mmp, mmp.content() ); map["id"] = _tv->getTrack()->id(); map["state"] = mmp.toString(); - addJournalEntry( journalEntry( RemoveTrack, map ) );*/ + addJournalEntry( JournalEntry( RemoveTrack, map ) );*/ m_trackViews.removeAt( index ); @@ -211,7 +210,7 @@ void trackContainerView::moveTrackViewDown( trackView * _tv ) -void trackContainerView::realignTracks( void ) +void trackContainerView::realignTracks() { QWidget * content = m_scrollArea->widget(); content->setFixedWidth( width() @@ -271,7 +270,7 @@ const trackView * trackContainerView::trackViewAt( const int _y ) const -bool trackContainerView::allowRubberband( void ) const +bool trackContainerView::allowRubberband() const { return( false ); } @@ -287,7 +286,7 @@ void trackContainerView::setPixelsPerTact( int _ppt ) -void trackContainerView::clearAllTracks( void ) +void trackContainerView::clearAllTracks() { while( !m_trackViews.empty() ) { @@ -301,7 +300,7 @@ void trackContainerView::clearAllTracks( void ) -void trackContainerView::undoStep( journalEntry & _je ) +void trackContainerView::undoStep( JournalEntry & _je ) { #if 0 saveJournallingState( false ); @@ -312,7 +311,7 @@ void trackContainerView::undoStep( journalEntry & _je ) QMap map = _je.data().toMap(); track * t = dynamic_cast( - engine::getProjectJournal()->getJournallingObject( + engine::projectJournal()->getJournallingObject( map["id"].toInt() ) ); assert( t != NULL ); multimediaProject mmp( multimediaProject::JournalData ); @@ -339,7 +338,7 @@ void trackContainerView::undoStep( journalEntry & _je ) -void trackContainerView::redoStep( journalEntry & _je ) +void trackContainerView::redoStep( JournalEntry & _je ) { #if 0 switch( _je.actionID() ) @@ -378,7 +377,7 @@ void trackContainerView::dropEvent( QDropEvent * _de ) engine::getMixer()->lock(); if( type == "instrument" ) { - instrumentTrack * it = dynamic_cast( + InstrumentTrack * it = dynamic_cast( track::create( track::InstrumentTrack, m_tc ) ); it->loadInstrument( value ); @@ -387,10 +386,10 @@ void trackContainerView::dropEvent( QDropEvent * _de ) } else if( type == "samplefile" || type == "pluginpresetfile" ) { - instrumentTrack * it = dynamic_cast( + InstrumentTrack * it = dynamic_cast( track::create( track::InstrumentTrack, m_tc ) ); - instrument * i = it->loadInstrument( + Instrument * i = it->loadInstrument( engine::pluginFileHandling()[fileItem::extension( value )]); i->loadFile( value ); @@ -400,7 +399,7 @@ void trackContainerView::dropEvent( QDropEvent * _de ) else if( type == "presetfile" ) { multimediaProject mmp( value ); - instrumentTrack * it = dynamic_cast( + InstrumentTrack * it = dynamic_cast( track::create( track::InstrumentTrack, m_tc ) ); it->loadSettings( mmp.content().toElement() ); @@ -409,7 +408,7 @@ void trackContainerView::dropEvent( QDropEvent * _de ) } else if( type == "importedproject" ) { - importFilter::import( value, m_tc ); + ImportFilter::import( value, m_tc ); _de->accept(); } else if( type.left( 6 ) == "track_" ) diff --git a/src/gui/widgets/ControllerRackView.cpp b/src/gui/widgets/ControllerRackView.cpp index 6d3e65ab1..ae26c11df 100644 --- a/src/gui/widgets/ControllerRackView.cpp +++ b/src/gui/widgets/ControllerRackView.cpp @@ -33,7 +33,7 @@ #include "song.h" #include "embed.h" -#include "main_window.h" +#include "MainWindow.h" #include "group_box.h" #include "ControllerRackView.h" #include "ControllerView.h" @@ -75,7 +75,7 @@ ControllerRackView::ControllerRackView( ) : this->setLayout( layout ); QMdiSubWindow * subWin = - engine::getMainWindow()->workspace()->addSubWindow( this ); + engine::mainWindow()->workspace()->addSubWindow( this ); // No maximize button Qt::WindowFlags flags = subWin->windowFlags(); @@ -104,7 +104,7 @@ ControllerRackView::~ControllerRackView() void ControllerRackView::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - mainWindow::saveWidgetState( this, _this ); + MainWindow::saveWidgetState( this, _this ); } @@ -112,7 +112,7 @@ void ControllerRackView::saveSettings( QDomDocument & _doc, void ControllerRackView::loadSettings( const QDomElement & _this ) { - mainWindow::restoreWidgetState( this, _this ); + MainWindow::restoreWidgetState( this, _this ); } diff --git a/src/gui/widgets/ControllerView.cpp b/src/gui/widgets/ControllerView.cpp index c1ae21f0b..cf2318765 100644 --- a/src/gui/widgets/ControllerView.cpp +++ b/src/gui/widgets/ControllerView.cpp @@ -38,18 +38,17 @@ #include "embed.h" #include "engine.h" #include "led_checkbox.h" -#include "main_window.h" +#include "MainWindow.h" #include "tooltip.h" -#include "mv_base.h" ControllerView::ControllerView( Controller * _model, QWidget * _parent ) : QWidget( _parent ), - modelView( _model, this ), + ModelView( _model, this ), m_bg( embed::getIconPixmap( "controller_bg" ) ), m_subWindow( NULL ), m_controllerDlg( NULL ), - m_show( TRUE ) + m_show( true ) { setFixedSize( 210, 32 ); @@ -63,9 +62,9 @@ ControllerView::ControllerView( Controller * _model, QWidget * _parent ) : connect( ctls_btn, SIGNAL( clicked() ), this, SLOT( editControls() ) ); - m_controllerDlg = getController()->createDialog( engine::getMainWindow()->workspace() ); + m_controllerDlg = getController()->createDialog( engine::mainWindow()->workspace() ); - m_subWindow = engine::getMainWindow()->workspace()->addSubWindow( + m_subWindow = engine::mainWindow()->workspace()->addSubWindow( m_controllerDlg ); Qt::WindowFlags flags = m_subWindow->windowFlags(); @@ -98,28 +97,28 @@ ControllerView::~ControllerView() -void ControllerView::editControls( void ) +void ControllerView::editControls() { if( m_show ) { m_subWindow->show(); m_subWindow->raise(); - m_show = FALSE; + m_show = false; } else { m_subWindow->hide(); - m_show = TRUE; + m_show = true; } } -void ControllerView::closeControls( void ) +void ControllerView::closeControls() { m_subWindow->hide(); - m_show = TRUE; + m_show = true; } @@ -136,7 +135,7 @@ void ControllerView::paintEvent( QPaintEvent * ) p.drawPixmap( 0, 0, m_bg ); QFont f = pointSizeF( font(), 7.5f ); - f.setBold( TRUE ); + f.setBold( true ); p.setFont( f ); Controller * c = castModel(); @@ -146,7 +145,7 @@ void ControllerView::paintEvent( QPaintEvent * ) p.setPen( Qt::white ); p.drawText( 6, 12, c->displayName() ); - f.setBold( FALSE ); + f.setBold( false ); p.setFont( f ); p.drawText( 8, 26, c->name() ); } @@ -170,7 +169,7 @@ void ControllerView::mouseDoubleClickEvent( QMouseEvent * event ) -void ControllerView::modelChanged( void ) +void ControllerView::modelChanged() { } @@ -178,17 +177,7 @@ void ControllerView::modelChanged( void ) void ControllerView::contextMenuEvent( QContextMenuEvent * ) { - QPointer contextMenu = new captionMenu( - getModel()->displayName() ); - /* - contextMenu->addAction( embed::getIconPixmap( "arp_up" ), - tr( "Move &up" ), - this, SLOT( moveUp() ) ); - contextMenu->addAction( embed::getIconPixmap( "arp_down" ), - tr( "Move &down" ), - this, SLOT( moveDown() ) ); - contextMenu->addSeparator(); - */ + QPointer contextMenu = new captionMenu( model()->displayName() ); contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "&Remove this plugin" ), this, SLOT( deleteController() ) ); @@ -202,7 +191,7 @@ void ControllerView::contextMenuEvent( QContextMenuEvent * ) -void ControllerView::displayHelp( void ) +void ControllerView::displayHelp() { QWhatsThis::showText( mapToGlobal( rect().center() ), whatsThis() ); diff --git a/src/gui/widgets/effect_rack_view.cpp b/src/gui/widgets/EffectRackView.cpp similarity index 66% rename from src/gui/widgets/effect_rack_view.cpp rename to src/gui/widgets/EffectRackView.cpp index c16c57fdd..f78c3d7e1 100644 --- a/src/gui/widgets/effect_rack_view.cpp +++ b/src/gui/widgets/EffectRackView.cpp @@ -1,5 +1,5 @@ /* - * effect_rack_view.cpp - view for effectChain-model + * EffectRackView.cpp - view for effectChain model * * Copyright (c) 2006-2007 Danny McRae * Copyright (c) 2008-2009 Tobias Doerffel @@ -23,22 +23,21 @@ * */ - #include #include #include #include #include -#include "effect_rack_view.h" -#include "effect_select_dialog.h" -#include "effect_view.h" +#include "EffectRackView.h" +#include "EffectSelectDialog.h" +#include "EffectView.h" #include "group_box.h" -effectRackView::effectRackView( effectChain * _model, QWidget * _parent ) : +EffectRackView::EffectRackView( EffectChain * _model, QWidget * _parent ) : QWidget( _parent ), - modelView( NULL, this ) + ModelView( NULL, this ) { setFixedSize( 250, 250 ); @@ -70,7 +69,7 @@ effectRackView::effectRackView( effectChain * _model, QWidget * _parent ) : -effectRackView::~effectRackView() +EffectRackView::~EffectRackView() { clearViews(); } @@ -79,9 +78,9 @@ effectRackView::~effectRackView() -void effectRackView::clearViews( void ) +void EffectRackView::clearViews() { - for( QVector::iterator it = m_effectViews.begin(); + for( QVector::Iterator it = m_effectViews.begin(); it != m_effectViews.end(); ++it ) { delete *it; @@ -92,14 +91,13 @@ void effectRackView::clearViews( void ) -void effectRackView::moveUp( effectView * _view ) +void EffectRackView::moveUp( EffectView * _view ) { - fxChain()->moveUp( _view->getEffect() ); + fxChain()->moveUp( _view->effect() ); if( _view != m_effectViews.first() ) { int i = 0; - for( QVector::iterator it = - m_effectViews.begin(); + for( QVector::Iterator it = m_effectViews.begin(); it != m_effectViews.end(); it++, i++ ) { if( *it == _view ) @@ -108,7 +106,7 @@ void effectRackView::moveUp( effectView * _view ) } } - effectView * temp = m_effectViews[ i - 1 ]; + EffectView * temp = m_effectViews[ i - 1 ]; m_effectViews[i - 1] = _view; m_effectViews[i] = temp; @@ -120,22 +118,21 @@ void effectRackView::moveUp( effectView * _view ) -void effectRackView::moveDown( effectView * _view ) +void EffectRackView::moveDown( EffectView * _view ) { if( _view != m_effectViews.last() ) { // moving next effect up is the same - moveUp( *( qFind( m_effectViews.begin(), m_effectViews.end(), - _view ) + 1 ) ); + moveUp( *( qFind( m_effectViews.begin(), m_effectViews.end(), _view ) + 1 ) ); } } -void effectRackView::deletePlugin( effectView * _view ) +void EffectRackView::deletePlugin( EffectView * _view ) { - effect * e = _view->getEffect(); + Effect * e = _view->effect(); m_effectViews.erase( qFind( m_effectViews.begin(), m_effectViews.end(), _view ) ); delete _view; @@ -147,49 +144,48 @@ void effectRackView::deletePlugin( effectView * _view ) -void effectRackView::update( void ) +void EffectRackView::update() { QWidget * w = m_scrollArea->widget(); QVector view_map( qMax( fxChain()->m_effects.size(), - m_effectViews.size() ), FALSE ); + m_effectViews.size() ), false ); - for( QVector::iterator it = fxChain()->m_effects.begin(); + for( QVector::Iterator it = fxChain()->m_effects.begin(); it != fxChain()->m_effects.end(); ++it ) { int i = 0; - for( QVector::iterator vit = - m_effectViews.begin(); + for( QVector::Iterator vit = m_effectViews.begin(); vit != m_effectViews.end(); ++vit, ++i ) { - if( ( *vit )->getModel() == *it ) + if( ( *vit )->model() == *it ) { - view_map[i] = TRUE; + view_map[i] = true; break; } } if( i >= m_effectViews.size() ) { - effectView * view = new effectView( *it, w ); - connect( view, SIGNAL( moveUp( effectView * ) ), - this, SLOT( moveUp( effectView * ) ) ); - connect( view, SIGNAL( moveDown( effectView * ) ), - this, SLOT( moveDown( effectView * ) ) ); - connect( view, SIGNAL( deletePlugin( effectView * ) ), - this, SLOT( deletePlugin( effectView * ) ), + EffectView * view = new EffectView( *it, w ); + connect( view, SIGNAL( moveUp( EffectView * ) ), + this, SLOT( moveUp( EffectView * ) ) ); + connect( view, SIGNAL( moveDown( EffectView * ) ), + this, SLOT( moveDown( EffectView * ) ) ); + connect( view, SIGNAL( deletePlugin( EffectView * ) ), + this, SLOT( deletePlugin( EffectView * ) ), Qt::QueuedConnection ); view->show(); m_effectViews.append( view ); - view_map[i] = TRUE; + view_map[i] = true; } } int i = m_lastY = 0; - for( QVector::iterator it = m_effectViews.begin(); + for( QVector::Iterator it = m_effectViews.begin(); it != m_effectViews.end(); ) { if( i < view_map.size() && i < m_effectViews.size() && - view_map[i] == FALSE ) + view_map[i] == false ) { delete m_effectViews[i]; m_effectViews.erase( it ); @@ -210,9 +206,9 @@ void effectRackView::update( void ) -void effectRackView::addEffect( void ) +void EffectRackView::addEffect() { - effectSelectDialog esd( this ); + EffectSelectDialog esd( this ); esd.exec(); if( esd.result() == QDialog::Rejected ) @@ -220,17 +216,17 @@ void effectRackView::addEffect( void ) return; } - effect * fx = esd.instantiateSelectedPlugin( fxChain() ); + Effect * fx = esd.instantiateSelectedPlugin( fxChain() ); - fxChain()->m_enabledModel.setValue( TRUE ); + fxChain()->m_enabledModel.setValue( true ); fxChain()->appendEffect( fx ); update(); // Find the effectView, and show the controls - for( QVector::iterator vit = m_effectViews.begin(); + for( QVector::Iterator vit = m_effectViews.begin(); vit != m_effectViews.end(); ++vit ) { - if( ( *vit )->getEffect() == fx ) + if( ( *vit )->effect() == fx ) { ( *vit )->editControls(); @@ -244,7 +240,7 @@ void effectRackView::addEffect( void ) -void effectRackView::modelChanged( void ) +void EffectRackView::modelChanged() { clearViews(); m_effectsGroupBox->setModel( &fxChain()->m_enabledModel ); @@ -255,5 +251,5 @@ void effectRackView::modelChanged( void ) -#include "moc_effect_rack_view.cxx" +#include "moc_EffectRackView.cxx" diff --git a/src/gui/widgets/effect_view.cpp b/src/gui/widgets/EffectView.cpp similarity index 82% rename from src/gui/widgets/effect_view.cpp rename to src/gui/widgets/EffectView.cpp index a6e762ef1..332e9caed 100644 --- a/src/gui/widgets/effect_view.cpp +++ b/src/gui/widgets/EffectView.cpp @@ -23,30 +23,28 @@ * */ - -#include "effect_view.h" - #include #include #include #include #include +#include "EffectView.h" #include "caption_menu.h" -#include "effect_controls.h" -#include "effect_control_dialog.h" +#include "EffectControls.h" +#include "EffectControlDialog.h" #include "embed.h" #include "engine.h" #include "gui_templates.h" #include "knob.h" #include "led_checkbox.h" -#include "main_window.h" -#include "tempo_sync_knob.h" +#include "MainWindow.h" +#include "TempoSyncKnob.h" #include "tooltip.h" -effectView::effectView( effect * _model, QWidget * _parent ) : - pluginView( _model, _parent ), +EffectView::EffectView( Effect * _model, QWidget * _parent ) : + PluginView( _model, _parent ), m_bg( embed::getIconPixmap( "effect_plugin" ) ), m_subWindow( NULL ), m_controlView( NULL ), @@ -71,7 +69,7 @@ effectView::effectView( effect * _model, QWidget * _parent ) : "forms the output." ) ); - m_autoQuit = new tempoSyncKnob( knobBright_26, this ); + m_autoQuit = new TempoSyncKnob( knobBright_26, this ); m_autoQuit->setLabel( tr( "DECAY" ) ); m_autoQuit->move( 60, 5 ); m_autoQuit->setHintText( tr( "Time:" ) + " ", "ms" ); @@ -90,7 +88,7 @@ effectView::effectView( effect * _model, QWidget * _parent ) : "while deciding when to stop processing signals." ) ); - if( getEffect()->getControls()->getControlCount() > 0 ) + if( effect()->controls()->controlCount() > 0 ) { QPushButton * ctls_btn = new QPushButton( tr( "Controls" ), this ); @@ -99,10 +97,10 @@ effectView::effectView( effect * _model, QWidget * _parent ) : ctls_btn->setGeometry( 140, 14, 50, 20 ); connect( ctls_btn, SIGNAL( clicked() ), this, SLOT( editControls() ) ); - m_controlView = getEffect()->getControls()->createView(); + m_controlView = effect()->controls()->createView(); if( m_controlView ) { - m_subWindow = engine::getMainWindow()->workspace()->addSubWindow( + m_subWindow = engine::mainWindow()->workspace()->addSubWindow( m_controlView, Qt::SubWindow | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint ); @@ -152,7 +150,7 @@ effectView::effectView( effect * _model, QWidget * _parent ) : -effectView::~effectView() +EffectView::~EffectView() { delete m_subWindow; } @@ -160,7 +158,7 @@ effectView::~effectView() -void effectView::editControls( void ) +void EffectView::editControls() { if( m_subWindow ) { @@ -181,7 +179,7 @@ void effectView::editControls( void ) -void effectView::moveUp() +void EffectView::moveUp() { emit moveUp( this ); } @@ -189,14 +187,14 @@ void effectView::moveUp() -void effectView::moveDown() +void EffectView::moveDown() { emit moveDown( this ); } -void effectView::deletePlugin() +void EffectView::deletePlugin() { emit deletePlugin( this ); } @@ -204,7 +202,7 @@ void effectView::deletePlugin() -void effectView::displayHelp( void ) +void EffectView::displayHelp() { QWhatsThis::showText( mapToGlobal( rect().bottomRight() ), whatsThis() ); @@ -213,7 +211,7 @@ void effectView::displayHelp( void ) -void effectView::closeEffects( void ) +void EffectView::closeEffects() { if( m_subWindow ) { @@ -224,10 +222,9 @@ void effectView::closeEffects( void ) -void effectView::contextMenuEvent( QContextMenuEvent * ) +void EffectView::contextMenuEvent( QContextMenuEvent * ) { - QPointer contextMenu = new captionMenu( - getModel()->displayName() ); + QPointer contextMenu = new captionMenu( model()->displayName() ); contextMenu->addAction( embed::getIconPixmap( "arp_up" ), tr( "Move &up" ), this, SLOT( moveUp() ) ); @@ -249,7 +246,7 @@ void effectView::contextMenuEvent( QContextMenuEvent * ) -void effectView::paintEvent( QPaintEvent * ) +void EffectView::paintEvent( QPaintEvent * ) { QPainter p( this ); p.drawPixmap( 0, 0, m_bg ); @@ -259,23 +256,23 @@ void effectView::paintEvent( QPaintEvent * ) p.setFont( f ); p.setPen( QColor( 64, 64, 64 ) ); - p.drawText( 6, 55, getModel()->displayName() ); - p.setPen( Qt::white ); - p.drawText( 5, 54, getModel()->displayName() ); + p.drawText( 6, 55, model()->displayName() ); + p.setPen( palette().text().color() ); + p.drawText( 5, 54, model()->displayName() ); } -void effectView::modelChanged( void ) +void EffectView::modelChanged() { - m_bypass->setModel( &getEffect()->m_enabledModel ); - m_wetDry->setModel( &getEffect()->m_wetDryModel ); - m_autoQuit->setModel( &getEffect()->m_autoQuitModel ); - m_gate->setModel( &getEffect()->m_gateModel ); + m_bypass->setModel( &effect()->m_enabledModel ); + m_wetDry->setModel( &effect()->m_wetDryModel ); + m_autoQuit->setModel( &effect()->m_autoQuitModel ); + m_gate->setModel( &effect()->m_gateModel ); } -#include "moc_effect_view.cxx" +#include "moc_EffectView.cxx" diff --git a/src/gui/widgets/envelope_and_lfo_view.cpp b/src/gui/widgets/EnvelopeAndLfoView.cpp similarity index 91% rename from src/gui/widgets/envelope_and_lfo_view.cpp rename to src/gui/widgets/EnvelopeAndLfoView.cpp index 7a40991d2..fdbfc549d 100644 --- a/src/gui/widgets/envelope_and_lfo_view.cpp +++ b/src/gui/widgets/EnvelopeAndLfoView.cpp @@ -1,6 +1,6 @@ /* - * envelope_and_lfo_view.cpp - widget which is m_used by envelope/lfo/filter- - * tab of channel-window + * EnvelopeAndLfoView.cpp - widget which is m_used by envelope/lfo/filter- + * tab of instrument track window * * Copyright (c) 2004-2009 Tobias Doerffel * @@ -23,15 +23,11 @@ * */ - -#include "envelope_and_lfo_view.h" - - #include #include - -#include "envelope_and_lfo_parameters.h" +#include "EnvelopeAndLfoView.h" +#include "EnvelopeAndLfoParameters.h" #include "embed.h" #include "engine.h" #include "gui_templates.h" @@ -39,16 +35,15 @@ #include "led_checkbox.h" #include "mixer.h" #include "mmp.h" -#include "oscillator.h" +#include "Oscillator.h" #include "pixmap_button.h" #include "string_pair_drag.h" -#include "tempo_sync_knob.h" +#include "TempoSyncKnob.h" #include "text_float.h" #include "tooltip.h" #include "track.h" - extern const float SECS_PER_ENV_SEGMENT; extern const float SECS_PER_LFO_OSCILLATION; @@ -81,20 +76,19 @@ const int LFO_SHAPES_X = LFO_GRAPH_X;//PREDELAY_KNOB_X; const int LFO_SHAPES_Y = LFO_GRAPH_Y + 50; -QPixmap * envelopeAndLFOView::s_envGraph = NULL; -QPixmap * envelopeAndLFOView::s_lfoGraph = NULL; +QPixmap * EnvelopeAndLfoView::s_envGraph = NULL; +QPixmap * EnvelopeAndLfoView::s_lfoGraph = NULL; -envelopeAndLFOView::envelopeAndLFOView( QWidget * _parent ) : +EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) : QWidget( _parent ), - modelView( NULL, this ), + ModelView( NULL, this ), m_params( NULL ) { if( s_envGraph == NULL ) { - s_envGraph = new QPixmap( embed::getIconPixmap( - "envelope_graph" ) ); + s_envGraph = new QPixmap( embed::getIconPixmap( "envelope_graph" ) ); } if( s_lfoGraph == NULL ) { @@ -200,7 +194,7 @@ envelopeAndLFOView::envelopeAndLFOView( QWidget * _parent ) : "increase its amplitude to maximum." ) ); - m_lfoSpeedKnob = new tempoSyncKnob( knobBright_26, this ); + m_lfoSpeedKnob = new TempoSyncKnob( knobBright_26, this ); m_lfoSpeedKnob->setLabel( tr( "SPD" ) ); m_lfoSpeedKnob->move( LFO_SPEED_KNOB_X, LFO_KNOB_Y ); m_lfoSpeedKnob->setHintText( tr( "LFO speed:" ) + " ", "" ); @@ -307,7 +301,7 @@ envelopeAndLFOView::envelopeAndLFOView( QWidget * _parent ) : -envelopeAndLFOView::~envelopeAndLFOView() +EnvelopeAndLfoView::~EnvelopeAndLfoView() { delete m_lfoWaveBtnGrp; } @@ -315,9 +309,9 @@ envelopeAndLFOView::~envelopeAndLFOView() -void envelopeAndLFOView::modelChanged( void ) +void EnvelopeAndLfoView::modelChanged() { - m_params = castModel(); + m_params = castModel(); m_predelayKnob->setModel( &m_params->m_predelayModel ); m_attackKnob->setModel( &m_params->m_attackModel ); m_holdKnob->setModel( &m_params->m_holdModel ); @@ -337,7 +331,7 @@ void envelopeAndLFOView::modelChanged( void ) -void envelopeAndLFOView::mousePressEvent( QMouseEvent * _me ) +void EnvelopeAndLfoView::mousePressEvent( QMouseEvent * _me ) { if( _me->button() != Qt::LeftButton ) { @@ -373,7 +367,7 @@ void envelopeAndLFOView::mousePressEvent( QMouseEvent * _me ) -void envelopeAndLFOView::dragEnterEvent( QDragEnterEvent * _dee ) +void EnvelopeAndLfoView::dragEnterEvent( QDragEnterEvent * _dee ) { stringPairDrag::processDragEnterEvent( _dee, QString( "samplefile,tco_%1" ).arg( @@ -383,7 +377,7 @@ void envelopeAndLFOView::dragEnterEvent( QDragEnterEvent * _dee ) -void envelopeAndLFOView::dropEvent( QDropEvent * _de ) +void EnvelopeAndLfoView::dropEvent( QDropEvent * _de ) { QString type = stringPairDrag::decodeKey( _de ); QString value = stringPairDrag::decodeValue( _de ); @@ -408,7 +402,7 @@ void envelopeAndLFOView::dropEvent( QDropEvent * _de ) -void envelopeAndLFOView::paintEvent( QPaintEvent * ) +void EnvelopeAndLfoView::paintEvent( QPaintEvent * ) { QPainter p( this ); p.setRenderHint( QPainter::Antialiasing ); @@ -517,20 +511,20 @@ void envelopeAndLFOView::paintEvent( QPaintEvent * ) osc_frames; switch( m_params->m_lfoWaveModel.value() ) { - case envelopeAndLFOParameters::SineWave: - val = oscillator::sinSample( phase ); + case EnvelopeAndLfoParameters::SineWave: + val = Oscillator::sinSample( phase ); break; - case envelopeAndLFOParameters::TriangleWave: - val = oscillator::triangleSample( + case EnvelopeAndLfoParameters::TriangleWave: + val = Oscillator::triangleSample( phase ); break; - case envelopeAndLFOParameters::SawWave: - val = oscillator::sawSample( phase ); + case EnvelopeAndLfoParameters::SawWave: + val = Oscillator::sawSample( phase ); break; - case envelopeAndLFOParameters::SquareWave: - val = oscillator::squareSample( phase ); + case EnvelopeAndLfoParameters::SquareWave: + val = Oscillator::squareSample( phase ); break; - case envelopeAndLFOParameters::UserDefinedWave: + case EnvelopeAndLfoParameters::UserDefinedWave: val = m_params->m_userWave. userWaveSample( phase ); } @@ -561,10 +555,10 @@ void envelopeAndLFOView::paintEvent( QPaintEvent * ) -void envelopeAndLFOView::lfoUserWaveChanged( void ) +void EnvelopeAndLfoView::lfoUserWaveChanged() { if( m_params->m_lfoWaveModel.value() == - envelopeAndLFOParameters::UserDefinedWave ) + EnvelopeAndLfoParameters::UserDefinedWave ) { if( m_params->m_userWave.frames() <= 1 ) { @@ -579,6 +573,6 @@ void envelopeAndLFOView::lfoUserWaveChanged( void ) -#include "moc_envelope_and_lfo_view.cxx" +#include "moc_EnvelopeAndLfoView.cxx" diff --git a/src/gui/widgets/instrument_function_views.cpp b/src/gui/widgets/InstrumentFunctionViews.cpp similarity index 87% rename from src/gui/widgets/instrument_function_views.cpp rename to src/gui/widgets/InstrumentFunctionViews.cpp index 3b6530a85..35c940ac3 100644 --- a/src/gui/widgets/instrument_function_views.cpp +++ b/src/gui/widgets/InstrumentFunctionViews.cpp @@ -1,8 +1,8 @@ /* - * instrument_function_views.cpp - view for instrument-functions-tab + * InstrumentFunctionViews.cpp - view for instrument-functions-tab + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,11 +22,10 @@ * */ - #include -#include "instrument_functions.h" -#include "instrument_function_views.h" +#include "InstrumentFunctions.h" +#include "InstrumentFunctionViews.h" #include "combobox.h" #include "embed.h" #include "engine.h" @@ -34,7 +33,7 @@ #include "gui_templates.h" #include "knob.h" #include "pixmap_button.h" -#include "tempo_sync_knob.h" +#include "TempoSyncKnob.h" #include "tooltip.h" @@ -50,9 +49,9 @@ const int ARP_GROUPBOX_HEIGHT = 240 - ARP_GROUPBOX_Y; -chordCreatorView::chordCreatorView( chordCreator * _cc, QWidget * _parent ) : +ChordCreatorView::ChordCreatorView( ChordCreator * _cc, QWidget * _parent ) : QWidget( _parent ), - modelView( NULL, this ), + ModelView( NULL, this ), m_cc( _cc ), m_chordsGroupBox( new groupBox( tr( "CHORDS" ), this ) ), m_chordsComboBox( new comboBox( m_chordsGroupBox ) ), @@ -81,7 +80,7 @@ chordCreatorView::chordCreatorView( chordCreator * _cc, QWidget * _parent ) : -chordCreatorView::~chordCreatorView() +ChordCreatorView::~ChordCreatorView() { delete m_chordsGroupBox; } @@ -89,9 +88,9 @@ chordCreatorView::~chordCreatorView() -void chordCreatorView::modelChanged( void ) +void ChordCreatorView::modelChanged( void ) { - m_cc = castModel(); + m_cc = castModel(); m_chordsGroupBox->setModel( &m_cc->m_chordsEnabledModel ); m_chordsComboBox->setModel( &m_cc->m_chordsModel ); m_chordRangeKnob->setModel( &m_cc->m_chordRangeModel ); @@ -103,14 +102,14 @@ void chordCreatorView::modelChanged( void ) -arpeggiatorView::arpeggiatorView( arpeggiator * _arp, QWidget * _parent ) : +ArpeggiatorView::ArpeggiatorView( Arpeggiator * _arp, QWidget * _parent ) : QWidget( _parent ), - modelView( NULL, this ), + ModelView( NULL, this ), m_a( _arp ), m_arpGroupBox( new groupBox( tr( "ARPEGGIO" ), this ) ), m_arpComboBox( new comboBox( m_arpGroupBox) ), m_arpRangeKnob( new knob( knobBright_26, m_arpGroupBox ) ), - m_arpTimeKnob( new tempoSyncKnob( knobBright_26, m_arpGroupBox ) ), + m_arpTimeKnob( new TempoSyncKnob( knobBright_26, m_arpGroupBox ) ), m_arpGateKnob( new knob( knobBright_26, m_arpGroupBox ) ), m_arpDirectionComboBox( new comboBox( m_arpGroupBox ) ), m_arpModeComboBox( new comboBox( m_arpGroupBox ) ) @@ -180,7 +179,7 @@ arpeggiatorView::arpeggiatorView( arpeggiator * _arp, QWidget * _parent ) : -arpeggiatorView::~arpeggiatorView() +ArpeggiatorView::~ArpeggiatorView() { delete m_arpGroupBox; } @@ -188,9 +187,9 @@ arpeggiatorView::~arpeggiatorView() -void arpeggiatorView::modelChanged( void ) +void ArpeggiatorView::modelChanged( void ) { - m_a = castModel(); + m_a = castModel(); m_arpGroupBox->setModel( &m_a->m_arpEnabledModel ); m_arpComboBox->setModel( &m_a->m_arpModel ); m_arpRangeKnob->setModel( &m_a->m_arpRangeModel ); @@ -202,5 +201,5 @@ void arpeggiatorView::modelChanged( void ) -#include "moc_instrument_function_views.cxx" +#include "moc_InstrumentFunctionViews.cxx" diff --git a/src/gui/widgets/instrument_midi_io_view.cpp b/src/gui/widgets/InstrumentMidiIOView.cpp similarity index 94% rename from src/gui/widgets/instrument_midi_io_view.cpp rename to src/gui/widgets/InstrumentMidiIOView.cpp index c7cb3b831..7db26499b 100644 --- a/src/gui/widgets/instrument_midi_io_view.cpp +++ b/src/gui/widgets/InstrumentMidiIOView.cpp @@ -1,8 +1,8 @@ /* - * instrument_midi_io_view.cpp - MIDI-IO-View + * InstrumentMidiIOView.cpp - MIDI-IO-View * * Copyright (c) 2005-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -25,7 +25,7 @@ #include #include -#include "instrument_midi_io_view.h" +#include "InstrumentMidiIOView.h" #include "MidiPortMenu.h" #include "engine.h" #include "embed.h" @@ -38,9 +38,9 @@ -instrumentMidiIOView::instrumentMidiIOView( QWidget * _parent ) : +InstrumentMidiIOView::InstrumentMidiIOView( QWidget * _parent ) : QWidget( _parent ), - modelView( NULL, this ), + ModelView( NULL, this ), m_rpBtn( NULL ), m_wpBtn( NULL ) { @@ -112,14 +112,14 @@ instrumentMidiIOView::instrumentMidiIOView( QWidget * _parent ) : -instrumentMidiIOView::~instrumentMidiIOView() +InstrumentMidiIOView::~InstrumentMidiIOView() { } -void instrumentMidiIOView::modelChanged() +void InstrumentMidiIOView::modelChanged() { MidiPort * mp = castModel(); diff --git a/src/gui/widgets/instrument_sound_shaping_view.cpp b/src/gui/widgets/InstrumentSoundShapingView.cpp similarity index 82% rename from src/gui/widgets/instrument_sound_shaping_view.cpp rename to src/gui/widgets/InstrumentSoundShapingView.cpp index 479bc3de1..98c5741c5 100644 --- a/src/gui/widgets/instrument_sound_shaping_view.cpp +++ b/src/gui/widgets/InstrumentSoundShapingView.cpp @@ -1,8 +1,8 @@ /* - * instrument_sound_shaping_view.cpp - view for instrumentSoundShaping-class + * InstrumentSoundShapingView.cpp - view for InstrumentSoundShaping class + * + * Copyright (c) 2004-2009 Tobias Doerffel * - * Copyright (c) 2004-2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,10 +22,9 @@ * */ - -#include "instrument_sound_shaping_view.h" -#include "envelope_and_lfo_parameters.h" -#include "envelope_and_lfo_view.h" +#include "InstrumentSoundShapingView.h" +#include "EnvelopeAndLfoParameters.h" +#include "EnvelopeAndLfoView.h" #include "combobox.h" #include "group_box.h" #include "gui_templates.h" @@ -46,9 +45,9 @@ const int FILTER_GROUPBOX_HEIGHT = 245-FILTER_GROUPBOX_Y; -instrumentSoundShapingView::instrumentSoundShapingView( QWidget * _parent ) : +InstrumentSoundShapingView::InstrumentSoundShapingView( QWidget * _parent ) : QWidget( _parent ), - modelView( NULL, this ), + ModelView( NULL, this ), m_ss( NULL ) { m_targetsTabWidget = new tabWidget( tr( "TARGET" ), this ); @@ -71,12 +70,11 @@ instrumentSoundShapingView::instrumentSoundShapingView( QWidget * _parent ) : "sounds out of a saw-wave with just some " "envelopes...!" ) ); - for( int i = 0; i < instrumentSoundShaping::NumTargets; ++i ) + for( int i = 0; i < InstrumentSoundShaping::NumTargets; ++i ) { - m_envLFOViews[i] = new envelopeAndLFOView( m_targetsTabWidget ); - m_targetsTabWidget->addTab( m_envLFOViews[i], - tr( __targetNames[i][0] - .toUtf8().constData() ) ); + m_envLfoViews[i] = new EnvelopeAndLfoView( m_targetsTabWidget ); + m_targetsTabWidget->addTab( m_envLfoViews[i], + tr( __targetNames[i][0].toUtf8().constData() ) ); } @@ -123,7 +121,7 @@ instrumentSoundShapingView::instrumentSoundShapingView( QWidget * _parent ) : -instrumentSoundShapingView::~instrumentSoundShapingView() +InstrumentSoundShapingView::~InstrumentSoundShapingView() { delete m_targetsTabWidget; } @@ -131,20 +129,20 @@ instrumentSoundShapingView::~instrumentSoundShapingView() -void instrumentSoundShapingView::modelChanged( void ) +void InstrumentSoundShapingView::modelChanged( void ) { - m_ss = castModel(); + m_ss = castModel(); m_filterGroupBox->setModel( &m_ss->m_filterEnabledModel ); m_filterComboBox->setModel( &m_ss->m_filterModel ); m_filterCutKnob->setModel( &m_ss->m_filterCutModel ); m_filterResKnob->setModel( &m_ss->m_filterResModel ); - for( int i = 0; i < instrumentSoundShaping::NumTargets; ++i ) + for( int i = 0; i < InstrumentSoundShaping::NumTargets; ++i ) { - m_envLFOViews[i]->setModel( m_ss->m_envLFOParameters[i] ); + m_envLfoViews[i]->setModel( m_ss->m_envLfoParameters[i] ); } } -#include "moc_instrument_sound_shaping_view.cxx" +#include "moc_InstrumentSoundShapingView.cxx" diff --git a/src/gui/widgets/ladspa_control_view.cpp b/src/gui/widgets/LadspaControlView.cpp similarity index 70% rename from src/gui/widgets/ladspa_control_view.cpp rename to src/gui/widgets/LadspaControlView.cpp index c20940b5e..585dba51c 100644 --- a/src/gui/widgets/ladspa_control_view.cpp +++ b/src/gui/widgets/LadspaControlView.cpp @@ -1,7 +1,8 @@ /* - * ladspa_control_view.cpp - widget for controlling a LADSPA port + * LadspaControlView.cpp - widget for controlling a LADSPA port * * Copyright (c) 2006-2008 Danny McRae + * Copyright (c) 2009 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -22,21 +23,20 @@ * */ - #include -#include "ladspa_control.h" -#include "ladspa_control_view.h" -#include "ladspa_base.h" +#include "LadspaControl.h" +#include "LadspaControlView.h" +#include "LadspaBase.h" #include "led_checkbox.h" -#include "tempo_sync_knob.h" +#include "TempoSyncKnob.h" #include "tooltip.h" -ladspaControlView::ladspaControlView( QWidget * _parent, - ladspaControl * _ctl ) : +LadspaControlView::LadspaControlView( QWidget * _parent, + LadspaControl * _ctl ) : QWidget( _parent ), - modelView( _ctl, this ), + ModelView( _ctl, this ), m_ctl( _ctl ) { QHBoxLayout * layout = new QHBoxLayout( this ); @@ -55,15 +55,13 @@ ladspaControlView::ladspaControlView( QWidget * _parent, knob * knb = NULL; - switch( m_ctl->getPort()->data_type ) + switch( m_ctl->port()->data_type ) { case TOGGLED: { ledCheckBox * toggle = new ledCheckBox( - m_ctl->getPort()->name, this, - QString::null, - ledCheckBox::Green ); - toggle->setModel( m_ctl->getToggledModel() ); + m_ctl->port()->name, this, QString::null, ledCheckBox::Green ); + toggle->setModel( m_ctl->toggledModel() ); layout->addWidget( toggle ); if( link != NULL ) { @@ -80,13 +78,11 @@ ladspaControlView::ladspaControlView( QWidget * _parent, case INTEGER: case FLOATING: - knb = new knob( knobBright_26, this, - m_ctl->getPort()->name ); + knb = new knob( knobBright_26, this, m_ctl->port()->name ); break; case TIME: - knb = new tempoSyncKnob( knobBright_26, this, - m_ctl->getPort()->name ); + knb = new TempoSyncKnob( knobBright_26, this, m_ctl->port()->name ); break; default: @@ -95,15 +91,15 @@ ladspaControlView::ladspaControlView( QWidget * _parent, if( knb != NULL ) { - if( m_ctl->getPort()->data_type != TIME ) + if( m_ctl->port()->data_type != TIME ) { - knb->setModel( m_ctl->getKnobModel() ); + knb->setModel( m_ctl->knobModel() ); } else { - knb->setModel( m_ctl->getTempoSyncKnobModel() ); + knb->setModel( m_ctl->tempoSyncKnobModel() ); } - knb->setLabel( m_ctl->getPort()->name ); + knb->setLabel( m_ctl->port()->name ); knb->setHintText( tr( "Value:" ) + " ", "" ); knb->setWhatsThis( tr( "Sorry, no help available." ) ); layout->addWidget( knb ); @@ -122,11 +118,11 @@ ladspaControlView::ladspaControlView( QWidget * _parent, -ladspaControlView::~ladspaControlView() +LadspaControlView::~LadspaControlView() { } -#include "moc_ladspa_control_view.cxx" +#include "moc_LadspaControlView.cxx" diff --git a/src/gui/widgets/meter_dialog.cpp b/src/gui/widgets/MeterDialog.cpp similarity index 83% rename from src/gui/widgets/meter_dialog.cpp rename to src/gui/widgets/MeterDialog.cpp index dceb467c3..7b7d1f626 100644 --- a/src/gui/widgets/meter_dialog.cpp +++ b/src/gui/widgets/MeterDialog.cpp @@ -1,9 +1,9 @@ /* - * meter_dialog.cpp - dialog for entering meter settings + * MeterDialog.cpp - dialog for entering meter settings * - * Copyright (c) 2008 Tobias Doerffel + * Copyright (c) 2008-2009 Tobias Doerffel * Copyright (c) 2006-2008 Danny McRae - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -28,16 +28,16 @@ #include #include -#include "meter_dialog.h" -#include "meter_model.h" +#include "MeterDialog.h" +#include "MeterModel.h" #include "embed.h" #include "gui_templates.h" #include "lcd_spinbox.h" -meterDialog::meterDialog( QWidget * _parent, bool _simple ) : +MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : QWidget( _parent ), - modelView( NULL, this ) + ModelView( NULL, this ) { QVBoxLayout * vlayout = new QVBoxLayout( this ); vlayout->setSpacing( 0 ); @@ -99,18 +99,18 @@ meterDialog::meterDialog( QWidget * _parent, bool _simple ) : -meterDialog::~meterDialog() +MeterDialog::~MeterDialog() { } -void meterDialog::modelChanged( void ) +void MeterDialog::modelChanged() { - meterModel * mm = castModel(); - m_numerator->setModel( &mm->m_numeratorModel ); - m_denominator->setModel( &mm->m_denominatorModel ); + MeterModel * mm = castModel(); + m_numerator->setModel( &mm->numeratorModel() ); + m_denominator->setModel( &mm->denominatorModel() ); } diff --git a/src/gui/widgets/MidiPortMenu.cpp b/src/gui/widgets/MidiPortMenu.cpp index e61f7a167..835f537d7 100644 --- a/src/gui/widgets/MidiPortMenu.cpp +++ b/src/gui/widgets/MidiPortMenu.cpp @@ -29,7 +29,7 @@ MidiPortMenu::MidiPortMenu( MidiPort::Modes _mode ) : - modelView( NULL, this ), + ModelView( NULL, this ), m_mode( _mode ) { setFont( pointSize<9>( font() ) ); diff --git a/src/gui/widgets/automatable_button.cpp b/src/gui/widgets/automatable_button.cpp index d1d44c63c..6dd51118a 100644 --- a/src/gui/widgets/automatable_button.cpp +++ b/src/gui/widgets/automatable_button.cpp @@ -32,7 +32,7 @@ #include "caption_menu.h" #include "engine.h" #include "embed.h" -#include "main_window.h" +#include "MainWindow.h" @@ -40,7 +40,7 @@ automatableButton::automatableButton( QWidget * _parent, const QString & _name ) : QPushButton( _parent ), - boolModelView( new boolModel( FALSE, NULL, _name, TRUE ), this ), + BoolModelView( new BoolModel( false, NULL, _name, true ), this ), m_group( NULL ) { setAccessibleName( _name ); @@ -62,7 +62,7 @@ automatableButton::~automatableButton() -void automatableButton::modelChanged( void ) +void automatableButton::modelChanged() { if( QPushButton::isChecked() != model()->value() ) { @@ -73,7 +73,7 @@ void automatableButton::modelChanged( void ) -void automatableButton::update( void ) +void automatableButton::update() { if( QPushButton::isChecked() != model()->value() ) { @@ -124,7 +124,7 @@ void automatableButton::mousePressEvent( QMouseEvent * _me ) } else { - automatableModelView::mousePressEvent( _me ); + AutomatableModelView::mousePressEvent( _me ); QPushButton::mousePressEvent( _me ); } } @@ -143,11 +143,11 @@ void automatableButton::mouseReleaseEvent( QMouseEvent * _me ) -void automatableButton::toggle( void ) +void automatableButton::toggle() { if( isCheckable() && m_group != NULL ) { - if( model()->value() == FALSE ) + if( model()->value() == false ) { m_group->activateButton( this ); } @@ -168,7 +168,7 @@ void automatableButton::toggle( void ) automatableButtonGroup::automatableButtonGroup( QWidget * _parent, const QString & _name ) : QWidget( _parent ), - intModelView( new intModel( 0, 0, 0, NULL, _name, TRUE ), this ) + IntModelView( new IntModel( 0, 0, 0, NULL, _name, true ), this ) { hide(); setAccessibleName( _name ); @@ -192,11 +192,11 @@ automatableButtonGroup::~automatableButtonGroup() void automatableButtonGroup::addButton( automatableButton * _btn ) { _btn->m_group = this; - _btn->setCheckable( TRUE ); - _btn->model()->setValue( FALSE ); + _btn->setCheckable( true ); + _btn->model()->setValue( false ); // disable journalling as we're recording changes of states of // button-group members on our own - _btn->model()->setJournalling( FALSE ); + _btn->model()->setJournalling( false ); m_buttons.push_back( _btn ); model()->setRange( 0, m_buttons.size() - 1 ); @@ -231,18 +231,18 @@ void automatableButtonGroup::activateButton( automatableButton * _btn ) -void automatableButtonGroup::modelChanged( void ) +void automatableButtonGroup::modelChanged() { connect( model(), SIGNAL( dataChanged() ), this, SLOT( updateButtons() ) ); - intModelView::modelChanged(); + IntModelView::modelChanged(); updateButtons(); } -void automatableButtonGroup::updateButtons( void ) +void automatableButtonGroup::updateButtons() { model()->setRange( 0, m_buttons.size() - 1 ); int i = 0; diff --git a/src/gui/widgets/automatable_slider.cpp b/src/gui/widgets/automatable_slider.cpp index 3515f6b88..b53014562 100644 --- a/src/gui/widgets/automatable_slider.cpp +++ b/src/gui/widgets/automatable_slider.cpp @@ -2,8 +2,8 @@ * automatable_slider.cpp - implementation of class automatableSlider * * Copyright (c) 2006-2007 Javier Serrano Polo - * Copyright (c) 2007-2008 Tobias Doerffel - * + * Copyright (c) 2007-2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,7 +23,6 @@ * */ - #include "automatable_slider.h" #include @@ -32,7 +31,7 @@ #include "caption_menu.h" #include "embed.h" #include "engine.h" -#include "main_window.h" +#include "MainWindow.h" @@ -40,8 +39,8 @@ automatableSlider::automatableSlider( QWidget * _parent, const QString & _name ) : QSlider( _parent ), - intModelView( new intModel( 0, 0, 0, NULL, _name, TRUE ), this ), - m_showStatus( FALSE ) + IntModelView( new IntModel( 0, 0, 0, NULL, _name, true ), this ), + m_showStatus( false ) { setAccessibleName( _name ); @@ -76,12 +75,12 @@ void automatableSlider::mousePressEvent( QMouseEvent * _me ) if( _me->button() == Qt::LeftButton && ! ( _me->modifiers() & Qt::ControlModifier ) ) { - m_showStatus = TRUE; + m_showStatus = true; QSlider::mousePressEvent( _me ); } else { - automatableModelView::mousePressEvent( _me ); + IntModelView::mousePressEvent( _me ); } } @@ -90,7 +89,7 @@ void automatableSlider::mousePressEvent( QMouseEvent * _me ) void automatableSlider::mouseReleaseEvent( QMouseEvent * _me ) { - m_showStatus = FALSE; + m_showStatus = false; QSlider::mouseReleaseEvent( _me ); } @@ -100,7 +99,7 @@ void automatableSlider::mouseReleaseEvent( QMouseEvent * _me ) void automatableSlider::wheelEvent( QWheelEvent * _me ) { bool old_status = m_showStatus; - m_showStatus = TRUE; + m_showStatus = true; QSlider::wheelEvent( _me ); m_showStatus = old_status; } @@ -108,7 +107,7 @@ void automatableSlider::wheelEvent( QWheelEvent * _me ) -void automatableSlider::modelChanged( void ) +void automatableSlider::modelChanged() { QSlider::setRange( model()->minValue(), model()->maxValue() ); updateSlider(); @@ -137,7 +136,7 @@ void automatableSlider::moveSlider( int _value ) -void automatableSlider::updateSlider( void ) +void automatableSlider::updateSlider() { QSlider::setValue( model()->value() ); } diff --git a/src/gui/widgets/combobox.cpp b/src/gui/widgets/combobox.cpp index 9b95f693d..053f57c26 100644 --- a/src/gui/widgets/combobox.cpp +++ b/src/gui/widgets/combobox.cpp @@ -38,7 +38,7 @@ #include "engine.h" #include "embed.h" #include "gui_templates.h" -#include "main_window.h" +#include "MainWindow.h" QPixmap * comboBox::s_background = NULL; @@ -50,26 +50,23 @@ const int CB_ARROW_BTN_WIDTH = 20; comboBox::comboBox( QWidget * _parent, const QString & _name ) : QWidget( _parent ), - intModelView( new comboBoxModel( NULL, QString::null, TRUE ), this ), + IntModelView( new ComboBoxModel( NULL, QString::null, true ), this ), m_menu( this ), - m_pressed( FALSE ) + m_pressed( false ) { if( s_background == NULL ) { - s_background = new QPixmap( embed::getIconPixmap( - "combobox_bg" ) ); + s_background = new QPixmap( embed::getIconPixmap( "combobox_bg" ) ); } if( s_arrow == NULL ) { - s_arrow = new QPixmap( embed::getIconPixmap( - "combobox_arrow" ) ); + s_arrow = new QPixmap( embed::getIconPixmap( "combobox_arrow" ) ); } if( s_arrowSelected == NULL ) { - s_arrowSelected = new QPixmap( embed::getIconPixmap( - "combobox_arrow_selected" ) ); + s_arrowSelected = new QPixmap( embed::getIconPixmap( "combobox_arrow_selected" ) ); } setFont( pointSize<9>( font() ) ); @@ -115,7 +112,7 @@ void comboBox::mousePressEvent( QMouseEvent * _me ) { if( _me->x() > width() - CB_ARROW_BTN_WIDTH ) { - m_pressed = TRUE; + m_pressed = true; update(); m_menu.clear(); @@ -141,7 +138,7 @@ void comboBox::mousePressEvent( QMouseEvent * _me ) m_menu.exec( mapToGlobal( QPoint( width(), 0 ) ) ); } - m_pressed = FALSE; + m_pressed = false; update(); } else if( _me->button() == Qt::LeftButton ) @@ -157,7 +154,7 @@ void comboBox::mousePressEvent( QMouseEvent * _me ) } else { - automatableModelView::mousePressEvent( _me ); + IntModelView::mousePressEvent( _me ); } } diff --git a/src/gui/widgets/fader.cpp b/src/gui/widgets/fader.cpp index 02a1de27d..cee9cc5e0 100644 --- a/src/gui/widgets/fader.cpp +++ b/src/gui/widgets/fader.cpp @@ -53,13 +53,13 @@ #include "embed.h" #include "engine.h" #include "caption_menu.h" -#include "main_window.h" +#include "MainWindow.h" -fader::fader( floatModel * _model, const QString & _name, QWidget * _parent ) : +fader::fader( FloatModel * _model, const QString & _name, QWidget * _parent ) : QWidget( _parent ), - floatModelView( _model, this ), + FloatModelView( _model, this ), m_model( _model ), m_fPeakValue_L( 0.0 ), m_fPeakValue_R( 0.0 ), @@ -120,7 +120,7 @@ void fader::mousePressEvent( QMouseEvent * _me ) } else { - automatableModelView::mousePressEvent( _me ); + AutomatableModelView::mousePressEvent( _me ); } } diff --git a/src/gui/widgets/graph.cpp b/src/gui/widgets/graph.cpp index 5a5299cc9..b4201383d 100644 --- a/src/gui/widgets/graph.cpp +++ b/src/gui/widgets/graph.cpp @@ -23,7 +23,6 @@ * */ - #include #include #include @@ -31,25 +30,21 @@ #include "graph.h" #include "string_pair_drag.h" #include "sample_buffer.h" -#include "oscillator.h" -//#include -//#include - -using namespace std; - +#include "Oscillator.h" +#include "engine.h" graph::graph( QWidget * _parent, graphStyle _style ) : QWidget( _parent ), - /* TODO: size, background? */ - modelView( new graphModel( -1.0, 1.0, 128, NULL, TRUE ), this ), + /* TODO: size, background? */ + ModelView( new graphModel( -1.0, 1.0, 128, NULL, true ), this ), m_graphStyle( _style ) { m_mouseDown = false; m_graphColor = QColor( 0xFF, 0xAA, 0x00 ); resize( 132, 104 ); - setAcceptDrops( TRUE ); + setAcceptDrops( true ); setCursor( Qt::CrossCursor ); graphModel * gModel = castModel(); @@ -125,18 +120,18 @@ void graph::mouseMoveEvent ( QMouseEvent * _me ) if( diff >= 1 ) { - x = min( width() - 2, m_lastCursorX + 1); + x = qMin( width() - 2, m_lastCursorX + 1); } else if( diff <= 1 ) { - x = max( 2, m_lastCursorX - 1 ); + x = qMax( 2, m_lastCursorX - 1 ); } else { x = m_lastCursorX; } - y = max( 2, min( y, height()-3 ) ); + y = qMax( 2, qMin( y, height()-3 ) ); changeSampleAt( x, y ); @@ -237,7 +232,7 @@ void graph::paintEvent( QPaintEvent * ) switch( m_graphStyle ) { case graph::LinearStyle: - p.setRenderHints( QPainter::Antialiasing, TRUE ); + p.setRenderHints( QPainter::Antialiasing, true ); for( int i=0; i < length; i++ ) { @@ -255,7 +250,7 @@ void graph::paintEvent( QPaintEvent * ) width()-2, 2+static_cast( ( (*samps)[0] - maxVal ) * yscale ) ); - p.setRenderHints( QPainter::Antialiasing, FALSE ); + p.setRenderHints( QPainter::Antialiasing, false ); break; @@ -314,7 +309,7 @@ void graph::dropEvent( QDropEvent * _de ) void graph::dragEnterEvent( QDragEnterEvent * _dee ) { if( stringPairDrag::processDragEnterEvent( _dee, - QString( "samplefile" ) ) == FALSE ) + QString( "samplefile" ) ) == false ) { _dee->ignore(); } @@ -322,7 +317,7 @@ void graph::dragEnterEvent( QDragEnterEvent * _dee ) -void graph::modelChanged( void ) +void graph::modelChanged() { graphModel * gModel = castModel(); @@ -341,15 +336,15 @@ void graph::updateGraph( int _startPos, int _endPos ) } -void graph::updateGraph( void ) +void graph::updateGraph() { updateGraph( 0, model()->length() - 1 ); } graphModel::graphModel( float _min, float _max, int _length, - ::model * _parent, bool _default_constructed, float _step ) : - model( _parent, tr( "Graph" ), _default_constructed ), + ::Model * _parent, bool _default_constructed, float _step ) : + Model( _parent, tr( "Graph" ), _default_constructed ), m_samples( _length ), m_minValue( _min ), m_maxValue( _max ), @@ -424,11 +419,11 @@ void graphModel::setSamples( const float * _samples ) -void graphModel::setWaveToSine( void ) +void graphModel::setWaveToSine() { for( int i = 0; i < length(); i++ ) { - m_samples[i] = oscillator::sinSample( + m_samples[i] = Oscillator::sinSample( i / static_cast( length() ) ); } @@ -437,11 +432,11 @@ void graphModel::setWaveToSine( void ) -void graphModel::setWaveToTriangle( void ) +void graphModel::setWaveToTriangle() { for( int i = 0; i < length(); i++ ) { - m_samples[i] = oscillator::triangleSample( + m_samples[i] = Oscillator::triangleSample( i / static_cast( length() ) ); } @@ -450,11 +445,11 @@ void graphModel::setWaveToTriangle( void ) -void graphModel::setWaveToSaw( void ) +void graphModel::setWaveToSaw() { for( int i = 0; i < length(); i++ ) { - m_samples[i] = oscillator::sawSample( + m_samples[i] = Oscillator::sawSample( i / static_cast( length() ) ); } @@ -463,11 +458,11 @@ void graphModel::setWaveToSaw( void ) -void graphModel::setWaveToSquare( void ) +void graphModel::setWaveToSquare() { for( int i = 0; i < length(); i++ ) { - m_samples[i] = oscillator::squareSample( + m_samples[i] = Oscillator::squareSample( i / static_cast( length() ) ); } @@ -476,11 +471,11 @@ void graphModel::setWaveToSquare( void ) -void graphModel::setWaveToNoise( void ) +void graphModel::setWaveToNoise() { for( int i = 0; i < length(); i++ ) { - m_samples[i] = oscillator::noiseSample( + m_samples[i] = Oscillator::noiseSample( i / static_cast( length() ) ); } @@ -489,7 +484,7 @@ void graphModel::setWaveToNoise( void ) -void graphModel::smooth( void ) +void graphModel::smooth() { // store values in temporary array QVector temp = m_samples; @@ -506,7 +501,7 @@ void graphModel::smooth( void ) -void graphModel::normalize( void ) +void graphModel::normalize() { float max = 0.0001f; for( int i = 0; i < length(); i++ ) diff --git a/src/gui/widgets/group_box.cpp b/src/gui/widgets/group_box.cpp index 8f6d71802..01ce277d3 100644 --- a/src/gui/widgets/group_box.cpp +++ b/src/gui/widgets/group_box.cpp @@ -2,7 +2,7 @@ * group_box.cpp - groupbox for LMMS * * Copyright (c) 2005-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,18 +22,15 @@ * */ - #include #include - #ifndef __USE_XOPEN #define __USE_XOPEN #endif #include - #include "group_box.h" #include "embed.h" #include "gui_templates.h" @@ -42,19 +39,19 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent ) : QWidget( _parent ), - boolModelView( NULL, this ), + BoolModelView( NULL, this ), m_caption( _caption ) { updatePixmap(); m_led = new pixmapButton( this, _caption ); - m_led->setCheckable( TRUE ); + m_led->setCheckable( true ); m_led->move( 3, 3 ); m_led->setActiveGraphic( embed::getIconPixmap( "led_green" ) ); m_led->setInactiveGraphic( embed::getIconPixmap( "led_off" ) ); - setModel( new boolModel( FALSE, NULL, _caption, TRUE ) ); - setAutoFillBackground( TRUE ); + setModel( new BoolModel( false, NULL, _caption, true ) ); + setAutoFillBackground( true ); unsetCursor(); } @@ -69,7 +66,7 @@ groupBox::~groupBox() -void groupBox::modelChanged( void ) +void groupBox::modelChanged() { m_led->setModel( model() ); } @@ -96,7 +93,7 @@ void groupBox::resizeEvent( QResizeEvent * _ev ) -void groupBox::updatePixmap( void ) +void groupBox::updatePixmap() { QColor bg_color = QApplication::palette().color( QPalette::Active, QPalette::Background ); diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index fcf042376..8866a4483 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -2,7 +2,7 @@ * knob.cpp - powerful knob-widget * * Copyright (c) 2004-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,9 +22,6 @@ * */ - -#include "knob.h" - #include #include #include @@ -38,15 +35,15 @@ #endif #include - +#include "knob.h" #include "caption_menu.h" #include "config_mgr.h" #include "ControllerConnection.h" #include "embed.h" #include "engine.h" #include "gui_templates.h" -#include "main_window.h" -#include "project_journal.h" +#include "MainWindow.h" +#include "ProjectJournal.h" #include "song.h" #include "string_pair_drag.h" #include "templates.h" @@ -59,13 +56,13 @@ textFloat * knob::s_textFloat = NULL; knob::knob( int _knob_num, QWidget * _parent, const QString & _name ) : QWidget( _parent ), - floatModelView( new knobModel( 0, 0, 0, 1, NULL, _name, TRUE ), this ), + FloatModelView( new FloatModel( 0, 0, 0, 1, NULL, _name, true ), this ), m_knobNum( _knob_num ), m_label( "" ), m_knobPixmap( NULL ), - m_volumeKnob( FALSE ), + m_volumeKnob( false ), m_mouseOffset( 0.0f ), - m_buttonPressed( FALSE ), + m_buttonPressed( false ), m_angle( -10 ), m_outerColor( NULL ) { @@ -137,7 +134,7 @@ void knob::setTotalAngle( float _angle ) -float knob::innerRadius( void ) const +float knob::innerRadius() const { return m_innerRadius; } @@ -151,7 +148,7 @@ void knob::setInnerRadius( float _r ) -float knob::outerRadius( void ) const +float knob::outerRadius() const { return m_outerRadius; } @@ -165,14 +162,14 @@ void knob::setOuterRadius( float _r ) -QPointF knob::centerPoint( void ) const +QPointF knob::centerPoint() const { return m_centerPoint; } -float knob::centerPointX( void ) const +float knob::centerPointX() const { return m_centerPoint.x(); } @@ -186,7 +183,7 @@ void knob::setCenterPointX( float _c ) -float knob::centerPointY( void ) const +float knob::centerPointY() const { return m_centerPoint.y(); } @@ -200,7 +197,7 @@ void knob::setCenterPointY( float _c ) -float knob::lineWidth( void ) const +float knob::lineWidth() const { return m_lineWidth; } @@ -214,7 +211,7 @@ void knob::setLineWidth( float _w ) -QColor knob::outerColor( void ) const +QColor knob::outerColor() const { if( m_outerColor ) { @@ -255,7 +252,7 @@ QLineF knob::calculateLine( const QPointF & _mid, float _radius, float _innerRad -bool knob::updateAngle( void ) +bool knob::updateAngle() { int angle = 0; if( model() && model()->maxValue() != model()->minValue() ) @@ -269,9 +266,9 @@ bool knob::updateAngle( void ) if( qAbs( angle - m_angle ) > 3 ) { m_angle = angle; - return( TRUE ); + return true; } - return( FALSE ); + return false; } @@ -279,7 +276,7 @@ bool knob::updateAngle( void ) void knob::drawKnob( QPainter * _p ) { - if( updateAngle() == FALSE && !m_cache.isNull() ) + if( updateAngle() == false && !m_cache.isNull() ) { _p->drawImage( 0, 0, m_cache ); return; @@ -371,7 +368,7 @@ void knob::drawKnob( QPainter * _p ) float knob::getValue( const QPoint & _p ) { - if( engine::getMainWindow()->isShiftPressed() ) + if( engine::mainWindow()->isShiftPressed() ) { return( ( _p.y() - m_origMousePos.y() ) * model()->step() ); } @@ -420,12 +417,12 @@ void knob::dropEvent( QDropEvent * _de ) } else if( type == "automatable_model" ) { - automatableModel * mod = dynamic_cast( - engine::getProjectJournal()-> - getJournallingObject( val.toInt() ) ); + AutomatableModel * mod = dynamic_cast( + engine::projectJournal()-> + journallingObject( val.toInt() ) ); if( mod != NULL ) { - automatableModel::linkModels( model(), mod ); + AutomatableModel::linkModels( model(), mod ); mod->setValue( model()->value() ); } } @@ -452,10 +449,10 @@ void knob::mousePressEvent( QMouseEvent * _me ) s_textFloat->moveGlobal( this, QPoint( width() + 2, 0 ) ); s_textFloat->show(); - m_buttonPressed = TRUE; + m_buttonPressed = true; } else if( _me->button() == Qt::LeftButton && - engine::getMainWindow()->isShiftPressed() == TRUE ) + engine::mainWindow()->isShiftPressed() == true ) { new stringPairDrag( "float_value", QString::number( model()->value() ), @@ -463,7 +460,7 @@ void knob::mousePressEvent( QMouseEvent * _me ) } else { - automatableModelView::mousePressEvent( _me ); + FloatModelView::mousePressEvent( _me ); } } @@ -472,7 +469,7 @@ void knob::mousePressEvent( QMouseEvent * _me ) void knob::mouseMoveEvent( QMouseEvent * _me ) { - if( m_buttonPressed == TRUE && _me->pos() != m_origMousePos ) + if( m_buttonPressed == true && _me->pos() != m_origMousePos ) { setPosition( _me->pos() ); emit sliderMoved( model()->value() ); @@ -489,7 +486,7 @@ void knob::mouseReleaseEvent( QMouseEvent * /* _me*/ ) { model()->addJournalEntryFromOldToCurVal(); - m_buttonPressed = FALSE; + m_buttonPressed = false; m_mouseOffset = 0; emit sliderReleased(); @@ -567,7 +564,7 @@ void knob::setPosition( const QPoint & _p ) -void knob::enterValue( void ) +void knob::enterValue() { bool ok; float new_val; @@ -611,11 +608,11 @@ void knob::enterValue( void ) -void knob::friendlyUpdate( void ) +void knob::friendlyUpdate() { if( model()->getControllerConnection() == NULL || model()->getControllerConnection()->getController()-> - frequentUpdates() == FALSE || + frequentUpdates() == false || Controller::runningFrames() % (256*4) == 0 ) { update(); @@ -625,23 +622,23 @@ void knob::friendlyUpdate( void ) -QString knob::displayValue( void ) const +QString knob::displayValue() const { if( isVolumeKnob() && configManager::inst()->value( "app", "displaydbv" ).toInt() ) { - return( m_description.trimmed() + QString( " %1 dBV" ). + return m_description.trimmed() + QString( " %1 dBV" ). arg( 20.0 * log10( model()->value() / 100.0 ), - 3, 'f', 2 ) ); + 3, 'f', 2 ); } - return( m_description.trimmed() + QString( " %1" ). - arg( model()->value() ) + m_unit ); + return m_description.trimmed() + QString( " %1" ). + arg( model()->value() ) + m_unit; } -void knob::doConnections( void ) +void knob::doConnections() { if( model() != NULL ) { @@ -656,7 +653,7 @@ void knob::doConnections( void ) -void knob::displayHelp( void ) +void knob::displayHelp() { QWhatsThis::showText( mapToGlobal( rect().bottomRight() ), whatsThis() ); diff --git a/src/gui/widgets/lcd_spinbox.cpp b/src/gui/widgets/lcd_spinbox.cpp index ec6568d51..8949d43d7 100644 --- a/src/gui/widgets/lcd_spinbox.cpp +++ b/src/gui/widgets/lcd_spinbox.cpp @@ -38,14 +38,14 @@ #include "embed.h" #include "gui_templates.h" #include "templates.h" -#include "main_window.h" +#include "MainWindow.h" lcdSpinBox::lcdSpinBox( int _num_digits, QWidget * _parent, const QString & _name ) : QWidget( _parent ), - intModelView( new intModel( 0, 0, 0, NULL, _name, true ), this ), + IntModelView( new IntModel( 0, 0, 0, NULL, _name, true ), this ), m_label(), m_numDigits( _num_digits ), m_origMousePos() @@ -70,7 +70,7 @@ lcdSpinBox::lcdSpinBox( int _num_digits, QWidget * _parent, lcdSpinBox::lcdSpinBox( int _num_digits, const QString & _lcd_style, QWidget * _parent, const QString & _name ) : QWidget( _parent ), - intModelView( new intModel( 0, 0, 0, NULL, _name, true ), this ), + IntModelView( new IntModel( 0, 0, 0, NULL, _name, true ), this ), m_label(), m_numDigits( _num_digits ), m_origMousePos() @@ -291,7 +291,7 @@ void lcdSpinBox::mousePressEvent( QMouseEvent * _me ) } else { - automatableModelView::mousePressEvent( _me ); + IntModelView::mousePressEvent( _me ); } } diff --git a/src/gui/widgets/pixmap_button.cpp b/src/gui/widgets/pixmap_button.cpp index 1ef8f9b8c..c2d99f3eb 100644 --- a/src/gui/widgets/pixmap_button.cpp +++ b/src/gui/widgets/pixmap_button.cpp @@ -28,7 +28,7 @@ #include #include "pixmap_button.h" -#include "main_window.h" +#include "MainWindow.h" #include "embed.h" diff --git a/src/gui/widgets/project_notes.cpp b/src/gui/widgets/project_notes.cpp index 9a8dfb921..678cec8ba 100644 --- a/src/gui/widgets/project_notes.cpp +++ b/src/gui/widgets/project_notes.cpp @@ -39,13 +39,13 @@ #include "embed.h" #include "engine.h" -#include "main_window.h" +#include "MainWindow.h" #include "song.h" projectNotes::projectNotes( void ) : - QMainWindow( engine::getMainWindow()->workspace() ) + QMainWindow( engine::mainWindow()->workspace() ) { m_edit = new QTextEdit( this ); m_edit->setAutoFillBackground( TRUE ); @@ -70,7 +70,7 @@ projectNotes::projectNotes( void ) : setWindowTitle( tr( "Project notes" ) ); setWindowIcon( embed::getIconPixmap( "project_notes" ) ); - engine::getMainWindow()->workspace()->addSubWindow( this ); + engine::mainWindow()->workspace()->addSubWindow( this ); parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false ); parentWidget()->move( 700, 10 ); parentWidget()->resize( 400, 300 ); @@ -378,7 +378,7 @@ void projectNotes::alignmentChanged( int _a ) void projectNotes::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - mainWindow::saveWidgetState( this, _this ); + MainWindow::saveWidgetState( this, _this ); QDomCDATASection ds = _doc.createCDATASection( m_edit->toHtml() ); _this.appendChild( ds ); @@ -389,7 +389,7 @@ void projectNotes::saveSettings( QDomDocument & _doc, QDomElement & _this ) void projectNotes::loadSettings( const QDomElement & _this ) { - mainWindow::restoreWidgetState( this, _this ); + MainWindow::restoreWidgetState( this, _this ); m_edit->setHtml( _this.text() ); } diff --git a/src/gui/widgets/tempo_sync_knob.cpp b/src/gui/widgets/tempo_sync_knob.cpp index 95719064a..4e178ee67 100644 --- a/src/gui/widgets/tempo_sync_knob.cpp +++ b/src/gui/widgets/tempo_sync_knob.cpp @@ -1,9 +1,9 @@ /* - * tempo_sync_knob.cpp - adds bpm to ms conversion for knob class + * TempoSyncKnob.cpp - adds bpm to ms conversion for knob class * * Copyright (c) 2005-2007 Danny McRae - * Copyright (c) 2005-2008 Tobias Doerffel - * + * Copyright (c) 2005-2009 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -24,191 +24,19 @@ */ -#include - -#include "tempo_sync_knob.h" - -#include #include -#include +#include "TempoSyncKnob.h" #include "engine.h" #include "caption_menu.h" #include "embed.h" -#include "main_window.h" -#include "meter_dialog.h" +#include "MainWindow.h" +#include "MeterDialog.h" #include "song.h" -tempoSyncKnobModel::tempoSyncKnobModel( const float _val, const float _min, - const float _max, const float _step, - const float _scale, ::model * _parent, - const QString & _display_name ) : - knobModel( _val, _min, _max, _step, _parent, _display_name ), - m_tempoSyncMode( SyncNone ), - m_tempoLastSyncMode( SyncNone ), - m_scale( _scale ), - m_custom( _parent ) -{ - connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), - this, SLOT( calculateTempoSyncTime( bpm_t ) ) ); -} - - - -tempoSyncKnobModel::~tempoSyncKnobModel() -{ -} - - - - -void tempoSyncKnobModel::setTempoSync( QAction * _item ) -{ - setTempoSync( _item->data().toInt() ); -} - - - - -void tempoSyncKnobModel::setTempoSync( int _note_type ) -{ - setSyncMode( ( tempoSyncMode ) _note_type ); - engine::getSong()->setModified(); -} - - - - -void tempoSyncKnobModel::calculateTempoSyncTime( bpm_t _bpm ) -{ - float conversionFactor = 1.0; - - if( m_tempoSyncMode ) - { - switch( m_tempoSyncMode ) - { - case SyncCustom: - conversionFactor = - static_cast( m_custom.getDenominator() ) / - static_cast( m_custom.getNumerator() ); - break; - case SyncDoubleWholeNote: - conversionFactor = 0.125; - break; - case SyncWholeNote: - conversionFactor = 0.25; - break; - case SyncHalfNote: - conversionFactor = 0.5; - break; - case SyncQuarterNote: - conversionFactor = 1.0; - break; - case SyncEighthNote: - conversionFactor = 2.0; - break; - case SyncSixteenthNote: - conversionFactor = 4.0; - break; - case SyncThirtysecondNote: - conversionFactor = 8.0; - break; - default: ; - } - bool journalling = testAndSetJournalling( FALSE ); - float oneUnit = 60000.0 / ( _bpm * conversionFactor * m_scale ); - setValue( oneUnit * maxValue() ); - setJournalling( journalling ); - } - - if( m_tempoSyncMode != m_tempoLastSyncMode ) - { - emit syncModeChanged( m_tempoSyncMode ); - m_tempoLastSyncMode = m_tempoSyncMode; - } -} - - - - -void tempoSyncKnobModel::saveSettings( QDomDocument & _doc, QDomElement & _this, - const QString & _name ) -{ - _this.setAttribute( "syncmode", ( int ) getSyncMode() ); - m_custom.saveSettings( _doc, _this, _name ); - knobModel::saveSettings( _doc, _this, _name ); -} - - - - -void tempoSyncKnobModel::loadSettings( const QDomElement & _this, - const QString & _name ) -{ - setSyncMode( ( tempoSyncMode ) _this.attribute( "syncmode" ).toInt() ); - m_custom.loadSettings( _this, _name ); - knobModel::loadSettings( _this, _name ); -} - - - - -tempoSyncKnobModel::tempoSyncMode tempoSyncKnobModel::getSyncMode( void ) -{ - return( m_tempoSyncMode ); -} - - - - -void tempoSyncKnobModel::setSyncMode( tempoSyncMode _new_mode ) -{ - if( m_tempoSyncMode != _new_mode ) - { - m_tempoSyncMode = _new_mode; - if( _new_mode == SyncCustom ) - { - connect( &m_custom, SIGNAL( dataChanged() ), - this, SLOT( updateCustom() ) ); - } - } - calculateTempoSyncTime( engine::getSong()->getTempo() ); -} - - - - -float tempoSyncKnobModel::getScale( void ) -{ - return( m_scale ); -} - - - - -void tempoSyncKnobModel::setScale( float _new_scale ) -{ - m_scale = _new_scale; - calculateTempoSyncTime( engine::getSong()->getTempo() ); - emit scaleChanged( _new_scale ); -} - - - - -void tempoSyncKnobModel::updateCustom( void ) -{ - setSyncMode( SyncCustom ); -} - - - - - - -tempoSyncKnob::tempoSyncKnob( int _knob_num, QWidget * _parent, +TempoSyncKnob::TempoSyncKnob( int _knob_num, QWidget * _parent, const QString & _name ) : knob( _knob_num, _parent, _name ), m_tempoSyncIcon( embed::getIconPixmap( "tempo_sync" ) ), @@ -220,7 +48,7 @@ tempoSyncKnob::tempoSyncKnob( int _knob_num, QWidget * _parent, -tempoSyncKnob::~tempoSyncKnob() +TempoSyncKnob::~TempoSyncKnob() { if( m_custom ) { @@ -231,17 +59,17 @@ tempoSyncKnob::~tempoSyncKnob() -void tempoSyncKnob::modelChanged( void ) +void TempoSyncKnob::modelChanged() { if( model() == NULL ) { - printf( "no tempoSyncKnobModel has been set!\n" ); + qWarning( "no TempoSyncKnobModel has been set!" ); } if( m_custom != NULL ) { m_custom->setModel( &model()->m_custom ); } - connect( model(), SIGNAL( syncModeChanged( tempoSyncMode ) ), + connect( model(), SIGNAL( syncModeChanged( TempoSyncMode ) ), this, SLOT( updateDescAndIcon() ) ); connect( this, SIGNAL( sliderMoved( float ) ), model(), SLOT( disableSync() ) ); @@ -251,7 +79,7 @@ void tempoSyncKnob::modelChanged( void ) -void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * ) +void TempoSyncKnob::contextMenuEvent( QContextMenuEvent * ) { mouseReleaseEvent( NULL ); @@ -270,51 +98,51 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * ) connect( syncMenu, SIGNAL( triggered( QAction * ) ), model(), SLOT( setTempoSync( QAction * ) ) ); syncMenu->addAction( embed::getIconPixmap( "note_none" ), - tr( "No Sync" ) )->setData( (int) tempoSyncKnobModel::SyncNone ); + tr( "No Sync" ) )->setData( (int) TempoSyncKnobModel::SyncNone ); if( limit / 0.125f <= model()->maxValue() ) { syncMenu->addAction( embed::getIconPixmap( "note_double_whole" ), tr( "Eight beats" ) )->setData( - (int) tempoSyncKnobModel::SyncDoubleWholeNote ); + (int) TempoSyncKnobModel::SyncDoubleWholeNote ); } if( limit / 0.25f <= model()->maxValue() ) { syncMenu->addAction( embed::getIconPixmap( "note_whole" ), tr( "Whole note" ) )->setData( - (int) tempoSyncKnobModel::SyncWholeNote ); + (int) TempoSyncKnobModel::SyncWholeNote ); } if( limit / 0.5f <= model()->maxValue() ) { syncMenu->addAction( embed::getIconPixmap( "note_half" ), tr( "Half note" ) )->setData( - (int) tempoSyncKnobModel::SyncHalfNote ); + (int) TempoSyncKnobModel::SyncHalfNote ); } if( limit <= model()->maxValue() ) { syncMenu->addAction( embed::getIconPixmap( "note_quarter" ), tr( "Quarter note" ) )->setData( - (int) tempoSyncKnobModel::SyncQuarterNote ); + (int) TempoSyncKnobModel::SyncQuarterNote ); } if( limit / 2.0f <= model()->maxValue() ) { syncMenu->addAction( embed::getIconPixmap( "note_eighth" ), tr( "8th note" ) )->setData( - (int) tempoSyncKnobModel::SyncEighthNote ); + (int) TempoSyncKnobModel::SyncEighthNote ); } if( limit / 4.0f <= model()->maxValue() ) { syncMenu->addAction( embed::getIconPixmap( "note_sixteenth" ), tr( "16th note" ) )->setData( - (int) tempoSyncKnobModel::SyncSixteenthNote ); + (int) TempoSyncKnobModel::SyncSixteenthNote ); } syncMenu->addAction( embed::getIconPixmap( "note_thirtysecond" ), tr( "32nd note" ) )->setData( - (int) tempoSyncKnobModel::SyncThirtysecondNote ); + (int) TempoSyncKnobModel::SyncThirtysecondNote ); syncMenu->addAction( embed::getIconPixmap( "dont_know" ), tr( "Custom..." ), - this, SLOT( showCustom( void ) ) + this, SLOT( showCustom() ) )->setData( - (int) tempoSyncKnobModel::SyncCustom ); + (int) TempoSyncKnobModel::SyncCustom ); contextMenu.addSeparator(); } @@ -330,45 +158,45 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * ) -void tempoSyncKnob::updateDescAndIcon( void ) +void TempoSyncKnob::updateDescAndIcon() { if( model()->m_tempoSyncMode ) { switch( model()->m_tempoSyncMode ) { - case tempoSyncKnobModel::SyncCustom: + case TempoSyncKnobModel::SyncCustom: m_tempoSyncDescription = tr( "Custom " ) + "(" + - QString::number( model()->m_custom.getNumerator() ) + + QString::number( model()->m_custom.numeratorModel().value() ) + "/" + - QString::number( model()->m_custom.getDenominator() ) + + QString::number( model()->m_custom.denominatorModel().value() ) + ")"; break; - case tempoSyncKnobModel::SyncDoubleWholeNote: + case TempoSyncKnobModel::SyncDoubleWholeNote: m_tempoSyncDescription = tr( "Synced to Eight Beats" ); break; - case tempoSyncKnobModel::SyncWholeNote: + case TempoSyncKnobModel::SyncWholeNote: m_tempoSyncDescription = tr( "Synced to Whole Note" ); break; - case tempoSyncKnobModel::SyncHalfNote: + case TempoSyncKnobModel::SyncHalfNote: m_tempoSyncDescription = tr( "Synced to Half Note" ); break; - case tempoSyncKnobModel::SyncQuarterNote: + case TempoSyncKnobModel::SyncQuarterNote: m_tempoSyncDescription = tr( "Synced to Quarter Note" ); break; - case tempoSyncKnobModel::SyncEighthNote: + case TempoSyncKnobModel::SyncEighthNote: m_tempoSyncDescription = tr( "Synced to 8th Note" ); break; - case tempoSyncKnobModel::SyncSixteenthNote: + case TempoSyncKnobModel::SyncSixteenthNote: m_tempoSyncDescription = tr( "Synced to 16th Note" ); break; - case tempoSyncKnobModel::SyncThirtysecondNote: + case TempoSyncKnobModel::SyncThirtysecondNote: m_tempoSyncDescription = tr( "Synced to 32nd Note" ); break; @@ -380,52 +208,43 @@ void tempoSyncKnob::updateDescAndIcon( void ) m_tempoSyncDescription = tr( "Tempo Sync" ); } if( m_custom != NULL && - model()->m_tempoSyncMode != tempoSyncKnobModel::SyncCustom ) + model()->m_tempoSyncMode != TempoSyncKnobModel::SyncCustom ) { m_custom->parentWidget()->hide(); } switch( model()->m_tempoSyncMode ) { - case tempoSyncKnobModel::SyncNone: - m_tempoSyncIcon = embed::getIconPixmap( - "tempo_sync" ); + case TempoSyncKnobModel::SyncNone: + m_tempoSyncIcon = embed::getIconPixmap( "tempo_sync" ); break; - case tempoSyncKnobModel::SyncCustom: - m_tempoSyncIcon = embed::getIconPixmap( - "dont_know" ); + case TempoSyncKnobModel::SyncCustom: + m_tempoSyncIcon = embed::getIconPixmap( "dont_know" ); break; - case tempoSyncKnobModel::SyncDoubleWholeNote: - m_tempoSyncIcon = embed::getIconPixmap( - "note_double_whole" ); + case TempoSyncKnobModel::SyncDoubleWholeNote: + m_tempoSyncIcon = embed::getIconPixmap( "note_double_whole" ); break; - case tempoSyncKnobModel::SyncWholeNote: - m_tempoSyncIcon = embed::getIconPixmap( - "note_whole" ); + case TempoSyncKnobModel::SyncWholeNote: + m_tempoSyncIcon = embed::getIconPixmap( "note_whole" ); break; - case tempoSyncKnobModel::SyncHalfNote: - m_tempoSyncIcon = embed::getIconPixmap( - "note_half" ); + case TempoSyncKnobModel::SyncHalfNote: + m_tempoSyncIcon = embed::getIconPixmap( "note_half" ); break; - case tempoSyncKnobModel::SyncQuarterNote: - m_tempoSyncIcon = embed::getIconPixmap( - "note_quarter" ); + case TempoSyncKnobModel::SyncQuarterNote: + m_tempoSyncIcon = embed::getIconPixmap( "note_quarter" ); break; - case tempoSyncKnobModel::SyncEighthNote: - m_tempoSyncIcon = embed::getIconPixmap( - "note_eighth" ); + case TempoSyncKnobModel::SyncEighthNote: + m_tempoSyncIcon = embed::getIconPixmap( "note_eighth" ); break; - case tempoSyncKnobModel::SyncSixteenthNote: - m_tempoSyncIcon = embed::getIconPixmap( - "note_sixteenth" ); + case TempoSyncKnobModel::SyncSixteenthNote: + m_tempoSyncIcon = embed::getIconPixmap( "note_sixteenth" ); break; - case tempoSyncKnobModel::SyncThirtysecondNote: - m_tempoSyncIcon = embed::getIconPixmap( - "note_thirtysecond" ); + case TempoSyncKnobModel::SyncThirtysecondNote: + m_tempoSyncIcon = embed::getIconPixmap( "note_thirtysecond" ); break; default: - printf( "tempoSyncKnob::calculateTempoSyncTime" - ": invalid tempoSyncMode" ); + qWarning( "TempoSyncKnob::calculateTempoSyncTime:" + "invalid TempoSyncMode" ); break; } @@ -436,15 +255,15 @@ void tempoSyncKnob::updateDescAndIcon( void ) -const QString & tempoSyncKnob::getSyncDescription( void ) +const QString & TempoSyncKnob::syncDescription() { - return( m_tempoSyncDescription ); + return m_tempoSyncDescription; } -void tempoSyncKnob::setSyncDescription( const QString & _new_description ) +void TempoSyncKnob::setSyncDescription( const QString & _new_description ) { m_tempoSyncDescription = _new_description; emit syncDescriptionChanged( _new_description ); @@ -453,15 +272,15 @@ void tempoSyncKnob::setSyncDescription( const QString & _new_description ) -const QPixmap & tempoSyncKnob::getSyncIcon( void ) +const QPixmap & TempoSyncKnob::syncIcon() { - return( m_tempoSyncIcon ); + return m_tempoSyncIcon; } -void tempoSyncKnob::setSyncIcon( const QPixmap & _new_icon ) +void TempoSyncKnob::setSyncIcon( const QPixmap & _new_icon ) { m_tempoSyncIcon = _new_icon; emit syncIconChanged(); @@ -470,22 +289,21 @@ void tempoSyncKnob::setSyncIcon( const QPixmap & _new_icon ) -void tempoSyncKnob::showCustom( void ) +void TempoSyncKnob::showCustom() { if( m_custom == NULL ) { - m_custom = new meterDialog( - engine::getMainWindow()->workspace() ); - engine::getMainWindow()->workspace()->addSubWindow( m_custom ); + m_custom = new MeterDialog( engine::mainWindow()->workspace() ); + engine::mainWindow()->workspace()->addSubWindow( m_custom ); m_custom->setWindowTitle( "Meter" ); m_custom->setModel( &model()->m_custom ); } m_custom->parentWidget()->show(); - model()->setTempoSync( tempoSyncKnobModel::SyncCustom ); + model()->setTempoSync( TempoSyncKnobModel::SyncCustom ); } -#include "moc_tempo_sync_knob.cxx" +#include "moc_TempoSyncKnob.cxx" diff --git a/src/gui/widgets/text_float.cpp b/src/gui/widgets/text_float.cpp index 61543a566..b65f7cad8 100644 --- a/src/gui/widgets/text_float.cpp +++ b/src/gui/widgets/text_float.cpp @@ -28,13 +28,13 @@ #include "text_float.h" #include "gui_templates.h" -#include "main_window.h" +#include "MainWindow.h" #include "engine.h" textFloat::textFloat( void ) : - QWidget( engine::getMainWindow(), Qt::ToolTip ), + QWidget( engine::mainWindow(), Qt::ToolTip ), m_title( "" ), m_text( "" ), m_pixmap() @@ -87,7 +87,7 @@ void textFloat::setVisibilityTimeOut( int _msecs ) textFloat * textFloat::displayMessage( const QString & _msg, int _timeout, QWidget * _parent, int _add_y_margin ) { - QWidget * mw = engine::getMainWindow(); + QWidget * mw = engine::mainWindow(); textFloat * tf = new textFloat; if( _parent != NULL ) { diff --git a/src/gui/widgets/track_label_button.cpp b/src/gui/widgets/track_label_button.cpp index c51e63594..1376e1f37 100644 --- a/src/gui/widgets/track_label_button.cpp +++ b/src/gui/widgets/track_label_button.cpp @@ -31,8 +31,8 @@ #include "track_label_button.h" #include "embed.h" #include "rename_dialog.h" -#include "instrument_track.h" -#include "instrument.h" +#include "InstrumentTrack.h" +#include "Instrument.h" #include "config_mgr.h" #include "engine.h" @@ -123,13 +123,13 @@ void trackLabelButton::paintEvent( QPaintEvent * _pe ) { if( m_trackView->getTrack()->type() == track::InstrumentTrack ) { - instrumentTrack * it = - dynamic_cast( + InstrumentTrack * it = + dynamic_cast( m_trackView->getTrack() ); - const pixmapLoader * pl; - if( it && it->getInstrument() && - it->getInstrument()->getDescriptor() && - ( pl = it->getInstrument()->getDescriptor()->logo ) ) + const PixmapLoader * pl; + if( it && it->instrument() && + it->instrument()->descriptor() && + ( pl = it->instrument()->descriptor()->logo ) ) { if( pl->pixmapName() != m_iconName ) { diff --git a/src/gui/widgets/visualization_widget.cpp b/src/gui/widgets/visualization_widget.cpp index c45dc0b58..e6f3d71ca 100644 --- a/src/gui/widgets/visualization_widget.cpp +++ b/src/gui/widgets/visualization_widget.cpp @@ -28,7 +28,7 @@ #include "visualization_widget.h" #include "gui_templates.h" -#include "main_window.h" +#include "MainWindow.h" #include "embed.h" #include "engine.h" #include "tooltip.h" @@ -88,7 +88,7 @@ void visualizationWidget::setActive( bool _active ) m_active = _active; if( m_active ) { - connect( engine::getMainWindow(), + connect( engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); connect( engine::getMixer(), @@ -97,7 +97,7 @@ void visualizationWidget::setActive( bool _active ) } else { - disconnect( engine::getMainWindow(), + disconnect( engine::mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); disconnect( engine::getMixer(), diff --git a/src/tracks/instrument_track.cpp b/src/tracks/InstrumentTrack.cpp similarity index 85% rename from src/tracks/instrument_track.cpp rename to src/tracks/InstrumentTrack.cpp index 6bbb46387..42f84dbae 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -1,5 +1,5 @@ /* - * instrument_track.cpp - implementation of instrument-track-class + * InstrumentTrack.cpp - implementation of instrument-track-class * (window + data-structures) * * Copyright (c) 2004-2009 Tobias Doerffel @@ -38,35 +38,36 @@ #include #include -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "AudioPort.h" #include "automation_pattern.h" #include "bb_track.h" #include "config_mgr.h" #include "debug.h" -#include "effect_chain.h" -#include "effect_rack_view.h" +#include "EffectChain.h" +#include "EffectRackView.h" #include "embed.h" #include "engine.h" #include "file_browser.h" -#include "fx_mixer.h" -#include "fx_mixer_view.h" -#include "instrument_sound_shaping.h" -#include "instrument_sound_shaping_view.h" +#include "FxMixer.h" +#include "FxMixerView.h" +#include "InstrumentSoundShaping.h" +#include "InstrumentSoundShapingView.h" #include "fade_button.h" #include "gui_templates.h" -#include "instrument.h" -#include "instrument_function_views.h" -#include "instrument_midi_io_view.h" +#include "Instrument.h" +#include "InstrumentFunctionViews.h" +#include "InstrumentMidiIOView.h" +#include "knob.h" #include "lcd_spinbox.h" #include "led_checkbox.h" -#include "main_window.h" +#include "MainWindow.h" #include "MidiClient.h" #include "MidiPortMenu.h" #include "mmp.h" #include "note_play_handle.h" #include "pattern.h" -#include "plugin_view.h" +#include "PluginView.h" #include "sample_play_handle.h" #include "song.h" #include "string_pair_drag.h" @@ -77,7 +78,7 @@ -const char * volume_help = QT_TRANSLATE_NOOP( "instrumentTrack", +const char * volume_help = QT_TRANSLATE_NOOP( "InstrumentTrack", "With this knob you can set " "the volume of the opened " "channel."); @@ -89,8 +90,8 @@ const int INSTRUMENT_WINDOW_CACHE_SIZE = 8; // #### IT: -instrumentTrack::instrumentTrack( trackContainer * _tc ) : - track( InstrumentTrack, _tc ), +InstrumentTrack::InstrumentTrack( trackContainer * _tc ) : + track( track::InstrumentTrack, _tc ), MidiEventProcessor(), m_audioPort( tr( "unnamed_track" ) ), m_midiPort( tr( "unnamed_track" ), engine::getMixer()->midiClient(), @@ -131,7 +132,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : -instrumentTrack::~instrumentTrack() +InstrumentTrack::~InstrumentTrack() { // kill all running notes silenceAllNotes(); @@ -143,11 +144,11 @@ instrumentTrack::~instrumentTrack() -void instrumentTrack::processAudioBuffer( sampleFrame * _buf, +void InstrumentTrack::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, notePlayHandle * _n ) { - // we must not play the sound if this instrumentTrack is muted... + // we must not play the sound if this InstrumentTrack is muted... if( isMuted() || ( _n && _n->bbTrackMuted() ) ) { return; @@ -155,7 +156,7 @@ void instrumentTrack::processAudioBuffer( sampleFrame * _buf, // if effects "went to sleep" because there was no input, wake them up // now - m_audioPort.getEffects()->startRunning(); + m_audioPort.effects()->startRunning(); float v_scale = (float) getVolume() / DefaultVolume; @@ -195,7 +196,7 @@ void instrumentTrack::processAudioBuffer( sampleFrame * _buf, -midiEvent instrumentTrack::applyMasterKey( const midiEvent & _me ) +midiEvent InstrumentTrack::applyMasterKey( const midiEvent & _me ) { midiEvent copy( _me ); switch( _me.m_type ) @@ -214,7 +215,7 @@ midiEvent instrumentTrack::applyMasterKey( const midiEvent & _me ) -void instrumentTrack::processInEvent( const midiEvent & _me, +void InstrumentTrack::processInEvent( const midiEvent & _me, const midiTime & _time ) { engine::getMixer()->lock(); @@ -337,7 +338,7 @@ void instrumentTrack::processInEvent( const midiEvent & _me, -void instrumentTrack::processOutEvent( const midiEvent & _me, +void InstrumentTrack::processOutEvent( const midiEvent & _me, const midiTime & _time ) { int k; @@ -407,7 +408,7 @@ void instrumentTrack::processOutEvent( const midiEvent & _me, -void instrumentTrack::silenceAllNotes() +void InstrumentTrack::silenceAllNotes() { engine::getMixer()->lock(); for( int i = 0; i < NumKeys; ++i ) @@ -425,7 +426,7 @@ void instrumentTrack::silenceAllNotes() -f_cnt_t instrumentTrack::beatLen( notePlayHandle * _n ) const +f_cnt_t InstrumentTrack::beatLen( notePlayHandle * _n ) const { if( m_instrument != NULL ) { @@ -441,7 +442,7 @@ f_cnt_t instrumentTrack::beatLen( notePlayHandle * _n ) const -void instrumentTrack::playNote( notePlayHandle * _n, +void InstrumentTrack::playNote( notePlayHandle * _n, sampleFrame * _working_buffer ) { // arpeggio- and chord-widget has to do its work -> adding sub-notes @@ -459,7 +460,7 @@ void instrumentTrack::playNote( notePlayHandle * _n, -QString instrumentTrack::instrumentName( void ) const +QString InstrumentTrack::instrumentName() const { if( m_instrument != NULL ) { @@ -471,7 +472,7 @@ QString instrumentTrack::instrumentName( void ) const -void instrumentTrack::deleteNotePluginData( notePlayHandle * _n ) +void InstrumentTrack::deleteNotePluginData( notePlayHandle * _n ) { if( m_instrument != NULL ) { @@ -495,7 +496,7 @@ void instrumentTrack::deleteNotePluginData( notePlayHandle * _n ) -void instrumentTrack::setName( const QString & _new_name ) +void InstrumentTrack::setName( const QString & _new_name ) { // when changing name of track, also change name of those patterns, // which have the same name as the instrument-track @@ -520,7 +521,7 @@ void instrumentTrack::setName( const QString & _new_name ) -void instrumentTrack::updateBaseNote( void ) +void InstrumentTrack::updateBaseNote() { engine::getMixer()->lock(); for( NotePlayHandleList::Iterator it = m_processHandles.begin(); @@ -534,7 +535,7 @@ void instrumentTrack::updateBaseNote( void ) -void instrumentTrack::updatePitch( void ) +void InstrumentTrack::updatePitch() { updateBaseNote(); processOutEvent( midiEvent( MidiPitchBend, @@ -545,7 +546,7 @@ void instrumentTrack::updatePitch( void ) -int instrumentTrack::masterKey( int _midi_key ) const +int InstrumentTrack::masterKey( int _midi_key ) const { int key = m_baseNoteModel.value() - engine::getSong()->masterPitch(); return tLimit( _midi_key - ( key - DefaultKey ), 0, NumKeys ); @@ -554,7 +555,7 @@ int instrumentTrack::masterKey( int _midi_key ) const -void instrumentTrack::removeMidiPortNode( multimediaProject & _mmp ) +void InstrumentTrack::removeMidiPortNode( multimediaProject & _mmp ) { QDomNodeList n = _mmp.elementsByTagName( "midiport" ); n.item( 0 ).parentNode().removeChild( n.item( 0 ) ); @@ -563,7 +564,7 @@ void instrumentTrack::removeMidiPortNode( multimediaProject & _mmp ) -bool instrumentTrack::play( const midiTime & _start, +bool InstrumentTrack::play( const midiTime & _start, const fpp_t _frames, const f_cnt_t _offset, Sint16 _tco_num ) @@ -688,7 +689,7 @@ bool instrumentTrack::play( const midiTime & _start, -trackContentObject * instrumentTrack::createTCO( const midiTime & ) +trackContentObject * InstrumentTrack::createTCO( const midiTime & ) { return new pattern( this ); } @@ -696,15 +697,15 @@ trackContentObject * instrumentTrack::createTCO( const midiTime & ) -trackView * instrumentTrack::createView( trackContainerView * _tcv ) +trackView * InstrumentTrack::createView( trackContainerView * _tcv ) { - return new instrumentTrackView( this, _tcv ); + return new InstrumentTrackView( this, _tcv ); } -void instrumentTrack::saveTrackSpecificSettings( QDomDocument & _doc, +void InstrumentTrack::saveTrackSpecificSettings( QDomDocument & _doc, QDomElement & _this ) { m_volumeModel.saveSettings( _doc, _this, "vol" ); @@ -717,7 +718,7 @@ void instrumentTrack::saveTrackSpecificSettings( QDomDocument & _doc, if( m_instrument != NULL ) { QDomElement i = _doc.createElement( "instrument" ); - i.setAttribute( "name", m_instrument->getDescriptor()->name ); + i.setAttribute( "name", m_instrument->descriptor()->name ); m_instrument->saveState( _doc, i ); _this.appendChild( i ); } @@ -725,13 +726,13 @@ void instrumentTrack::saveTrackSpecificSettings( QDomDocument & _doc, m_chordCreator.saveState( _doc, _this ); m_arpeggiator.saveState( _doc, _this ); m_midiPort.saveState( _doc, _this ); - m_audioPort.getEffects()->saveState( _doc, _this ); + m_audioPort.effects()->saveState( _doc, _this ); } -void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this ) +void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & _this ) { silenceAllNotes(); @@ -770,7 +771,7 @@ void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this ) } // clear effect-chain just in case we load an old preset without FX-data - m_audioPort.getEffects()->clear(); + m_audioPort.effects()->clear(); QDomNode node = _this.firstChild(); while( !node.isNull() ) @@ -793,17 +794,15 @@ void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this ) { m_midiPort.restoreState( node.toElement() ); } - else if( m_audioPort.getEffects()->nodeName() == - node.nodeName() ) + else if( m_audioPort.effects()->nodeName() == node.nodeName() ) { - m_audioPort.getEffects()->restoreState( - node.toElement() ); + m_audioPort.effects()->restoreState( node.toElement() ); } else if( node.nodeName() == "instrument" ) { delete m_instrument; m_instrument = NULL; - m_instrument = instrument::instantiate( + m_instrument = Instrument::instantiate( node.toElement().attribute( "name" ), this ); m_instrument->restoreState( @@ -819,7 +818,7 @@ void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this ) { delete m_instrument; m_instrument = NULL; - m_instrument = instrument::instantiate( + m_instrument = Instrument::instantiate( node.nodeName(), this ); if( m_instrument->nodeName() == node.nodeName() ) @@ -838,13 +837,13 @@ void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this ) -instrument * instrumentTrack::loadInstrument( const QString & _plugin_name ) +Instrument * InstrumentTrack::loadInstrument( const QString & _plugin_name ) { silenceAllNotes(); engine::getMixer()->lock(); delete m_instrument; - m_instrument = instrument::instantiate( _plugin_name, this ); + m_instrument = Instrument::instantiate( _plugin_name, this ); engine::getMixer()->unlock(); emit instrumentChanged(); @@ -859,11 +858,11 @@ instrument * instrumentTrack::loadInstrument( const QString & _plugin_name ) // #### ITV: -QQueue instrumentTrackView::s_windows; +QQueue InstrumentTrackView::s_windows; -instrumentTrackView::instrumentTrackView( instrumentTrack * _it, +InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, trackContainerView * _tcv ) : trackView( _it, _tcv ), m_window( NULL ), @@ -945,9 +944,9 @@ instrumentTrackView::instrumentTrackView( instrumentTrack * _it, m_activityIndicator->setGeometry( DEFAULT_SETTINGS_WIDGET_WIDTH-2*24-11, 2, 8, 28 ); m_activityIndicator->show(); - connect( m_activityIndicator, SIGNAL( pressed( void ) ), + connect( m_activityIndicator, SIGNAL( pressed() ), this, SLOT( activityIndicatorPressed() ) ); - connect( m_activityIndicator, SIGNAL( released( void ) ), + connect( m_activityIndicator, SIGNAL( released() ), this, SLOT( activityIndicatorReleased() ) ); connect( _it, SIGNAL( newNote() ), m_activityIndicator, SLOT( activate() ) ); @@ -959,7 +958,7 @@ instrumentTrackView::instrumentTrackView( instrumentTrack * _it, -instrumentTrackView::~instrumentTrackView() +InstrumentTrackView::~InstrumentTrackView() { freeInstrumentTrackWindow(); @@ -973,7 +972,7 @@ instrumentTrackView::~instrumentTrackView() // TODO: Add windows to free list on freeInstrumentTrackWindow. // But, don't NULL m_window or disconnect signals. This will allow windows // that are being show/hidden frequently to stay connected. -void instrumentTrackView::freeInstrumentTrackWindow( void ) +void InstrumentTrackView::freeInstrumentTrackWindow() { if( m_window != NULL ) { @@ -983,7 +982,7 @@ void instrumentTrackView::freeInstrumentTrackWindow( void ) model()->setHook( NULL ); m_window->parentWidget()->hide(); m_window->setModel( - engine::getDummyTrackContainer()-> + engine::dummyTrackContainer()-> dummyInstrumentTrack() ); m_window->updateInstrumentView(); s_windows.enqueue( m_window ); @@ -1000,7 +999,7 @@ void instrumentTrackView::freeInstrumentTrackWindow( void ) -void instrumentTrackView::cleanupWindowPool( void ) +void InstrumentTrackView::cleanupWindowPool() { while( s_windows.count() ) { @@ -1011,7 +1010,7 @@ void instrumentTrackView::cleanupWindowPool( void ) -instrumentTrackWindow * instrumentTrackView::getInstrumentTrackWindow( void ) +InstrumentTrackWindow * InstrumentTrackView::getInstrumentTrackWindow() { if( m_window != NULL ) { @@ -1032,7 +1031,7 @@ instrumentTrackWindow * instrumentTrackView::getInstrumentTrackWindow( void ) } else { - m_window = new instrumentTrackWindow( this ); + m_window = new InstrumentTrackWindow( this ); } return m_window; @@ -1041,9 +1040,9 @@ instrumentTrackWindow * instrumentTrackView::getInstrumentTrackWindow( void ) -void instrumentTrackView::dragEnterEvent( QDragEnterEvent * _dee ) +void InstrumentTrackView::dragEnterEvent( QDragEnterEvent * _dee ) { - instrumentTrackWindow::dragEnterEventGeneric( _dee ); + InstrumentTrackWindow::dragEnterEventGeneric( _dee ); if( !_dee->isAccepted() ) { trackView::dragEnterEvent( _dee ); @@ -1053,7 +1052,7 @@ void instrumentTrackView::dragEnterEvent( QDragEnterEvent * _dee ) -void instrumentTrackView::dropEvent( QDropEvent * _de ) +void InstrumentTrackView::dropEvent( QDropEvent * _de ) { getInstrumentTrackWindow()->dropEvent( _de ); trackView::dropEvent( _de ); @@ -1062,7 +1061,7 @@ void instrumentTrackView::dropEvent( QDropEvent * _de ) -void instrumentTrackView::toggleInstrumentWindow( bool _on ) +void InstrumentTrackView::toggleInstrumentWindow( bool _on ) { getInstrumentTrackWindow()->toggleVisibility( _on ); @@ -1075,7 +1074,7 @@ void instrumentTrackView::toggleInstrumentWindow( bool _on ) -void instrumentTrackView::activityIndicatorPressed( void ) +void InstrumentTrackView::activityIndicatorPressed() { model()->processInEvent( midiEvent( MidiNoteOn, 0, DefaultKey, MidiMaxVelocity ), @@ -1085,7 +1084,7 @@ void instrumentTrackView::activityIndicatorPressed( void ) -void instrumentTrackView::activityIndicatorReleased( void ) +void InstrumentTrackView::activityIndicatorReleased() { model()->processInEvent( midiEvent( MidiNoteOff, 0, DefaultKey, 0 ), midiTime() ); @@ -1095,7 +1094,7 @@ void instrumentTrackView::activityIndicatorReleased( void ) -void instrumentTrackView::midiInSelected( void ) +void InstrumentTrackView::midiInSelected() { if( model() ) { @@ -1107,7 +1106,7 @@ void instrumentTrackView::midiInSelected( void ) -void instrumentTrackView::midiOutSelected( void ) +void InstrumentTrackView::midiOutSelected() { if( model() ) { @@ -1119,7 +1118,7 @@ void instrumentTrackView::midiOutSelected( void ) -void instrumentTrackView::midiConfigChanged( void ) +void InstrumentTrackView::midiConfigChanged() { m_midiInputAction->setChecked( model()->m_midiPort.isReadable() ); m_midiOutputAction->setChecked( model()->m_midiPort.isWritable() ); @@ -1140,7 +1139,7 @@ class fxLineLcdSpinBox : public lcdSpinBox protected: virtual void mouseDoubleClickEvent ( QMouseEvent * _me ) { - engine::getFxMixerView()->setCurrentFxLine( model()->value() ); + engine::fxMixerView()->setCurrentFxLine( model()->value() ); //engine::getFxMixerView()->raise(); } }; @@ -1148,9 +1147,9 @@ class fxLineLcdSpinBox : public lcdSpinBox // #### ITW: -instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) : +InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : QWidget(), - modelView( NULL, this ), + ModelView( NULL, this ), m_track( _itv->model() ), m_itv( _itv ), m_instrumentView( NULL ) @@ -1232,14 +1231,14 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) : // create tab-widgets - m_ssView = new instrumentSoundShapingView( m_tabWidget ); + m_ssView = new InstrumentSoundShapingView( m_tabWidget ); QWidget * instrument_functions = new QWidget( m_tabWidget ); - m_chordView = new chordCreatorView( &m_track->m_chordCreator, + m_chordView = new ChordCreatorView( &m_track->m_chordCreator, instrument_functions ); - m_arpView= new arpeggiatorView( &m_track->m_arpeggiator, + m_arpView= new ArpeggiatorView( &m_track->m_arpeggiator, instrument_functions ); - m_midiView = new instrumentMidiIOView( m_tabWidget ); - m_effectView = new effectRackView( m_track->m_audioPort.getEffects(), + m_midiView = new InstrumentMidiIOView( m_tabWidget ); + m_effectView = new EffectRackView( m_track->m_audioPort.effects(), m_tabWidget ); m_tabWidget->addTab( m_ssView, tr( "ENV/LFO" ), 1 ); m_tabWidget->addTab( instrument_functions, tr( "FUNC" ), 2 ); @@ -1247,7 +1246,7 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) : m_tabWidget->addTab( m_midiView, tr( "MIDI" ), 4 ); // setup piano-widget - m_pianoView= new pianoView( this ); + m_pianoView= new PianoView( this ); m_pianoView->setFixedSize( INSTRUMENT_WIDTH, PIANO_HEIGHT ); vlayout->addWidget( m_generalSettingsWidget ); @@ -1263,7 +1262,7 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) : resize( sizeHint() ); QMdiSubWindow * subWin = - engine::getMainWindow()->workspace()->addSubWindow( this ); + engine::mainWindow()->workspace()->addSubWindow( this ); Qt::WindowFlags flags = subWin->windowFlags(); flags |= Qt::MSWindowsFixedSizeDialogHint; flags &= ~Qt::WindowMaximizeButtonHint; @@ -1276,10 +1275,10 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) : -instrumentTrackWindow::~instrumentTrackWindow() +InstrumentTrackWindow::~InstrumentTrackWindow() { delete m_instrumentView; - if( engine::getMainWindow()->workspace() ) + if( engine::mainWindow()->workspace() ) { parentWidget()->hide(); parentWidget()->deleteLater(); @@ -1289,9 +1288,9 @@ instrumentTrackWindow::~instrumentTrackWindow() -void instrumentTrackWindow::modelChanged( void ) +void InstrumentTrackWindow::modelChanged() { - m_track = castModel(); + m_track = castModel(); m_nameLineEdit->setText( m_track->name() ); @@ -1308,7 +1307,7 @@ void instrumentTrackWindow::modelChanged( void ) m_effectChannelNumber->setModel( &m_track->m_effectChannelModel ); m_pianoView->setModel( &m_track->m_piano ); - if( m_track->getInstrument() && m_track->getInstrument()->isBendable() ) + if( m_track->instrument() && m_track->instrument()->isBendable() ) { m_pitchKnob->setModel( &m_track->m_pitchModel ); m_pitchKnob->show(); @@ -1323,14 +1322,14 @@ void instrumentTrackWindow::modelChanged( void ) m_chordView->setModel( &m_track->m_chordCreator ); m_arpView->setModel( &m_track->m_arpeggiator ); m_midiView->setModel( &m_track->m_midiPort ); - m_effectView->setModel( m_track->m_audioPort.getEffects() ); + m_effectView->setModel( m_track->m_audioPort.effects() ); updateName(); } -void instrumentTrackWindow::saveSettingsBtnClicked( void ) +void InstrumentTrackWindow::saveSettingsBtnClicked() { QFileDialog sfd( this, tr( "Save preset" ), "", tr( "XML preset file (*.xpf)" ) ); @@ -1365,7 +1364,7 @@ void instrumentTrackWindow::saveSettingsBtnClicked( void ) -void instrumentTrackWindow::updateName( void ) +void InstrumentTrackWindow::updateName() { setWindowTitle( m_track->name() ); @@ -1379,7 +1378,7 @@ void instrumentTrackWindow::updateName( void ) -void instrumentTrackWindow::updateInstrumentView( void ) +void InstrumentTrackWindow::updateInstrumentView() { delete m_instrumentView; if( m_track->m_instrument != NULL ) @@ -1397,7 +1396,7 @@ void instrumentTrackWindow::updateInstrumentView( void ) -void instrumentTrackWindow::textChanged( const QString & _new_name ) +void InstrumentTrackWindow::textChanged( const QString & _new_name ) { m_track->setName( _new_name ); engine::getSong()->setModified(); @@ -1406,7 +1405,7 @@ void instrumentTrackWindow::textChanged( const QString & _new_name ) -void instrumentTrackWindow::toggleVisibility( bool _on ) +void InstrumentTrackWindow::toggleVisibility( bool _on ) { if( _on ) @@ -1424,10 +1423,10 @@ void instrumentTrackWindow::toggleVisibility( bool _on ) -void instrumentTrackWindow::closeEvent( QCloseEvent * _ce ) +void InstrumentTrackWindow::closeEvent( QCloseEvent * _ce ) { _ce->ignore(); - if( engine::getMainWindow()->workspace() ) + if( engine::mainWindow()->workspace() ) { parentWidget()->hide(); } @@ -1442,7 +1441,7 @@ void instrumentTrackWindow::closeEvent( QCloseEvent * _ce ) -void instrumentTrackWindow::focusInEvent( QFocusEvent * ) +void InstrumentTrackWindow::focusInEvent( QFocusEvent * ) { m_pianoView->setFocus(); } @@ -1450,7 +1449,7 @@ void instrumentTrackWindow::focusInEvent( QFocusEvent * ) -void instrumentTrackWindow::dragEnterEventGeneric( QDragEnterEvent * _dee ) +void InstrumentTrackWindow::dragEnterEventGeneric( QDragEnterEvent * _dee ) { stringPairDrag::processDragEnterEvent( _dee, "instrument,presetfile," "pluginpresetfile" ); @@ -1459,7 +1458,7 @@ void instrumentTrackWindow::dragEnterEventGeneric( QDragEnterEvent * _dee ) -void instrumentTrackWindow::dragEnterEvent( QDragEnterEvent * _dee ) +void InstrumentTrackWindow::dragEnterEvent( QDragEnterEvent * _dee ) { dragEnterEventGeneric( _dee ); } @@ -1467,7 +1466,7 @@ void instrumentTrackWindow::dragEnterEvent( QDragEnterEvent * _dee ) -void instrumentTrackWindow::dropEvent( QDropEvent * _de ) +void InstrumentTrackWindow::dropEvent( QDropEvent * _de ) { QString type = stringPairDrag::decodeKey( _de ); QString value = stringPairDrag::decodeValue( _de ); @@ -1480,7 +1479,7 @@ void instrumentTrackWindow::dropEvent( QDropEvent * _de ) else if( type == "presetfile" ) { multimediaProject mmp( value ); - instrumentTrack::removeMidiPortNode( mmp ); + InstrumentTrack::removeMidiPortNode( mmp ); m_track->setSimpleSerializing(); m_track->loadSettings( mmp.content().toElement() ); engine::getSong()->setModified(); @@ -1489,8 +1488,8 @@ void instrumentTrackWindow::dropEvent( QDropEvent * _de ) else if( type == "pluginpresetfile" ) { const QString ext = fileItem::extension( value ); - instrument * i = m_track->getInstrument(); - if( !i->getDescriptor()->supportsFileType( ext ) ) + Instrument * i = m_track->instrument(); + if( !i->descriptor()->supportsFileType( ext ) ) { i = m_track->loadInstrument( engine::pluginFileHandling()[ext] ); @@ -1503,20 +1502,20 @@ void instrumentTrackWindow::dropEvent( QDropEvent * _de ) -void instrumentTrackWindow::saveSettings( QDomDocument & _doc, +void InstrumentTrackWindow::saveSettings( QDomDocument & _doc, QDomElement & _this ) { _this.setAttribute( "tab", m_tabWidget->activeTab() ); - mainWindow::saveWidgetState( this, _this ); + MainWindow::saveWidgetState( this, _this ); } -void instrumentTrackWindow::loadSettings( const QDomElement & _this ) +void InstrumentTrackWindow::loadSettings( const QDomElement & _this ) { m_tabWidget->setActiveTab( _this.attribute( "tab" ).toInt() ); - mainWindow::restoreWidgetState( this, _this ); + MainWindow::restoreWidgetState( this, _this ); if( isVisible() ) { m_itv->m_tlb->setChecked( true ); @@ -1526,6 +1525,6 @@ void instrumentTrackWindow::loadSettings( const QDomElement & _this ) -#include "moc_instrument_track.cxx" +#include "moc_InstrumentTrack.cxx" diff --git a/src/tracks/automation_track.cpp b/src/tracks/automation_track.cpp index c9411b548..82fa48fbf 100644 --- a/src/tracks/automation_track.cpp +++ b/src/tracks/automation_track.cpp @@ -29,7 +29,7 @@ #include "automation_pattern.h" #include "engine.h" #include "embed.h" -#include "project_journal.h" +#include "ProjectJournal.h" #include "string_pair_drag.h" #include "track_container_view.h" #include "track_label_button.h" @@ -56,7 +56,7 @@ bool automationTrack::play( const midiTime & _start, const fpp_t _frames, { if( isMuted() ) { - return( FALSE ); + return false; } tcoVector tcos; @@ -86,7 +86,7 @@ bool automationTrack::play( const midiTime & _start, const fpp_t _frames, } p->processMidiTime( cur_start ); } - return( FALSE ); + return false; } @@ -94,7 +94,7 @@ bool automationTrack::play( const midiTime & _start, const fpp_t _frames, trackView * automationTrack::createView( trackContainerView * _tcv ) { - return( new automationTrackView( this, _tcv ) ); + return new automationTrackView( this, _tcv ); } @@ -102,7 +102,7 @@ trackView * automationTrack::createView( trackContainerView * _tcv ) trackContentObject * automationTrack::createTCO( const midiTime & ) { - return( new automationPattern( this ) ); + return new automationPattern( this ); } @@ -121,7 +121,7 @@ void automationTrack::loadTrackSpecificSettings( const QDomElement & _this ) // just in case something somehow wrent wrong... if( type() == HiddenAutomationTrack ) { - setMuted( FALSE ); + setMuted( false ); } } @@ -166,9 +166,9 @@ void automationTrackView::dropEvent( QDropEvent * _de ) QString val = stringPairDrag::decodeValue( _de ); if( type == "automatable_model" ) { - automatableModel * mod = dynamic_cast( - engine::getProjectJournal()-> - getJournallingObject( val.toInt() ) ); + AutomatableModel * mod = dynamic_cast( + engine::projectJournal()-> + journallingObject( val.toInt() ) ); if( mod != NULL ) { midiTime pos = midiTime( getTrackContainerView()-> diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index efb815de0..0b06817ff 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -2,7 +2,7 @@ * bb_track.cpp - implementation of class bbTrack and bbTCO * * Copyright (c) 2004-2009 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,13 +22,11 @@ * */ - #include #include #include #include - #include "bb_editor.h" #include "bb_track.h" #include "bb_track_container.h" @@ -432,7 +430,7 @@ void bbTrack::saveTrackSpecificSettings( QDomDocument & _doc, _this.parentNode().parentNode().nodeName() != "clone" && _this.parentNode().nodeName() != "journaldata" ) { - ( (journallingObject *)( engine::getBBTrackContainer() ) )-> + ( (JournallingObject *)( engine::getBBTrackContainer() ) )-> saveState( _doc, _this ); } if( _this.parentNode().parentNode().nodeName() == "clone" ) @@ -471,7 +469,7 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this ) trackContainer::classNodeName() ); if( node.isElement() ) { - ( (journallingObject *)engine::getBBTrackContainer() )-> + ( (JournallingObject *)engine::getBBTrackContainer() )-> restoreState( node.toElement() ); } } diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 1746df121..a4ce567b2 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -34,7 +34,7 @@ #include #include "pattern.h" -#include "instrument_track.h" +#include "InstrumentTrack.h" #include "templates.h" #include "gui_templates.h" #include "embed.h" @@ -48,7 +48,7 @@ #include "tooltip.h" #include "bb_track_container.h" #include "string_pair_drag.h" -#include "main_window.h" +#include "MainWindow.h" QPixmap * patternView::s_stepBtnOn = NULL; @@ -59,7 +59,7 @@ QPixmap * patternView::s_frozen = NULL; -pattern::pattern( instrumentTrack * _instrument_track ) : +pattern::pattern( InstrumentTrack * _instrument_track ) : trackContentObject( _instrument_track ), m_instrumentTrack( _instrument_track ), m_patternType( BeatPattern ), @@ -1301,7 +1301,7 @@ void patternView::paintEvent( QPaintEvent * ) p.setPen( QColor( 32, 240, 32 ) ); } - if( m_pat->name() != m_pat->getInstrumentTrack()->name() ) + if( m_pat->name() != m_pat->instrumentTrack()->name() ) { p.drawText( 2, p.fontMetrics().height() - 1, m_pat->name() ); } diff --git a/src/tracks/sample_track.cpp b/src/tracks/sample_track.cpp index d086ad85d..6f78b5bcc 100644 --- a/src/tracks/sample_track.cpp +++ b/src/tracks/sample_track.cpp @@ -42,8 +42,8 @@ #include "sample_record_handle.h" #include "string_pair_drag.h" #include "knob.h" -#include "main_window.h" -#include "effect_rack_view.h" +#include "MainWindow.h" +#include "EffectRackView.h" #include "track_label_button.h" @@ -404,7 +404,7 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames, const f_cnt_t _offset, Sint16 /*_tco_num*/ ) { - m_audioPort.getEffects()->startRunning(); + m_audioPort.effects()->startRunning(); bool played_a_note = false; // will be return variable for( int i = 0; i < numOfTCOs(); ++i ) @@ -467,7 +467,7 @@ trackContentObject * sampleTrack::createTCO( const midiTime & ) void sampleTrack::saveTrackSpecificSettings( QDomDocument & _doc, QDomElement & _this ) { - m_audioPort.getEffects()->saveState( _doc, _this ); + m_audioPort.effects()->saveState( _doc, _this ); #if 0 _this.setAttribute( "icon", tlb->pixmapFile() ); #endif @@ -480,16 +480,14 @@ void sampleTrack::saveTrackSpecificSettings( QDomDocument & _doc, void sampleTrack::loadTrackSpecificSettings( const QDomElement & _this ) { QDomNode node = _this.firstChild(); - m_audioPort.getEffects()->clear(); + m_audioPort.effects()->clear(); while( !node.isNull() ) { if( node.isElement() ) { - if( m_audioPort.getEffects()->nodeName() == - node.nodeName() ) + if( m_audioPort.effects()->nodeName() == node.nodeName() ) { - m_audioPort.getEffects()->restoreState( - node.toElement() ); + m_audioPort.effects()->restoreState( node.toElement() ); } } node = node.nextSibling(); @@ -524,10 +522,10 @@ sampleTrackView::sampleTrackView( sampleTrack * _t, trackContainerView * _tcv ) m_volumeKnob->setLabel( tr( "VOL" ) ); m_volumeKnob->show(); - m_effectRack = new effectRackView( _t->audioPort()->getEffects() ); + m_effectRack = new EffectRackView( _t->audioPort()->effects() ); m_effectRack->setFixedSize( 240, 242 ); - engine::getMainWindow()->workspace()->addSubWindow( m_effectRack ); + engine::mainWindow()->workspace()->addSubWindow( m_effectRack ); m_effWindow = m_effectRack->parentWidget(); m_effWindow->setAttribute( Qt::WA_DeleteOnClose, false ); m_effWindow->layout()->setSizeConstraint( QLayout::SetFixedSize );