2#include <Settings/SettingsWrapper.hpp>
25 DEBUGREF(F(
"No SysExStart received"));
45template <u
int8_t NumBytes>
48 static_assert(NumBytes == 2 || NumBytes == 3,
49 "Only 2- or 3-byte SysEx packets are supported");
60 DEBUGFN(F(
"No SysExStart received"));
98 DEBUGREF(F(
"No SysExStart received"));
153 case M::MiscFunctionCodes:
break;
154 case M::CableEvents:
break;
155 case M::SystemCommon2B:
158 case M::SysExEnd1B:
return handleSysExEnd<1>(packet, cable);
159 case M::SysExEnd2B:
return handleSysExEnd<2>(packet, cable);
160 case M::SysExEnd3B:
return handleSysExEnd<3>(packet, cable);
164 case M::ControlChange:
165 case M::ProgramChange:
166 case M::ChannelPressure:
MIDIReadEvent
Values returned by the MIDI reading functions.
@ CHANNEL_MESSAGE
A MIDI Channel message was received.
@ SYSEX_CHUNK
An incomplete System Exclusive message.
@ SYSCOMMON_MESSAGE
A MIDI System Common message was received.
@ NO_MESSAGE
No new messages were received.
@ SYSEX_MESSAGE
A MIDI System Exclusive message was received.
@ REALTIME_MESSAGE
A MIDI Real-Time message was received.
@ SysExStart
Start of System Exclusive.
@ SysExEnd
End of System Exclusive.
MIDICodeIndexNumber
MIDI USB Code Index Numbers.
#define BEGIN_CS_NAMESPACE
#define USB_MIDI_NUMBER_OF_CABLES
A type-safe class for MIDI USB Cable numbers.
constexpr uint8_t getRaw() const
Get the cable as an integer.
bool hasSysExSpace(Cable cable, uint8_t amount) const
MIDIReadEvent handleSingleByte(MIDIUSBPacket_t packet, Cable cable)
MIDIReadEvent resume()
Resume the parser with the previously stored and unhandled packet.
MIDIReadEvent handleSysExStartCont(MIDIUSBPacket_t packet, Cable cable)
void endSysExChunk(Cable cable)
void storePacket(MIDIUSBPacket_t packet)
MIDIReadEvent handleSysExEnd(MIDIUSBPacket_t packet, Cable cable)
MIDIReadEvent handleChannelMessage(MIDIUSBPacket_t packet, Cable cable)
void startSysEx(Cable cable)
bool receivingSysEx(Cable cable) const
bool hasStoredPacket() const
MIDIUSBPacket_t popStoredPacket()
MIDIReadEvent feed(MIDIUSBPacket_t packet)
Feed a new packet to the parser.
void addSysExByte(Cable cable, uint8_t data)
void endSysEx(Cable cable)
void addSysExBytes(Cable cable, const uint8_t *data, uint8_t len)
MIDIReadEvent handleSysCommon(MIDIUSBPacket_t packet, Cable cable)
#define DEBUGFN(x)
Print an expression and its function (function name and line number) to the debug output if debugging...
#define DEBUGREF(x)
Print an expression and its location (file and line number) to the debug output if debugging is enabl...
uint8_t data2
First MIDI data byte.
uint8_t header
MIDI status byte (message type and channel).
uint8_t data1
First MIDI data byte.
Cable cable
USB MIDI cable number;.