mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
VST3 Host: Be more forgiving of internal parameter IDs in beginEdit/performEdit/endEdit methods
This commit is contained in:
parent
3f699f5b14
commit
f17425c880
1 changed files with 22 additions and 26 deletions
|
|
@ -3437,53 +3437,49 @@ AudioPluginInstance* VST3ComponentHolder::createPluginInstance()
|
|||
//==============================================================================
|
||||
tresult VST3HostContext::beginEdit (Vst::ParamID paramID)
|
||||
{
|
||||
if (plugin != nullptr)
|
||||
{
|
||||
if (auto* param = plugin->getParameterForID (paramID))
|
||||
{
|
||||
param->beginChangeGesture();
|
||||
return kResultTrue;
|
||||
}
|
||||
if (plugin == nullptr)
|
||||
return kResultTrue;
|
||||
|
||||
jassertfalse; // Invalid parameter index!
|
||||
return kResultFalse;
|
||||
if (auto* param = plugin->getParameterForID (paramID))
|
||||
{
|
||||
param->beginChangeGesture();
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
return kResultTrue;
|
||||
return kResultFalse;
|
||||
}
|
||||
|
||||
tresult VST3HostContext::performEdit (Vst::ParamID paramID, Vst::ParamValue valueNormalised)
|
||||
{
|
||||
if (plugin != nullptr)
|
||||
if (plugin == nullptr)
|
||||
return kResultTrue;
|
||||
|
||||
if (auto* param = plugin->getParameterForID (paramID))
|
||||
{
|
||||
if (auto* param = plugin->getParameterForID (paramID))
|
||||
param->setValueFromEditor ((float) valueNormalised);
|
||||
else
|
||||
jassertfalse; // Invalid parameter index!
|
||||
param->setValueFromEditor ((float) valueNormalised);
|
||||
|
||||
// did the plug-in already update the parameter internally
|
||||
if (plugin->editController->getParamNormalized (paramID) != (float) valueNormalised)
|
||||
return plugin->editController->setParamNormalized (paramID, valueNormalised);
|
||||
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
return kResultTrue;
|
||||
return kResultFalse;
|
||||
}
|
||||
|
||||
tresult VST3HostContext::endEdit (Vst::ParamID paramID)
|
||||
{
|
||||
if (plugin != nullptr)
|
||||
{
|
||||
if (auto* param = plugin->getParameterForID (paramID))
|
||||
{
|
||||
param->endChangeGesture();
|
||||
return kResultTrue;
|
||||
}
|
||||
if (plugin == nullptr)
|
||||
return kResultTrue;
|
||||
|
||||
jassertfalse; // Invalid parameter index!
|
||||
return kResultFalse;
|
||||
if (auto* param = plugin->getParameterForID (paramID))
|
||||
{
|
||||
param->endChangeGesture();
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
return kResultTrue;
|
||||
return kResultFalse;
|
||||
}
|
||||
|
||||
tresult VST3HostContext::restartComponent (Steinberg::int32 flags)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue