29JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE (
"-Wdeprecated-declarations")
30JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
44 float getValue()
const override {
return processor->getParameter (parameterIndex); }
45 void setValue (
float newValue)
override { processor->setParameter (parameterIndex, newValue); }
46 float getDefaultValue()
const override {
return processor->getParameterDefaultValue (parameterIndex); }
48 String getLabel()
const override {
return processor->getParameterLabel (parameterIndex); }
49 int getNumSteps()
const override {
return processor->getParameterNumSteps (parameterIndex); }
50 bool isDiscrete()
const override {
return processor->isParameterDiscrete (parameterIndex); }
52 bool isOrientationInverted()
const override {
return processor->isParameterOrientationInverted (parameterIndex); }
53 bool isAutomatable()
const override {
return processor->isParameterAutomatable (parameterIndex); }
54 bool isMetaParameter()
const override {
return processor->isMetaParameter (parameterIndex); }
80 static int getParamIndex (AudioProcessor& processor, AudioProcessorParameter* param)
noexcept
82 if (
auto*
legacy =
dynamic_cast<LegacyAudioParameter*
> (param))
84 return legacy->parameterIndex;
88 auto n = processor.getNumParameters();
89 jassert (n == processor.getParameters().size());
91 for (
int i = 0; i < n; ++i)
93 if (processor.getParameters()[i] == param)
101 static String getParamID (
const AudioProcessorParameter* param,
bool forceLegacyParamIDs)
noexcept
103 if (
auto*
legacy =
dynamic_cast<const LegacyAudioParameter*
> (param))
106 if (
auto*
paramWithID =
dynamic_cast<const HostedAudioProcessorParameter*
> (param))
112 if (param !=
nullptr)
113 return String (param->getParameterIndex());
143 if (usingManagedParameters)
156 processorGroup = usingManagedParameters ? &
audioProcessor.getParameterTree()
169 return params[index];
176 if (usingManagedParameters && ! legacyParamIDs)
177 return processor.getParameterID (idx);
184 return processorGroup !=
nullptr ? *processorGroup
193 size_t size()
const noexcept {
return (
size_t) params.size(); }
195 bool isUsingManagedParameters()
const noexcept {
return usingManagedParameters; }
196 int getNumParameters()
const noexcept {
return params.size(); }
203 return params.contains (param);
210 bool legacyParamIDs =
false, usingManagedParameters =
false;
213JUCE_END_IGNORE_WARNINGS_GCC_LIKE
214JUCE_END_IGNORE_WARNINGS_MSVC
Holds a resizable array of primitive or copy-by-value objects.
A class encapsulating a group of AudioProcessorParameters and nested AudioProcessorParameterGroups.
void addChild(std::unique_ptr< ParameterOrGroup > child)
Adds a child to the group.
An abstract base class for parameter objects that can be added to an AudioProcessor.
Base class for audio processing classes or plugins.
bool isOrientationInverted() const override
This can be overridden to tell the host that this parameter operates in the reverse direction.
bool isMetaParameter() const override
Should return true if this parameter is a "meta" parameter.
bool isBoolean() const override
Returns whether the parameter represents a boolean switch, typically with "On" and "Off" states.
String getName(int maxLen) const override
Returns the name to display for this parameter, which should be made to fit within the given string l...
float getDefaultValue() const override
This should return the default value for this parameter.
bool isDiscrete() const override
Returns whether the parameter uses discrete values, based on the result of getNumSteps,...
void setValue(float newValue) override
The host will call this method to change the value of a parameter.
String getCurrentValueAsText() const override
Returns the current value of the parameter as a String.
float getValueForText(const String &) const override
Should parse a string and return the appropriate value for it.
Category getCategory() const override
Returns the parameter's category.
String getText(float, int) const override
Returns a textual version of the supplied normalised parameter value.
float getValue() const override
Called by the host to find out the value of this parameter.
bool isAutomatable() const override
Returns true if the host can automate this parameter.
int getNumSteps() const override
Returns the number of steps that this parameter's range should be quantised into.
String getLabel() const override
Some parameters may be able to return a label string for their units.
String getParameterID() const override
Returns an ID that is unique to this parameter.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Returns true if a value is at least zero, and also below a specified upper limit.
A parameter with functions that are useful for plugin hosts.