MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
31 (void)oldSetting, (
void)newSetting;
56 template <setting_t N,
class Callback = EmptySelectorCallback>
90 newSetting =
selectable.validateSetting(newSetting);
92 if (
get() != newSetting) {
149 template <setting_t N>
A Selector with an empty callback.
void update()
Refresh, called periodically.
void update(setting_t oldSetting, setting_t newSetting)
Called when the setting changes.
setting_t setting
The selection of the selector.
void decrement(Wrap wrap)
Subtract one from the setting, wrap around or clamp, depending on the parameter, if the new setting w...
Selectable< N > & selectable
A super class for object that have to be updated regularly.
setting_t get() const
Get the current selection/setting.
Selector(Selectable< N > &selectable)
Constructor.
SelectorBase()=default
Constructor.
Base class for all Selectors exposing the get method, so it can be used by display elements etc,...
#define BEGIN_CS_NAMESPACE
A callback for the GenericSelector class that does nothing.
void set(setting_t newSetting)
Select the given selection.
GenericSelector(Selectable< N > &selectable, const Callback &callback)
Constructor.
Wrap
An enumeration to set the behavior of selectors that are incremented (decremented) beyond their maxim...
void update() override
Update this updatable.
void increment(Wrap wrap)
Add one to the setting, wrap around or clamp, depending on the parameter, if the new setting would be...
uint8_t setting_t
The type used for Selectors.
When the maximum (minimum) setting is reached, wrap around to the minimum (maximum) setting.
void begin() override
Initialize this updatable.
When the maximum (minimum) setting is reached, clamp to the maximum (minimum) setting.
void reset()
Reset the selection to the initial selection.