33 FATAL_ERROR(F(
"A Bank must have a non-zero number of tracks."),
70 template <setting_t N>
93template <setting_t NumBanks>
151template <setting_t NumBanks>
153 inputBankables.
append(bankable);
156template <setting_t NumBanks>
158 inputBankables.remove(bankable);
161template <setting_t NumBanks>
163 bankSetting = this->validateSetting(bankSetting);
166 e.onBankSettingChange();
uint8_t setting_t
The type used for Selectors.
#define BEGIN_CS_NAMESPACE
Callback class for Bankable objects that need to be notified when the active setting of their Bank ch...
virtual void onBankSettingChange()
A function to be executed each time the bank setting changes.
A class that groups Bankable MIDI Output Elements and Bankable MIDI Input Elements,...
static constexpr uint8_t getNumberOfBanks()
Get the number of banks.
void add(BankSettingChangeCallback *bankable)
Add a Bankable MIDI Input Element to the bank.
void remove(BankSettingChangeCallback *bankable)
Remove a Bankable MIDI Input Element from the bank.
void select(setting_t bankSetting) override
Select the given bank setting.
Bank(uint8_t tracksPerBank=1, setting_t initialSelection=0, int8_t selectionOffset=0)
Construct a new Bank object.
DoublyLinkedList< BankSettingChangeCallback > inputBankables
A linked list of all Bankable MIDI Input Elements that have been added to this bank,...
A class that can be inherited from to allow inserting into a DoublyLinkedList.
A class for doubly linked lists.
void append(Node *node)
Append a node to a linked list.
A class for changing the address of BankableMIDIOutputs.
uint8_t getTracksPerBank() const
Get the number of tracks per bank.
setting_t getSelection() const
Get the current bank setting (zero-based).
int8_t getOffset() const
Get the address offset (number of banks times the index of the selected bank after applying the offse...
OutputBank(uint8_t tracksPerBank=1, setting_t initialSelection=0, int8_t selectionOffset=0)
Create a new OutputBank object.
void select(setting_t setting)
Select the given bank setting.
int8_t getOffsetOfSetting(setting_t s) const
The same as getOffset, but for a given setting.
int8_t getSelectionOffset() const
Get the offset of the bank setting.
setting_t initialSelection
#define FATAL_ERROR(msg, errc)
Print the error message and error code, and stop the execution.