Control Surface  1.1.1
MIDI Control Surface library for Arduino
Control_Surface_Class.hpp
Go to the documentation of this file.
1 /* ✔ */
2 
3 #pragma once
4 
11 #include <Settings/SettingsWrapper.hpp>
12 
14 
15 using AH::FilteredAnalog;
17 using AH::Timer;
18 using AH::Updatable;
19 
27  public:
28  // Copying is not allowed
29  Control_Surface_(Control_Surface_ const &) = delete;
30  void operator=(Control_Surface_ const &) = delete;
31 
36  static Control_Surface_ &getInstance();
37 
41  void begin();
42 
46  void loop();
47 
56 
60  void updateMidiInput();
61 
65  void updateInputs();
66 
70  void updateDisplays();
71 
72  private:
76  Control_Surface_() = default;
77 
82  void onChannelMessage(Parsing_MIDI_Interface &midi) override;
83 
88  void onSysExMessage(Parsing_MIDI_Interface &midi) override;
89 
95  uint8_t message) override;
96 
101 
102  public:
115 
117  void
121  this->channelMessageCallback = channelMessageCallback;
122  this->sysExMessageCallback = sysExMessageCallback;
123  this->realTimeMessageCallback = realTimeMessageCallback;
124  }
125 
126  private:
130 };
131 
134 
Control_Surface
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
Definition: Control_Surface_Class.cpp:176
AH::Updatable
A super class for object that have to be updated regularly.
Definition: Updatable.hpp:25
AH::NormalUpdatable
Definition: Updatable.hpp:16
Control_Surface_::updateDisplays
void updateDisplays()
Clear, draw and display all displays.
Definition: Control_Surface_Class.cpp:158
MillisMicrosTimer.hpp
SysExMessage
Definition: MIDI_Parser.hpp:64
Control_Surface_::RealTimeMessageCallback
bool(*)(RealTimeMessage) RealTimeMessageCallback
Callback function type for Real-Time messages.
Definition: Control_Surface_Class.hpp:114
Updatable.hpp
Parsing_MIDI_Interface
An abstract class for MIDI interfaces.
Definition: MIDI_Interface.hpp:188
AH::Timer
A class for easily managing timed events.
Definition: MillisMicrosTimer.hpp:28
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:9
AH::FilteredAnalog
A class that reads and filters an analog input.
Definition: FilteredAnalog.hpp:55
Control_Surface_::sysExMessageCallback
SysExMessageCallback sysExMessageCallback
Definition: Control_Surface_Class.hpp:128
Control_Surface_::MIDI
MIDI_Interface & MIDI()
Get the MIDI interface of the Control Surface.
Definition: Control_Surface_Class.cpp:58
Control_Surface_::potentiometerTimer
Timer< micros > potentiometerTimer
A timer to know when to update the analog inputs.
Definition: Control_Surface_Class.hpp:98
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:10
DisplayInterface.hpp
MAX_FPS
constexpr uint8_t MAX_FPS
The maximum frame rate of the displays.
Definition: Settings/Settings.hpp:60
Control_Surface_::updateMidiInput
void updateMidiInput()
Update all MIDI interfaces to receive new MIDI events.
Definition: Control_Surface_Class.cpp:66
Control_Surface_::loop
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
Definition: Control_Surface_Class.cpp:48
DisplayElement.hpp
Control_Surface_::getInstance
static Control_Surface_ & getInstance()
Return the static Control_Surface_ instance.
Definition: Control_Surface_Class.cpp:20
Control_Surface_::onSysExMessage
void onSysExMessage(Parsing_MIDI_Interface &midi) override
The callback to be called when a MIDI System Exclusive message is received.
Definition: Control_Surface_Class.cpp:121
Control_Surface_::ChannelMessageCallback
bool(*)(ChannelMessage) ChannelMessageCallback
Callback function type for channel messages.
Definition: Control_Surface_Class.hpp:106
RealTimeMessage
Definition: MIDI_Parser.hpp:77
Control_Surface_::displayTimer
Timer< micros > displayTimer
A timer to know when to refresh the displays.
Definition: Control_Surface_Class.hpp:100
Control_Surface_::setMIDIInputCallbacks
void setMIDIInputCallbacks(ChannelMessageCallback channelMessageCallback, SysExMessageCallback sysExMessageCallback, RealTimeMessageCallback realTimeMessageCallback)
Set the MIDI input callbacks.
Definition: Control_Surface_Class.hpp:118
Control_Surface_::operator=
void operator=(Control_Surface_ const &)=delete
Control_Surface_::onRealtimeMessage
void onRealtimeMessage(Parsing_MIDI_Interface &midi, uint8_t message) override
The callback to be called when a MIDI Real-Time message is received.
Definition: Control_Surface_Class.cpp:140
Control_Surface_::onChannelMessage
void onChannelMessage(Parsing_MIDI_Interface &midi) override
The callback to be called when a MIDI channel message is received.
Definition: Control_Surface_Class.cpp:71
ChannelMessage
Definition: MIDI_Parser.hpp:47
Control_Surface_::updateInputs
void updateInputs()
Update all MIDIInputElements.
Definition: Control_Surface_Class.cpp:150
Control_Surface_::realTimeMessageCallback
RealTimeMessageCallback realTimeMessageCallback
Definition: Control_Surface_Class.hpp:129
MIDI_Callbacks
A class for callbacks from MIDI input.
Definition: MIDI_Interface.hpp:247
MIDI_Interface
An abstract class for MIDI interfaces.
Definition: MIDI_Interface.hpp:16
MIDI_Interface.hpp
Control_Surface_::SysExMessageCallback
bool(*)(SysExMessage) SysExMessageCallback
Callback function type for SysEx messages.
Definition: Control_Surface_Class.hpp:110
FilteredAnalog.hpp
Control_Surface_
This class ensures initialization, updating, and interaction between all other classes,...
Definition: Control_Surface_Class.hpp:26
Control_Surface_::Control_Surface_
Control_Surface_()=default
Control_Surface_ is a singleton, so the constructor is private.
AH::FILTERED_INPUT_UPDATE_INTERVAL
constexpr unsigned long FILTERED_INPUT_UPDATE_INTERVAL
The interval between updating filtered analog inputs, in microseconds.
Definition: AH/Settings/Settings.hpp:83
Control_Surface_::channelMessageCallback
ChannelMessageCallback channelMessageCallback
Definition: Control_Surface_Class.hpp:127
Control_Surface_::begin
void begin()
Initialize the Control_Surface.
Definition: Control_Surface_Class.cpp:25