Browse Source

Fix lv2 host parameter changes notification to plugin

Signed-off-by: falkTX <falktx@falktx.com>
tags/2021-03-15
falkTX 1 year ago
parent
commit
9e78585473
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 15 additions and 1 deletions
  1. +15
    -1
      libs/juce-current/source/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp

+ 15
- 1
libs/juce-current/source/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp View File

@@ -383,6 +383,8 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceLv2ParentContainer);
};

static ThreadLocalValue<bool> inParameterChangedCallback;

//==============================================================================
/**
Juce LV2 UI handle
@@ -562,6 +564,12 @@ public:

void audioProcessorParameterChanged (AudioProcessor*, int index, float newValue)
{
if (inParameterChangedCallback.get())
{
inParameterChangedCallback = false;
return;
}

if (writeFunction == nullptr || controller == nullptr)
return;

@@ -1078,7 +1086,13 @@ public:

if (lastControlValues[i] != curValue)
{
filter->setParameter (i, curValue);
if (AudioProcessorParameter* const param = filter->getParameters()[i])
{
param->setValue (curValue);

inParameterChangedCallback = true;
param->sendValueChangedMessageToListeners (curValue);
}
lastControlValues.setUnchecked (i, curValue);
}
}


Loading…
Cancel
Save