Skip to content

Commit

Permalink
Don't use dummy controllers for connections if not loading projects (L…
Browse files Browse the repository at this point in the history
…MMS#4493)

Remove the need of ControllerConnection::finalizeConnections
when not loading projects.
Fix ZynAddSubFX knob disconnection when exporting.
  • Loading branch information
PhysSong committed Aug 1, 2018
1 parent 160fbf7 commit 32b8563
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
3 changes: 0 additions & 3 deletions plugins/LadspaEffect/LadspaEffect.cpp
Expand Up @@ -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();
}


Expand Down
2 changes: 0 additions & 2 deletions plugins/zynaddsubfx/ZynAddSubFx.cpp
Expand Up @@ -645,8 +645,6 @@ void ZynAddSubFxView::toggleUI()
connect( model->m_remotePlugin, SIGNAL( clickedCloseButton() ),
m_toggleUIButton, SLOT( toggle() ) );
}

ControllerConnection::finalizeConnections();
}
}

Expand Down
16 changes: 11 additions & 5 deletions src/core/ControllerConnection.cpp
Expand Up @@ -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 );
}
}

Expand Down

0 comments on commit 32b8563

Please sign in to comment.