diff --git a/plugins/LadspaEffect/LadspaEffect.cpp b/plugins/LadspaEffect/LadspaEffect.cpp index 72b195314f0..a274bef6dc8 100644 --- a/plugins/LadspaEffect/LadspaEffect.cpp +++ b/plugins/LadspaEffect/LadspaEffect.cpp @@ -121,9 +121,6 @@ void LadspaEffect::changeSampleRate() // the IDs of re-created controls have been saved and now need to be // resolved again AutomationPattern::resolveAllIDs(); - - // make sure, connections are ok - ControllerConnection::finalizeConnections(); } diff --git a/plugins/zynaddsubfx/ZynAddSubFx.cpp b/plugins/zynaddsubfx/ZynAddSubFx.cpp index 8c1da751f2c..adc3375427c 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/ZynAddSubFx.cpp @@ -645,8 +645,6 @@ void ZynAddSubFxView::toggleUI() connect( model->m_remotePlugin, SIGNAL( clickedCloseButton() ), m_toggleUIButton, SLOT( toggle() ) ); } - - ControllerConnection::finalizeConnections(); } } diff --git a/src/core/ControllerConnection.cpp b/src/core/ControllerConnection.cpp index 4f04cbc2096..af398d389f4 100644 --- a/src/core/ControllerConnection.cpp +++ b/src/core/ControllerConnection.cpp @@ -204,16 +204,22 @@ void ControllerConnection::loadSettings( const QDomElement & _this ) } else { - if( _this.attribute( "id", "-1" ).toInt() >= 0 ) + m_controllerId = _this.attribute( "id", "-1" ).toInt(); + if( m_controllerId < 0 ) { - m_controllerId = _this.attribute( "id" ).toInt(); + qWarning( "controller index invalid\n" ); + m_controllerId = -1; + } + + if (!Engine::getSong()->isLoadingProject() && m_controllerId != -1) + { + setController( Engine::getSong()-> + controllers().at( m_controllerId ) ); } else { - qWarning( "controller index invalid\n" ); - m_controllerId = -1; + m_controller = Controller::create( Controller::DummyController, NULL ); } - m_controller = Controller::create( Controller::DummyController, NULL ); } }