dxd - dynax driver framework  2675
cross platform open source driver development framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dx::usb::midi< buffer_t > Struct Template Reference

USB MIDI packetizer. More...

#include <dx_usb_audio.h>

+ Inheritance diagram for dx::usb::midi< buffer_t >:
+ Collaboration diagram for dx::usb::midi< buffer_t >:

Classes

union  msg
 USB MIDI endpoint element types: defining the element size for a single USB MIDI pipe request. More...
 

Public Member Functions

int decode (uint64_t &rx, union msg &msg, unsigned char cable)
 USB MIDI msg word to OS MIDI stream format decoder. More...
 
bool encode (const unsigned char *os_midi_package, int length, unsigned char cable)
 OS MIDI stream to USB MIDI msg word format encoder. More...
 

Detailed Description

template<class buffer_t = dx::circular>
struct dx::usb::midi< buffer_t >

USB MIDI packetizer.

Member Function Documentation

template<class buffer_t = dx::circular>
int dx::usb::midi< buffer_t >::decode ( uint64_t rx,
union msg msg,
unsigned char  cable 
)
inline

USB MIDI msg word to OS MIDI stream format decoder.

Pops a corresponding MIDI msg from the backing store

filters MIDI data only for this cable number and ignores: CIN misc function, future use & cable events,

generates event size out of USB-MIDI CIN (code index) classification look-up table,

Parameters
cableUSB MIDI cable number
template<class buffer_t = dx::circular>
bool dx::usb::midi< buffer_t >::encode ( const unsigned char *  os_midi_package,
int  length,
unsigned char  cable 
)
inline

OS MIDI stream to USB MIDI msg word format encoder.

Encodes USB midi message from OS MIDI package and pushes it to USB MIDI backingstore buffer. It does not signal the buffer though so encode can be called for multiple MIDI packages and then manually signalled together. Although generally unusual handles SYSEX midi and any combination of general MIDI and SYSEX in the same OS package.

checks OS MIDI msg type validy,

handles SYSEX data

Todo:
cleanup issue with stl not available in kernel:

checks for sysex termination prior end of os_midi_stream

checks if USB SYSEX msg fits and pushes msg to the backingstore without signalization.

handles general USB MIDI messages

computes USB MIDI msg nibbles,

checks OS MIDI msg size,

selects MIDI cable number and synthesize USB MIDI msg word,

checks if USB MIDI msg fits and pushes msg to the backingstore without signalization.

Parameters
os_midi_packageOS MIDI package
lengthlength of the OS MIDI package
cableUSB MIDI cable number

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

(c) copyright 2009 dynamic acoustics e.U. generated on Tue Dec 4 2018

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.