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>
|
| 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.
|
|
◆ MidiParser()
daisy::MidiParser::MidiParser |
( |
| ) |
|
|
inline |
◆ ~MidiParser()
daisy::MidiParser::~MidiParser |
( |
| ) |
|
|
inline |
◆ Init()
void daisy::MidiParser::Init |
( |
| ) |
|
|
inline |
◆ Parse()
bool daisy::MidiParser::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.
- Parameters
-
byte | Raw MIDI byte to parse |
event_out | Pointer to output event object, value assigned on parse success |
- Returns
- true If a new event was parsed
-
false If no new event was parsed
◆ Reset()
void daisy::MidiParser::Reset |
( |
| ) |
|
Reset parser to default state.
The documentation for this class was generated from the following file: