Control Surface pin-t-adl
MIDI Control Surface library for Arduino
Bankable/ProgramChanger.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <Def/Def.hpp>
7
9
10namespace Bankable {
11
12template <setting_t N>
13class ProgramChanger : public Selectable<N> {
14 public:
18
19 void select(setting_t setting) override {
20 setting = this->validateSetting(setting);
21 MIDIAddress addr {programs[setting], channelCN};
23 }
24
25 private:
29};
30
31} // namespace Bankable
32
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
uint8_t setting_t
The type used for Selectors.
Definition: Def.hpp:53
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
ProgramChanger(OutputBankConfig<> bank, const Array< uint8_t, N > &programs, MIDIChannelCable channelCN)
OutputBankableMIDIAddress bank
void select(setting_t setting) override
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
A class for saving a MIDI channel and cable number.
Definition: MIDIAddress.hpp:24
void sendProgramChange(MIDIAddress address)
Send a MIDI Program Change event.
Definition: MIDI_Sender.ipp:78
A base class for all MIDIOutputElements that can be banked.
RelativeMIDIAddress getAddressOffset(setting_t bankindex) const
Get the offset relative to the base address.
static setting_t validateSetting(setting_t setting)
Definition: Selectable.hpp:19
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
An array wrapper for easy copying, comparing, and iterating.
Definition: Array.hpp:36