67 const String& parameterName,
86 [[deprecated (
"Prefer the signature taking an Attributes argument")]]
88 const String& parameterName,
91 const String& parameterLabel,
99 .withStringFromValueFunction (
std::move (stringFromIndex))
100 .withValueFromStringFunction (
std::move (indexFromString)))
111 operator int() const noexcept {
return getIndex(); }
117 operator String() const noexcept {
return getCurrentChoiceName(); }
136 float getValue()
const override;
137 void setValue (
float newValue)
override;
138 float getDefaultValue()
const override;
139 int getNumSteps()
const override;
140 bool isDiscrete()
const override;
141 String getText (
float,
int)
const override;
142 float getValueForText (
const String&)
const override;
146 const float defaultValue;
Properties of an AudioParameterChoice.
Provides a class of AudioProcessorParameter that can be used to select an indexed,...
const StringArray choices
Provides access to the list of choices that this parameter is working with.
const NormalisableRange< float > & getNormalisableRange() const override
Returns the range of values that the parameter can take.
String getCurrentChoiceName() const noexcept
Returns the name of the currently selected item.
int getIndex() const noexcept
Returns the current index of the selected item.
AudioParameterChoice(const ParameterID ¶meterID, const String ¶meterName, const StringArray &choicesToUse, int defaultItemIndex, const String ¶meterLabel, std::function< String(int index, int maximumStringLength)> stringFromIndex=nullptr, std::function< int(const String &text)> indexFromString=nullptr)
Creates a AudioParameterChoice with the specified parameters.
Represents a mapping between an arbitrary range of values and a normalised 0->1 range.
Combines a parameter ID and a version hint.
This abstract base class is used by some AudioProcessorParameter helper classes.
A special array for holding a list of strings.
@ valueChanged
Indicates that the UI element's value has changed.
int roundToInt(const FloatType value) noexcept
Fast floating-point-to-integer conversion.