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

VST3: Fixed an issue where the program number was calculated incorrectly when the host requests a program change

This commit is contained in:
hogliux 2017-07-11 11:43:08 +01:00
parent 276d760cb5
commit 4b4b171423

View file

@ -1917,7 +1917,7 @@ public:
else if (vstParamID == JuceVST3EditController::paramPreset)
{
auto numPrograms = pluginInstance->getNumPrograms();
auto programValue = roundToInt (value * numPrograms);
auto programValue = roundToInt (value * (jmax (0, numPrograms - 1)));
if (numPrograms > 1 && isPositiveAndBelow (programValue, numPrograms)
&& programValue != pluginInstance->getCurrentProgram())