Browse Source

Implement full state on lv2 and vst

pull/6/head
falkTX 8 years ago
parent
commit
4444810108
2 changed files with 37 additions and 0 deletions
  1. +18
    -0
      distrho/src/DistrhoPluginLV2.cpp
  2. +19
    -0
      distrho/src/DistrhoPluginVST.cpp

+ 18
- 0
distrho/src/DistrhoPluginLV2.cpp View File

@@ -743,6 +743,15 @@ public:
if (fPortControls[i] != nullptr)
*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

@@ -751,6 +760,15 @@ public:
#if DISTRHO_PLUGIN_WANT_STATE
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)
{
const String& key = cit->first;


+ 19
- 0
distrho/src/DistrhoPluginVST.cpp View File

@@ -454,7 +454,17 @@ public:

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
// Set state
for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit)
{
const String& key = cit->first;
@@ -506,6 +516,15 @@ public:
}
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;

for (StringMap::const_iterator cit=fStateMap.begin(), cite=fStateMap.end(); cit != cite; ++cit)


Loading…
Cancel
Save