mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-19 01:04:20 +00:00
AAX: Fixed an issue where you could get stuck in audioParameterChanged recursion
This commit is contained in:
parent
c452e49e8e
commit
581fa8c5a0
1 changed files with 17 additions and 2 deletions
|
|
@ -616,6 +616,8 @@ namespace AAXClasses
|
|||
JuceAAX_Processor()
|
||||
: pluginInstance (createPluginFilterOfType (AudioProcessor::wrapperType_AAX))
|
||||
{
|
||||
inParameterChangedCallback = false;
|
||||
|
||||
pluginInstance->setPlayHead (this);
|
||||
pluginInstance->addListener (this);
|
||||
|
||||
|
|
@ -784,8 +786,13 @@ namespace AAXClasses
|
|||
{
|
||||
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
|
||||
{
|
||||
|
|
@ -993,6 +1000,12 @@ namespace AAXClasses
|
|||
|
||||
void audioProcessorParameterChanged (AudioProcessor* /*processor*/, int parameterIndex, float newValue) override
|
||||
{
|
||||
if (inParameterChangedCallback.get())
|
||||
{
|
||||
inParameterChangedCallback = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto paramID = getAAXParamIDFromJuceIndex (parameterIndex))
|
||||
SetParameterNormalizedValue (paramID, (double) newValue);
|
||||
}
|
||||
|
|
@ -1763,6 +1776,8 @@ namespace AAXClasses
|
|||
mutable ThreadLocalValue<ChunkMemoryBlock> perThreadFilterData;
|
||||
CriticalSection perThreadDataLock;
|
||||
|
||||
ThreadLocalValue<bool> inParameterChangedCallback;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE (JuceAAX_Processor)
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue