mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-26 02:14:22 +00:00
VST3: Added explicit check for current program value in setComponentState() so it is recalled correctly when loading
This commit is contained in:
parent
99112cf71f
commit
cc9fdc3d6a
1 changed files with 16 additions and 3 deletions
|
|
@ -705,9 +705,22 @@ public:
|
|||
//==============================================================================
|
||||
tresult PLUGIN_API setComponentState (IBStream* stream) override
|
||||
{
|
||||
// Cubase and Nuendo need to inform the host of the current parameter values
|
||||
for (auto vstParamId : audioProcessor->vstParamIDs)
|
||||
setParamNormalized (vstParamId, audioProcessor->getParamForVSTParamID (vstParamId)->getValue());
|
||||
if (auto* pluginInstance = getPluginInstance())
|
||||
{
|
||||
for (auto vstParamId : audioProcessor->vstParamIDs)
|
||||
{
|
||||
auto paramValue = [&]
|
||||
{
|
||||
if (vstParamId == JuceAudioProcessor::paramPreset)
|
||||
return EditController::plainParamToNormalized (JuceAudioProcessor::paramPreset,
|
||||
pluginInstance->getCurrentProgram());
|
||||
|
||||
return (double) audioProcessor->getParamForVSTParamID (vstParamId)->getValue();
|
||||
}();
|
||||
|
||||
setParamNormalized (vstParamId, paramValue);
|
||||
}
|
||||
}
|
||||
|
||||
if (auto* handler = getComponentHandler())
|
||||
handler->restartComponent (Vst::kParamValuesChanged);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue