23#if defined(ARDUINO) && defined(DEBUG_OUT)
31 ExtendedIOElement::beginAll();
52 FATAL_ERROR(F(
"No default MIDI Interface"), 0xF123);
66 ExtendedIOElement::updateAllBufferedInputs();
72 ExtendedIOElement::updateAllBufferedOutputs();
93#ifdef DEBUG_MIDI_PACKETS
111 DEBUG(F(
"Reset All Controllers"));
123 DEBUGFN(F(
"Updating Note elements with new MIDI "
128 DEBUGFN(F(
"Updating Key Pressure elements with new MIDI "
133 DEBUGFN(F(
"Updating CC elements with new MIDI "
138 DEBUGFN(F(
"Updating Program Change elements with new MIDI "
143 DEBUGFN(F(
"Updating Channel Pressure elements with new MIDI "
149 DEBUGFN(F(
"Updating Pitch Bend elements with new MIDI "
180#ifdef DEBUG_MIDI_PACKETS
181 const uint8_t *data = msg.
data;
184 for (
size_t i = 0; i < len; i++)
196#ifdef DEBUG_MIDI_PACKETS
208#ifdef DEBUG_MIDI_PACKETS
231 auto it = allElements.begin();
232 auto end = allElements.end();
235 auto previousDisplay = &it->getDisplay();
240 if (it == end || &it->getDisplay() != previousDisplay) {
242 previousDisplay->begin();
245 previousDisplay = &it->getDisplay();
252 auto it = allElements.begin();
253 auto end = allElements.end();
257 auto previousDisplay = &prevIt->getDisplay();
261 dirty |= it->getDirty();
264 if (it == end || &it->getDisplay() != previousDisplay) {
269 previousDisplay->clearAndDrawBackground();
271 for (
auto drawIt = prevIt; drawIt != it; ++drawIt)
274 previousDisplay->display();
279 previousDisplay = &it->getDisplay();
285#if CS_TRUE_CONTROL_SURFACE_INSTANCE || defined(DOXYGEN)
#define DEBUG_OUT
The debug output.
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
#define BEGIN_CS_NAMESPACE
An abstract base class for Extended Input/Output elements.
A class that reads and filters an analog input.
void begin()
Initialize or reset the timer. The timer will fire immediately.
A super class for object that have to be updated regularly.
constexpr uint8_t getOneBased() const
Get the cable as an integer.
This class ensures initialization, updating, and interaction between all other classes,...
void updateDisplays()
Clear, draw and display all displays that contain display elements that have changed.
Timer< micros > displayTimer
A timer to know when to refresh the displays.
bool connectDefaultMIDI_Interface()
Connect Control Surface to the default MIDI interface.
void disconnectMIDI_Interfaces()
Disconnect Control Surface from the MIDI interfaces it's connected to.
void updateInputs()
Update all MIDIInputElements.
ChannelMessageCallback channelMessageCallback
static Control_Surface_ & getInstance()
Return the static Control_Surface_ instance (Control_Surface_ is a singleton.)
void updateMidiInput()
Update all MIDI interfaces to receive new MIDI events.
void sendSysExImpl(SysExMessage)
Low-level function for sending a system exclusive MIDI message.
void sinkMIDIfromPipe(ChannelMessage msg) override
Accept an incoming MIDI Channel message.
SysCommonMessageCallback sysCommonMessageCallback
void begin()
Initialize the Control_Surface.
RealTimeMessageCallback realTimeMessageCallback
void beginDisplays()
Initialize all displays that have at least one display element.
SysExMessageCallback sysExMessageCallback
void sendSysCommonImpl(SysCommonMessage)
Low-level function for sending a MIDI system common message.
void sendChannelMessageImpl(ChannelMessage)
Low-level function for sending a MIDI channel voice message.
void sendRealTimeImpl(RealTimeMessage)
Low-level function for sending a MIDI real-time message.
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
static DoublyLinkedList< DisplayElement > & getAll()
Get the list of all DisplayElement instances.
static MIDI_Interface * getDefault()
Return the default MIDI interface.
void disconnectSourcePipes()
Disconnect all source pipes that sink to this sink (recursively).
bool hasSourcePipe() const
Check if this sink is connected to a source pipe.
void sourceMIDItoPipe(ChannelMessage)
Send a MIDI Channel Message down the pipe.
void disconnectSinkPipes()
Disconnect all sink pipes that this source sinks to (recursively).
bool hasSinkPipe() const
Check if this source is connected to a sink pipe.
#define DEBUG(x)
Print an expression to the debug output if debugging is enabled.
#define DEBUGFN(x)
Print an expression and its function (function name and line number) to the debug output if debugging...
#define FATAL_ERROR(msg, errc)
Print the error message and error code, and stop the execution.
Print & hex(Print &printer)
Print & endl(Print &printer)
Print & dec(Print &printer)
constexpr unsigned long defaultBaudRate
The default baud rate for debug output.
constexpr uint8_t Reset_All_Controllers
constexpr uint8_t All_Notes_Off
MIDIMessageType getMessageType() const
Get the MIDI message type.
bool hasTwoDataBytes() const
Check whether this message has one or two data bytes.
uint8_t data2
First MIDI data byte.
uint8_t header
MIDI status byte (message type and channel).
uint8_t getData1() const
Get the first data byte.
uint8_t data1
First MIDI data byte.
Cable cable
USB MIDI cable number;.
uint8_t getData2() const
Get the second data byte.
MIDIMessageType getMessageType() const
Get the MIDI message type.