diff --git a/ChangeLog b/ChangeLog index 64bd9c5020..20ce2b7a28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2008-01-04 Tobias Doerffel + + * plugins/ladspa_effect/ladspa_effect.cpp: + * plugins/ladspa_effect/ladspa_control_dialog.cpp: + * plugins/ladspa_effect/ladspa_control_dialog.h: + minor fixes in order to compile again with lately changed effect-API + + * src/core/effect_tab_widget.cpp: + * src/lib/mmp.cpp: + renabled XML-attribute "fxdisabled" to "fxenabled" + + * src/core/effect_tab_widget.cpp: + * include/effect_tab_widget.h: + made effects working again by using effect-chain's m_enabledModel as + model for effect-groupbox + + * include/effect_chain.h: + * src/core/effect_chain.cpp: + * src/core/effect_tab_widget.cpp: + removed bypassed-property and introduced m_enabledModel + + * include/effect.h: + - made lot of methods const + - renamed enabled() to isEnabled() + 2008-01-04 Tobias Doerffel * src/core/bb_editor.cpp: diff --git a/configure.in b/configure.in index ec351903f9..deb308d9c5 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.4.0-svn20080102-mv, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20080102-mv) +AC_INIT(lmms, 0.4.0-svn20080104-mv, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20080104-mv) AM_CONFIG_HEADER(config.h) diff --git a/include/automatable_model_templates.h b/include/automatable_model_templates.h index 1bf06a31a0..ab5bb2adde 100644 --- a/include/automatable_model_templates.h +++ b/include/automatable_model_templates.h @@ -1,7 +1,7 @@ /* * automatable_model_templates.h - definition of automatableModel templates * - * Copyright (c) 2007 Tobias Doerffel + * Copyright (c) 2007-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * diff --git a/include/effect.h b/include/effect.h index a44655a4a6..d5e55618ce 100644 --- a/include/effect.h +++ b/include/effect.h @@ -54,7 +54,7 @@ public: virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf, const fpp_t _frames ); - inline ch_cnt_t getProcessorCount( void ) + inline ch_cnt_t getProcessorCount( void ) const { return( m_processors ); } @@ -64,7 +64,7 @@ public: m_processors = _processors; } - inline bool isOkay( void ) + inline bool isOkay( void ) const { return( m_okay ); } @@ -75,7 +75,7 @@ public: } - inline bool isRunning( void ) + inline bool isRunning( void ) const { return( m_running ); } @@ -91,12 +91,12 @@ public: m_running = FALSE; } - inline bool enabled( void ) + inline bool isEnabled( void ) const { return( m_enabledModel.value() ); } - inline Uint32 getTimeout( void ) + inline Uint32 getTimeout( void ) const { return( m_silenceTimeout ); } @@ -106,24 +106,24 @@ public: m_silenceTimeout = _time_out; } - inline float getWetLevel( void ) + inline float getWetLevel( void ) const { return( m_wetDryModel.value() ); } - inline float getDryLevel( void ) + inline float getDryLevel( void ) const { return( 1.0f - m_wetDryModel.value() ); } - inline float getGate( void ) + inline float getGate( void ) const { const float level = m_gateModel.value(); return( level*level * m_processors * engine::getMixer()->framesPerPeriod() ); } - inline Uint32 getBufferCount( void ) + inline Uint32 getBufferCount( void ) const { return( m_bufferCount ); } @@ -138,7 +138,7 @@ public: m_bufferCount++; } - inline bool dontRun( void ) + inline bool dontRun( void ) const { return( m_noRun ); } @@ -148,7 +148,7 @@ public: m_noRun = _state; } - inline const descriptor::subPluginFeatures::key & getKey( void ) + inline const descriptor::subPluginFeatures::key & getKey( void ) const { return( m_key ); } diff --git a/include/effect_chain.h b/include/effect_chain.h index 1b6011035b..c0acf4155e 100644 --- a/include/effect_chain.h +++ b/include/effect_chain.h @@ -1,7 +1,7 @@ /* * effect_chain.h - class for processing and effects chain * - * Copyright (c) 2006-2007 Danny McRae + * Copyright (c) 2006-2008 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -27,8 +27,10 @@ #include "effect.h" + typedef QVector effect_list_t; + class effectChain { public: @@ -43,21 +45,20 @@ public: const fpp_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; + + boolModel m_enabledModel; + + + friend class effectTabWidget; } ; diff --git a/include/effect_tab_widget.h b/include/effect_tab_widget.h index f2198bcd3c..a64a454c0c 100644 --- a/include/effect_tab_widget.h +++ b/include/effect_tab_widget.h @@ -2,7 +2,7 @@ * effect_tab_widget.h - tab-widget in channel-track-window for setting up * effects * - * Copyright (c) 2006-2007 Danny McRae + * Copyright (c) 2006-2008 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -70,7 +70,6 @@ public: private slots: void addEffect( void ); - void setBypass( bool _state ); private: diff --git a/include/engine.h b/include/engine.h index 601c705363..3750f41799 100644 --- a/include/engine.h +++ b/include/engine.h @@ -1,7 +1,7 @@ /* * engine.h - engine-system of LMMS * - * Copyright (c) 2006-2007 Tobias Doerffel + * Copyright (c) 2006-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * diff --git a/include/plugin.h b/include/plugin.h index 5cea2a5684..385589c47a 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -1,7 +1,7 @@ /* * plugin.h - class plugin, the base-class and generic interface for all plugins * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * diff --git a/plugins/ladspa_effect/ladspa_control_dialog.cpp b/plugins/ladspa_effect/ladspa_control_dialog.cpp index 713888036f..d6321d5a3d 100644 --- a/plugins/ladspa_effect/ladspa_control_dialog.cpp +++ b/plugins/ladspa_effect/ladspa_control_dialog.cpp @@ -2,7 +2,7 @@ * ladspa_control_dialog.cpp - dialog for displaying and editing control port * values for LADSPA plugins * - * Copyright (c) 2006-2007 Danny McRae + * Copyright (c) 2006-2008 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -132,10 +132,9 @@ ladspaControlDialog::ladspaControlDialog( QWidget * _parent, m_mainLay->addSpacing( 3 ); QHBoxLayout * center = new QHBoxLayout(); m_mainLay->addLayout( center ); - m_stereoLink = new ledCheckBox( tr( "Link Channels" ), this, - NULL, NULL ); - connect( m_stereoLink, SIGNAL( toggled( bool ) ), - this, SLOT( link( bool ) ) ); + m_stereoLink = new ledCheckBox( tr( "Link Channels" ), this ); + connect( m_stereoLink, SIGNAL( dataChanged() ), + this, SLOT( updateChannelLinkState() ) ); m_stereoLink->setChecked( TRUE ); center->addWidget( m_stereoLink ); } @@ -161,7 +160,7 @@ void FASTCALL ladspaControlDialog::saveSettings( QDomDocument & _doc, { if( m_processors > 1 ) { - _this.setAttribute( "link", m_stereoLink->isChecked() ); + _this.setAttribute( "link", m_stereoLink->model()->value() ); } multi_proc_t controls = m_effect->getControls(); @@ -182,7 +181,8 @@ void FASTCALL ladspaControlDialog::loadSettings( const QDomElement & _this ) { if( m_processors > 1 ) { - m_stereoLink->setChecked( _this.attribute( "link" ).toInt() ); + m_stereoLink->model()->setValue( + _this.attribute( "link" ).toInt() ); } multi_proc_t controls = m_effect->getControls(); @@ -221,9 +221,9 @@ void ladspaControlDialog::linkPort( Uint16 _port, bool _state ) -void ladspaControlDialog::link( bool _state ) +void ladspaControlDialog::updateChannelLinkState( void ) { - if( _state ) + if( m_stereoLink->model()->value() ) { for( Uint16 port = 0; port < m_controlCount / m_processors; diff --git a/plugins/ladspa_effect/ladspa_control_dialog.h b/plugins/ladspa_effect/ladspa_control_dialog.h index 5013e6810e..f0d1da2423 100644 --- a/plugins/ladspa_effect/ladspa_control_dialog.h +++ b/plugins/ladspa_effect/ladspa_control_dialog.h @@ -2,7 +2,7 @@ * ladspa_control_dialog.h - dialog for displaying and editing control port * values for LADSPA plugins * - * Copyright (c) 2006-2007 Danny McRae + * Copyright (c) 2006-2008 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -62,7 +62,7 @@ public: protected slots: - void link( bool _state ); + void updateChannelLinkState( void ); void linkPort( Uint16 _port, bool _state ); diff --git a/plugins/ladspa_effect/ladspa_effect.cpp b/plugins/ladspa_effect/ladspa_effect.cpp index 4cc2971837..200235393d 100644 --- a/plugins/ladspa_effect/ladspa_effect.cpp +++ b/plugins/ladspa_effect/ladspa_effect.cpp @@ -1,7 +1,7 @@ /* * ladspa_effect.cpp - class for processing LADSPA effects * - * Copyright (c) 2006-2007 Danny McRae + * Copyright (c) 2006-2008 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -326,7 +326,7 @@ ladspaEffect::~ladspaEffect() bool FASTCALL ladspaEffect::processAudioBuffer( surroundSampleFrame * _buf, const fpp_t _frames ) { - if( !isOkay() || dontRun() || !isRunning() || isBypassed() ) + if( !isOkay() || dontRun() || !isRunning() || !isEnabled() ) { return( FALSE ); } diff --git a/src/core/arp_and_chords_tab_widget.cpp b/src/core/arp_and_chords_tab_widget.cpp index 519993a1f1..086c7cbeba 100644 --- a/src/core/arp_and_chords_tab_widget.cpp +++ b/src/core/arp_and_chords_tab_widget.cpp @@ -4,7 +4,7 @@ * arp_and_chords_tab_widget.cpp - widget for use in arp/chord-tab of * instrument-track-window * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * diff --git a/src/core/bb_editor.cpp b/src/core/bb_editor.cpp index 3075cee8cb..5f758358e6 100644 --- a/src/core/bb_editor.cpp +++ b/src/core/bb_editor.cpp @@ -3,7 +3,7 @@ /* * bb_editor.cpp - basic main-window for editing of beats and basslines * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * diff --git a/src/core/effect_chain.cpp b/src/core/effect_chain.cpp index f7b0311c1b..0ea0f42614 100644 --- a/src/core/effect_chain.cpp +++ b/src/core/effect_chain.cpp @@ -3,7 +3,7 @@ /* * effect_chain.cpp - class for processing and effects chain * - * Copyright (c) 2006-2007 Danny McRae + * Copyright (c) 2006-2008 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -32,7 +32,7 @@ effectChain::effectChain( void ) : - m_bypassed( TRUE ) + m_enabledModel( FALSE, FALSE, TRUE ) { } @@ -78,7 +78,7 @@ void FASTCALL effectChain::moveDown( effect * _effect ) for( effect_list_t::iterator it = m_effects.begin(); it != m_effects.end(); it++, i++ ) { - if( (*it) == _effect ) + if( *it == _effect ) { break; } @@ -101,7 +101,7 @@ void FASTCALL effectChain::moveUp( effect * _effect ) for( effect_list_t::iterator it = m_effects.begin(); it != m_effects.end(); it++, i++ ) { - if( (*it) == _effect ) + if( *it == _effect ) { break; } @@ -119,7 +119,7 @@ void FASTCALL effectChain::moveUp( effect * _effect ) bool FASTCALL effectChain::processAudioBuffer( surroundSampleFrame * _buf, const fpp_t _frames ) { - if( m_bypassed ) + if( m_enabledModel.value() == FALSE ) { return( FALSE ); } @@ -127,7 +127,7 @@ bool FASTCALL effectChain::processAudioBuffer( surroundSampleFrame * _buf, for( effect_list_t::iterator it = m_effects.begin(); it != m_effects.end(); it++ ) { - more_effects |= (*it)->processAudioBuffer( _buf, _frames ); + more_effects |= ( *it )->processAudioBuffer( _buf, _frames ); } return( more_effects ); } @@ -137,7 +137,7 @@ bool FASTCALL effectChain::processAudioBuffer( surroundSampleFrame * _buf, void effectChain::startRunning( void ) { - if( m_bypassed ) + if( m_enabledModel.value() == FALSE ) { return; } @@ -145,7 +145,7 @@ void effectChain::startRunning( void ) for( effect_list_t::iterator it = m_effects.begin(); it != m_effects.end(); it++ ) { - (*it)->startRunning(); + ( *it )->startRunning(); } } @@ -154,7 +154,7 @@ void effectChain::startRunning( void ) bool effectChain::isRunning( void ) { - if( m_bypassed ) + if( m_enabledModel.value() == FALSE ) { return( FALSE ); } @@ -164,7 +164,7 @@ bool effectChain::isRunning( void ) for( effect_list_t::iterator it = m_effects.begin(); it != m_effects.end() || !running; it++ ) { - running = (*it)->isRunning() && running; + running = ( *it )->isRunning() && running; } return( running ); } diff --git a/src/core/effect_tab_widget.cpp b/src/core/effect_tab_widget.cpp index 32bd7bc857..f6ef459d71 100644 --- a/src/core/effect_tab_widget.cpp +++ b/src/core/effect_tab_widget.cpp @@ -4,7 +4,7 @@ * effect_tab_widget.cpp - tab-widget in channel-track-window for setting up * effects * - * Copyright (c) 2006-2007 Danny McRae + * Copyright (c) 2006-2008 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -52,6 +52,7 @@ effectTabWidget::effectTabWidget( instrumentTrack * _track, m_track( dynamic_cast( _track ) ), m_port( _port ) { + m_port->getEffects()->m_enabledModel.setTrack( m_track ); setupWidget(); } @@ -65,6 +66,7 @@ effectTabWidget::effectTabWidget( QWidget * _parent, m_track( dynamic_cast( _track ) ), m_port( _port ) { + m_port->getEffects()->m_enabledModel.setTrack( m_track ); setupWidget(); } @@ -81,9 +83,7 @@ effectTabWidget::~effectTabWidget() void effectTabWidget::setupWidget( void ) { m_effectsGroupBox = new groupBox( tr( "EFFECTS CHAIN" ), this ); - m_effectsGroupBox->model()->setTrack( m_track ); - connect( m_effectsGroupBox, SIGNAL( toggled( bool ) ), - this, SLOT( setBypass( bool ) ) ); + m_effectsGroupBox->setModel( &m_port->getEffects()->m_enabledModel ); m_effectsGroupBox->setGeometry( 2, 2, 242, 244 ); m_rack = new rackView( m_effectsGroupBox, m_track, m_port ); @@ -101,8 +101,8 @@ void effectTabWidget::setupWidget( void ) void effectTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - _this.setAttribute( "fxdisabled", - !m_effectsGroupBox->model()->value() ); + _this.setAttribute( "fxenabled", + m_port->getEffects()->m_enabledModel.value() ); m_rack->saveState( _doc, _this ); } @@ -112,8 +112,8 @@ void effectTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this ) void effectTabWidget::loadSettings( const QDomElement & _this ) { - m_effectsGroupBox->model()->setValue( - !_this.attribute( "fxdisabled" ).toInt() ); + m_port->getEffects()->m_enabledModel.setValue( + _this.attribute( "fxenabled" ).toInt() ); QDomNode node = _this.firstChild(); while( !node.isNull() ) @@ -149,14 +149,6 @@ void effectTabWidget::addEffect( void ) -void effectTabWidget::setBypass( bool _state ) -{ - m_port->getEffects()->setBypass( !_state ); -} - - - - #include "effect_tab_widget.moc" #endif diff --git a/src/core/engine.cpp b/src/core/engine.cpp index 13f121d047..919571e897 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -3,7 +3,7 @@ /* * engine.cpp - implementation of LMMS' engine-system * - * Copyright (c) 2006-2007 Tobias Doerffel + * Copyright (c) 2006-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * diff --git a/src/core/envelope_tab_widget.cpp b/src/core/envelope_tab_widget.cpp index bf973a8cf7..2ec337dd8c 100644 --- a/src/core/envelope_tab_widget.cpp +++ b/src/core/envelope_tab_widget.cpp @@ -4,7 +4,7 @@ * envelope_tab_widget.cpp - widget for use in envelope/lfo/filter-tab of * instrument-track-window * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * diff --git a/src/lib/mmp.cpp b/src/lib/mmp.cpp index 0b764b7d56..b41aa4f40f 100644 --- a/src/lib/mmp.cpp +++ b/src/lib/mmp.cpp @@ -3,7 +3,7 @@ /* * mmp.cpp - implementation of class multimediaProject * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -571,6 +571,20 @@ void multimediaProject::upgrade( void ) } } + if( version < "0.4.0-svn20080104" ) + { + QDomNodeList list = elementsByTagName( "fx" ); + for( int i = 0; !list.item( i ).isNull(); ++i ) + { + QDomElement el = list.item( i ).toElement(); + if( el.hasAttribute( "fxdisabled" ) && + el.attribute( "fxdisabled" ).toInt() == 0 ) + { + el.setAttribute( "fxenabled", 1 ); + } + } + } + if( !m_head.hasAttribute( "mastervol" ) ) { m_head.setAttribute( "mastervol", 100 ); diff --git a/src/widgets/group_box.cpp b/src/widgets/group_box.cpp index 55e44d0bd8..25c3a1e427 100644 --- a/src/widgets/group_box.cpp +++ b/src/widgets/group_box.cpp @@ -3,7 +3,7 @@ /* * group_box.cpp - groupbox for LMMS * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net *