This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
Control_Surface_Class.hpp
Go to the documentation of this file.
1 /* ✔ */
2 
3 #pragma once
4 
6 
10 
12 
20  public:
21  // Copying is not allowed
22  Control_Surface_(Control_Surface_ const &) = delete;
23  void operator=(Control_Surface_ const &) = delete;
24 
29  static Control_Surface_ &getInstance();
30 
34  void begin();
35 
39  void loop();
40 
49 
53  void updateMidiInput();
54 
58  void updateInputs();
59 
63  void updateDisplays();
64 
65  private:
69  Control_Surface_() = default;
70 
75  void onChannelMessage(Parsing_MIDI_Interface &midi) override;
76 
81  void onSysExMessage(Parsing_MIDI_Interface &midi) override;
82 
88  uint8_t message) override;
89 
94 
95  public:
108 
110  void
114  this->channelMessageCallback = channelMessageCallback;
115  this->sysExMessageCallback = sysExMessageCallback;
116  this->realTimeMessageCallback = realTimeMessageCallback;
117  }
118 
119  private:
123 };
124 
127 
Control_Surface
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
Definition: Control_Surface_Class.cpp:171
MillisMicrosTimer.hpp
FILTERED_INPUT_UPDATE_INTERVAL
constexpr unsigned long FILTERED_INPUT_UPDATE_INTERVAL
The interval between updating filtered analog inputs, in microseconds.
Definition: Settings.hpp:81
SysExMessage
Definition: MIDI_Parser.hpp:64
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:118
Parsing_MIDI_Interface
An abstract class for MIDI interfaces.
Definition: MIDI_Interface.hpp:188
Control_Surface_::updateInputs
void updateInputs()
Update all MIDIInputElements.
Definition: Control_Surface_Class.cpp:147
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:68
Control_Surface_::MIDI
MIDI_Interface & MIDI()
Get the MIDI interface of the Control Surface.
Definition: Control_Surface_Class.cpp:55
Control_Surface_::Control_Surface_
Control_Surface_()=default
Control_Surface_ is a singleton, so the constructor is private.
Timer< micros >
DisplayInterface.hpp
Control_Surface_::displayTimer
Timer< micros > displayTimer
A timer to know when to refresh the displays.
Definition: Control_Surface_Class.hpp:93
Control_Surface_::updateMidiInput
void updateMidiInput()
Update all MIDI interfaces to receive new MIDI events.
Definition: Control_Surface_Class.cpp:63
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:137
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: NamespaceSettings.hpp:9
DisplayElement.hpp
Control_Surface_::operator=
void operator=(Control_Surface_ const &)=delete
Control_Surface_::RealTimeMessageCallback
bool(*)(RealTimeMessage) RealTimeMessageCallback
Callback function type for Real-Time messages.
Definition: Control_Surface_Class.hpp:107
Control_Surface_::channelMessageCallback
ChannelMessageCallback channelMessageCallback
Definition: Control_Surface_Class.hpp:120
RealTimeMessage
Definition: MIDI_Parser.hpp:77
Control_Surface_::setMIDIInputCallbacks
void setMIDIInputCallbacks(ChannelMessageCallback channelMessageCallback, SysExMessageCallback sysExMessageCallback, RealTimeMessageCallback realTimeMessageCallback)
Set the MIDI input callbacks.
Definition: Control_Surface_Class.hpp:111
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: NamespaceSettings.hpp:10
MAX_FPS
constexpr uint8_t MAX_FPS
The maximum frame rate of the displays.
Definition: Settings.hpp:111
Control_Surface_::potentiometerTimer
Timer< micros > potentiometerTimer
A timer to know when to update the analog inputs.
Definition: Control_Surface_Class.hpp:91
Control_Surface_::sysExMessageCallback
SysExMessageCallback sysExMessageCallback
Definition: Control_Surface_Class.hpp:121
Control_Surface_::realTimeMessageCallback
RealTimeMessageCallback realTimeMessageCallback
Definition: Control_Surface_Class.hpp:122
Control_Surface_::begin
void begin()
Initialize the Control_Surface.
Definition: Control_Surface_Class.cpp:22
Control_Surface_::updateDisplays
void updateDisplays()
Clear, draw and display all displays.
Definition: Control_Surface_Class.cpp:155
Control_Surface_::ChannelMessageCallback
bool(*)(ChannelMessage) ChannelMessageCallback
Callback function type for channel messages.
Definition: Control_Surface_Class.hpp:99
ChannelMessage
Definition: MIDI_Parser.hpp:47
Control_Surface_::SysExMessageCallback
bool(*)(SysExMessage) SysExMessageCallback
Callback function type for SysEx messages.
Definition: Control_Surface_Class.hpp:103
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_
This class ensures initialization, updating, and interaction between all other classes,...
Definition: Control_Surface_Class.hpp:19
Control_Surface_::loop
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
Definition: Control_Surface_Class.cpp:45
Control_Surface_::getInstance
static Control_Surface_ & getInstance()
Return the static Control_Surface_ instance.
Definition: Control_Surface_Class.cpp:17