MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
41 constexpr
unsigned int Hold = 0;
77 template <u
int8_t NumValues,
class Callback>
112 uint8_t data = midimsg.
data1 & 0x0F;
118 default:
setValue(index, data);
break;
128 int8_t(midimsg.
data1 >> 4),
135 for (uint8_t i = 0; i < NumValues; ++i)
181 template <
class Callback = VUEmptyCallback>
285 template <u
int8_t NumBanks,
class Callback = VUEmptyCallback>
351 template <u
int8_t NumBanks>
setting_t getSelection() const override
virtual setting_t getBankIndex(const MIDIAddress &target) const
Get the bank index from a MIDI address.
uint8_t getMax() const
Get the maximum value that this VU meter can return.
void onBankSettingChange() override
A function to be executed each time the bank setting changes.
virtual float getFloatValue()
Get the VU meter value as a floating point number.
A type-safe class for MIDI channels.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
bool getOverload(uint8_t index) const
Get the overload status value from the raw value.
A type-safe class for MIDI USB Cable numbers.
void reset() override
Reset all values to zero.
An abstract interface for VU meters.
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
A class for MIDI input elements that represent Mackie Control Universal VU meters.
GenericVU(uint8_t track, const MIDIChannelCN &channelCN, unsigned int decayTime, const Callback &callback)
Construct a new GenericVU object.
void clearOverload(uint8_t index)
Clear the overload status.
Empty callback for VU meters that does nothing.
A class for saving a MIDI channel and cable number.
constexpr unsigned int Default
Decay one segment/block every 150 ms if no new values are received.
VU(BankConfig< NumBanks > config, uint8_t track, unsigned int decayTime=VUDecay::Default)
Construct a new Bankable VU object.
#define BEGIN_CS_NAMESPACE
A class for MIDI input elements that represent Mackie Control Universal VU meters.
virtual bool getOverload()=0
Return the overload status.
void setValue(uint8_t index, uint8_t newValue)
Set the VU meter value.
bool updateImpl(const ChannelMessageMatcher &midimsg, const MIDIAddress &target) override
Called when an incoming MIDI message matches this element.
Struct for easily matching MIDI messages.
bool getOverload() override
Return the overload status.
uint8_t getBankIndex(const MIDIAddress &target) const override
Get the bank index from a MIDI address.
A class for MIDI input elements that represent Mackie Control Universal VU meters.
unsigned long prevDecayTime
VU(uint8_t track, const MIDIChannelCN &channelCN, unsigned int decayTime=VUDecay::Default)
Construct a new VU object.
GenericVU(BankConfig< NumBanks > config, uint8_t track, const MIDIChannelCN &channelCN, unsigned int decayTime, const Callback &callback)
Construct a new Bankable VU object.
An array wrapper for easy copying, comparing, and iterating.
uint8_t getValue() override
Return the VU meter value as an integer in [0, 12].
VU(BankConfig< NumBanks > config, uint8_t track, const MIDIChannelCN &channelCN, unsigned int decayTime=VUDecay::Default)
Construct a new Bankable VU object.
bool match(const MIDIAddress &target) const override
Check if the address of the incoming MIDI message is in one of the banks of this element.
A class for MIDI input elements that represent Mackie Control Universal VU meters.
VU(uint8_t track, unsigned int decayTime=VUDecay::Default)
Construct a new VU object.
VU_Base(uint8_t track, const MIDIChannelCN &channelCN, unsigned int decayTime, const Callback &callback)
void update() override
Update is called periodically, it decays the meter if the time is right.
uint8_t getValue(uint8_t index) const
Get the VU meter value from the raw value.
void begin() override
Initialize.
virtual uint8_t getValue()=0
Return the VU meter value as an integer.
void setOverload(uint8_t index)
Set the overload status.
MIDIAddress getTarget(const ChannelMessageMatcher &midimsg) const override
The address of the VU meter is the high nibble of the first (and only) data byte.
uint8_t setting_t
The type used for Selectors.
A MIDI input element that represents a Mackie Control Universal VU meter.
constexpr unsigned int Hold
Don't decay automatically, hold the latest value until a new one is received.
Array< uint8_t, NumValues > values
constexpr Channel CHANNEL_1
virtual uint8_t getSelection() const
Get the active bank selection.