@@ -743,6 +743,15 @@ public: | |||||
if (fPortControls[i] != nullptr) | if (fPortControls[i] != nullptr) | ||||
*fPortControls[i] = fLastControlValues[i]; | *fPortControls[i] = fLastControlValues[i]; | ||||
} | } | ||||
# if DISTRHO_PLUGIN_WANT_FULL_STATE | |||||
// Update state | |||||
for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) | |||||
{ | |||||
const String& key = cit->first; | |||||
fStateMap[key] = fPlugin.getState(key); | |||||
} | |||||
# endif | |||||
} | } | ||||
#endif | #endif | ||||
@@ -751,6 +760,15 @@ public: | |||||
#if DISTRHO_PLUGIN_WANT_STATE | #if DISTRHO_PLUGIN_WANT_STATE | ||||
LV2_State_Status lv2_save(const LV2_State_Store_Function store, const LV2_State_Handle handle) | LV2_State_Status lv2_save(const LV2_State_Store_Function store, const LV2_State_Handle handle) | ||||
{ | { | ||||
# if DISTRHO_PLUGIN_WANT_FULL_STATE | |||||
// Update current state | |||||
for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) | |||||
{ | |||||
const String& key = cit->first; | |||||
fStateMap[key] = fPlugin.getState(key); | |||||
} | |||||
# endif | |||||
for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) | for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) | ||||
{ | { | ||||
const String& key = cit->first; | const String& key = cit->first; | ||||
@@ -454,7 +454,17 @@ public: | |||||
fVstUI = new UIVst(fAudioMaster, fEffect, this, &fPlugin, (intptr_t)ptr); | fVstUI = new UIVst(fAudioMaster, fEffect, this, &fPlugin, (intptr_t)ptr); | ||||
# if DISTRHO_PLUGIN_WANT_FULL_STATE | |||||
// Update current state from plugin side | |||||
for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) | |||||
{ | |||||
const String& key = cit->first; | |||||
fStateMap[key] = fPlugin.getState(key); | |||||
} | |||||
# endif | |||||
# if DISTRHO_PLUGIN_WANT_STATE | # if DISTRHO_PLUGIN_WANT_STATE | ||||
// Set state | |||||
for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) | for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) | ||||
{ | { | ||||
const String& key = cit->first; | const String& key = cit->first; | ||||
@@ -506,6 +516,15 @@ public: | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
# if DISTRHO_PLUGIN_WANT_FULL_STATE | |||||
// Update current state | |||||
for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) | |||||
{ | |||||
const String& key = cit->first; | |||||
fStateMap[key] = fPlugin.getState(key); | |||||
} | |||||
# endif | |||||
String chunkStr; | String chunkStr; | ||||
for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) | for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit) | ||||