Classes | Public Member Functions | Static Public Member Functions | List of all members
MacroControlBroadcaster Class Reference

A class that handles macro controlled parameters of its children. More...

Inheritance diagram for MacroControlBroadcaster:
ModulatorSynthChain

Classes

struct  MacroControlData
 A MacroControlData object stores information about all parameters that are mapped to one macro control. More...
 
struct  MacroControlledParameterData
 A simple POD object to store information about a macro controlled parameter. More...
 

Public Member Functions

void addControlledParameter (int macroControllerIndex, const String &processorId, int parameterId, const String &parameterName, NormalisableRange< double > range, bool readOnly=true)
 Adds a parameter. More...
 
void clearData (int macroIndex)
 Removes all parameters and resets the name. More...
 
MacroControlDatagetMacroControlData (int index)
 Returns the MacroControlData object at the supplied index. More...
 
const MacroControlDatagetMacroControlData (int index) const
 Returns the MacroControlData object at the supplied index. More...
 
int getMacroControlIndexForProcessorParameter (const Processor *p, int parameter) const
 searches all macroControls and returns the index of the control if the supplied parameter is mapped or -1 if it is not mapped. More...
 
bool hasActiveParameters (int macroIndex)
 Checks if the macro control has any parameters. More...
 
void loadMacroValuesFromValueTree (const ValueTree &v)
 Only loads the values of the macros (and doesn't recreate the macro controls. More...
 
 MacroControlBroadcaster (ModulatorSynthChain *chain)
 Creates a new MacroControlBroadcaster with eight Macro slots. More...
 
void replaceMacroControlData (int index, MacroControlData *newData, ModulatorSynthChain *parentChain)
 this replaces the macro control data object at the specified index with the new one. More...
 
void setMacroControl (int macroIndex, float newValue, NotificationType notifyEditor=dontSendNotification)
 sets the macro control to the supplied value and sends a notification message if desired. More...
 

Static Public Member Functions

static ProcessorfindProcessor (Processor *p, const String &idToSearch)
 Small helper function that iterates all child processors and returns the matching Processor with the given ID. More...
 

Detailed Description

A class that handles macro controlled parameters of its children.

This is supposed to be a base class of ModulatorSynthChain to encapsulate all macro control handling, so you should not use this class directly.

Constructor & Destructor Documentation

Creates a new MacroControlBroadcaster with eight Macro slots.

Member Function Documentation

void addControlledParameter ( int  macroControllerIndex,
const String &  processorId,
int  parameterId,
const String &  parameterName,
NormalisableRange< double >  range,
bool  readOnly = true 
)

Adds a parameter.

Parameters
macroControllerIndexthe index from 1 to 8 where the parameter should be added.
processorIdthe unique id of the processor. If the ID is not unique, then the first processor is used, which can have undesired effects, so make sure, you rename the processor before mapping a controller!
parameterIdthe parameter id (use the SpecialParameters enum from the Processor)
parameterNamethe name of the control. This is supplied by the name of the component, but it can be useful for eg. scripted controls.
rangethe total range of the parameter.
readOnlyif the knob can be changed when assigned.
void clearData ( int  macroIndex)

Removes all parameters and resets the name.

Processor * findProcessor ( Processor p,
const String &  idToSearch 
)
static

Small helper function that iterates all child processors and returns the matching Processor with the given ID.

MacroControlData* getMacroControlData ( int  index)
inline

Returns the MacroControlData object at the supplied index.

const MacroControlData* getMacroControlData ( int  index) const
inline

Returns the MacroControlData object at the supplied index.

int getMacroControlIndexForProcessorParameter ( const Processor p,
int  parameter 
) const
inline

searches all macroControls and returns the index of the control if the supplied parameter is mapped or -1 if it is not mapped.

bool hasActiveParameters ( int  macroIndex)
inline

Checks if the macro control has any parameters.

void loadMacroValuesFromValueTree ( const ValueTree &  v)

Only loads the values of the macros (and doesn't recreate the macro controls.

void replaceMacroControlData ( int  index,
MacroControlData newData,
ModulatorSynthChain parentChain 
)

this replaces the macro control data object at the specified index with the new one.

Parameters
indexthe index of the macro control which will be replaced
newDataa pointer to the macro control data that should replace the old data
parentChaina pointer to the ModulatorSynthChain where the newData resides. This is used to get the correct Processor for the given ID.
void setMacroControl ( int  macroIndex,
float  newValue,
NotificationType  notifyEditor = dontSendNotification 
)

sets the macro control to the supplied value and sends a notification message if desired.

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