Public Member Functions | List of all members
universal_midi_packets::ToBytestreamDispatcher Class Reference

Parses a stream of 32-bit words representing a sequence of UMP-encoded MIDI messages, converting the messages to MIDI 1.0 bytestream format and passing them to a user-provided callback as they become ready. More...

Public Member Functions

 ToBytestreamDispatcher (int storageSize)
 Initialises the dispatcher. More...
 
void reset ()
 Clears the dispatcher. More...
 
template<typename BytestreamMessageCallback >
void dispatch (const uint32_t *begin, const uint32_t *end, double timestamp, BytestreamMessageCallback &&callback)
 Calls callback with converted bytestream-formatted MidiMessage whenever a new message becomes available. More...
 

Detailed Description

Parses a stream of 32-bit words representing a sequence of UMP-encoded MIDI messages, converting the messages to MIDI 1.0 bytestream format and passing them to a user-provided callback as they become ready.

Constructor & Destructor Documentation

◆ ToBytestreamDispatcher()

universal_midi_packets::ToBytestreamDispatcher::ToBytestreamDispatcher ( int  storageSize)
explicit

Initialises the dispatcher.

storageSize bytes will be allocated to store incomplete messages.

Member Function Documentation

◆ reset()

void universal_midi_packets::ToBytestreamDispatcher::reset ( )

◆ dispatch()

template<typename BytestreamMessageCallback >
void universal_midi_packets::ToBytestreamDispatcher::dispatch ( const uint32_t *  begin,
const uint32_t *  end,
double  timestamp,
BytestreamMessageCallback &&  callback 
)

Calls callback with converted bytestream-formatted MidiMessage whenever a new message becomes available.

Parameters
beginthe first word in a stream of words representing UMP-encoded MIDI packets.
endone-past the last word in a stream of words representing UMP-encoded MIDI packets.
timestampa timestamp to apply to converted messages.
callbacka callback which will be passed a MidiMessage each time a new message becomes ready.

References begin(), universal_midi_packets::Dispatcher::dispatch(), and end().


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