From 5ca5da40b17dfd6b16c4d096dd808df94364fc05 Mon Sep 17 00:00:00 2001 From: Danny McRae Date: Tue, 15 Aug 2006 14:16:42 +0000 Subject: [PATCH] reformatted ladspa stuff to 80 characters per line git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@328 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 3 + include/effect.h | 3 +- include/effect_chain.h | 36 +++++++++- include/effect_label.h | 7 +- include/effect_tab_widget.h | 6 +- include/ladspa_control.h | 9 ++- include/ladspa_manager.h | 43 +++++++----- include/rack_plugin.h | 6 +- include/rack_view.h | 6 +- src/core/effect.cpp | 6 +- src/core/effect_chain.cpp | 21 ++++-- src/core/effect_tab_widget.cpp | 19 ++++-- src/core/ladspa_browser.cpp | 74 ++++++++++++-------- src/core/ladspa_port_dialog.cpp | 9 ++- src/lib/ladspa_manager.cpp | 105 +++++++++++++++-------------- src/widgets/effect_label.cpp | 18 +++-- src/widgets/ladspa_control.cpp | 36 +++++++--- src/widgets/ladspa_description.cpp | 15 +++-- src/widgets/rack_plugin.cpp | 84 ++++++++++++++++------- src/widgets/rack_view.cpp | 67 ++++++++++++------ 20 files changed, 382 insertions(+), 191 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3bd17934be..855d45410c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ added deletion of the control view to the dtor to make it clean up after itself + * All of the effects related files: + reformatted to respect the 80 characters per line convention + 2006-08-11 Tobias Doerffel * Makefile.cvs: diff --git a/include/effect.h b/include/effect.h index c837423d4f..bcaad4e0b3 100644 --- a/include/effect.h +++ b/include/effect.h @@ -55,7 +55,8 @@ public: effect( engine * _engine ); virtual ~effect(); - virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf, const fpab_t _frames ); + virtual bool FASTCALL processAudioBuffer( + surroundSampleFrame * _buf, const fpab_t _frames ); inline ch_cnt_t getProcessorCount( void ) { diff --git a/include/effect_chain.h b/include/effect_chain.h index 48a5869708..67df8a6bd8 100644 --- a/include/effect_chain.h +++ b/include/effect_chain.h @@ -55,7 +55,8 @@ public: void FASTCALL deleteEffect( effect * _effect ); void FASTCALL moveDown( effect * _effect ); void FASTCALL moveUp( effect * _effect ); - bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf, const fpab_t _frames ); + bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf, + const fpab_t _frames ); void startRunning( void ); bool isRunning( void ); @@ -80,6 +81,39 @@ private: #endif +typedef vvector effect_list_t; + +class effectChain: public engineObject +{ + public: + effectChain( engine * _engine ); + ~effectChain(); + + void FASTCALL appendEffect( effect * _effect ); + void FASTCALL deleteEffect( effect * _effect ); + void FASTCALL moveDown( effect * _effect ); + void FASTCALL moveUp( effect * _effect ); + bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf, + const fpab_t _frames ); + void startRunning( void ); + bool isRunning( void ); + + inline void setBypass( bool _mode ) + { + m_bypassed = _mode; + } + + inline const effect_list_t & getEffects( void ) + { + return( m_effects ); + } + + private: + effect_list_t m_effects; + + bool m_bypassed; + QMutex m_processLock; +}; diff --git a/include/effect_label.h b/include/effect_label.h index 4c896f07a2..36d05965b0 100644 --- a/include/effect_label.h +++ b/include/effect_label.h @@ -55,7 +55,9 @@ class effectLabel: public QWidget, public journallingObject { Q_OBJECT public: - effectLabel( const QString & _initial_name, QWidget * _parent, engine * _engine, sampleTrack * _track ); + effectLabel( const QString & _initial_name, + QWidget * _parent, engine * _engine, + sampleTrack * _track ); virtual ~effectLabel(); inline const QString & text( void ) @@ -64,7 +66,8 @@ public: } void FASTCALL setText( const QString & _text ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void FASTCALL saveSettings( QDomDocument & _doc, + QDomElement & _parent ); virtual void FASTCALL loadSettings( const QDomElement & _this ); inline virtual QString nodeName( void ) const { diff --git a/include/effect_tab_widget.h b/include/effect_tab_widget.h index d644e48c97..fba078252c 100644 --- a/include/effect_tab_widget.h +++ b/include/effect_tab_widget.h @@ -72,11 +72,13 @@ class effectTabWidget : public QWidget, public journallingObject Q_OBJECT public: effectTabWidget( instrumentTrack * _track, audioPort * _port ); - effectTabWidget( QWidget * _parent, sampleTrack * _track, audioPort * _port ); + effectTabWidget( QWidget * _parent, sampleTrack * _track, + audioPort * _port ); virtual ~effectTabWidget(); - virtual void FASTCALL saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void FASTCALL saveSettings( QDomDocument & _doc, + QDomElement & _parent ); virtual void FASTCALL loadSettings( const QDomElement & _this ); inline virtual QString nodeName( void ) const { diff --git a/include/ladspa_control.h b/include/ladspa_control.h index 5533a3e9f3..b6868d0e57 100644 --- a/include/ladspa_control.h +++ b/include/ladspa_control.h @@ -53,14 +53,17 @@ class ladspaControl : public QWidget, public journallingObject { Q_OBJECT public: - ladspaControl( QWidget * _parent, port_desc_t * _port, engine * _engine, track * _track ); + ladspaControl( QWidget * _parent, port_desc_t * _port, + engine * _engine, track * _track ); ~ladspaControl(); LADSPA_Data getValue( void ); void FASTCALL setValue( LADSPA_Data _value ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, QDomElement & _parent, const QString & _name ); - virtual void FASTCALL loadSettings( const QDomElement & _this, const QString & _name ); + virtual void FASTCALL saveSettings( QDomDocument & _doc, + QDomElement & _parent, const QString & _name ); + virtual void FASTCALL loadSettings( const QDomElement & _this, + const QString & _name ); inline virtual QString nodeName( void ) const { return( "port" ); diff --git a/include/ladspa_manager.h b/include/ladspa_manager.h index 44e9df10cb..1b0ad4ed54 100644 --- a/include/ladspa_manager.h +++ b/include/ladspa_manager.h @@ -158,7 +158,8 @@ public: bool FASTCALL isPortAudio( const ladspa_key_t & _plugin, Uint32 _port ); /* Indicates that the port is an control. */ - bool FASTCALL isPortControl( const ladspa_key_t & _plugin, Uint32 _port ); + bool FASTCALL isPortControl( const ladspa_key_t & _plugin, + Uint32 _port ); /* Indicates that any bounds specified should be interpreted as multiples of the sample rate. For instance, a frequency range from @@ -166,24 +167,28 @@ public: by this hint in conjunction with LowerBound = 0 and UpperBound = 0.5. Hosts that support bounds at all must support this hint to retain meaning. */ - bool FASTCALL areHintsSampleRateDependent( const ladspa_key_t & _plugin, + bool FASTCALL areHintsSampleRateDependent( + const ladspa_key_t & _plugin, Uint32 _port ); /* Returns the lower boundary value for the given port. If no lower bound is provided by the plug-in, returns -999e-99. When areHintsSampleRateDependent() is also true then this value should be multiplied by the relevant sample rate. */ - float FASTCALL getLowerBound( const ladspa_key_t & _plugin, Uint32 _port ); + float FASTCALL getLowerBound( const ladspa_key_t & _plugin, + Uint32 _port ); /* Returns the upper boundary value for the given port. If no upper bound is provided by the plug-in, returns -999e-99. When areHintsSampleRateDependent() is also true then this value should be multiplied by the relevant sample rate. */ - float FASTCALL getUpperBound( const ladspa_key_t & _plugin, Uint32 _port ); + float FASTCALL getUpperBound( const ladspa_key_t & _plugin, + Uint32 _port ); /* Indicates whether the given port should be considered 0 or 1 boolean switch. */ - bool FASTCALL isPortToggled( const ladspa_key_t & _plugin, Uint32 _port ); + bool FASTCALL isPortToggled( const ladspa_key_t & _plugin, + Uint32 _port ); /* Retrieves any default setting hints offered by the plug-in for the given port. */ @@ -193,7 +198,8 @@ public: /* Indicates that it is likely that the user will find it more intuitive to view values using a logarithmic scale. This is particularly useful for frequencies and gains. */ - bool FASTCALL isLogarithmic( const ladspa_key_t & _plugin, Uint32 _port ); + bool FASTCALL isLogarithmic( const ladspa_key_t & _plugin, + Uint32 _port ); /* Indicates that a user interface would probably wish to provide a stepped control taking only integer values. Any bounds set should be @@ -203,7 +209,8 @@ public: bool FASTCALL isInteger( const ladspa_key_t & _plugin, Uint32 _port ); /* Returns the name of the port. */ - QString FASTCALL getPortName( const ladspa_key_t & _plugin, Uint32 _port ); + QString FASTCALL getPortName( const ladspa_key_t & _plugin, + Uint32 _port ); /* This may be used by the plugin developer to pass any custom @@ -285,7 +292,8 @@ public: before run() or run_adding(). If deactivate() is called for a plugin instance then the plugin instance may not be reused until activate() has been called again. */ - bool FASTCALL run( const ladspa_key_t & _plugin, LADSPA_Handle _instance, + bool FASTCALL run( const ladspa_key_t & _plugin, + LADSPA_Handle _instance, Uint32 _sample_count ); /* This method calls a function pointer that runs an instance of a @@ -302,8 +310,8 @@ public: this function pointer must be set to NULL. When it is provided, the function setRunAddingGain() must be provided also. */ bool FASTCALL runAdding( const ladspa_key_t & _plugin, - LADSPA_Handle _instance, - Uint32 _sample_count ); + LADSPA_Handle _instance, + Uint32 _sample_count ); /* This method calls a function pointer that sets the output gain for use when runAdding() is called (see above). If this function is @@ -315,8 +323,8 @@ public: runAdding() function is provided. When it is absent this function pointer must be set to NULL. */ bool FASTCALL setRunAddingGain( const ladspa_key_t & _plugin, - LADSPA_Handle _instance, - LADSPA_Data _gain ); + LADSPA_Handle _instance, + LADSPA_Data _gain ); /* This is the counterpart to activate() (see above). If there is nothing for deactivate() to do then the plugin writer may provide @@ -345,13 +353,16 @@ public: LADSPA_Handle _instance ); private: - void FASTCALL addPlugins( LADSPA_Descriptor_Function _descriptor_func, + void FASTCALL addPlugins( + LADSPA_Descriptor_Function _descriptor_func, const QString & _file ); - Uint16 FASTCALL getPluginInputs( const LADSPA_Descriptor * _descriptor ); - Uint16 FASTCALL getPluginOutputs( const LADSPA_Descriptor * _descriptor ); + Uint16 FASTCALL getPluginInputs( + const LADSPA_Descriptor * _descriptor ); + Uint16 FASTCALL getPluginOutputs( + const LADSPA_Descriptor * _descriptor ); typedef QMap - ladspaManagerMapType; + ladspaManagerMapType; ladspaManagerMapType m_ladspaManagerMap; l_sortable_plugin_t m_sortedPlugins; diff --git a/include/rack_plugin.h b/include/rack_plugin.h index ab5b0ee4a4..cfe8882cc0 100644 --- a/include/rack_plugin.h +++ b/include/rack_plugin.h @@ -62,7 +62,8 @@ class rackPlugin: public QWidget, public journallingObject Q_OBJECT public: - rackPlugin( QWidget * _parent, ladspa_key_t _key, track * _track, engine * _engine, audioPort * _port ); + rackPlugin( QWidget * _parent, ladspa_key_t _key, + track * _track, engine * _engine, audioPort * _port ); ~rackPlugin(); inline effect * getEffect() @@ -75,7 +76,8 @@ public: return( m_key ); } - virtual void FASTCALL saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void FASTCALL saveSettings( QDomDocument & _doc, + QDomElement & _parent ); virtual void FASTCALL loadSettings( const QDomElement & _this ); inline virtual QString nodeName( void ) const { diff --git a/include/rack_view.h b/include/rack_view.h index 3e0fc11695..bddcf0600b 100644 --- a/include/rack_view.h +++ b/include/rack_view.h @@ -57,12 +57,14 @@ class rackView: public QWidget, public journallingObject Q_OBJECT public: - rackView( QWidget * _parent, engine * _engine, track * _track, audioPort * _port ); + rackView( QWidget * _parent, engine * _engine, + track * _track, audioPort * _port ); ~rackView(); void addPlugin( ladspa_key_t _key ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void FASTCALL saveSettings( QDomDocument & _doc, + QDomElement & _parent ); virtual void FASTCALL loadSettings( const QDomElement & _this ); inline virtual QString nodeName( void ) const { diff --git a/src/core/effect.cpp b/src/core/effect.cpp index 158b9150ea..0871023e98 100644 --- a/src/core/effect.cpp +++ b/src/core/effect.cpp @@ -64,7 +64,8 @@ effect::~effect() -bool FASTCALL effect::processAudioBuffer( surroundSampleFrame * _buf, const fpab_t _frames ) +bool FASTCALL effect::processAudioBuffer( surroundSampleFrame * _buf, + const fpab_t _frames ) { return( FALSE ); } @@ -75,7 +76,8 @@ bool FASTCALL effect::processAudioBuffer( surroundSampleFrame * _buf, const fpab void FASTCALL effect::setGate( float _level ) { m_processLock.lock(); - m_gate = _level * _level * m_processors * eng()->getMixer()->framesPerAudioBuffer(); + m_gate = _level * _level * m_processors * + eng()->getMixer()->framesPerAudioBuffer(); m_processLock.unlock(); } diff --git a/src/core/effect_chain.cpp b/src/core/effect_chain.cpp index 87380ec26f..08540b9078 100644 --- a/src/core/effect_chain.cpp +++ b/src/core/effect_chain.cpp @@ -65,7 +65,8 @@ void FASTCALL effectChain::deleteEffect( effect * _effect ) { m_processLock.lock(); effect_list_t::iterator which = NULL; - for( effect_list_t::iterator it = m_effects.begin(); it != m_effects.end(); it++ ) + for( effect_list_t::iterator it = m_effects.begin(); + it != m_effects.end(); it++ ) { if( (*it) == _effect ) { @@ -92,7 +93,8 @@ void FASTCALL effectChain::moveDown( effect * _effect ) if( _effect != m_effects.last() ) { int i = 0; - for( effect_list_t::iterator it = m_effects.begin(); it != m_effects.end(); it++, i++ ) + for( effect_list_t::iterator it = m_effects.begin(); + it != m_effects.end(); it++, i++ ) { if( (*it) == _effect ) { @@ -118,7 +120,8 @@ void FASTCALL effectChain::moveUp( effect * _effect ) if( _effect != m_effects.first() ) { int i = 0; - for( effect_list_t::iterator it = m_effects.begin(); it != m_effects.end(); it++, i++ ) + for( effect_list_t::iterator it = m_effects.begin(); + it != m_effects.end(); it++, i++ ) { if( (*it) == _effect ) { @@ -137,14 +140,16 @@ void FASTCALL effectChain::moveUp( effect * _effect ) -bool FASTCALL effectChain::processAudioBuffer( surroundSampleFrame * _buf, const fpab_t _frames ) +bool FASTCALL effectChain::processAudioBuffer( surroundSampleFrame * _buf, + const fpab_t _frames ) { if( m_bypassed || ! m_processLock.tryLock() ) { return( FALSE ); } bool more_effects = FALSE; - for( effect_list_t::iterator it = m_effects.begin(); it != m_effects.end(); it++ ) + for( effect_list_t::iterator it = m_effects.begin(); + it != m_effects.end(); it++ ) { more_effects |= (*it)->processAudioBuffer( _buf, _frames ); } @@ -162,7 +167,8 @@ void effectChain::startRunning( void ) return; } - for( effect_list_t::iterator it = m_effects.begin(); it != m_effects.end(); it++ ) + for( effect_list_t::iterator it = m_effects.begin(); + it != m_effects.end(); it++ ) { (*it)->startRunning(); } @@ -180,7 +186,8 @@ bool effectChain::isRunning( void ) bool running = FALSE; - for( effect_list_t::iterator it = m_effects.begin(); it != m_effects.end() || !running; it++ ) + for( effect_list_t::iterator it = m_effects.begin(); + it != m_effects.end() || !running; it++ ) { running = (*it)->isRunning() && running; } diff --git a/src/core/effect_tab_widget.cpp b/src/core/effect_tab_widget.cpp index a9347689f9..d4020af19d 100644 --- a/src/core/effect_tab_widget.cpp +++ b/src/core/effect_tab_widget.cpp @@ -56,7 +56,8 @@ #include "audio_port.h" -effectTabWidget::effectTabWidget( instrumentTrack * _track, audioPort * _port ) : +effectTabWidget::effectTabWidget( instrumentTrack * _track, + audioPort * _port ) : QWidget( _track->tabWidgetParent() ), journallingObject( _track->eng() ), m_track( dynamic_cast( _track ) ), @@ -68,7 +69,9 @@ effectTabWidget::effectTabWidget( instrumentTrack * _track, audioPort * _port ) -effectTabWidget::effectTabWidget( QWidget * _parent, sampleTrack * _track, audioPort * _port ) : +effectTabWidget::effectTabWidget( QWidget * _parent, + sampleTrack * _track, + audioPort * _port ) : QWidget( _parent ), journallingObject( _track->eng() ), m_track( dynamic_cast( _track ) ), @@ -89,8 +92,10 @@ effectTabWidget::~effectTabWidget() void effectTabWidget::setupWidget( void ) { - m_effectsGroupBox = new groupBox( tr( "EFFECTS CHAIN" ), this, eng(), m_track ); - connect( m_effectsGroupBox, SIGNAL( toggled( bool ) ), this, SLOT( setBypass( bool ) ) ); + m_effectsGroupBox = new groupBox( tr( "EFFECTS CHAIN" ), + this, eng(), m_track ); + connect( m_effectsGroupBox, SIGNAL( toggled( bool ) ), + this, SLOT( setBypass( bool ) ) ); m_effectsGroupBox->setGeometry( 2, 2, 242, 244 ); m_rack = new rackView( m_effectsGroupBox, eng(), m_track, m_port ); @@ -99,7 +104,8 @@ void effectTabWidget::setupWidget( void ) m_addButton = new QPushButton( m_effectsGroupBox, "Add Effect" ); m_addButton->setText( tr( "Add" ) ); m_addButton->move( 75, 210 ); - connect( m_addButton, SIGNAL( clicked( void ) ), this, SLOT( addEffect( void ) ) ); + connect( m_addButton, SIGNAL( clicked( void ) ), + this, SLOT( addEffect( void ) ) ); } @@ -117,7 +123,8 @@ void effectTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this ) void effectTabWidget::loadSettings( const QDomElement & _this ) { - m_effectsGroupBox->setState( !_this.attribute( "fxdisabled" ).toInt() ); + m_effectsGroupBox->setState( + !_this.attribute( "fxdisabled" ).toInt() ); QDomNode node = _this.firstChild(); while( !node.isNull() ) diff --git a/src/core/ladspa_browser.cpp b/src/core/ladspa_browser.cpp index d4bd45eb8f..e6f42777ea 100644 --- a/src/core/ladspa_browser.cpp +++ b/src/core/ladspa_browser.cpp @@ -106,9 +106,10 @@ ladspaBrowser::ladspaBrowser( engine * _engine ) : avl_layout->setMargin( 0 ); labelWidget( available, tr( "Available Effects" ) ); - ladspaDescription * available_list = new ladspaDescription(available, _engine, VALID ); + ladspaDescription * available_list = new ladspaDescription(available, + _engine, VALID ); connect( available_list, SIGNAL( doubleClicked( const ladspa_key_t & ) ), - SLOT( showPorts( const ladspa_key_t & ) ) ); + this, SLOT( showPorts( const ladspa_key_t & ) ) ); avl_layout->addWidget( available_list ); @@ -119,9 +120,11 @@ ladspaBrowser::ladspaBrowser( engine * _engine ) : unavl_layout->setMargin( 0 ); labelWidget( unavailable, tr( "Unavailable Effects" ) ); - ladspaDescription * unavailable_list = new ladspaDescription(unavailable, _engine, INVALID ); - connect( unavailable_list, SIGNAL( doubleClicked( const ladspa_key_t & ) ), - SLOT( showPorts( const ladspa_key_t & ) ) ); + ladspaDescription * unavailable_list = new ladspaDescription(unavailable, + _engine, INVALID ); + connect( unavailable_list, + SIGNAL( doubleClicked( const ladspa_key_t & ) ), + this, SLOT( showPorts( const ladspa_key_t & ) ) ); unavl_layout->addWidget( unavailable_list ); @@ -132,9 +135,11 @@ ladspaBrowser::ladspaBrowser( engine * _engine ) : inst_layout->setMargin( 0 ); labelWidget( instruments, tr( "Instruments" ) ); - ladspaDescription * instruments_list = new ladspaDescription(instruments, _engine, SOURCE ); - connect( instruments_list, SIGNAL( doubleClicked( const ladspa_key_t & ) ), - SLOT( showPorts( const ladspa_key_t & ) ) ); + ladspaDescription * instruments_list = + new ladspaDescription(instruments, _engine, SOURCE ); + connect( instruments_list, + SIGNAL( doubleClicked( const ladspa_key_t & ) ), + this, SLOT( showPorts( const ladspa_key_t & ) ) ); inst_layout->addWidget( instruments_list ); @@ -145,9 +150,11 @@ ladspaBrowser::ladspaBrowser( engine * _engine ) : anal_layout->setMargin( 0 ); labelWidget( analysis, tr( "Analysis Tools" ) ); - ladspaDescription * analysis_list = new ladspaDescription(analysis, _engine, SINK ); - connect( analysis_list, SIGNAL( doubleClicked( const ladspa_key_t & ) ), - SLOT( showPorts( const ladspa_key_t & ) ) ); + ladspaDescription * analysis_list = + new ladspaDescription(analysis, _engine, SINK ); + connect( analysis_list, + SIGNAL( doubleClicked( const ladspa_key_t & ) ), + this, SLOT( showPorts( const ladspa_key_t & ) ) ); anal_layout->addWidget( analysis_list ); @@ -158,26 +165,33 @@ ladspaBrowser::ladspaBrowser( engine * _engine ) : other_layout->setMargin( 0 ); labelWidget( other, tr( "Don't know" ) ); - ladspaDescription * other_list = new ladspaDescription(other, _engine, OTHER ); - connect( other_list, SIGNAL( doubleClicked( const ladspa_key_t & ) ), - SLOT( showPorts( const ladspa_key_t & ) ) ); + ladspaDescription * other_list = + new ladspaDescription(other, _engine, OTHER ); + connect( other_list, + SIGNAL( doubleClicked( const ladspa_key_t & ) ), + this, SLOT( showPorts( const ladspa_key_t & ) ) ); other_layout->addWidget( other_list ); #ifndef QT4 #define setIcon setPixmap #endif - m_tabBar->addTab( available, tr( "Available Effects" ), 0, FALSE, TRUE + m_tabBar->addTab( available, tr( "Available Effects" ), + 0, FALSE, TRUE )->setIcon( embed::getIconPixmap( "setup_audio" ) ); - m_tabBar->addTab( unavailable, tr( "Unavailable Effects" ), 1, FALSE, TRUE + m_tabBar->addTab( unavailable, tr( "Unavailable Effects" ), + 1, FALSE, TRUE + )->setIcon( embed::getIconPixmap( + "unavailable_sound" ) ); + m_tabBar->addTab( instruments, tr( "Instruments" ), + 2, FALSE, TRUE )->setIcon( embed::getIconPixmap( - "unavailable_sound" ) ); - m_tabBar->addTab( instruments, tr( "Instruments" ), 2, FALSE, - TRUE )->setIcon( embed::getIconPixmap( "setup_midi" ) ); - m_tabBar->addTab( analysis, tr( "Analysis Tools" ), 3, FALSE, TRUE + m_tabBar->addTab( analysis, tr( "Analysis Tools" ), + 3, FALSE, TRUE )->setIcon( embed::getIconPixmap( "analysis" ) ); - m_tabBar->addTab( other, tr( "Don't know" ), 4, TRUE, TRUE + m_tabBar->addTab( other, tr( "Don't know" ), + 4, TRUE, TRUE )->setIcon( embed::getIconPixmap( "uhoh" ) ); #undef setIcon @@ -195,11 +209,15 @@ ladspaBrowser::ladspaBrowser( engine * _engine ) : btn_layout->setSpacing( 0 ); btn_layout->setMargin( 0 ); - QPushButton * help_btn = new QPushButton( embed::getIconPixmap( "help" ), "", buttons ); - connect( help_btn, SIGNAL( clicked() ), this, SLOT( displayHelp() ) ); + QPushButton * help_btn = new QPushButton( + embed::getIconPixmap( "help" ), "", buttons ); + connect( help_btn, SIGNAL( clicked() ), + this, SLOT( displayHelp() ) ); - QPushButton * cancel_btn = new QPushButton( embed::getIconPixmap( "cancel" ), tr( "Close" ), buttons ); - connect( cancel_btn, SIGNAL( clicked() ), this, SLOT( reject() ) ); + QPushButton * cancel_btn = new QPushButton( + embed::getIconPixmap( "cancel" ), tr( "Close" ), buttons ); + connect( cancel_btn, SIGNAL( clicked() ), + this, SLOT( reject() ) ); btn_layout->addStretch(); btn_layout->addSpacing( 10 ); @@ -272,9 +290,11 @@ void ladspaBrowser::showPorts( const ladspa_key_t & _key ) void ladspaBrowser::displayHelp( void ) { #ifdef QT4 - QWhatsThis::showText( mapToGlobal( rect().bottomRight() ), whatsThis() ); + QWhatsThis::showText( mapToGlobal( rect().bottomRight() ), + whatsThis() ); #else - QWhatsThis::display( QWhatsThis::textFor( this ), mapToGlobal( rect().bottomRight() ) ); + QWhatsThis::display( QWhatsThis::textFor( this ), + mapToGlobal( rect().bottomRight() ) ); #endif } diff --git a/src/core/ladspa_port_dialog.cpp b/src/core/ladspa_port_dialog.cpp index 01d00f20f6..aaba96972b 100644 --- a/src/core/ladspa_port_dialog.cpp +++ b/src/core/ladspa_port_dialog.cpp @@ -81,7 +81,8 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key, { port_nums.append( QString::number( row ) ); Uint8 col = 0; - display->setText( row, col, m_ladspa->getPortName( m_key, row ) ); + display->setText( row, col, m_ladspa->getPortName( + m_key, row ) ); col++; if( m_ladspa->isPortAudio( m_key, row ) ) @@ -141,7 +142,8 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key, } else if( m_ladspa->isInteger( m_key, row ) ) { - range += QString::number( static_cast( min ) ) + " < "; + range += QString::number( static_cast( min ) ) + + " < "; } else { @@ -154,7 +156,8 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key, } else if( m_ladspa->isInteger( m_key, row ) ) { - range += QString::number( static_cast( def ) ) + " < "; + range += QString::number( static_cast( def ) ) + + " < "; } else { diff --git a/src/lib/ladspa_manager.cpp b/src/lib/ladspa_manager.cpp index 83e2e121e6..40cac1e7ce 100644 --- a/src/lib/ladspa_manager.cpp +++ b/src/lib/ladspa_manager.cpp @@ -56,8 +56,6 @@ ladspaManager::ladspaManager( engine * _engine ) { - // TODO Need to move the search path definition to the config file to - // have more control over where it tries to find the plugins. #ifdef QT4 QStringList ladspaDirectories = QString( getenv( "LADSPA_PATH" ) ). split( ':' ); @@ -142,8 +140,8 @@ ladspaManager::~ladspaManager() -ladspaManagerDescription * ladspaManager::getDescription( const ladspa_key_t & - _plugin ) +ladspaManagerDescription * ladspaManager::getDescription( + const ladspa_key_t & _plugin ) { if( m_ladspaManagerMap.contains( _plugin ) ) { @@ -160,7 +158,7 @@ ladspaManagerDescription * ladspaManager::getDescription( const ladspa_key_t & void FASTCALL ladspaManager::addPlugins( LADSPA_Descriptor_Function _descriptor_func, - const QString & _file ) + const QString & _file ) { const LADSPA_Descriptor * descriptor; long pluginIndex = 0; @@ -209,11 +207,13 @@ Uint16 FASTCALL ladspaManager::getPluginInputs( for( Uint16 port = 0; port < _descriptor->PortCount; port++ ) { - if( - LADSPA_IS_PORT_INPUT( _descriptor->PortDescriptors[port] ) && - LADSPA_IS_PORT_AUDIO( _descriptor->PortDescriptors[port] ) ) + if( LADSPA_IS_PORT_INPUT( + _descriptor->PortDescriptors[port] ) && + LADSPA_IS_PORT_AUDIO( + _descriptor->PortDescriptors[port] ) ) { - QString name = QString( _descriptor->PortNames[port] ); + QString name = QString( + _descriptor->PortNames[port] ); if( name.upper().contains( "IN" ) ) { inputs++; @@ -233,11 +233,13 @@ Uint16 FASTCALL ladspaManager::getPluginOutputs( for( Uint16 port = 0; port < _descriptor->PortCount; port++ ) { - if( - LADSPA_IS_PORT_OUTPUT( _descriptor->PortDescriptors[port] ) && - LADSPA_IS_PORT_AUDIO( _descriptor->PortDescriptors[port] ) ) + if( LADSPA_IS_PORT_OUTPUT( + _descriptor->PortDescriptors[port] ) && + LADSPA_IS_PORT_AUDIO( + _descriptor->PortDescriptors[port] ) ) { - QString name = QString( _descriptor->PortNames[port] ); + QString name = QString( + _descriptor->PortNames[port] ); if( name.upper().contains( "OUT" ) ) { outputs++; @@ -263,7 +265,7 @@ QString FASTCALL ladspaManager::getLabel( const ladspa_key_t & _plugin ) if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -278,12 +280,13 @@ QString FASTCALL ladspaManager::getLabel( const ladspa_key_t & _plugin ) -bool FASTCALL ladspaManager::hasRealTimeDependency( const ladspa_key_t & _plugin ) +bool FASTCALL ladspaManager::hasRealTimeDependency( + const ladspa_key_t & _plugin ) { if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -303,7 +306,7 @@ bool FASTCALL ladspaManager::isInplaceBroken( const ladspa_key_t & _plugin ) if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -318,12 +321,13 @@ bool FASTCALL ladspaManager::isInplaceBroken( const ladspa_key_t & _plugin ) -bool FASTCALL ladspaManager::isRealTimeCapable( const ladspa_key_t & _plugin ) +bool FASTCALL ladspaManager::isRealTimeCapable( + const ladspa_key_t & _plugin ) { if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -343,7 +347,7 @@ QString FASTCALL ladspaManager::getName( const ladspa_key_t & _plugin ) if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -363,7 +367,7 @@ QString FASTCALL ladspaManager::getMaker( const ladspa_key_t & _plugin ) if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -383,7 +387,7 @@ QString FASTCALL ladspaManager::getCopyright( const ladspa_key_t & _plugin ) if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -403,7 +407,7 @@ Uint32 FASTCALL ladspaManager::getPortCount( const ladspa_key_t & _plugin ) if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -425,7 +429,7 @@ bool FASTCALL ladspaManager::isPortInput( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -449,7 +453,7 @@ bool FASTCALL ladspaManager::isPortOutput( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -473,7 +477,7 @@ bool FASTCALL ladspaManager::isPortAudio( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -497,7 +501,7 @@ bool FASTCALL ladspaManager::isPortControl( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -522,7 +526,7 @@ bool FASTCALL ladspaManager::areHintsSampleRateDependent( && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -546,7 +550,7 @@ float FASTCALL ladspaManager::getLowerBound( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -576,7 +580,7 @@ float FASTCALL ladspaManager::getUpperBound( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -607,7 +611,7 @@ bool FASTCALL ladspaManager::isPortToggled( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -631,7 +635,7 @@ float FASTCALL ladspaManager::getDefaultSetting( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -718,7 +722,7 @@ bool FASTCALL ladspaManager::isLogarithmic( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -742,7 +746,7 @@ bool FASTCALL ladspaManager::isInteger( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -766,7 +770,7 @@ QString FASTCALL ladspaManager::getPortName( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -788,7 +792,7 @@ const void * FASTCALL ladspaManager::getImplementationData( if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -809,7 +813,7 @@ const LADSPA_Descriptor * FASTCALL ladspaManager::getDescriptor( if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -824,13 +828,14 @@ const LADSPA_Descriptor * FASTCALL ladspaManager::getDescriptor( -LADSPA_Handle FASTCALL ladspaManager::instantiate( const ladspa_key_t & _plugin, +LADSPA_Handle FASTCALL ladspaManager::instantiate( + const ladspa_key_t & _plugin, Uint32 _sample_rate ) { if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -855,7 +860,7 @@ bool FASTCALL ladspaManager::connectPort( const ladspa_key_t & _plugin, && _port < getPortCount( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -878,7 +883,7 @@ bool FASTCALL ladspaManager::activate( const ladspa_key_t & _plugin, if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -901,7 +906,7 @@ bool FASTCALL ladspaManager::run( const ladspa_key_t & _plugin, if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -918,13 +923,13 @@ bool FASTCALL ladspaManager::run( const ladspa_key_t & _plugin, bool FASTCALL ladspaManager::runAdding( const ladspa_key_t & _plugin, - LADSPA_Handle _instance, - Uint32 _sample_count ) + LADSPA_Handle _instance, + Uint32 _sample_count ) { if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -942,13 +947,13 @@ bool FASTCALL ladspaManager::runAdding( const ladspa_key_t & _plugin, bool FASTCALL ladspaManager::setRunAddingGain( const ladspa_key_t & _plugin, - LADSPA_Handle _instance, - LADSPA_Data _gain ) + LADSPA_Handle _instance, + LADSPA_Data _gain ) { if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -972,7 +977,7 @@ bool FASTCALL ladspaManager::deactivate( const ladspa_key_t & _plugin, if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); @@ -994,7 +999,7 @@ bool FASTCALL ladspaManager::cleanup( const ladspa_key_t & _plugin, if( m_ladspaManagerMap.contains( _plugin ) ) { LADSPA_Descriptor_Function descriptorFunction = - m_ladspaManagerMap[_plugin]->descriptorFunction; + m_ladspaManagerMap[_plugin]->descriptorFunction; const LADSPA_Descriptor * descriptor = descriptorFunction( m_ladspaManagerMap[_plugin]->index ); diff --git a/src/widgets/effect_label.cpp b/src/widgets/effect_label.cpp index f7dbbdd386..671247c311 100644 --- a/src/widgets/effect_label.cpp +++ b/src/widgets/effect_label.cpp @@ -36,15 +36,20 @@ #include "main_window.h" -effectLabel::effectLabel( const QString & _initial_name, QWidget * _parent, engine * _engine, sampleTrack * _track ) : +effectLabel::effectLabel( const QString & _initial_name, + QWidget * _parent, + engine * _engine, + sampleTrack * _track ) : QWidget( _parent ), journallingObject( _engine ), m_track( _track ), m_show( TRUE ) { - m_effectBtn = new QPushButton( embed::getIconPixmap( "setup_audio" ), "", this ); + m_effectBtn = new QPushButton( embed::getIconPixmap( "setup_audio" ), + "", this ); m_effectBtn->setGeometry( 6, 1, 28, 28 ); - connect( m_effectBtn, SIGNAL( clicked() ), this, SLOT( showEffects() ) ); + connect( m_effectBtn, SIGNAL( clicked() ), + this, SLOT( showEffects() ) ); m_label = new QLabel( this ); m_label->setText( _initial_name ); @@ -52,10 +57,13 @@ effectLabel::effectLabel( const QString & _initial_name, QWidget * _parent, engi m_label->setFont( pointSize<8>( f ) ); m_label->setGeometry( 38, 1, 200, 28 ); - m_effWidget = new effectTabWidget( eng()->getMainWindow()->workspace(), m_track, m_track->getAudioPort() ); + m_effWidget = new effectTabWidget( eng()->getMainWindow()->workspace(), + m_track, + m_track->getAudioPort() ); m_effWidget->setFixedSize( 240, 242 ); m_effWidget->hide(); - connect( m_effWidget, SIGNAL( closed() ), this, SLOT( closeEffects() ) ); + connect( m_effWidget, SIGNAL( closed() ), + this, SLOT( closeEffects() ) ); } diff --git a/src/widgets/ladspa_control.cpp b/src/widgets/ladspa_control.cpp index 74e1aa96d6..17a72a7439 100644 --- a/src/widgets/ladspa_control.cpp +++ b/src/widgets/ladspa_control.cpp @@ -42,7 +42,10 @@ #include "ladspa_effect.h" -ladspaControl::ladspaControl( QWidget * _parent, port_desc_t * _port, engine * _engine, track * _track ) : +ladspaControl::ladspaControl( QWidget * _parent, + port_desc_t * _port, + engine * _engine, + track * _track ) : QWidget( _parent, "ladspaControl" ), journallingObject( _engine ), m_port( _port ), @@ -53,7 +56,8 @@ ladspaControl::ladspaControl( QWidget * _parent, port_desc_t * _port, engine * _ switch( m_port->data_type ) { case TOGGLED: - m_toggle = new ledCheckBox( m_port->name, this, "", eng(), m_track ); + m_toggle = new ledCheckBox( m_port->name, this, "", + eng(), m_track ); setFixedSize( m_toggle->width(), m_toggle->height() ); if( m_port->def == 1.0f ) { @@ -61,10 +65,15 @@ ladspaControl::ladspaControl( QWidget * _parent, port_desc_t * _port, engine * _ } break; case INTEGER: - m_knob = new knob( knobBright_26, this, m_port->name, eng(), m_track); + m_knob = new knob( knobBright_26, this, + m_port->name, eng(), m_track); m_knob->setLabel( m_port->name ); - m_knob->setRange( static_cast( m_port->max ), static_cast( m_port->min ), 1 + static_cast( m_port->max - m_port->min ) / 200 ); - m_knob->setInitValue( static_cast( m_port->def ) ); + m_knob->setRange( static_cast( m_port->max ), + static_cast( m_port->min ), + 1 + static_cast( m_port->max - + m_port->min ) / 200 ); + m_knob->setInitValue( + static_cast( m_port->def ) ); setFixedSize( m_knob->width(), m_knob->height() ); m_knob->setHintText( tr( "Value:" ) + " ", "" ); #ifdef QT4 @@ -75,9 +84,12 @@ ladspaControl::ladspaControl( QWidget * _parent, port_desc_t * _port, engine * _ tr( "Sorry, no help available." ) ); break; case FLOAT: - m_knob = new knob( knobBright_26, this, m_port->name, eng(), m_track); + m_knob = new knob( knobBright_26, this, + m_port->name, eng(), m_track); m_knob->setLabel( m_port->name ); - m_knob->setRange( m_port->min, m_port->max, ( m_port->max - m_port->min ) / 200.0f ); + m_knob->setRange( m_port->min, m_port->max, + ( m_port->max - + m_port->min ) / 200.0f ); m_knob->setInitValue( m_port->def ); m_knob->setHintText( tr( "Value:" ) + " ", "" ); #ifdef QT4 @@ -110,7 +122,8 @@ LADSPA_Data ladspaControl::getValue( void ) switch( m_port->data_type ) { case TOGGLED: - value = static_cast( m_toggle->isChecked() ); + value = static_cast( + m_toggle->isChecked() ); break; case INTEGER: value = static_cast( m_knob->value() ); @@ -151,7 +164,9 @@ void ladspaControl::setValue( LADSPA_Data _value ) -void FASTCALL ladspaControl::saveSettings( QDomDocument & _doc, QDomElement & _this, const QString & _name ) +void FASTCALL ladspaControl::saveSettings( QDomDocument & _doc, + QDomElement & _this, + const QString & _name ) { switch( m_port->data_type ) { @@ -170,7 +185,8 @@ void FASTCALL ladspaControl::saveSettings( QDomDocument & _doc, QDomElement & _t -void FASTCALL ladspaControl::loadSettings( const QDomElement & _this, const QString & _name ) +void FASTCALL ladspaControl::loadSettings( const QDomElement & _this, + const QString & _name ) { switch( m_port->data_type ) { diff --git a/src/widgets/ladspa_description.cpp b/src/widgets/ladspa_description.cpp index 02cfd13ae9..cf380b7e83 100644 --- a/src/widgets/ladspa_description.cpp +++ b/src/widgets/ladspa_description.cpp @@ -47,7 +47,8 @@ pluginDescription::pluginDescription( QWidget * _parent, engine * _engine ): m_ladspaManager( _engine->getLADSPAManager() ) { m_boxer = new QVBoxLayout( this ); - m_grouper = new QGroupBox( 9, Qt::Vertical, tr( "Description" ), this ); + m_grouper = new QGroupBox( 9, Qt::Vertical, + tr( "Description" ), this ); m_label = new QLabel( m_grouper ); m_label->setText( tr( "Label:" ) ); @@ -131,7 +132,9 @@ void pluginDescription::onHighlighted( const ladspa_key_t & _key ) -ladspaDescription::ladspaDescription( QWidget * _parent, engine * _engine, pluginType _type ): +ladspaDescription::ladspaDescription( QWidget * _parent, + engine * _engine, + pluginType _type ): QWidget( _parent, "ladspaDescription" ) { m_ladspaManager = _engine->getLADSPAManager(); @@ -168,7 +171,10 @@ ladspaDescription::ladspaDescription( QWidget * _parent, engine * _engine, plugi for( l_sortable_plugin_t::iterator it = plugins.begin(); it != plugins.end(); it++ ) { - if( _type != VALID || m_ladspaManager->getDescription( (*it).second )->inputChannels <= _engine->getMixer()->audioDev()->channels() ) + if( _type != VALID || + m_ladspaManager->getDescription( + (*it).second )->inputChannels <= + _engine->getMixer()->audioDev()->channels() ) { m_pluginNames.append( (*it).first ); m_pluginKeys.append( (*it).second ); @@ -186,7 +192,7 @@ ladspaDescription::ladspaDescription( QWidget * _parent, engine * _engine, plugi m_pluginDescription = new pluginDescription( this, _engine ); connect( this, SIGNAL( highlighted( const ladspa_key_t & ) ), m_pluginDescription, - SLOT( onHighlighted( const ladspa_key_t & ) ) ); + SLOT( onHighlighted( const ladspa_key_t & ) ) ); m_boxer->addWidget( m_pluginDescription ); if( m_pluginList->numRows() > 0 ) @@ -222,7 +228,6 @@ void ladspaDescription::onHighlighted( int _pluginIndex ) void ladspaDescription::onDoubleClicked( QListBoxItem * _item ) { -// m_currentSelection = m_pluginKeys[m_pluginList->index( _item )]; emit( doubleClicked( m_currentSelection ) ); } diff --git a/src/widgets/rack_plugin.cpp b/src/widgets/rack_plugin.cpp index 92e70302d3..1769582ba5 100644 --- a/src/widgets/rack_plugin.cpp +++ b/src/widgets/rack_plugin.cpp @@ -63,7 +63,11 @@ #include "main_window.h" -rackPlugin::rackPlugin( QWidget * _parent, ladspa_key_t _key, track * _track, engine * _engine, audioPort * _port ) : +rackPlugin::rackPlugin( QWidget * _parent, + ladspa_key_t _key, + track * _track, + engine * _engine, + audioPort * _port ) : QWidget( _parent, "rackPlugin" ), journallingObject( _engine ), m_track( _track ), @@ -83,8 +87,10 @@ rackPlugin::rackPlugin( QWidget * _parent, ladspa_key_t _key, track * _track, en m_grouper = new QGroupBox( 1, Qt::Vertical, "", this ); m_grouper->setFixedSize( 210, 58 ); - m_bypass = new ledCheckBox( "", this, tr( "Turn the effect off" ), eng(), m_track ); - connect( m_bypass, SIGNAL( toggled( bool ) ), this, SLOT( bypassed( bool ) ) ); + m_bypass = new ledCheckBox( "", this, tr( "Turn the effect off" ), + eng(), m_track ); + connect( m_bypass, SIGNAL( toggled( bool ) ), + this, SLOT( bypassed( bool ) ) ); toolTip::add( m_bypass, tr( "On/Off" ) ); m_bypass->setChecked( TRUE ); m_bypass->move( 3, 3 ); @@ -96,8 +102,10 @@ rackPlugin::rackPlugin( QWidget * _parent, ladspa_key_t _key, track * _track, en tr( "Toggles the effect on or off." ) ); - m_wetDry = new knob( knobBright_26, this, tr( "Wet/Dry mix" ), eng(), m_track ); - connect( m_wetDry, SIGNAL( valueChanged( float ) ), this, SLOT( setWetDry( float ) ) ); + m_wetDry = new knob( knobBright_26, this, + tr( "Wet/Dry mix" ), eng(), m_track ); + connect( m_wetDry, SIGNAL( valueChanged( float ) ), + this, SLOT( setWetDry( float ) ) ); m_wetDry->setLabel( tr( "W/D" ) ); m_wetDry->setRange( 0.0f, 1.0f, 0.01f ); m_wetDry->setInitValue( 1.0f ); @@ -109,10 +117,13 @@ rackPlugin::rackPlugin( QWidget * _parent, ladspa_key_t _key, track * _track, en QWhatsThis::add( m_wetDry, #endif tr( -"The Wet/Dry knob sets the ratio between the input signal and the effect that shows up in the output." ) ); +"The Wet/Dry knob sets the ratio between the input signal and the effect that " +"shows up in the output." ) ); - m_autoQuit = new tempoSyncKnob( knobBright_26, this, tr( "Decay" ), eng(), m_track ); - connect( m_autoQuit, SIGNAL( valueChanged( float ) ), this, SLOT( setAutoQuit( float ) ) ); + m_autoQuit = new tempoSyncKnob( knobBright_26, this, tr( "Decay" ), + eng(), m_track ); + connect( m_autoQuit, SIGNAL( valueChanged( float ) ), + this, SLOT( setAutoQuit( float ) ) ); m_autoQuit->setLabel( tr( "Decay" ) ); m_autoQuit->setRange( 1.0f, 8000.0f, 100.0f ); m_autoQuit->setInitValue( 1 ); @@ -124,11 +135,13 @@ rackPlugin::rackPlugin( QWidget * _parent, ladspa_key_t _key, track * _track, en QWhatsThis::add( m_autoQuit, #endif tr( -"The Decay knob controls how many buffers of silence must pass before the plugin stops processing. Smaller values " -"will reduce the CPU overhead but run the risk of clipping the tail on delay effects." ) ); +"The Decay knob controls how many buffers of silence must pass before the " +"plugin stops processing. Smaller values will reduce the CPU overhead but " +"run the risk of clipping the tail on delay effects." ) ); m_gate = new knob( knobBright_26, this, tr( "Gate" ), eng(), m_track ); - connect( m_wetDry, SIGNAL( valueChanged( float ) ), this, SLOT( setGate( float ) ) ); + connect( m_wetDry, SIGNAL( valueChanged( float ) ), + this, SLOT( setGate( float ) ) ); m_gate->setLabel( tr( "Gate" ) ); m_gate->setRange( 0.0f, 1.0f, 0.01f ); m_gate->setInitValue( 0.0f ); @@ -140,15 +153,16 @@ rackPlugin::rackPlugin( QWidget * _parent, ladspa_key_t _key, track * _track, en QWhatsThis::add( m_gate, #endif tr( -"The Gate knob controls the signal level that is considered to be 'silence' while deciding when to stop processing " -"signals." ) ); +"The Gate knob controls the signal level that is considered to be 'silence' " +"while deciding when to stop processing signals." ) ); m_editButton = new QPushButton( this, "Controls" ); m_editButton->setText( tr( "Controls" ) ); QFont f = m_editButton->font(); m_editButton->setFont( pointSize<7>( f ) ); m_editButton->setGeometry( 140, 19, 50, 20 ); - connect( m_editButton, SIGNAL( clicked() ), this, SLOT( editControls() ) ); + connect( m_editButton, SIGNAL( clicked() ), + this, SLOT( editControls() ) ); QString name = eng()->getLADSPAManager()->getShortName( _key ); m_label = new QLabel( this ); @@ -158,8 +172,11 @@ rackPlugin::rackPlugin( QWidget * _parent, ladspa_key_t _key, track * _track, en m_label->setFont( pointSize<7>( f ) ); m_label->setGeometry( 5, 38, 200, 20 ); - m_controlView = new ladspaControlDialog( eng()->getMainWindow()->workspace(), m_effect, eng(), m_track ); - connect( m_controlView, SIGNAL( closed() ), this, SLOT( closeEffects() ) ); + m_controlView = new ladspaControlDialog( + eng()->getMainWindow()->workspace(), + m_effect, eng(), m_track ); + connect( m_controlView, SIGNAL( closed() ), + this, SLOT( closeEffects() ) ); m_controlView->hide(); #ifdef QT4 @@ -243,7 +260,8 @@ void rackPlugin::setWetDry( float _value ) void rackPlugin::setAutoQuit( float _value ) { float samples = eng()->getMixer()->sampleRate() * _value / 1000.0f; - Uint32 buffers = 1 + ( static_cast( samples ) / eng()->getMixer()->framesPerAudioBuffer() ); + Uint32 buffers = 1 + ( static_cast( samples ) / + eng()->getMixer()->framesPerAudioBuffer() ); m_effect->setTimeout( buffers ); } @@ -263,17 +281,27 @@ void rackPlugin::contextMenuEvent( QContextMenuEvent * ) #ifdef QT4 m_contextMenu->setTitle( m_effect->getName() ); #else - QLabel * caption = new QLabel( "" + QString( m_effect->getName() ) + "", this ); + QLabel * caption = new QLabel( "" + + QString( m_effect->getName() ) + "", + this ); caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) ); caption->setAlignment( Qt::AlignCenter ); m_contextMenu->addAction( caption ); #endif - m_contextMenu->addAction( embed::getIconPixmap( "arp_up_on" ), tr( "Move &up" ), this, SLOT( moveUp() ) ); - m_contextMenu->addAction( embed::getIconPixmap( "arp_down_on" ), tr( "Move &down" ), this, SLOT( moveDown() ) ); + m_contextMenu->addAction( embed::getIconPixmap( "arp_up_on" ), + tr( "Move &up" ), + this, SLOT( moveUp() ) ); + m_contextMenu->addAction( embed::getIconPixmap( "arp_down_on" ), + tr( "Move &down" ), + this, SLOT( moveDown() ) ); m_contextMenu->addSeparator(); - m_contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "&Remove this plugin" ), this, SLOT( deletePlugin() ) ); + m_contextMenu->addAction( embed::getIconPixmap( "cancel" ), + tr( "&Remove this plugin" ), + this, SLOT( deletePlugin() ) ); m_contextMenu->addSeparator(); - m_contextMenu->addAction( embed::getIconPixmap( "help" ), tr( "&Help" ), this, SLOT( displayHelp() ) ); + m_contextMenu->addAction( embed::getIconPixmap( "help" ), + tr( "&Help" ), + this, SLOT( displayHelp() ) ); m_contextMenu->exec( QCursor::pos() ); if( m_contextMenu != NULL ) { @@ -325,16 +353,19 @@ void rackPlugin::deletePlugin() void rackPlugin::displayHelp( void ) { #ifdef QT4 - QWhatsThis::showText( mapToGlobal( rect().bottomRight() ), whatsThis() ); + QWhatsThis::showText( mapToGlobal( rect().bottomRight() ), + whatsThis() ); #else - QWhatsThis::display( QWhatsThis::textFor( this ), mapToGlobal( rect().bottomRight() ) ); + QWhatsThis::display( QWhatsThis::textFor( this ), + mapToGlobal( rect().bottomRight() ) ); #endif } -void FASTCALL rackPlugin::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void FASTCALL rackPlugin::saveSettings( QDomDocument & _doc, + QDomElement & _this ) { _this.setAttribute( "on", m_bypass->isChecked() ); _this.setAttribute( "wet", m_wetDry->value() ); @@ -360,7 +391,8 @@ void FASTCALL rackPlugin::loadSettings( const QDomElement & _this ) { if( m_controlView->nodeName() == node.nodeName() ) { - m_controlView->restoreState( node.toElement() ); + m_controlView->restoreState( + node.toElement() ); } } node = node.nextSibling(); diff --git a/src/widgets/rack_view.cpp b/src/widgets/rack_view.cpp index 1f6a1bb2dd..72db2bc24a 100644 --- a/src/widgets/rack_view.cpp +++ b/src/widgets/rack_view.cpp @@ -41,7 +41,10 @@ #include "rack_view.h" -rackView::rackView( QWidget * _parent, engine * _engine, track * _track, audioPort * _port ): +rackView::rackView( QWidget * _parent, + engine * _engine, + track * _track, + audioPort * _port ): QWidget( _parent, "rackView" ), journallingObject( _engine ), m_track( _track ), @@ -70,10 +73,14 @@ rackView::~rackView() void rackView::addPlugin( ladspa_key_t _key ) { - rackPlugin * plugin = new rackPlugin( m_scrollView->viewport(), _key, m_track, eng(), m_port ); - connect( plugin, SIGNAL( moveUp( rackPlugin * ) ), this, SLOT( moveUp( rackPlugin * ) ) ); - connect( plugin, SIGNAL( moveDown( rackPlugin * ) ), this, SLOT( moveDown( rackPlugin * ) ) ); - connect( plugin, SIGNAL( deletePlugin( rackPlugin * ) ), this, SLOT( deletePlugin( rackPlugin * ) ) ); + rackPlugin * plugin = new rackPlugin( m_scrollView->viewport(), + _key, m_track, eng(), m_port ); + connect( plugin, SIGNAL( moveUp( rackPlugin * ) ), + this, SLOT( moveUp( rackPlugin * ) ) ); + connect( plugin, SIGNAL( moveDown( rackPlugin * ) ), + this, SLOT( moveDown( rackPlugin * ) ) ); + connect( plugin, SIGNAL( deletePlugin( rackPlugin * ) ), + this, SLOT( deletePlugin( rackPlugin * ) ) ); m_scrollView->addChild( plugin ); m_scrollView->moveChild( plugin, 0, m_lastY ); plugin->show(); @@ -90,7 +97,9 @@ void rackView::moveUp( rackPlugin * _plugin ) if( _plugin != m_rackInserts.first() ) { int i = 0; - for( vvector::iterator it = m_rackInserts.begin(); it != m_rackInserts.end(); it++, i++ ) + for( vvector::iterator it = + m_rackInserts.begin(); + it != m_rackInserts.end(); it++, i++ ) { if( (*it) == _plugin ) { @@ -116,7 +125,9 @@ void rackView::moveDown( rackPlugin * _plugin ) if( _plugin != m_rackInserts.last() ) { int i = 0; - for( vvector::iterator it = m_rackInserts.begin(); it != m_rackInserts.end(); it++, i++ ) + for( vvector::iterator it = + m_rackInserts.begin(); + it != m_rackInserts.end(); it++, i++ ) { if( (*it) == _plugin ) { @@ -143,7 +154,8 @@ void rackView::deletePlugin( rackPlugin * _plugin ) m_scrollView->removeChild( _plugin ); vvector::iterator loc = NULL; - for( vvector::iterator it = m_rackInserts.begin(); it != m_rackInserts.end(); it++ ) + for( vvector::iterator it = m_rackInserts.begin(); + it != m_rackInserts.end(); it++ ) { if( (*it) == _plugin ) { @@ -166,7 +178,8 @@ void rackView::deletePlugin( rackPlugin * _plugin ) void rackView::redraw() { m_lastY = 0; - for( vvector::iterator it = m_rackInserts.begin(); it != m_rackInserts.end(); it++ ) + for( vvector::iterator it = m_rackInserts.begin(); + it != m_rackInserts.end(); it++ ) { m_scrollView->moveChild( (*it), 0, m_lastY ); m_lastY += (*it)->height(); @@ -177,17 +190,22 @@ void rackView::redraw() -void FASTCALL rackView::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void FASTCALL rackView::saveSettings( QDomDocument & _doc, + QDomElement & _this ) { int num = 0; _this.setAttribute( "plugins", m_rackInserts.count() ); - for( vvector::iterator it = m_rackInserts.begin(); it != m_rackInserts.end(); it++ ) + for( vvector::iterator it = m_rackInserts.begin(); + it != m_rackInserts.end(); it++ ) { ladspa_key_t key = (*it)->getKey(); - _this.setAttribute( "label" + QString::number(num), key.first ); + _this.setAttribute( "label" + QString::number(num), + key.first ); _this.setAttribute( "lib" + QString::number(num), key.second ); - _this.setAttribute( "name" + QString::number(num), m_ladspa->getName( key ) ); - _this.setAttribute( "maker" + QString::number(num), m_ladspa->getMaker( key ) ); + _this.setAttribute( "name" + QString::number(num), + m_ladspa->getName( key ) ); + _this.setAttribute( "maker" + QString::number(num), + m_ladspa->getMaker( key ) ); (*it)->saveState( _doc, _this ); num++; } @@ -204,7 +222,8 @@ void FASTCALL rackView::loadSettings( const QDomElement & _this ) for( int i = 0; i < plugin_cnt; i++ ) { QString lib = _this.attribute( "lib" + QString::number( i ) ); - QString label = _this.attribute( "label" + QString::number( i ) ); + QString label = _this.attribute( "label" + + QString::number( i ) ); ladspa_key_t key( label, lib ); if( m_ladspa->getDescriptor( key ) != NULL ) { @@ -212,22 +231,28 @@ void FASTCALL rackView::loadSettings( const QDomElement & _this ) if( node.isElement() ) { - if( m_rackInserts.last()->nodeName() == node.nodeName() ) + if( m_rackInserts.last()->nodeName() == + node.nodeName() ) { - m_rackInserts.last()->restoreState( node.toElement() ); + m_rackInserts.last()->restoreState( + node.toElement() ); } } } else { - QString name = _this.attribute( "name" + QString::number( i ) ); - QString maker = _this.attribute( "maker" + QString::number( i ) ); - QString message = "Couldn't find " + name + " from:\n\n"; + QString name = _this.attribute( "name" + + QString::number( i ) ); + QString maker = _this.attribute( "maker" + + QString::number( i ) ); + QString message = "Couldn't find " + name + + " from:\n\n"; message += "Library: " + lib + "\n"; message += "Label: " + label + "\n"; message += "Maker: " + maker; - QMessageBox::information( 0, tr( "Uknown plugin" ), message, QMessageBox::Ok ); + QMessageBox::information( 0, tr( "Uknown plugin" ), + message, QMessageBox::Ok ); } node = node.nextSibling(); }