mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
VST3 Host: Update parameter values after plugin requests restart with kParamValuesChanged
This commit is contained in:
parent
2be72f6acd
commit
5dfae8b58b
2 changed files with 10 additions and 3 deletions
|
|
@ -1732,7 +1732,6 @@ private:
|
|||
#if JUCE_MAC
|
||||
void addPropertyChangeListener (AudioUnitPropertyID type) const
|
||||
{
|
||||
|
||||
AudioUnitEvent event;
|
||||
event.mEventType = kAudioUnitEvent_PropertyChange;
|
||||
event.mArgument.mProperty.mPropertyID = type;
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue