Public Member Functions | Protected Member Functions | List of all members
MacroControlledObject Class Referenceabstract

A base class for all control Components that can be controlled by a MacroControlBroadcaster. More...

Inheritance diagram for MacroControlledObject:
HiComboBox HiSlider MacroModulator

Public Member Functions

void enableMacroControlledComponent (bool shouldBeEnabled) noexcept
 Since the original setEnabled() is overwritten in the updateValue, use this method instead to enable / disable MacroControlledComponents. More...
 
const String getName () const noexcept
 returns the name. More...
 
virtual NormalisableRange< double > getRange () const =0
 overwrite this method and return the range that the parameter can have. More...
 
 MacroControlledObject ()
 Creates a new MacroControlledObject. More...
 
virtual void setup (Processor *p, int parameter_, const String &name_)
 Initializes the control element. More...
 
virtual void updateValue (NotificationType sendAttributeChange=sendNotification)=0
 overwrite this method and update the element to display the current value of the controlled attribute. More...
 

Protected Member Functions

bool checkLearnMode ()
 checks if the macro learn mode is active. More...
 

Detailed Description

A base class for all control Components that can be controlled by a MacroControlBroadcaster.

Subclass your component from this class, and set the Processor's Attribute in its specified callback.

Constructor & Destructor Documentation

Creates a new MacroControlledObject.

You have to call setup() before you use the object!

Member Function Documentation

bool checkLearnMode ( )
protected

checks if the macro learn mode is active.

If it is active, it adds this control to the macro and returns true. You can use this in the element's callback like:

if(!checkLearnMode())
{
    getProcessor()->setAttribute(parameter, value, dontSendNotification);
}
void enableMacroControlledComponent ( bool  shouldBeEnabled)
inlinenoexcept

Since the original setEnabled() is overwritten in the updateValue, use this method instead to enable / disable MacroControlledComponents.

const String getName ( void  ) const
inlinenoexcept

returns the name.

virtual NormalisableRange<double> getRange ( ) const
pure virtual

overwrite this method and return the range that the parameter can have.

virtual void setup ( Processor p,
int  parameter_,
const String &  name_ 
)
inlinevirtual

Initializes the control element.

It connects to a Processor's parameter and automatically updates its value and changes the attribute.

Parameters
pthe Processor that is controlled by the element.
parameter_the parameter that is controlled by the element
name_the name of the element. This will also be the displayed name in the macro control panel.
virtual void updateValue ( NotificationType  sendAttributeChange = sendNotification)
pure virtual

overwrite this method and update the element to display the current value of the controlled attribute.

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