libcw/cwMidiDecls.h
kevin 742fc05e81 Renamed cwMidiPort.h/cpp to cwMidiDevice.h/cpp.
cwMidiDecls.h midi::msg_t now breaks out MIDI channel from status and has a new user 'uid' field to link the msg to an external entity.
Renamed midi::packet_t. cbDataPtr to cbArg.
midi::packet_t.cbFunc_t is now included in cwMidiDecls.h.
Other files effected: cwIo.cpp,cwIoAudioMidi.cpp,cwIoPresetSelApp.cpp
2024-02-14 11:15:02 -05:00

33 lines
1.0 KiB
C++

#ifndef cwMidiDecls_H
#define cwMidiDecls_H
namespace cw
{
namespace midi
{
typedef struct msg_str
{
time::spec_t timeStamp;
unsigned uid; // application specified id
uint8_t ch; // midi channel
uint8_t status; // midi status byte (channel has been removed)
uint8_t d0; // midi data byte 0
uint8_t d1; // midi data byte 1
} msg_t;
typedef struct packet_str
{
void* cbArg; // Application supplied reference value
unsigned devIdx; // The device the msg originated from
unsigned portIdx; // The port index on the source device
msg_t* msgArray; // Pointer to an array of 'msgCnt' mdMsg records or NULL if sysExMsg is non-NULL
uint8_t* sysExMsg; // Pointer to a sys-ex msg or NULL if msgArray is non-NULL (see note below)
unsigned msgCnt; // Count of mdMsg records or sys-ex bytes
} packet_t;
typedef void (*cbFunc_t)( const packet_t* pktArray, unsigned pktCnt );
}
}
#endif