This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
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_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...
 
virtual void onChannelMessage (UNUSED_PARAM Parsing_MIDI_Interface &midi)
 
virtual void onSysExMessage (UNUSED_PARAM Parsing_MIDI_Interface &midi)
 
virtual void onRealtimeMessage (UNUSED_PARAM Parsing_MIDI_Interface &midi, UNUSED_PARAM uint8_t message)
 

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 = {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 19 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 99 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 103 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 107 of file Control_Surface_Class.hpp.

Constructor & Destructor Documentation

◆ Control_Surface_() [1/2]

Control_Surface_::Control_Surface_ ( Control_Surface_ const &  )
delete

◆ Control_Surface_() [2/2]

Control_Surface_::Control_Surface_ ( )
privatedefault

Control_Surface_ is a singleton, so the constructor is private.

Member Function Documentation

◆ operator=()

void Control_Surface_::operator= ( Control_Surface_ const &  )
delete

◆ getInstance()

Control_Surface_ & Control_Surface_::getInstance ( )
static

Return the static Control_Surface_ instance.

(Control_Surface_ is a singleton.)

Definition at line 17 of file Control_Surface_Class.cpp.

◆ begin()

void Control_Surface_::begin ( )

◆ loop()

void Control_Surface_::loop ( )

◆ MIDI()

MIDI_Interface & Control_Surface_::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 55 of file Control_Surface_Class.cpp.

◆ updateMidiInput()

void Control_Surface_::updateMidiInput ( )

Update all MIDI interfaces to receive new MIDI events.

Definition at line 63 of file Control_Surface_Class.cpp.

◆ updateInputs()

void Control_Surface_::updateInputs ( )

Update all MIDIInputElements.

Definition at line 147 of file Control_Surface_Class.cpp.

◆ updateDisplays()

void Control_Surface_::updateDisplays ( )

Clear, draw and display all displays.

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

Definition at line 155 of file Control_Surface_Class.cpp.

◆ onChannelMessage() [1/2]

void Control_Surface_::onChannelMessage ( Parsing_MIDI_Interface midi)
overrideprivate

The callback to be called when a MIDI channel message is received.

Definition at line 68 of file Control_Surface_Class.cpp.

◆ onSysExMessage() [1/2]

void Control_Surface_::onSysExMessage ( Parsing_MIDI_Interface midi)
overrideprivate

The callback to be called when a MIDI System Exclusive message is received.

Definition at line 118 of file Control_Surface_Class.cpp.

◆ onRealtimeMessage() [1/2]

void Control_Surface_::onRealtimeMessage ( Parsing_MIDI_Interface midi,
uint8_t  message 
)
overrideprivate

The callback to be called when a MIDI Real-Time message is received.

Definition at line 137 of file Control_Surface_Class.cpp.

◆ setMIDIInputCallbacks()

void Control_Surface_::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 111 of file Control_Surface_Class.hpp.

◆ onChannelMessage() [2/2]

virtual void MIDI_Callbacks::onChannelMessage ( UNUSED_PARAM Parsing_MIDI_Interface midi)
inlinevirtualinherited

Definition at line 249 of file MIDI_Interface.hpp.

◆ onSysExMessage() [2/2]

virtual void MIDI_Callbacks::onSysExMessage ( UNUSED_PARAM Parsing_MIDI_Interface midi)
inlinevirtualinherited
Examples
SysEx-Send-Receive.ino.

Definition at line 250 of file MIDI_Interface.hpp.

◆ onRealtimeMessage() [2/2]

virtual void MIDI_Callbacks::onRealtimeMessage ( UNUSED_PARAM Parsing_MIDI_Interface midi,
UNUSED_PARAM uint8_t  message 
)
inlinevirtualinherited

Definition at line 251 of file MIDI_Interface.hpp.

Member Data Documentation

◆ potentiometerTimer

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

A timer to know when to update the analog inputs.

Definition at line 91 of file Control_Surface_Class.hpp.

◆ displayTimer

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

A timer to know when to refresh the displays.

Definition at line 93 of file Control_Surface_Class.hpp.

◆ channelMessageCallback

ChannelMessageCallback Control_Surface_::channelMessageCallback = nullptr
private

Definition at line 120 of file Control_Surface_Class.hpp.

◆ sysExMessageCallback

SysExMessageCallback Control_Surface_::sysExMessageCallback = nullptr
private

Definition at line 121 of file Control_Surface_Class.hpp.

◆ realTimeMessageCallback

RealTimeMessageCallback Control_Surface_::realTimeMessageCallback = nullptr
private

Definition at line 122 of file Control_Surface_Class.hpp.


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