Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
SelectorLEDs.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <Def/Def.hpp>
6
8
9template <setting_t N>
34
54
56
57// -------------------------------------------------------------------------- //
58
60
62
69template <setting_t N>
71 : public GenericEncoderSelector<N, SelectorLEDsCallback<N>> {
72 public:
80};
81
83
84// -------------------------------------------------------------------------- //
85
87
89
96template <setting_t N>
98 : public GenericIncrementDecrementSelector<N, SelectorLEDsCallback<N>> {
99 public:
110};
111
113
114// -------------------------------------------------------------------------- //
115
117
119
126template <setting_t N>
128 : public GenericIncrementSelector<N, SelectorLEDsCallback<N>> {
129 public:
134};
135
137
138// -------------------------------------------------------------------------- //
139
141
143
150template <setting_t N>
152 : public GenericManyButtonsSelector<N, SelectorLEDsCallback<N>> {
153 public:
162};
163
165
166// -------------------------------------------------------------------------- //
167
169
171
178template <setting_t N>
180 : public GenericProgramChangeSelector<N, SelectorLEDsCallback<N>> {
181 public:
183 MIDIChannelCable address,
184 const PinList<N> &ledPins)
187 {ledPins},
188 address,
189 } {}
190};
191
193
194// -------------------------------------------------------------------------- //
195
197
199
207 : public GenericSwitchSelector<SelectorSingleLEDCallback> {
208 public:
216};
217
constexpr PinStatus_t LOW
constexpr PinStatus_t HIGH
constexpr PinMode_t OUTPUT
Wrap
An enumeration to set the behavior of selectors that are incremented (decremented) beyond their maxim...
Definition Selector.hpp:14
@ Wrap
When the maximum (minimum) setting is reached, wrap around to the minimum (maximum) setting.
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
A class for reading and debouncing buttons and switches.
Definition Button.hpp:15
A class for buttons that increment and decrement some counter or setting.
Selector that reads from a rotary encoder. This version displays the setting using LEDs.
EncoderSelectorLEDs(Selectable< N > &selectable, const EncoderSwitchPinList &pins, const PinList< N > &ledPins, int8_t pulsesPerStep=4, Wrap wrap=Wrap::Wrap)
Selectable< N > & selectable
Definition Selector.hpp:141
Selector with two buttons (one to increment, one to decrement). This version displays the setting u...
IncrementDecrementSelectorLEDs(Selectable< N > &selectable, const AH::IncrementDecrementButtons &buttons, const PinList< N > &ledPins, Wrap wrap=Wrap::Wrap)
Selector with one button that increments the selection. This version displays the setting using LED...
IncrementSelectorLEDs(Selectable< N > &selectable, const AH::Button &button, const PinList< N > &ledPins)
A class for saving a MIDI channel and cable number.
Selector that reads from buttons. This version displays the setting using LEDs.
ManyButtonsSelectorLEDs(Selectable< N > &selectable, const PinList< N > &buttonPins, const PinList< N > &ledPins)
Selector that listens for MIDI Program Change events on a given MIDI Channel, and uses the program nu...
ProgramChangeSelectorLEDs(Selectable< N > &selectable, MIDIChannelCable address, const PinList< N > &ledPins)
void update(setting_t oldSetting, setting_t newSetting)
Called when the setting changes.
void begin()
Initialize.
void update()
Refresh, called periodically.
SelectorLEDsCallback(const PinList< N > &ledPins)
SelectorSingleLEDCallback(pin_t ledPin)
void update(setting_t oldSetting, setting_t newSetting)
Called when the setting changes.
void begin()
Initialize.
void update()
Refresh, called periodically.
Selector that selects one of two settings, based on the state of a toggle or momentary switch....
SwitchSelectorLED(Selectable< 2 > &selectable, const AH::Button &button, pin_t ledPin)
void pinMode(pin_t pin, PinMode_t mode)
An ExtIO version of the Arduino function.
void digitalWrite(pin_t pin, PinStatus_t val)
An ExtIO version of the Arduino function.
An array wrapper for easy copying, comparing, and iterating.
Definition Array.hpp:32
A struct for the pins of a rotary (quadrature) encoder with a switch.
Definition Def.hpp:31