libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::MidiHandler< Transport > Class Template Reference

Simple MIDI Handler
Parses bytes from an input into valid MidiEvents.
The MidiEvents fill a FIFO queue that the user can pop messages from. More...

Detailed Description

template<typename Transport>
class daisy::MidiHandler< Transport >

Simple MIDI Handler
Parses bytes from an input into valid MidiEvents.
The MidiEvents fill a FIFO queue that the user can pop messages from.

Author
shensley
Date
March 2020

#include <midi.h>

Classes

struct  Config
 

Public Member Functions

 MidiHandler ()
 
 ~MidiHandler ()
 
void Init (Config config)
 
void StartReceive ()
 
void Listen ()
 
bool HasEvents () const
 
bool RxActive ()
 
MidiEvent PopEvent ()
 
void SendMessage (uint8_t *bytes, size_t size)
 
void Parse (uint8_t byte)
 

Constructor & Destructor Documentation

◆ MidiHandler()

template<typename Transport >
daisy::MidiHandler< Transport >::MidiHandler ( )
inline

◆ ~MidiHandler()

Member Function Documentation

◆ HasEvents()

template<typename Transport >
bool daisy::MidiHandler< Transport >::HasEvents ( ) const
inline

Checks if there are unhandled messages in the queue

Returns
True if there are events to be handled, else false.

◆ Init()

template<typename Transport >
void daisy::MidiHandler< Transport >::Init ( Config  config)
inline

Initializes the MidiHandler

Parameters
configConfiguration structure used to define specifics to the MIDI Handler.

◆ Listen()

template<typename Transport >
void daisy::MidiHandler< Transport >::Listen ( )
inline

Start listening

◆ Parse()

template<typename Transport >
void daisy::MidiHandler< Transport >::Parse ( uint8_t  byte)
inline

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

◆ PopEvent()

template<typename Transport >
MidiEvent daisy::MidiHandler< Transport >::PopEvent ( )
inline

Pops the oldest unhandled MidiEvent from the internal queue

Returns
The event to be handled

◆ RxActive()

template<typename Transport >
bool daisy::MidiHandler< Transport >::RxActive ( )
inline

◆ SendMessage()

template<typename Transport >
void daisy::MidiHandler< Transport >::SendMessage ( uint8_t bytes,
size_t  size 
)
inline

SendMessage Send raw bytes as message

◆ StartReceive()

template<typename Transport >
void daisy::MidiHandler< Transport >::StartReceive ( )
inline

Starts listening on the selected input mode(s). MidiEvent Queue will begin to fill, and can be checked with HasEvents()


The documentation for this class was generated from the following file: