A MacroControlData object stores information about all parameters that are mapped to one macro control. More...
Public Member Functions | |
void | addParameter (Processor *p, int parameterId, const String ¶meterName, NormalisableRange< double > range, bool readOnly=true) |
adds the parameter to the parameter list and renames the macro if it is the only parameter. More... | |
void | clearDanglingProcessors () |
Removes all parameters with deleted processors. More... | |
XmlElement * | exportAsXml () |
Exports the data as XML. More... | |
float | getCurrentValue () const |
Returns the last value. More... | |
float | getDisplayValue () const |
returns the display value (which takes the first mapped parameter and applies the value to its range). More... | |
String | getMacroName () const |
Returns the macro name. More... | |
int | getNumParameters () const |
Returns the number of mapped parameters. More... | |
MacroControlledParameterData * | getParameter (int parameterIndex) |
returns the parameter at the supplied index. More... | |
MacroControlledParameterData * | getParameterWithProcessorAndIndex (Processor *p, int parameterIndex) |
Searches the parameters for a match with the processor and index. More... | |
MacroControlledParameterData * | getParameterWithProcessorAndName (Processor *p, const String ¶meterName) |
Searches the parameters for a match with the processor and parameter name. More... | |
bool | hasParameter (Processor *p, int parameterIndex) |
checks if the parameter exists. More... | |
bool | isDanglingProcessor (int parameterIndex) |
Checks if the processor of the parameter still exists. More... | |
MacroControlData (int index) | |
Creates an empty data object. More... | |
MacroControlData (ModulatorSynthChain *chain, XmlElement *xml) | |
Creates a new data object from an XmlElement. More... | |
void | removeAllParametersWithProcessor (Processor *p) |
Removes all parameters that control a certain processor. More... | |
void | removeParameter (int parameterIndex) |
Removes the parameter. More... | |
void | removeParameter (const String ¶meterName, const Processor *processor=nullptr) |
Removes the parameter with the name. More... | |
void | setMacroName (const String &name) |
Sets the macro name that is displayed beyond the knob. More... | |
void | setMidiController (int newControllerNumber) |
sets the MidiController number that controls this macro when loaded as main chain. More... | |
void | setValue (float newValue) |
sets the value of the macro controller. More... | |
A MacroControlData object stores information about all parameters that are mapped to one macro control.
|
inline |
Creates an empty data object.
MacroControlData | ( | ModulatorSynthChain * | chain, |
XmlElement * | xml | ||
) |
Creates a new data object from an XmlElement.
The chain is used to find the child processor with the given id.
void addParameter | ( | Processor * | p, |
int | parameterId, | ||
const String & | parameterName, | ||
NormalisableRange< double > | range, | ||
bool | readOnly = true |
||
) |
adds the parameter to the parameter list and renames the macro if it is the only parameter.
void clearDanglingProcessors | ( | ) |
Removes all parameters with deleted processors.
XmlElement * exportAsXml | ( | ) |
Exports the data as XML.
float getCurrentValue | ( | ) | const |
Returns the last value.
float getDisplayValue | ( | ) | const |
returns the display value (which takes the first mapped parameter and applies the value to its range).
|
inline |
Returns the macro name.
|
inline |
Returns the number of mapped parameters.
|
inline |
returns the parameter at the supplied index.
|
inline |
Searches the parameters for a match with the processor and index.
|
inline |
Searches the parameters for a match with the processor and parameter name.
bool hasParameter | ( | Processor * | p, |
int | parameterIndex | ||
) |
checks if the parameter exists.
bool isDanglingProcessor | ( | int | parameterIndex | ) |
Checks if the processor of the parameter still exists.
void removeAllParametersWithProcessor | ( | Processor * | p | ) |
Removes all parameters that control a certain processor.
void removeParameter | ( | int | parameterIndex | ) |
Removes the parameter.
void removeParameter | ( | const String & | parameterName, |
const Processor * | processor = nullptr |
||
) |
Removes the parameter with the name.
|
inline |
Sets the macro name that is displayed beyond the knob.
|
inline |
sets the MidiController number that controls this macro when loaded as main chain.
void setValue | ( | float | newValue | ) |
sets the value of the macro controller.
newValue | the value from 0 to 127 (the knob range). |
This iterates all parameters that this controller is connected to and sets the attribute. It also saves the parameter so that other objects have access to the current value (useful if using scripting)