3#include <AH/STL/algorithm>
22 bool changed = data != this->
value;
50 int8_t
value = position - 1;
78 return (data & 0x0F) <= 0x0B ? data : ((data & 0xF0) | 0x0B);
126template <u
int8_t BankSize>
143 {track + 0x30 - 1, channelCN}) {}
173 :
Parent({track, channelCN}) {}
236template <u
int8_t BankSize>
239 BankableVPotMatcher<BankSize>>,
260 :
Parent({config, track, channelCN}) {}
constexpr Channel CHANNEL_1
Wrap
An enumeration to set the behavior of selectors that are incremented (decremented) beyond their maxim...
#define BEGIN_CS_NAMESPACE
A MIDI input element that represents a Mackie Control Universal VPot ring.
VPotRing(BankConfig< BankSize > config, uint8_t track, MIDIChannelCable channelCN=CHANNEL_1)
Constructor.
VPotState::Mode getMode() const
Return the mode of the V-Pot ring.
bool getCenterLed(uint8_t bank) const
Return the status of the center LED of the V-Pot ring.
uint8_t getStartOff(uint8_t bank) const
Get the first segment that should be off.
VPotState::Mode getMode(uint8_t bank) const
Return the mode of the V-Pot ring.
bool ignoreReset
Don't reset the state when calling the reset method.
uint8_t getStartOff() const override
Get the first segment that should be off.
void onBankSettingChange() override
A function to be executed each time the bank setting changes.
uint8_t getPosition() const
Return the position of the V-Pot ring. [0, 11].
VPotState getState() const
Get the full state of the VPot ring. (For the active bank.)
bool handleUpdateImpl(typename Matcher::Result match)
uint8_t getStartOn() const override
Get the first segment that should be on.
VPotState getState(uint8_t bank) const
Get the full state of the VPot ring. (For the given bank.)
uint8_t getPosition(uint8_t bank) const
Return the position of the V-Pot ring. [0, 11].
AH::Array< VPotState, BankSize > states
void handleUpdate(typename Matcher::Result match) override
void reset() override
Reset all states to zero.
uint8_t getStartOn(uint8_t bank) const
Get the first segment that should be on.
bool getCenterLed() const override
Return the status of the center LED of the V-Pot ring.
A MIDI input element that represents a Mackie Control Universal VPot ring.
VPotState::Mode getMode() const
Return the mode of the V-Pot ring.
bool ignoreReset
Don't reset the state when calling the reset method.
uint8_t getStartOff() const override
Get the first segment that should be off.
uint8_t getPosition() const
Return the position of the V-Pot ring. [0, 11].
VPotState getState() const
Get the full state of the VPot ring.
bool handleUpdateImpl(typename Matcher::Result match)
uint8_t getStartOn() const override
Get the first segment that should be on.
VPotRing(uint8_t track, MIDIChannelCable channelCN=CHANNEL_1)
Constructor.
void handleUpdate(typename Matcher::Result match) override
void reset() override
Reset the state to zero.
bool getCenterLed() const override
Return the status of the center LED of the V-Pot ring.
A class for saving a MIDI channel and cable number.
constexpr auto min(const T &a, const U &b) -> decltype(b< a ? b :a)
Return the smaller of two numbers/objects.
constexpr auto max(const T &a, const U &b) -> decltype(a< b ? b :a)
Return the larger of two numbers/objects.
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
An array wrapper for easy copying, comparing, and iterating.
Matcher for MIDI messages with 2 data bytes, such as Note On/Off, Control Change, Key Pressure.
BaseBankConfig< BankSize > config
MIDI Input matcher for Mackie Control Universal VPot LED rings with bank support.
BankableVPotMatcher(BankConfig< BankSize > config, uint8_t track, MIDIChannelCable channelCN)
Constructor.
MIDI Input matcher for Mackie Control Universal VPot LED rings.
VPotMatcher(uint8_t track, MIDIChannelCable channelCN)
Constructor.
Struct that keeps track of the value and overload indicator of a Mackie Control Universal VPot LED ri...
Mode getMode() const
Return the mode of the V-Pot ring.
uint8_t getStartOff() const
Get the first segment that should be off.
uint8_t getStartOn() const
Get the first segment that should be on.
bool getCenterLed() const
Return the status of the center LED of the V-Pot ring.
Mode
Determines how the VPot value is displayed using the LEDs.
uint8_t value
The value representing the VPot position, mode and LED.
uint8_t getPosition() const
Return the position of the V-Pot ring. [0, 11].
static uint8_t sanitizeData(uint8_t data)
Make sure that the received value is valid and will not result in array out of bounds conditions.
bool update(uint8_t data)
VPotState(uint8_t value=0)
Constructor.
Matcher for MIDI messages with 2 data bytes, such as Note On/Off, Control Change, Key Pressure (but n...