| @@ -616,6 +616,8 @@ namespace AAXClasses | |||||
| JuceAAX_Processor() | JuceAAX_Processor() | ||||
| : pluginInstance (createPluginFilterOfType (AudioProcessor::wrapperType_AAX)) | : pluginInstance (createPluginFilterOfType (AudioProcessor::wrapperType_AAX)) | ||||
| { | { | ||||
| inParameterChangedCallback = false; | |||||
| pluginInstance->setPlayHead (this); | pluginInstance->setPlayHead (this); | ||||
| pluginInstance->addListener (this); | pluginInstance->addListener (this); | ||||
| @@ -784,8 +786,13 @@ namespace AAXClasses | |||||
| { | { | ||||
| if (auto* param = pluginInstance->getParameters()[index]) | if (auto* param = pluginInstance->getParameters()[index]) | ||||
| { | { | ||||
| param->setValue (value); | |||||
| param->sendValueChangedMessageToListeners (value); | |||||
| if (value != param->getValue()) | |||||
| { | |||||
| param->setValue (value); | |||||
| inParameterChangedCallback = true; | |||||
| param->sendValueChangedMessageToListeners (value); | |||||
| } | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -993,6 +1000,12 @@ namespace AAXClasses | |||||
| void audioProcessorParameterChanged (AudioProcessor* /*processor*/, int parameterIndex, float newValue) override | void audioProcessorParameterChanged (AudioProcessor* /*processor*/, int parameterIndex, float newValue) override | ||||
| { | { | ||||
| if (inParameterChangedCallback.get()) | |||||
| { | |||||
| inParameterChangedCallback = false; | |||||
| return; | |||||
| } | |||||
| if (auto paramID = getAAXParamIDFromJuceIndex (parameterIndex)) | if (auto paramID = getAAXParamIDFromJuceIndex (parameterIndex)) | ||||
| SetParameterNormalizedValue (paramID, (double) newValue); | SetParameterNormalizedValue (paramID, (double) newValue); | ||||
| } | } | ||||
| @@ -1763,6 +1776,8 @@ namespace AAXClasses | |||||
| mutable ThreadLocalValue<ChunkMemoryBlock> perThreadFilterData; | mutable ThreadLocalValue<ChunkMemoryBlock> perThreadFilterData; | ||||
| CriticalSection perThreadDataLock; | CriticalSection perThreadDataLock; | ||||
| ThreadLocalValue<bool> inParameterChangedCallback; | |||||
| JUCE_DECLARE_NON_COPYABLE (JuceAAX_Processor) | JUCE_DECLARE_NON_COPYABLE (JuceAAX_Processor) | ||||
| }; | }; | ||||