Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
BankableAddresses.hpp
Go to the documentation of this file.
1/* ✔ */
2
3#pragma once
4
5#include "Bank.hpp"
6#include "BankConfig.hpp"
7#include <Def/MIDIAddress.hpp>
8
10
16 protected:
24
25 public:
30 setting_t getRawBankSetting() const { return bank.getSelection(); }
31
41
48 void lock() {
51 }
52
60
61 protected:
63
64 private:
65 constexpr static setting_t Unlocked = NoSetting;
67};
68
86 public:
97
108
113 int8_t offset = bank.getOffsetOfSetting(bankindex);
114 switch (type) {
115 case ChangeAddress: return {offset, 0, 0};
116 case ChangeChannel: return {0, offset, 0};
117 case ChangeCable: return {0, 0, offset};
118 default: return {};
119 }
120 }
125
126 private:
128};
129
149 public:
158 template <uint8_t NumBanks>
161};
162
BankType
An enumeration of the different bank types.
@ ChangeAddress
Change the offset of the address (i.e.
@ ChangeCable
Change the offset of the cable number of the element.
@ ChangeChannel
Change the offset of the channel number of the element.
constexpr setting_t NoSetting
A special setting that indicates an unused or invalid setting.
Definition Def.hpp:53
uint8_t setting_t
The type used for Selectors.
Definition Def.hpp:51
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
A struct for selecting the bank of BankableMIDIOutputs and the bank type.
A base class for all MIDIOutputElements that can have one of many addresses.
ManyAddresses_Base(const Bank< NumBanks > &bank)
Constructor.
A class for changing the address of BankableMIDIOutputs.
Definition Bank.hpp:16
Class for keeping track of the active bank, and allows locking of the bank setting.
setting_t getSelection() const
Get the bank setting.
OutputBankableMIDIAddress_Base(const OutputBank &bank)
Constructor.
setting_t getRawBankSetting() const
Get the actual bank setting (no matter whether the element is locked or not).
void unlock()
Unlock the bank setting.
void lock()
Lock the bank setting.
static constexpr setting_t Unlocked
A base class for all MIDIOutputElements that can be banked.
OutputBankableMIDIAddress(const OutputBank &bank, BankType type)
Create a new OutputBankableMIDIAddress object.
RelativeMIDIAddress getAddressOffset() const
Get the offset relative to the base address.
OutputBankableMIDIAddress(BaseOutputBankConfig config)
Create a new OutputBankableMIDIAddress object.
RelativeMIDIAddress getAddressOffset(setting_t bankindex) const
Get the offset relative to the base address.
A class for saving an offset to a MIDI address.
An array wrapper for easy copying, comparing, and iterating.
Definition Array.hpp:32