Browse Source

Only load default state on LV2 plugins that request such feature

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
7f595594b4
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      source/backend/plugin/CarlaPluginLV2.cpp

+ 9
- 2
source/backend/plugin/CarlaPluginLV2.cpp View File

@@ -577,6 +577,7 @@ public:
fCvInBuffers(nullptr),
fCvOutBuffers(nullptr),
fParamBuffers(nullptr),
fHasLoadDefaultState(false),
fHasThreadSafeRestore(false),
fNeedsFixedBuffers(false),
fNeedsUiClose(false),
@@ -3235,10 +3236,11 @@ public:
{
setMidiProgram(0, false, false, false, true);
}
else
else if (fHasLoadDefaultState)
{
// load default state
if (LilvState* const state = Lv2WorldClass::getInstance().getStateFromURI(fDescriptor->URI, (const LV2_URID_Map*)fFeatures[kFeatureIdUridMap]->data))
if (LilvState* const state = Lv2WorldClass::getInstance().getStateFromURI(fDescriptor->URI,
(const LV2_URID_Map*)fFeatures[kFeatureIdUridMap]->data))
{
lilv_state_restore(state, fExt.state, fHandle, carla_lilv_set_port_value, this, 0, fFeatures);

@@ -6084,6 +6086,10 @@ public:
{
fStrictBounds = feature.Required ? 1 : 0;
}
else if (std::strcmp(feature.URI, LV2_STATE__loadDefaultState) == 0)
{
fHasLoadDefaultState = true;
}
else if (std::strcmp(feature.URI, LV2_STATE__threadSafeRestore) == 0)
{
fHasThreadSafeRestore = true;
@@ -6944,6 +6950,7 @@ private:
float** fCvOutBuffers;
float* fParamBuffers;

bool fHasLoadDefaultState : 1;
bool fHasThreadSafeRestore : 1;
bool fNeedsFixedBuffers : 1;
bool fNeedsUiClose : 1;


Loading…
Cancel
Save