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;
129 int8_t(midimsg.
data1 >> 4),
136 for (uint8_t i = 0; i < NumValues; ++i)
182 template <
class Callback = VUEmptyCallback>
286 template <u
int8_t NumBanks,
class Callback = VUEmptyCallback>
352 template <u
int8_t NumBanks>
setting_t getSelection() const override
Get the active bank selection.
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.
bool getOverload(uint8_t index) const
Get the overload status value from the raw value.
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.
bool match(const MIDICNChannelAddress &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.
void clearOverload(uint8_t index)
Clear the overload status.
Names and note and controller numbers for the Mackie Control Universal (MCU) protocol.
GenericVU(const BankConfig< NumBanks > &config, uint8_t track, const MIDICNChannel &channelCN, unsigned int decayTime, const Callback &callback)
Construct a new Bankable VU object.
Empty callback for VU meters that does nothing.
constexpr unsigned int Default
Decay one segment/block every 150 ms if no new values are received.
#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.
MIDICNChannelAddress getTarget(const ChannelMessageMatcher &midimsg) const override
The address of the VU meter is the high nibble of the first (and only) data byte.
void setValue(uint8_t index, uint8_t newValue)
Set the VU meter value.
Struct for easily matching MIDI messages.
bool getOverload() override
Return the overload status.
bool updateImpl(const ChannelMessageMatcher &midimsg, const MIDICNChannelAddress &target) override
Called when an incoming MIDI message matches this element.
A class for MIDI input elements that represent Mackie Control Universal VU meters.
unsigned long prevDecayTime
virtual setting_t getBankIndex(const MIDICNChannelAddress &target) const
Get the bank index from a MIDI address.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
An array wrapper for easy copying, comparing, and iterating.
uint8_t getValue() override
Return the VU meter value as an integer in [0, 12].
uint8_t getBankIndex(const MIDICNChannelAddress &target) const override
Get the bank index from a MIDI address.
VU(const BankConfig< NumBanks > &config, uint8_t track, unsigned int decayTime=VUDecay::Default)
Construct a new Bankable VU object.
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.
A class for saving a MIDI channel and cable number.
VU_Base(uint8_t track, const MIDICNChannel &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.
uint8_t setting_t
The type used for Selectors.
A MIDI input element that represents a Mackie Control Universal VU meter.
A struct for selecting the bank of BankableMIDIInputs and the bank type.
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
VU(uint8_t track, const MIDICNChannel &channelCN, unsigned int decayTime=VUDecay::Default)
Construct a new VU object.
GenericVU(uint8_t track, const MIDICNChannel &channelCN, unsigned int decayTime, const Callback &callback)
Construct a new GenericVU object.
VU(const BankConfig< NumBanks > &config, uint8_t track, const MIDICNChannel &channelCN, unsigned int decayTime=VUDecay::Default)
Construct a new Bankable VU object.
virtual uint8_t getSelection() const
Get the active bank selection.