2024-12-01 19:35:24 +00:00
|
|
|
//| Copyright: (C) 2020-2024 Kevin Larke <contact AT larke DOT org>
|
|
|
|
//| License: GNU GPL version 3.0 or above. See the accompanying LICENSE file.
|
2020-03-23 14:41:28 +00:00
|
|
|
#ifndef cwMidiDecls_H
|
|
|
|
#define cwMidiDecls_H
|
|
|
|
|
|
|
|
namespace cw
|
|
|
|
{
|
|
|
|
namespace midi
|
|
|
|
{
|
|
|
|
typedef struct msg_str
|
|
|
|
{
|
|
|
|
time::spec_t timeStamp;
|
2024-02-14 15:56:44 +00:00
|
|
|
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
|
2020-03-23 14:41:28 +00:00
|
|
|
} msg_t;
|
2024-04-06 19:44:43 +00:00
|
|
|
|
2020-03-23 14:41:28 +00:00
|
|
|
typedef struct packet_str
|
|
|
|
{
|
2024-04-06 19:44:43 +00:00
|
|
|
//void* cbArg; // Application supplied reference value
|
2021-01-31 16:08:36 +00:00
|
|
|
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
|
2020-03-23 14:41:28 +00:00
|
|
|
} packet_t;
|
2024-02-14 15:56:44 +00:00
|
|
|
|
2024-04-06 19:44:43 +00:00
|
|
|
typedef void (*cbFunc_t)( void* cbArg, const packet_t* pktArray, unsigned pktCnt );
|
2024-02-14 15:56:44 +00:00
|
|
|
|
2024-04-06 19:44:43 +00:00
|
|
|
typedef struct ch_msg_str
|
|
|
|
{
|
|
|
|
time::spec_t timeStamp;
|
|
|
|
unsigned devIdx; // The device the msg originated from
|
|
|
|
unsigned portIdx; // The port index on the source device
|
|
|
|
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
|
|
|
|
} ch_msg_t;
|
2020-03-23 14:41:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|