1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-20 01:14:20 +00:00

VST3: Fixed bypass and program parameter indices when JUCE_FORCE_USE_LEGACY_PARAM_IDS=1 and AudioProcessor::getBypassParameter() is implemented

This commit is contained in:
ed 2021-03-26 14:13:28 +00:00
parent fbe95b0b07
commit 2ac46c600d

View file

@ -302,7 +302,7 @@ private:
#endif
juceParameters.update (*audioProcessor, forceLegacyParamIDs);
auto additionalLegacyParameterIDIndex = juceParameters.getNumParameters();
auto numParameters = juceParameters.getNumParameters();
bool vst3WrapperProvidedBypassParam = false;
auto* bypassParameter = audioProcessor->getBypassParameter();
@ -333,8 +333,7 @@ private:
{
// we need to remain backward compatible with the old bypass id
if (vst3WrapperProvidedBypassParam)
vstParamID = static_cast<Vst::ParamID> ((isUsingManagedParameters() && ! forceLegacyParamIDs) ? paramBypass
: additionalLegacyParameterIDIndex++);
vstParamID = static_cast<Vst::ParamID> ((isUsingManagedParameters() && ! forceLegacyParamIDs) ? paramBypass : numParameters);
bypassParamID = vstParamID;
}
@ -353,8 +352,7 @@ private:
juceParameters.params.add (ownedProgramParameter.get());
programParamID = static_cast<Vst::ParamID> (forceLegacyParamIDs ? additionalLegacyParameterIDIndex++
: paramPreset);
programParamID = static_cast<Vst::ParamID> (forceLegacyParamIDs ? i++ : paramPreset);
vstParamIDs.add (programParamID);
paramMap.set (static_cast<int32> (programParamID), ownedProgramParameter.get());