#include <Banks/Bank.hpp>
template<
setting_t NumBanks>
class Bank< NumBanks >
A class that groups Bankable MIDI Output Elements and Bankable MIDI Input Elements, and allows the user to change the addresses of these elements.
- See also
- FAQ: Can I change the address, controller number, MIDI channel, etc. at runtime?
-
FAQ: How do banks work?
- Template Parameters
-
NumBanks | The number of banks. |
- Examples
- Bank-Button-Matrix.ino, Bank.ino, Bankable-Smart-Control-Change-Potentiometer.ino, Custom-MIDI-Output-Element-Bankable.ino, Custom-Selector-Callback.ino, Encoder-Selector-Bank.ino, MCU-OLED-SSD1306-x2.ino, MCU-OLED-SSD1306.ino, MIDI-Controller-Finished-Example.ino, MIDI_controller-97.ino, ManyAddressesPCButton.ino, Note-ManyAddresses-Transposer.ino, and One-Pot-Both-PB-and-CC.ino.
Definition at line 94 of file Bank.hpp.
◆ Bank()
Bank |
( |
uint8_t | tracksPerBank = 1, |
|
|
setting_t | initialSelection = 0, |
|
|
int8_t | selectionOffset = 0 ) |
|
inline |
Construct a new Bank object.
- Parameters
-
tracksPerBank | The number of addresses/tracks to skip for each bank setting. Must be strictly positive. |
initialSelection | The initial bank setting. |
selectionOffset | The offset added to the bank setting before computing the actual address offset. |
Definition at line 107 of file Bank.hpp.
◆ select()
Select the given bank setting.
All Bankable MIDI Input elements that were added to this bank will be updated.
- Parameters
-
bankSetting | The new setting to select. |
Implements Selectable< NumBanks >.
Definition at line 162 of file Bank.hpp.
◆ getNumberOfBanks()
static constexpr uint8_t getNumberOfBanks |
( |
| ) |
|
|
inlinestaticconstexpr |
Get the number of banks.
Definition at line 122 of file Bank.hpp.
◆ add()
Add a Bankable MIDI Input Element to the bank.
- Parameters
-
bankable | The MIDI Input Element to be added. |
Definition at line 152 of file Bank.hpp.
◆ remove()
Remove a Bankable MIDI Input Element from the bank.
- Parameters
-
bankable | The MIDI Input Element to be removed. |
Definition at line 157 of file Bank.hpp.
◆ validateSetting()
◆ getInitialSelection()
◆ setInitialSelection()
void setInitialSelection |
( |
setting_t | initialSelection | ) |
|
|
inlineinherited |
◆ getSelection()
Get the current bank setting (zero-based).
Definition at line 44 of file Bank.hpp.
◆ getSelectionOffset()
int8_t getSelectionOffset |
( |
| ) |
const |
|
inlineinherited |
Get the offset of the bank setting.
Definition at line 46 of file Bank.hpp.
◆ getTracksPerBank()
uint8_t getTracksPerBank |
( |
| ) |
const |
|
inlineinherited |
Get the number of tracks per bank.
This is the number of addresses/tracks to skip for each bank setting.
Definition at line 50 of file Bank.hpp.
◆ getOffsetOfSetting()
int8_t getOffsetOfSetting |
( |
setting_t | s | ) |
const |
|
inlineinherited |
◆ getOffset()
int8_t getOffset |
( |
| ) |
const |
|
inlineinherited |
Get the address offset (number of banks times the index of the selected bank after applying the offset)
Definition at line 58 of file Bank.hpp.
◆ inputBankables
A linked list of all Bankable MIDI Input Elements that have been added to this bank, and that should be updated when the bank setting changes.
The list is updated automatically when Bankable MIDI Input Elements are created or destroyed.
Definition at line 142 of file Bank.hpp.
◆ initialSelection
◆ tracksPerBank
◆ bankSetting
◆ selectionOffset
The documentation for this class was generated from the following file: