Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
VST3: Wrap program parameter changes in begin/endEdit() calls to ensu…
…re that automation data is recorded correctly
  • Loading branch information
ed95 committed Jan 6, 2021
1 parent 3ff9666 commit 0715b7e
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
Expand Up @@ -594,19 +594,13 @@ class JuceVST3EditController : public Vst::EditController,

bool setNormalized (Vst::ParamValue v) override
{
Vst::ParamValue program = v * info.stepCount;

if (! isPositiveAndBelow ((int) program, owner.getNumPrograms()))
if (! isPositiveAndBelow ((int) toPlain (v), owner.getNumPrograms())
|| v == valueNormalized)
return false;

if (valueNormalized != v)
{
valueNormalized = v;
changed();
return true;
}

return false;
valueNormalized = v;
changed();
return true;
}

void toString (Vst::ParamValue value, Vst::String128 result) const override
Expand Down Expand Up @@ -954,7 +948,10 @@ class JuceVST3EditController : public Vst::EditController,

if (paramValue != EditController::getParamNormalized (JuceAudioProcessor::paramPreset))
{
EditController::setParamNormalized (JuceAudioProcessor::paramPreset, paramValue);
beginEdit (JuceAudioProcessor::paramPreset);
paramChanged (JuceAudioProcessor::paramPreset, (float) paramValue);
endEdit (JuceAudioProcessor::paramPreset);

flags |= Vst::kParamValuesChanged;
}
}
Expand Down

0 comments on commit 0715b7e

Please sign in to comment.