Browse Source

VST3: Added the ability to change parameter names at runtime

tags/2021-05-28
Tom Poole 5 years ago
parent
commit
d00d23139c
1 changed files with 15 additions and 4 deletions
  1. +15
    -4
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp

+ 15
- 4
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -429,9 +429,7 @@ public:
info.id = vstParamID;
info.unitId = vstUnitID;
toString128 (info.title, param.getName (128));
toString128 (info.shortTitle, param.getName (8));
toString128 (info.units, param.getLabel());
updateParameterInfo();
info.stepCount = (Steinberg::int32) 0;
@@ -460,6 +458,13 @@ public:
virtual ~Param() override = default;
void updateParameterInfo()
{
toString128 (info.title, param.getName (128));
toString128 (info.shortTitle, param.getName (8));
toString128 (info.units, param.getLabel());
}
bool setNormalized (Vst::ParamValue v) override
{
v = jlimit (0.0, 1.0, v);
@@ -887,6 +892,12 @@ public:
void audioProcessorChanged (AudioProcessor*) override
{
auto numParameters = parameters.getParameterCount();
for (int32 i = 0; i < numParameters; ++i)
if (auto* param = dynamic_cast<Param*> (parameters.getParameterByIndex (i)))
param->updateParameterInfo();
if (auto* pluginInstance = getPluginInstance())
{
if (pluginInstance->getNumPrograms() > 1)
@@ -895,7 +906,7 @@ public:
}
if (componentHandler != nullptr && ! inSetupProcessing)
componentHandler->restartComponent (Vst::kLatencyChanged | Vst::kParamValuesChanged);
componentHandler->restartComponent (Vst::kLatencyChanged | Vst::kParamValuesChanged | Vst::kParamTitlesChanged);
}
void parameterValueChanged (int, float newValue) override


Loading…
Cancel
Save