This class ensures initialization, updating, and interaction between all other classes, it's the glue that holds everything together. More...
#include <Control_Surface/Control_Surface_Class.hpp>
Public Types | |
using | ChannelMessageCallback = bool(*)(ChannelMessage) |
Callback function type for channel messages. More... | |
using | SysExMessageCallback = bool(*)(SysExMessage) |
Callback function type for SysEx messages. More... | |
using | RealTimeMessageCallback = bool(*)(RealTimeMessage) |
Callback function type for Real-Time messages. More... | |
Public Member Functions | |
Control_Surface_ (Control_Surface_ const &)=delete | |
void | operator= (Control_Surface_ const &)=delete |
void | begin () |
Initialize the Control_Surface. More... | |
void | loop () |
Update all MIDI elements, send MIDI events and read MIDI input. More... | |
MIDI_Interface & | MIDI () |
Get the MIDI interface of the Control Surface. More... | |
void | updateMidiInput () |
Update all MIDI interfaces to receive new MIDI events. More... | |
void | updateInputs () |
Update all MIDIInputElements. More... | |
void | updateDisplays () |
Clear, draw and display all displays. More... | |
void | setMIDIInputCallbacks (ChannelMessageCallback channelMessageCallback, SysExMessageCallback sysExMessageCallback, RealTimeMessageCallback realTimeMessageCallback) |
Set the MIDI input callbacks. More... | |
Static Public Member Functions | |
static Control_Surface_ & | getInstance () |
Return the static Control_Surface_ instance. More... | |
Private Member Functions | |
Control_Surface_ ()=default | |
Control_Surface_ is a singleton, so the constructor is private. More... | |
void | onChannelMessage (Parsing_MIDI_Interface &midi) override |
The callback to be called when a MIDI channel message is received. More... | |
void | onSysExMessage (Parsing_MIDI_Interface &midi) override |
The callback to be called when a MIDI System Exclusive message is received. More... | |
void | onRealtimeMessage (Parsing_MIDI_Interface &midi, uint8_t message) override |
The callback to be called when a MIDI Real-Time message is received. More... | |
Private Attributes | |
Timer< micros > | potentiometerTimer = {AH::FILTERED_INPUT_UPDATE_INTERVAL} |
A timer to know when to update the analog inputs. More... | |
Timer< micros > | displayTimer = {1000000UL / MAX_FPS} |
A timer to know when to refresh the displays. More... | |
ChannelMessageCallback | channelMessageCallback = nullptr |
SysExMessageCallback | sysExMessageCallback = nullptr |
RealTimeMessageCallback | realTimeMessageCallback = nullptr |
This class ensures initialization, updating, and interaction between all other classes, it's the glue that holds everything together.
Definition at line 26 of file Control_Surface_Class.hpp.
using ChannelMessageCallback = bool (*)(ChannelMessage) |
Callback function type for channel messages.
Return true if handling is done in the user-provided callback, false if Control_Surface
should handle the message.
Definition at line 106 of file Control_Surface_Class.hpp.
using SysExMessageCallback = bool (*)(SysExMessage) |
Callback function type for SysEx messages.
Return true if handling is done in the user-provided callback, false if Control_Surface
should handle the message.
Definition at line 110 of file Control_Surface_Class.hpp.
using RealTimeMessageCallback = bool (*)(RealTimeMessage) |
Callback function type for Real-Time messages.
Return true if handling is done in the user-provided callback, false if Control_Surface
should handle the message.
Definition at line 114 of file Control_Surface_Class.hpp.
|
delete |
|
privatedefault |
Control_Surface_ is a singleton, so the constructor is private.
|
delete |
|
static |
Return the static Control_Surface_ instance.
(Control_Surface_ is a singleton.)
Definition at line 20 of file Control_Surface_Class.cpp.
void begin | ( | ) |
Initialize the Control_Surface.
Definition at line 25 of file Control_Surface_Class.cpp.
void loop | ( | ) |
Update all MIDI elements, send MIDI events and read MIDI input.
Definition at line 48 of file Control_Surface_Class.cpp.
MIDI_Interface & MIDI | ( | ) |
Get the MIDI interface of the Control Surface.
Definition at line 58 of file Control_Surface_Class.cpp.
void updateMidiInput | ( | ) |
Update all MIDI interfaces to receive new MIDI events.
Definition at line 66 of file Control_Surface_Class.cpp.
void updateInputs | ( | ) |
Update all MIDIInputElements.
Definition at line 150 of file Control_Surface_Class.cpp.
void updateDisplays | ( | ) |
Clear, draw and display all displays.
Definition at line 158 of file Control_Surface_Class.cpp.
|
overrideprivatevirtual |
The callback to be called when a MIDI channel message is received.
Reimplemented from MIDI_Callbacks.
Definition at line 71 of file Control_Surface_Class.cpp.
|
overrideprivatevirtual |
The callback to be called when a MIDI System Exclusive message is received.
Reimplemented from MIDI_Callbacks.
Definition at line 121 of file Control_Surface_Class.cpp.
|
overrideprivatevirtual |
The callback to be called when a MIDI Real-Time message is received.
Reimplemented from MIDI_Callbacks.
Definition at line 140 of file Control_Surface_Class.cpp.
|
inline |
Set the MIDI input callbacks.
Definition at line 118 of file Control_Surface_Class.hpp.
|
private |
A timer to know when to update the analog inputs.
Definition at line 98 of file Control_Surface_Class.hpp.
A timer to know when to refresh the displays.
Definition at line 100 of file Control_Surface_Class.hpp.
|
private |
Definition at line 127 of file Control_Surface_Class.hpp.
|
private |
Definition at line 128 of file Control_Surface_Class.hpp.
|
private |
Definition at line 129 of file Control_Surface_Class.hpp.