119 uint8_t track = m.
data1 >> 4;
122 uint8_t data = m.
data1 & 0x0F;
132template <u
int8_t BankSize>
149 uint8_t track = m.
data1 >> 4;
152 return {
false, 0, 0};
153 uint8_t data = m.
data1 & 0x0F;
155 return {
true, data, bankIndex};
177constexpr unsigned int Hold = 0;
289template <u
int8_t BankSize>
292 BankableVUMatcher<BankSize>>,
322 :
Parent({config, {track - 1, channelCN}}),
IVU(12),
350 match.
bankIndex == this->getActiveBank())
364 bool newdirty =
false;
366 for (uint8_t i = 0; i < BankSize; ++i)
BankType
An enumeration of the different bank types.
constexpr Channel Channel_1
uint8_t setting_t
The type used for Selectors.
@ ChannelPressure
Channel Pressure Channel Voice message (2B).
#define BEGIN_CS_NAMESPACE
A class for serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bu...
unsigned long getInterval() const
Get the interval of the timer.
void beginNextPeriod()
Initialize or reset the timer. The timer will fire after one period.
A class that groups Bankable MIDI Output Elements and Bankable MIDI Input Elements,...
A struct for selecting the bank of BankableMIDIInputs and the bank type.
An abstract interface for VU meters.
IVU(uint8_t max, bool alwaysDirty=false)
A MIDI input element that represents a Mackie Control Universal VU meter.
void update() override
Decay the VU meter.
uint8_t getValue() override
Get the most recent VU position that was received for the active bank.
bool getOverload(uint8_t bank) const
Get the status of the overload indicator for the given bank.
AH::Timer< millis > decayTimer
void onBankSettingChange() override
A function to be executed each time the bank setting changes.
bool handleUpdateImpl(typename Matcher::Result match)
VU(BankConfig< BankSize > config, uint8_t track, unsigned int decayTime=VUDecay::Default)
Constructor.
bool getOverload() override
Get the status of the overload indicator for the active bank.
void handleUpdate(typename Matcher::Result match) override
float getFloatValue() override
Get the most recent VU position for the active bank as a value between 0 and 1.
VU(BankConfig< BankSize > config, uint8_t track, MIDIChannelCable channelCN, unsigned int decayTime=VUDecay::Default)
Constructor.
float getFloatValue(uint8_t bank) const
Get the most recent VU position for the given bank as a value between 0 and 1.
void reset() override
Reset all values to zero.
uint8_t getValue(uint8_t bank) const
Get the most recent VU position that was received for the given bank.
AH::Array< VUState, BankSize > states
A MIDI input element that represents a Mackie Control Universal VU meter.
VU(uint8_t track, unsigned int decayTime=VUDecay::Default)
Constructor.
void update() override
Decay the VU meter.
uint8_t getValue() override
Get the most recent VU position that was received.
AH::Timer< millis > decayTimer
bool handleUpdateImpl(typename Matcher::Result match)
VU(uint8_t track, MIDIChannelCable channelCN, unsigned int decayTime=VUDecay::Default)
Constructor.
bool getOverload() override
Get the status of the overload indicator.
void handleUpdate(typename Matcher::Result match) override
void reset() override
Reset all values to zero.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
static bool matchSingle(MIDIAddress toMatch, MIDIAddress base)
Check if two addresses match (are equal).
A class for saving a MIDI channel and cable number.
uint8_t getBankIndex(uint8_t tgt, uint8_t base, const Bank< BankSize > &bank)
bool matchBankable(uint8_t tgt, uint8_t base, const Bank< BankSize > &bank)
Check if the given address is part of the bank relative to the base address.
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
constexpr unsigned int Default
Decay one segment/block every 150 ms if no new values are received.
constexpr unsigned int Hold
Don't decay automatically, hold the latest value until a new one is received.
MIDIChannelCable getChannelCable() const
Get the MIDI channel and cable number.
Output data of the matcher/parser.
uint8_t bankIndex
The bank index of the message [0, BankSize-1].
uint8_t data
The data to update the VU meter with [0x0, 0xF].
bool match
Whether the address of the message matched our address.
MIDI Input matcher for Mackie Control Universal VU meters with bank support.
MIDIAddress address
MIDI address to compare incoming messages with.
setting_t getSelection() const
Get the current bank setting.
static constexpr setting_t getBankSize()
BankableVUMatcher(BankConfig< BankSize > config, MIDIAddress address)
Constructor.
BaseBankConfig< BankSize > config
Bank configuration.
const Bank< BankSize > & getBank() const
BankType getBankType() const
Result operator()(ChannelMessage m)
Parse and try to match the incoming MIDI message.
Bank< BankSize > & getBank()
Output data of the matcher/parser.
uint8_t data
The data to update the VU meter with [0x0, 0xF].
bool match
Whether the address of the message matched our address.
MIDI Input matcher for Mackie Control Universal VU meters.
MIDIAddress address
MIDI address to compare incoming messages with.
VUMatcher(MIDIAddress address)
Constructor.
Result operator()(ChannelMessage m)
Parse and try to match the incoming MIDI message.
Struct that keeps track of the value and overload indicator of a Mackie Control Universal VU meter.
bool overload
The state of the overload indicator.
uint8_t value
The value of the VU meter [0, 12].
Changed update(uint8_t data)
Update the value or overload status with a new raw MIDI value.
VUState(uint8_t value=0, bool overload=false)
Constructor.
bool decay()
Decay the VU value: subtract one from the position if it is not zero.
uint8_t data1
First MIDI data byte.