20#include <JuceHeader.h>
36 juce::String
id =
"0";
43 juce::AudioProcessorParameter::Category
category = juce::AudioProcessorParameter::Category::genericParameter;
48 ParameterControlType
type = ParameterControlType::Continuous;
75 return !(*
this == other);
95 return !(other < *
this);
101 return !(*
this < other);
106 return juce::String(
index) +
";"
114 + juce::String(
static_cast<int>(
category)) +
";"
119 + juce::String(
int(
type)) +
";"
122 juce::StringArray sa;
125 return sa.joinIntoString(
",");
130 juce::StringArray parameterStringArray;
131 auto paramCnt = parameterStringArray.addTokens(parameterString,
";",
"");
134 index = parameterStringArray[0].getIntValue();
135 id = parameterStringArray[1];
136 name = parameterStringArray[2];
139 label = parameterStringArray[5];
140 isAutomatable = parameterStringArray[6].getIntValue() == 1 ? true :
false;
142 category =
static_cast<juce::AudioProcessorParameter::Category
>(parameterStringArray[8].getIntValue());
143 minValue = parameterStringArray[9].getFloatValue();
144 maxValue = parameterStringArray[10].getFloatValue();
145 stepSize = parameterStringArray[11].getFloatValue();
146 isDiscrete = parameterStringArray[12].getIntValue() == 1 ? true :
false;
147 type =
static_cast<ParameterControlType
>(parameterStringArray[13].getIntValue());
148 stepCount = parameterStringArray[14].getIntValue();
150 juce::StringArray stepNamesArray;
151 stepNamesArray.addTokens(parameterStringArray[15],
",",
"");
152 for (
auto const& stepName : stepNamesArray)
153 stepNames.push_back(stepName.toStdString());
166 return parameterInfo;
170 index = processorParameter.getParameterIndex();
171 name = processorParameter.getName(100);
172 label = processorParameter.getLabel();
177 category = processorParameter.getCategory();
179 if (
auto* paramWithID =
dynamic_cast<juce::AudioProcessorParameterWithID*
>(&processorParameter))
181 id = paramWithID->paramID;
185 id =
"param_" + juce::String(
index);
188 if (
auto* rangedParam =
dynamic_cast<juce::RangedAudioParameter*
>(&processorParameter))
190 auto range = rangedParam->getNormalisableRange();
211 return parameterInfo;
214 static std::vector<PluginParameterInfo>
parametersToInfos(juce::Array<juce::AudioProcessorParameter*> processorParameters)
216 std::vector<PluginParameterInfo> infos(processorParameters.size());
217 for (
auto param : processorParameters)
Metadata describing a single plugin parameter exposed for remote control.
std::vector< std::string > stepNames
Display names for each discrete step.
bool operator==(const PluginParameterInfo &other) const
bool operator<(const PluginParameterInfo &other) const
juce::String name
Human-readable parameter name.
bool isRemoteControllable
Whether this parameter is exposed for remote control.
int stepCount
Number of discrete steps (0 if continuous).
bool initializeFromString(const juce::String ¶meterString)
bool isAutomatable
Whether the host can automate this parameter.
int index
Zero-based parameter index within the plugin.
ParameterControlType type
Control widget type (slider, combo, toggle).
static PluginParameterInfo fromString(const juce::String ¶meterString)
bool initializeFromAudioProcessorParameter(juce::AudioProcessorParameter &processorParameter)
float defaultValue
Factory default value (normalised 0..1).
juce::String id
Unique string identifier of the parameter.
bool operator>(const PluginParameterInfo &other) const
juce::String toString() const
bool operator>=(const PluginParameterInfo &other) const
float stepSize
Step interval for discrete parameters (0 = continuous).
static PluginParameterInfo fromAudioProcessorParameter(juce::AudioProcessorParameter &processorParameter)
float minValue
Minimum value in the parameter's native range.
float currentValue
Current parameter value (normalised 0..1).
float maxValue
Maximum value in the parameter's native range.
bool isDiscrete
True if the parameter has a finite set of steps.
static std::vector< PluginParameterInfo > parametersToInfos(juce::Array< juce::AudioProcessorParameter * > processorParameters)
juce::AudioProcessorParameter::Category category
JUCE parameter category.
bool operator!=(const PluginParameterInfo &other) const
bool operator<=(const PluginParameterInfo &other) const
juce::String label
Unit label (e.g. "dB", "Hz").