From af4b727b8a86802e47a31252874d80b26a21693f Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 29 Mar 2021 16:42:19 +0100 Subject: [PATCH] VST3: Fixed an assertion when JUCE_FORCE_LEGACY_PARAM_IDS=1 due to getProgramParameter() returning the wrong parameter --- modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index 4eb1a6209f..ad1c4b8350 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -262,7 +262,7 @@ public: //============================================================================== static const FUID iid; Array vstParamIDs; - Vst::ParamID bypassParamID = 0, programParamID = 0; + Vst::ParamID bypassParamID = 0, programParamID = static_cast (paramPreset); bool bypassIsRegularParameter = false; private: @@ -355,7 +355,8 @@ private: juceParameters.params.add (ownedProgramParameter.get()); - programParamID = static_cast (forceLegacyParamIDs ? i++ : paramPreset); + if (forceLegacyParamIDs) + programParamID = static_cast (i++); vstParamIDs.add (programParamID); paramMap.set (static_cast (programParamID), ownedProgramParameter.get());