Skip to content

Commit

Permalink
Add my hack for long parameter names in old VST2 plug-ins
Browse files Browse the repository at this point in the history
  • Loading branch information
getdunne committed Jun 20, 2024
1 parent 6564910 commit f83b6b0
Showing 1 changed file with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -949,8 +949,19 @@ struct VSTPluginInstance final : public AudioPluginInstance,
String getName (int maximumStringLength) const override
{
if (name.isEmpty())
return pluginInstance.getTextForOpcode (getParameterIndex(),
Vst2::effGetParamName);
{
#if 1
String name0 = pluginInstance.getTextForOpcode(getParameterIndex(), Vst2::effGetParamName);
Vst2::VstParameterProperties props;
if (pluginInstance.dispatch(Vst2::effGetParameterProperties, getParameterIndex(), 0, &props, 0) && props.label[0])
{
String name1 = String(props.label);
return name1.length() > name0.length() ? name1 : name0;
}
else
#endif
return pluginInstance.getTextForOpcode(getParameterIndex(), Vst2::effGetParamName);
}

if (name.length() <= maximumStringLength)
return name;
Expand Down Expand Up @@ -1651,16 +1662,16 @@ struct VSTPluginInstance final : public AudioPluginInstance,
case Vst2::audioMasterBeginEdit:
if (auto* param = getParameters()[index])
param->beginChangeGesture();
else
jassertfalse; // Invalid parameter index!
// else
// jassertfalse; // Invalid parameter index!

break;

case Vst2::audioMasterEndEdit:
if (auto* param = getParameters()[index])
param->endChangeGesture();
else
jassertfalse; // Invalid parameter index!
// else
// jassertfalse; // Invalid parameter index!

break;

Expand Down

0 comments on commit f83b6b0

Please sign in to comment.