From cccb3d360aa9fd8c2be14682b068a00decdad283 Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 28 Oct 2021 10:39:14 +0100 Subject: [PATCH] AAX Client: Avoid overwriting bypass parameter value on state recall --- modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index edc383f5ff..30732f16b8 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -822,11 +822,15 @@ namespace AAXClasses // * The preset is loaded in PT 10 using the AAX version. // * The session is then saved, and closed. // * The saved session is loaded, but acting as if the preset was never loaded. + // IMPORTANT! If the plugin doesn't manage its own bypass parameter, don't try + // to overwrite the bypass parameter value. auto numParameters = juceParameters.getNumParameters(); for (int i = 0; i < numParameters; ++i) - if (auto paramID = getAAXParamIDFromJuceIndex(i)) - SetParameterNormalizedValue (paramID, juceParameters.getParamForIndex (i)->getValue()); + if (auto* juceParam = juceParameters.getParamForIndex (i)) + if (juceParam != ownedBypassParameter.get()) + if (auto paramID = getAAXParamIDFromJuceIndex (i)) + SetParameterNormalizedValue (paramID, juceParam->getValue()); return AAX_SUCCESS; }