Control Surface  1.1.1
MIDI Control Surface library for Arduino
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Control_Surface_ Class Reference

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>

Inheritance diagram for Control_Surface_:
Collaboration diagram for Control_Surface_:

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_InterfaceMIDI ()
 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
 

Detailed Description

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.

Member Typedef Documentation

◆ ChannelMessageCallback

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.

◆ SysExMessageCallback

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.

◆ RealTimeMessageCallback

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.

Constructor & Destructor Documentation

◆ Control_Surface_() [1/2]

Control_Surface_ ( Control_Surface_ const &  )
delete

◆ Control_Surface_() [2/2]

Control_Surface_ ( )
privatedefault

Control_Surface_ is a singleton, so the constructor is private.

Member Function Documentation

◆ operator=()

void operator= ( Control_Surface_ const &  )
delete

◆ getInstance()

Control_Surface_ & getInstance ( )
static

Return the static Control_Surface_ instance.

(Control_Surface_ is a singleton.)

Definition at line 20 of file Control_Surface_Class.cpp.

◆ begin()

void begin ( )

◆ loop()

void loop ( )

◆ MIDI()

MIDI_Interface & MIDI ( )

Get the MIDI interface of the Control Surface.

Returns
A reference to the Control Surface's MIDI interface.
Todo:
This violate's the Law of Demeter.

Definition at line 58 of file Control_Surface_Class.cpp.

◆ updateMidiInput()

void updateMidiInput ( )

Update all MIDI interfaces to receive new MIDI events.

Definition at line 66 of file Control_Surface_Class.cpp.

◆ updateInputs()

void updateInputs ( )

Update all MIDIInputElements.

Definition at line 150 of file Control_Surface_Class.cpp.

◆ updateDisplays()

void updateDisplays ( )

Clear, draw and display all displays.

Examples
2.VU-Meter-OLED-USB-DAC.ino.

Definition at line 158 of file Control_Surface_Class.cpp.

◆ onChannelMessage()

void onChannelMessage ( Parsing_MIDI_Interface midi)
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.

◆ onSysExMessage()

void onSysExMessage ( Parsing_MIDI_Interface midi)
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.

◆ onRealtimeMessage()

void onRealtimeMessage ( Parsing_MIDI_Interface midi,
uint8_t  message 
)
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.

◆ setMIDIInputCallbacks()

void setMIDIInputCallbacks ( ChannelMessageCallback  channelMessageCallback,
SysExMessageCallback  sysExMessageCallback,
RealTimeMessageCallback  realTimeMessageCallback 
)
inline

Set the MIDI input callbacks.

Examples
Mackie-Control-Universal-Reverse-Engineering.ino, and MIDI-Input-Callback.ino.

Definition at line 118 of file Control_Surface_Class.hpp.

Member Data Documentation

◆ potentiometerTimer

Timer<micros> potentiometerTimer = {AH::FILTERED_INPUT_UPDATE_INTERVAL}
private

A timer to know when to update the analog inputs.

Definition at line 98 of file Control_Surface_Class.hpp.

◆ displayTimer

Timer<micros> displayTimer = {1000000UL / MAX_FPS}
private

A timer to know when to refresh the displays.

Definition at line 100 of file Control_Surface_Class.hpp.

◆ channelMessageCallback

ChannelMessageCallback channelMessageCallback = nullptr
private

Definition at line 127 of file Control_Surface_Class.hpp.

◆ sysExMessageCallback

SysExMessageCallback sysExMessageCallback = nullptr
private

Definition at line 128 of file Control_Surface_Class.hpp.

◆ realTimeMessageCallback

RealTimeMessageCallback realTimeMessageCallback = nullptr
private

Definition at line 129 of file Control_Surface_Class.hpp.


The documentation for this class was generated from the following files: