Class daisy::MidiHandler¶
ClassList > daisy > MidiHandler
Simple MIDI Handler Parses bytes from an input into valid MidiEvents. The MidiEvents fill aFIFO queue that the user can pop messages from.More...
#include <midi.h>
Classes¶
| Type | Name |
|---|---|
| struct | Config |
Public Types¶
| Type | Name |
|---|---|
| typedef std::function< void(MidiEvent &)> | MidiEventCallback |
Public Functions¶
| Type | Name |
|---|---|
| bool | HasEvents () const |
| void | Init (Config config) |
| void | Listen () |
| MidiHandler () |
|
| void | Parse (uint8_t byte) |
| MidiEvent | PopEvent () |
| bool | RxActive () |
| void | SendMessage (uint8_t * bytes, size_t size) |
| void | StartReceive () |
| void | StartReceiveRt (MidiEventCallback callback_for_rt_messages) |
| ~MidiHandler () |
Detailed Description¶
Author:
shensley
Date:
March 2020
Public Types Documentation¶
typedef MidiEventCallback¶
Public Functions Documentation¶
function HasEvents¶
Checks if there are unhandled messages in the queue
Returns:
True if there are events to be handled, else false.
function Init¶
Initializes the MidiHandler
Parameters:
configConfiguration structure used to define specifics to the MIDI Handler.
function Listen¶
Start listening
function MidiHandler¶
function Parse¶
Feed in bytes to parser state machine from an external source. Populates internal FIFO queue with MIDI Messages.
Note:
Normally application code won't need to use this method directly.
Parameters:
byteMIDI byte to be parsed
function PopEvent¶
Pops the oldest unhandled MidiEvent from the internal queue
Returns:
The event to be handled
function RxActive¶
function SendMessage¶
SendMessage Send raw bytes as message
function StartReceive¶
Starts listening on the selected input mode(s). MidiEvent Queue will begin to fill, and can be checked with HasEvents()
function StartReceiveRt¶
Starts listening on the selected input mode(s). MidiEvent Queue will begin to fill, and can be checked with HasEvents() MIDI events of type SystemRealTime will be delivered synchronously by callback. All other events are on the queue
function ~MidiHandler¶
The documentation for this class was generated from the following file external-docs/libDaisy/src/hid/midi.h