All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
Public Member Functions | List of all members
MacroControlBroadcaster::MacroControlData Struct Reference

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 &parameterName, 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...
 
MacroControlledParameterDatagetParameter (int parameterIndex)
 returns the parameter at the supplied index. More...
 
MacroControlledParameterDatagetParameterWithProcessorAndIndex (Processor *p, int parameterIndex)
 Searches the parameters for a match with the processor and index. More...
 
MacroControlledParameterDatagetParameterWithProcessorAndName (Processor *p, const String &parameterName)
 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 &parameterName, 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...
 

Detailed Description

A MacroControlData object stores information about all parameters that are mapped to one macro control.

Constructor & Destructor Documentation

MacroControlData ( int  index)
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.

Member Function Documentation

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).

String getMacroName ( ) const
inline

Returns the macro name.

int getNumParameters ( ) const
inline

Returns the number of mapped parameters.

MacroControlledParameterData* getParameter ( int  parameterIndex)
inline

returns the parameter at the supplied index.

MacroControlledParameterData* getParameterWithProcessorAndIndex ( Processor p,
int  parameterIndex 
)
inline

Searches the parameters for a match with the processor and index.

MacroControlledParameterData* getParameterWithProcessorAndName ( Processor p,
const String &  parameterName 
)
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.

void setMacroName ( const String &  name)
inline

Sets the macro name that is displayed beyond the knob.

void setMidiController ( int  newControllerNumber)
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.

Parameters
newValuethe 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)

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.