#include <MIDI_Inputs/LEDs/MCU/VULEDs.hpp>
Public Member Functions | |
VULEDs (BankConfig< NumBanks > config, const PinList< NumLEDs > &ledPins, uint8_t track, unsigned int decayTime=VUDecay::Default) | |
VULEDs (BankConfig< NumBanks > config, const PinList< NumLEDs > &ledPins, uint8_t track, MIDICNChannel channelCN, unsigned int decayTime=VUDecay::Default) | |
AH::DotBarMode | getMode () const |
Get the dot/bar mode. More... | |
void | setMode (AH::DotBarMode mode) |
Set the mode to either dot or bar mode. More... | |
void | dotMode () |
Set the mode to dot mode. More... | |
void | barMode () |
Set the mode to bar mode. More... | |
void | toggleMode () |
Toggle the dot/bar mode. More... | |
uint8_t | getBankIndex (const MIDICNChannelAddress &target, const MIDICNChannelAddress &base) const |
Calculate the bank setting of a given MIDI address, relative to a base address. More... | |
void | begin () override |
Initialize. More... | |
void | reset () override |
Reset all values to zero. More... | |
uint8_t | getValue () override |
Return the VU meter value as an integer in [0, 12]. More... | |
bool | getOverload () override |
Return the overload status. More... | |
void | update () override |
Update is called periodically, it decays the meter if the time is right. More... | |
bool | updateWith (const ChannelMessageMatcher &midimsg) |
Receive a new MIDI message and update the internal state. More... | |
virtual float | getFloatValue () |
Get the VU meter value as a floating point number. More... | |
uint8_t | getMax () const |
Get the maximum value that this VU meter can return. More... | |
Static Public Member Functions | |
static void | beginAll () |
static void | resetAll () |
Reset all MIDIInputElementChannelPressure elements to their initial state. More... | |
static void | updateAll () |
Update all MIDIInputElementChannelPressure elements. More... | |
static void | updateAllWith (const ChannelMessageMatcher &midimsg) |
Update all MIDIInputElementChannelPressure elements with a new MIDI message. More... | |
Public Attributes | |
VULEDsCallback< NumLEDs > | callback |
Protected Member Functions | |
bool | matchBankable (uint8_t toMatch, uint8_t base) const |
Check if the given address is part of the bank relative to the base address. More... | |
bool | matchBankable (const MIDICNChannelAddress &toMatch, const MIDICNChannelAddress &base) const |
Check whether a given address is part of the bank relative to the base address. More... | |
bool | matchBankableInRange (uint8_t toMatch, uint8_t base, uint8_t length) const |
Check if the given address is part of the bank relative to the base address. More... | |
uint8_t | getRangeIndex (MIDICNChannelAddress target, MIDICNChannelAddress base) const |
If matchBankableAddressInRange returned true, get the index of the message in the range. More... | |
bool | matchBankableAddressInRange (const MIDICNChannelAddress &toMatch, const MIDICNChannelAddress &base, uint8_t length) const |
Check whether a given address is part of the bank relative to the base address and within a range with a given length. More... | |
Static Protected Member Functions | |
static bool | inRange (uint8_t toMatch, uint8_t base, uint8_t length) |
Check whether a given address is within a range of given length starting from the given base address. More... | |
Protected Attributes | |
const MIDICNChannelAddress | address |
MIDIInputElementChannelPressure * | next |
BankableMIDIInput< N > * | next |
MIDIInputElementChannelPressure * | previous |
BankableMIDIInput< N > * | previous |
const uint8_t | max |
Private Member Functions | |
setting_t | getSelection () const override |
Get the active bank selection. More... | |
uint8_t | getBankIndex (const MIDICNChannelAddress &target) const override |
Get the bank index from a MIDI address. More... | |
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. More... | |
void | onBankSettingChange () override |
A function to be executed each time the bank setting changes. More... | |
uint8_t | getValue (uint8_t index) const |
Get the VU meter value from the raw value. More... | |
bool | getOverload (uint8_t index) const |
Get the overload status value from the raw value. More... | |
bool | updateImpl (const ChannelMessageMatcher &midimsg, const MIDICNChannelAddress &target) override |
Called when an incoming MIDI message matches this element. More... | |
MIDICNChannelAddress | getTarget (const ChannelMessageMatcher &midimsg) const override |
The address of the VU meter is the high nibble of the first (and only) data byte. More... | |
void | decay () |
void | setValue (uint8_t index, uint8_t newValue) |
Set the VU meter value. More... | |
void | setOverload (uint8_t index) |
Set the overload status. More... | |
void | clearOverload (uint8_t index) |
Clear the overload status. More... | |
void | moveDown () |
Move down this element in the linked list of elements. More... | |
Private Attributes | |
Array< uint8_t, NumValues > | values |
unsigned int | decayTime |
unsigned long | prevDecayTime |
Bank< N > & | bank |
const BankType | type |
Static Private Attributes | |
static DoublyLinkedList< MIDIInputElementChannelPressure > | elements |
Definition at line 81 of file VULEDs.hpp.
|
inline |
Definition at line 83 of file VULEDs.hpp.
|
inline |
Definition at line 89 of file VULEDs.hpp.
|
inline |
Get the dot/bar mode.
Definition at line 97 of file VULEDs.hpp.
|
inline |
Set the mode to either dot or bar mode.
mode | The mode. |
Definition at line 99 of file VULEDs.hpp.
|
inline |
Set the mode to dot mode.
Definition at line 101 of file VULEDs.hpp.
|
inline |
Set the mode to bar mode.
Definition at line 103 of file VULEDs.hpp.
|
inline |
Toggle the dot/bar mode.
Definition at line 105 of file VULEDs.hpp.
|
inlineoverrideprivatevirtualinherited |
Get the active bank selection.
Reimplemented from VU_Base< NumBanks, VULEDsCallback< NumLEDs > >.
|
inlineoverrideprivatevirtualinherited |
Get the bank index from a MIDI address.
Reimplemented from VU_Base< NumBanks, VULEDsCallback< NumLEDs > >.
|
inlineinherited |
Calculate the bank setting of a given MIDI address, relative to a base address.
target | The MIDI address to calculate the bank setting of. |
base | The base address to compare it to (the address of bank setting 0). |
Definition at line 71 of file BankableMIDIInput.hpp.
|
inlineoverrideprivatevirtualinherited |
Check if the address of the incoming MIDI message is in one of the banks of this element.
Reimplemented from MIDIInputElement.
|
inlineoverrideprivatevirtualinherited |
A function to be executed each time the bank setting changes.
Think of an LED that indicates whether a track is muted or not. If this LED is bankable, let's say with 4 tracks per bank, 2 banks, and a base address of 3, then this LED object keeps the state of tracks 3 and 7. When the bank setting is 0, the LED displays the state of track 3, when the bank setting is 1, the LED displays the state of track 7.
To know when to update the LED, this callback is used.
Reimplemented from BankableMIDIInput< NumBanks >.
|
inlineoverridevirtualinherited |
|
inlineoverridevirtualinherited |
Reset all values to zero.
Reimplemented from MIDIInputElement.
|
inlineoverridevirtualinherited |
|
inlineprivateinherited |
|
inlineoverridevirtualinherited |
|
inlineprivateinherited |
|
inlineoverridevirtualinherited |
Update is called periodically, it decays the meter if the time is right.
Reimplemented from MIDIInputElement.
|
inlineoverrideprivatevirtualinherited |
Called when an incoming MIDI message matches this element.
Implements MIDIInputElement.
|
inlineoverrideprivatevirtualinherited |
The address of the VU meter is the high nibble of the first (and only) data byte.
Reimplemented from MIDIInputElementChannelPressure.
|
inlineprivateinherited |
|
inlineprivateinherited |
|
inlineprivateinherited |
|
inlinestaticinherited |
Definition at line 38 of file MIDIInputElementChannelPressure.hpp.
|
inlinestaticinherited |
Reset all MIDIInputElementChannelPressure elements to their initial state.
Definition at line 50 of file MIDIInputElementChannelPressure.hpp.
|
inlinestaticinherited |
Update all MIDIInputElementChannelPressure elements.
Definition at line 59 of file MIDIInputElementChannelPressure.hpp.
|
inlinestaticinherited |
Update all MIDIInputElementChannelPressure elements with a new MIDI message.
Definition at line 71 of file MIDIInputElementChannelPressure.hpp.
|
inlineprivateinherited |
Move down this element in the linked list of elements.
This means that the element will be checked earlier on the next iteration.
Definition at line 96 of file MIDIInputElementChannelPressure.hpp.
|
inlineinherited |
Receive a new MIDI message and update the internal state.
Definition at line 39 of file MIDIInputElement.hpp.
|
inlinevirtualinherited |
|
inlineinherited |
|
inlineprotectedinherited |
Check if the given address is part of the bank relative to the base address.
Consider the following example:
A Bank with 4 tracks per bank (T), 2 bank settings (N), and a base address of 3.
Addresses before the base adddress are not matched (0, 1, 2).
Addresses after N * T are not matched (8, 9, 10, 11, 12).
Addresses with a distance to the base address that is not a multiple of N are not matched (4, 5, 6).
toMatch | The address to check. |
base | The base address (the address of bank setting 0). |
matchBankableInRange(toMatch, base, 1)
. Definition at line 113 of file BankableMIDIInput.hpp.
|
inlineprotectedinherited |
Check whether a given address is part of the bank relative to the base address.
toMatch | The address to check. |
base | The base address (the address of bank setting 0). |
Definition at line 175 of file BankableMIDIInput.hpp.
|
inlineprotectedinherited |
Check if the given address is part of the bank relative to the base address.
toMatch | The address to check. |
base | The base address (the address of bank setting 0). |
length | The length of the range. |
Definition at line 132 of file BankableMIDIInput.hpp.
|
inlineprotectedinherited |
If matchBankableAddressInRange returned true, get the index of the message in the range.
Definition at line 143 of file BankableMIDIInput.hpp.
|
inlinestaticprotectedinherited |
Check whether a given address is within a range of given length starting from the given base address.
toMatch | The address to check |
base | The base address, start of the range. |
length | The length of the range. |
Definition at line 162 of file BankableMIDIInput.hpp.
|
inlineprotectedinherited |
Check whether a given address is part of the bank relative to the base address and within a range with a given length.
toMatch | The address to check. |
base | The base address (the address of bank setting 0). |
length | The length of the range. |
Definition at line 212 of file BankableMIDIInput.hpp.
|
inherited |
|
staticprivateinherited |
Definition at line 101 of file MIDIInputElementChannelPressure.hpp.
|
protectedinherited |
Definition at line 80 of file MIDIInputElement.hpp.
|
protectedinherited |
Definition at line 305 of file LinkedList.hpp.
|
protectedinherited |
Definition at line 305 of file LinkedList.hpp.
|
protectedinherited |
Definition at line 306 of file LinkedList.hpp.
|
protectedinherited |
Definition at line 306 of file LinkedList.hpp.
|
privateinherited |
Definition at line 242 of file BankableMIDIInput.hpp.
|
privateinherited |
Definition at line 243 of file BankableMIDIInput.hpp.