From 90e8da0cfb54ac593cdbed74c3d0c9b09bad3a9f 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 da029bece7..7c326dc355 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -259,7 +259,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: @@ -352,7 +352,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());