Control Surface  1.2.0
MIDI Control Surface library for Arduino
BankConfig.hpp
Go to the documentation of this file.
1 /* ✔ */
2 
3 #pragma once
4 
5 #include <Def/Def.hpp>
6 
8 
12 enum BankType {
26 };
27 
28 template <setting_t N>
29 class Bank;
30 class OutputBank;
31 
32 template <BankType DefaultBankType>
33 struct OutputBankConfig;
34 
39 template <setting_t N>
41  protected:
43 
44  public:
46  const BankType type;
47 };
48 
50 template <setting_t N, BankType DefaultBankType = BankType::CHANGE_ADDRESS>
52  BankConfig(Bank<N> &bank, BankType type = DefaultBankType)
53  : BaseBankConfig<N>(bank, type) {}
54 };
55 
61  protected:
63  : bank(bank), type(type) {}
64 
65  public:
66  template <setting_t N>
68  : bank(config.bank), type(config.type) {}
69 
71  const BankType type;
72 };
73 
75 template <BankType DefaultBankType = BankType::CHANGE_ADDRESS>
77  OutputBankConfig(OutputBank &bank, BankType type = DefaultBankType)
78  : BaseOutputBankConfig(bank, type) {}
79 };
80 
BaseBankConfig::BaseBankConfig
BaseBankConfig(Bank< N > &bank, BankType type)
Definition: BankConfig.hpp:42
OutputBank
A class for changing the address of BankableMIDIOutputs.
Definition: Bank.hpp:18
BaseOutputBankConfig::BaseOutputBankConfig
BaseOutputBankConfig(OutputBank &bank, BankType type)
Definition: BankConfig.hpp:62
Bank
A class that groups Bankable BankableMIDIOutputs and BankableMIDIInputs, and allows the user to chang...
Definition: Bank.hpp:75
BaseBankConfig::bank
Bank< N > & bank
Definition: BankConfig.hpp:45
BankConfig::BankConfig
BankConfig(Bank< N > &bank, BankType type=DefaultBankType)
Definition: BankConfig.hpp:52
Def.hpp
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:9
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:10
OutputBankConfig::OutputBankConfig
OutputBankConfig(OutputBank &bank, BankType type=DefaultBankType)
Definition: BankConfig.hpp:77
BaseBankConfig::type
const BankType type
Definition: BankConfig.hpp:46
BaseBankConfig
A struct for selecting the bank of BankableMIDIInputs and the bank type.
Definition: BankConfig.hpp:40
BaseOutputBankConfig::bank
OutputBank & bank
Definition: BankConfig.hpp:70
CHANGE_CHANNEL
@ CHANGE_CHANNEL
Change the offset of the channel number of the element.
Definition: BankConfig.hpp:21
CHANGE_CABLENB
@ CHANGE_CABLENB
Change the offset of the cable number of the element.
Definition: BankConfig.hpp:25
BankType
BankType
An enumeration of the different bank types.
Definition: BankConfig.hpp:12
BaseOutputBankConfig
A struct for selecting the bank of BankableMIDIOutputs and the bank type.
Definition: BankConfig.hpp:60
BankConfig
Definition: BankConfig.hpp:51
CHANGE_ADDRESS
@ CHANGE_ADDRESS
Change the offset of the address (i.e.
Definition: BankConfig.hpp:17
OutputBankConfig
A struct for selecting the bank of BankableMIDIOutputs and the bank type.
Definition: BankConfig.hpp:76
BaseOutputBankConfig::type
const BankType type
Definition: BankConfig.hpp:71
BaseOutputBankConfig::BaseOutputBankConfig
BaseOutputBankConfig(BaseBankConfig< N > config)
Definition: BankConfig.hpp:67