Browse Source

VST3 Host: Update parameter values after plugin requests restart with kParamValuesChanged

v6.1.6
reuk 4 years ago
parent
commit
5dfae8b58b
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
2 changed files with 10 additions and 3 deletions
  1. +0
    -1
      modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  2. +10
    -2
      modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp

+ 0
- 1
modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm View File

@@ -1732,7 +1732,6 @@ private:
#if JUCE_MAC
void addPropertyChangeListener (AudioUnitPropertyID type) const
{
AudioUnitEvent event;
event.mEventType = kAudioUnitEvent_PropertyChange;
event.mArgument.mProperty.mPropertyID = type;


+ 10
- 2
modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -328,7 +328,7 @@ struct VST3HostContext : public Vst::IComponentHandler, // From VST V3.0.0
attributeList = new AttributeList (this);
}
virtual ~VST3HostContext() override {}
~VST3HostContext() override = default;
JUCE_DECLARE_VST3_COM_REF_METHODS
@@ -2883,11 +2883,16 @@ public:
jassert (editController != nullptr);
warnOnFailureIfImplemented (editController->setComponentState (&stream));
resetParameters();
}
void resetParameters()
{
for (auto* parameter : getParameters())
{
auto* vst3Param = static_cast<VST3Parameter*> (parameter);
vst3Param->setValueWithoutUpdatingProcessor ((float) editController->getParamNormalized (vst3Param->getParamID()));
const auto value = (float) editController->getParamNormalized (vst3Param->getParamID());
vst3Param->setValueWithoutUpdatingProcessor (value);
}
}
@@ -3505,6 +3510,9 @@ void VST3HostContext::restartComponentOnMessageThread (int32 flags)
if (hasFlag (flags, Vst::kMidiCCAssignmentChanged))
plugin->updateMidiMappings();
if (hasFlag (flags, Vst::kParamValuesChanged))
plugin->resetParameters();
plugin->updateHostDisplay (AudioProcessorListener::ChangeDetails().withProgramChanged (true)
.withParameterInfoChanged (true));
}


Loading…
Cancel
Save