| @@ -112,6 +112,8 @@ private: | |||||
| class JuceVST3Component; | class JuceVST3Component; | ||||
| static ThreadLocalValue<bool> inParameterChangedCallback; | |||||
| //============================================================================== | //============================================================================== | ||||
| class JuceVST3EditController : public Vst::EditController, | class JuceVST3EditController : public Vst::EditController, | ||||
| public Vst::IMidiMapping, | public Vst::IMidiMapping, | ||||
| @@ -252,6 +254,8 @@ public: | |||||
| if (auto* param = owner.getParameters()[paramIndex]) | if (auto* param = owner.getParameters()[paramIndex]) | ||||
| { | { | ||||
| param->setValue (value); | param->setValue (value); | ||||
| inParameterChangedCallback = true; | |||||
| param->sendValueChangedMessageToListeners (value); | param->sendValueChangedMessageToListeners (value); | ||||
| } | } | ||||
| else | else | ||||
| @@ -602,6 +606,12 @@ public: | |||||
| void audioProcessorParameterChanged (AudioProcessor*, int index, float newValue) override | void audioProcessorParameterChanged (AudioProcessor*, int index, float newValue) override | ||||
| { | { | ||||
| if (inParameterChangedCallback.get()) | |||||
| { | |||||
| inParameterChangedCallback = false; | |||||
| return; | |||||
| } | |||||
| // NB: Cubase has problems if performEdit is called without setParamNormalized | // NB: Cubase has problems if performEdit is called without setParamNormalized | ||||
| EditController::setParamNormalized (getVSTParamIDForIndex (index), (double) newValue); | EditController::setParamNormalized (getVSTParamIDForIndex (index), (double) newValue); | ||||
| performEdit (getVSTParamIDForIndex (index), (double) newValue); | performEdit (getVSTParamIDForIndex (index), (double) newValue); | ||||
| @@ -1137,6 +1147,8 @@ public: | |||||
| : pluginInstance (createPluginFilterOfType (AudioProcessor::wrapperType_VST3)), | : pluginInstance (createPluginFilterOfType (AudioProcessor::wrapperType_VST3)), | ||||
| host (h) | host (h) | ||||
| { | { | ||||
| inParameterChangedCallback = false; | |||||
| #ifdef JucePlugin_PreferredChannelConfigurations | #ifdef JucePlugin_PreferredChannelConfigurations | ||||
| short configs[][2] = { JucePlugin_PreferredChannelConfigurations }; | short configs[][2] = { JucePlugin_PreferredChannelConfigurations }; | ||||
| const int numConfigs = sizeof (configs) / sizeof (short[2]); | const int numConfigs = sizeof (configs) / sizeof (short[2]); | ||||
| @@ -2031,6 +2043,8 @@ public: | |||||
| if (auto* param = pluginInstance->getParameters()[index]) | if (auto* param = pluginInstance->getParameters()[index]) | ||||
| { | { | ||||
| param->setValue (floatValue); | param->setValue (floatValue); | ||||
| inParameterChangedCallback = true; | |||||
| param->sendValueChangedMessageToListeners (floatValue); | param->sendValueChangedMessageToListeners (floatValue); | ||||
| } | } | ||||
| else if (isPositiveAndBelow (index, pluginInstance->getNumParameters())) | else if (isPositiveAndBelow (index, pluginInstance->getNumParameters())) | ||||