|
| BankableMIDIInput (Bank< N > &bank, BankType type) |
| Create a new BankableMIDIInput object, and add it to the bank. More...
|
|
| BankableMIDIInput (BankConfig< N > config) |
| Create a new BankableMIDIInput object, and add it to the bank. More...
|
|
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 | 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 (MIDIAddress target, MIDIAddress base) const |
| If matchBankableAddressInRange returned true, get the index of the message in the range. More...
|
|
bool | matchBankable (const MIDIAddress &toMatch, const MIDIAddress &base) const |
| Check whether a given address is part of the bank relative to the base address. More...
|
|
bool | matchBankableAddressInRange (const MIDIAddress &toMatch, const MIDIAddress &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...
|
|
template<setting_t N>
class BankableMIDIInput< N >
A base class for all MIDIInputElements that can be banked.
- Note
- These elements must be updated when the bank setting is changed, so they are added to a linked list of the bank.
- Template Parameters
-
Definition at line 21 of file BankableMIDIInput.hpp.
bool matchBankable |
( |
uint8_t |
toMatch, |
|
|
uint8_t |
base |
|
) |
| const |
|
inlineprotected |
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.
0 1 2 3 4 5 6 7 8 9 10 11 12 ...
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).
- Parameters
-
toMatch | The address to check. |
base | The base address (the address of bank setting 0). |
- Note
- Equivalent to
matchBankableInRange(toMatch, base, 1)
.
Definition at line 113 of file BankableMIDIInput.hpp.
virtual void onBankSettingChange |
( |
| ) |
|
|
inlineprivatevirtual |
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 in GenericNoteCCRange< MIDIInput_t, RangeLen, NumBanks, Callback >, GenericNoteCCRange< MIDIInputElementCC, RangeLen, BankSize, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericNoteCCRange< MIDIInputElementNote, 1, BankSize, NoteCCLEDPWM< 1 > >, GenericNoteCCRange< MIDIInputElementNote, 1, BankSize, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen, BankSize, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericNoteCCRange< MIDIInputElementCC, 1, BankSize, NoteCCLED< 1 > >, GenericNoteCCRange< MIDIInputElementCC, 1, BankSize, NoteCCFastLEDCallback< DefaultColorMapper > >, GenericNoteCCRange< MIDIInputElementCC, RangeLen, BankSize, NoteCCLEDPWM< RangeLen > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen, BankSize, NoteCCLED< RangeLen > >, GenericNoteCCRange< MIDIInputElementNote, 1, BankSize, NoteCCLEDBarCallback< NumLEDs > >, GenericNoteCCRange< MIDIInputElementCC, 1, BankSize, NoteCCLEDPWM< 1 > >, GenericNoteCCRange< MIDIInputElementNote, RangeLen, BankSize, NoteCCLEDPWM< RangeLen > >, GenericNoteCCRange< MIDIInputElementNote, 1, BankSize, NoteCCLED< 1 > >, GenericNoteCCRange< MIDIInputElementCC, 1, BankSize, NoteCCLEDBarCallback< NumLEDs > >, GenericNoteCCRange< MIDIInputElementCC, RangeLen, BankSize, NoteCCLED< RangeLen > >, GenericVU< NumBanks, Callback >, GenericVU< NumBanks >, GenericVU< NumBanks, VULEDsCallback< NumLEDs > >, GenericVPotRing< NumBanks, Callback >, GenericVPotRing< NumBanks >, and GenericVPotRing< NumBanks, VPotRingLEDsCallback >.
Definition at line 255 of file BankableMIDIInput.hpp.