fixed lost automation relations when switching samplerate

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1734 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-10-04 20:47:47 +00:00
parent 13c00f55a1
commit 9b5b9d0468
7 changed files with 120 additions and 84 deletions

View File

@@ -34,6 +34,7 @@
#include "ladspa_subplugin_features.h"
#include "mixer.h"
#include "effect_chain.h"
#include "automation_pattern.h"
#undef SINGLE_SOURCE_COMPILE
@@ -105,15 +106,23 @@ void ladspaEffect::changeSampleRate( void )
{
multimediaProject mmp( multimediaProject::EffectSettings );
m_controls->saveState( mmp, mmp.content() );
ladspaControls * controls = m_controls;
m_controls = NULL;
m_pluginMutex.lock();
pluginDestruction();
pluginInstantiation();
m_pluginMutex.unlock();
m_controls->restoreState( mmp.content().firstChild().toElement() );
controls->effectModelChanged( m_controls );
delete controls;
m_controls->restoreState( mmp.content().firstChild().toElement() );
// the IDs of re-created controls have been saved and now need to be
// resolved again
automationPattern::resolveAllIDs();
}