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

Translates a series of MIDI 1 Universal MIDI Packets to corresponding MIDI 2 packets. More...

Public Member Functions

 Midi1ToMidi2DefaultTranslator ()=default
 
template<typename PacketCallback >
void dispatch (const View &v, PacketCallback &&callback)
 Converts MIDI 1 Universal MIDI Packets to corresponding MIDI 2 packets, calling callback with each converted packet. More...
 
void reset ()
 

Detailed Description

Translates a series of MIDI 1 Universal MIDI Packets to corresponding MIDI 2 packets.

Constructor & Destructor Documentation

◆ Midi1ToMidi2DefaultTranslator()

universal_midi_packets::Midi1ToMidi2DefaultTranslator::Midi1ToMidi2DefaultTranslator ( )
default

Member Function Documentation

◆ dispatch()

template<typename PacketCallback >
void universal_midi_packets::Midi1ToMidi2DefaultTranslator::dispatch ( const View v,
PacketCallback &&  callback 
)

Converts MIDI 1 Universal MIDI Packets to corresponding MIDI 2 packets, calling callback with each converted packet.

In some cases (such as RPN/NRPN messages) multiple MIDI 1 packets will convert to a single MIDI 2 packet. In these cases, the translator will accumulate the full message internally, and send a single callback with the completed message, once all the individual MIDI 1 packets have been processed.

References universal_midi_packets::Packet< numWords >::data(), universal_midi_packets::Utils::getGroup(), universal_midi_packets::Utils::getMessageType(), universal_midi_packets::Utils::getStatus(), gl::v, and gl::x2.

Referenced by universal_midi_packets::ToUMP2Converter::convert().

◆ reset()

void universal_midi_packets::Midi1ToMidi2DefaultTranslator::reset ( )

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