Utility class for parsing raw byte streams into MIDI messages. More...
Utility class for parsing raw byte streams into MIDI messages.
Implemented as a state machine designed to parse one byte at a time
#include <midi_parser.h>
Public Member Functions | |
MidiParser () | |
~MidiParser () | |
void | Init () |
bool | Parse (uint8_t byte, MidiEvent *event_out) |
Parse one MIDI byte. If the byte completes a parsed event, its value will be assigned to the dereferenced output pointer. Otherwise, status is preserved in anticipation of the next sequential byte. Return value indicates if a new event was parsed or not. | |
void | Reset () |
Reset parser to default state. | |
|
inline |
|
inline |
|
inline |
Parse one MIDI byte. If the byte completes a parsed event, its value will be assigned to the dereferenced output pointer. Otherwise, status is preserved in anticipation of the next sequential byte. Return value indicates if a new event was parsed or not.
byte | Raw MIDI byte to parse |
event_out | Pointer to output event object, value assigned on parse success |
void daisy::MidiParser::Reset | ( | ) |
Reset parser to default state.