Line data Source code
1 : #pragma once 2 : 3 : #include <Control_Surface/Control_Surface_Class.hpp> 4 : #include <Def/Def.hpp> 5 : #include <Selectors/Selectable.hpp> 6 : 7 : BEGIN_CS_NAMESPACE 8 : 9 : template <setting_t N> 10 : class ProgramChanger : public Selectable<N> { 11 : public: 12 2 : ProgramChanger(const Array<uint8_t, N> &programs, 13 : MIDIChannelCable channelCN) 14 2 : : programs(programs), channelCN(channelCN) {} 15 : 16 1 : void select(setting_t setting) override { 17 1 : setting = this->validateSetting(setting); 18 1 : Control_Surface.sendProgramChange(channelCN, programs[setting]); 19 1 : } 20 : 21 : private: 22 : Array<uint8_t, N> programs; 23 : MIDIChannelCable channelCN; 24 : }; 25 : 26 : END_CS_NAMESPACE