Hi everybody,
we have a plugin that uses a custom preset backend that supports user presets. When a new preset is added and updateHostDisplay() is called, the VST3 program parameter will not reflect the current number of presets available as it uses a cached preset list that was generated during construction.
In juce_VST3_Wrapper.cpp, the following code is given:
if (details.programChanged)
{
const auto programParameterId = audioProcessor->getProgramParamID();
if (audioProcessor->getParamForVSTParamID (programParameterId) != nullptr)
{
const auto currentProgram = pluginInstance->getCurrentProgram();
const auto paramValue = roundToInt (EditController::normalizedParamToPlain (programParameterId,
EditController::getParamNormalized (programParameterId)));
if (currentProgram != paramValue)
{
beginGesture (programParameterId);
paramChanged (audioProcessor->findCacheIndexForParamID (programParameterId),
programParameterId,
EditController::plainParamToNormalized (programParameterId, currentProgram));
endGesture (programParameterId);
flags |= Vst::kParamValuesChanged;
}
}
}
Here the line with “const auto paramValue” will always result in a wrong integer value, when the number of presets in the backend have been changed since start of the plugin.
Do you how this could be fixed?
Many thanks in advance