mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-08 04:20:09 +00:00
VST and VST3: Removed the caching of hosted parameter information
This commit is contained in:
parent
895c822775
commit
5a701fc385
2 changed files with 21 additions and 37 deletions
|
|
@ -1700,20 +1700,10 @@ struct VST3PluginInstance : public AudioPluginInstance
|
|||
{
|
||||
VST3Parameter (VST3PluginInstance& parent,
|
||||
Steinberg::Vst::ParamID parameterID,
|
||||
const String& parameterName,
|
||||
const String& parameterLabel,
|
||||
Steinberg::Vst::ParamValue defaultParameterValue,
|
||||
bool parameterIsAutomatable,
|
||||
bool parameterIsDiscrete,
|
||||
int numParameterSteps)
|
||||
bool parameterIsAutomatable)
|
||||
: pluginInstance (parent),
|
||||
paramID (parameterID),
|
||||
name (parameterName),
|
||||
label (parameterLabel),
|
||||
defaultValue (defaultParameterValue),
|
||||
automatable (parameterIsAutomatable),
|
||||
discrete (parameterIsDiscrete),
|
||||
numSteps (numParameterSteps)
|
||||
automatable (parameterIsAutomatable)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -1767,17 +1757,17 @@ struct VST3PluginInstance : public AudioPluginInstance
|
|||
|
||||
float getDefaultValue() const override
|
||||
{
|
||||
return (float) defaultValue;
|
||||
return (float) pluginInstance.getParameterInfoForIndex (getParameterIndex()).defaultNormalizedValue;
|
||||
}
|
||||
|
||||
String getName (int /*maximumStringLength*/) const override
|
||||
{
|
||||
return name;
|
||||
return toString (pluginInstance.getParameterInfoForIndex (getParameterIndex()).title);
|
||||
}
|
||||
|
||||
String getLabel() const override
|
||||
{
|
||||
return label;
|
||||
return toString (pluginInstance.getParameterInfoForIndex (getParameterIndex()).units);
|
||||
}
|
||||
|
||||
bool isAutomatable() const override
|
||||
|
|
@ -1787,12 +1777,14 @@ struct VST3PluginInstance : public AudioPluginInstance
|
|||
|
||||
bool isDiscrete() const override
|
||||
{
|
||||
return discrete;
|
||||
return getNumSteps() != AudioProcessor::getDefaultNumParameterSteps();
|
||||
}
|
||||
|
||||
int getNumSteps() const override
|
||||
{
|
||||
return numSteps;
|
||||
auto stepCount = pluginInstance.getParameterInfoForIndex (getParameterIndex()).stepCount;
|
||||
return stepCount == 0 ? AudioProcessor::getDefaultNumParameterSteps()
|
||||
: stepCount + 1;
|
||||
}
|
||||
|
||||
StringArray getAllValueStrings() const override
|
||||
|
|
@ -1802,10 +1794,7 @@ struct VST3PluginInstance : public AudioPluginInstance
|
|||
|
||||
VST3PluginInstance& pluginInstance;
|
||||
const Steinberg::Vst::ParamID paramID;
|
||||
const String name, label;
|
||||
const Steinberg::Vst::ParamValue defaultValue;
|
||||
const bool automatable, discrete;
|
||||
const int numSteps;
|
||||
const bool automatable;
|
||||
};
|
||||
|
||||
VST3PluginInstance (VST3ComponentHolder* componentHolder)
|
||||
|
|
@ -1878,21 +1867,10 @@ struct VST3PluginInstance : public AudioPluginInstance
|
|||
|
||||
for (int i = 0; i < editController->getParameterCount(); ++i)
|
||||
{
|
||||
Vst::ParameterInfo paramInfo = { 0 };
|
||||
editController->getParameterInfo (i, paramInfo);
|
||||
|
||||
bool isDiscrete = paramInfo.stepCount != 0;
|
||||
int numSteps = isDiscrete ? paramInfo.stepCount + 1
|
||||
: AudioProcessor::getDefaultNumParameterSteps();
|
||||
|
||||
auto paramInfo = getParameterInfoForIndex (i);
|
||||
VST3Parameter* p = new VST3Parameter (*this,
|
||||
paramInfo.id,
|
||||
toString (paramInfo.title),
|
||||
toString (paramInfo.units),
|
||||
paramInfo.defaultNormalizedValue,
|
||||
(paramInfo.flags & Vst::ParameterInfo::kCanAutomate) != 0,
|
||||
isDiscrete,
|
||||
numSteps);
|
||||
(paramInfo.flags & Vst::ParameterInfo::kCanAutomate) != 0);
|
||||
addParameter (p);
|
||||
|
||||
if ((paramInfo.flags & Vst::ParameterInfo::kIsBypass) != 0)
|
||||
|
|
|
|||
|
|
@ -916,6 +916,10 @@ struct VSTPluginInstance : public AudioPluginInstance,
|
|||
|
||||
String getName (int maximumStringLength) const override
|
||||
{
|
||||
if (name.isEmpty())
|
||||
return pluginInstance.getTextForOpcode (getParameterIndex(),
|
||||
plugInOpcodeGetParameterName);
|
||||
|
||||
if (name.length() <= maximumStringLength)
|
||||
return name;
|
||||
|
||||
|
|
@ -933,7 +937,9 @@ struct VSTPluginInstance : public AudioPluginInstance,
|
|||
|
||||
String getLabel() const override
|
||||
{
|
||||
return label;
|
||||
return label.isEmpty() ? pluginInstance.getTextForOpcode (getParameterIndex(),
|
||||
plugInOpcodeGetParameterLabel)
|
||||
: label;
|
||||
}
|
||||
|
||||
bool isAutomatable() const override
|
||||
|
|
@ -989,10 +995,10 @@ struct VSTPluginInstance : public AudioPluginInstance,
|
|||
|
||||
for (int i = 0; i < vstEffect->numParameters; ++i)
|
||||
{
|
||||
String paramName (getTextForOpcode (i, plugInOpcodeGetParameterName));
|
||||
String paramName;
|
||||
Array<String> shortParamNames;
|
||||
float defaultValue = 0;
|
||||
String label (getTextForOpcode (i, plugInOpcodeGetParameterLabel));
|
||||
String label;
|
||||
bool isAutomatable = dispatch (plugInOpcodeIsParameterAutomatable, i, 0, 0, 0) != 0;
|
||||
bool isDiscrete = false;
|
||||
int numSteps = AudioProcessor::getDefaultNumParameterSteps();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue