mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
ump: Add helpers for handling SysEx data
Yet a few more helpers for handling SysEx data with UMP packets. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
040356ecf0
commit
e80ee6ae75
2 changed files with 113 additions and 0 deletions
|
|
@ -500,6 +500,14 @@ enum {
|
|||
SND_UMP_MSG_RESET = 0xff,
|
||||
};
|
||||
|
||||
/** MIDI 2.0 SysEx / Data Status; same values for both 7-bit and 8-bit SysEx */
|
||||
enum {
|
||||
SND_UMP_SYSEX_STATUS_SINGLE = 0,
|
||||
SND_UMP_SYSEX_STATUS_START = 1,
|
||||
SND_UMP_SYSEX_STATUS_CONTINUE = 2,
|
||||
SND_UMP_SYSEX_STATUS_END = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief get UMP status (4bit) from 32bit UMP message header
|
||||
*/
|
||||
|
|
@ -564,6 +572,25 @@ static inline uint8_t snd_ump_msg_group(const uint32_t *ump)
|
|||
return snd_ump_msg_hdr_group(*ump);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief get UMP sysex message status
|
||||
*/
|
||||
static inline uint8_t snd_ump_sysex_msg_status(const uint32_t *ump)
|
||||
{
|
||||
return (*ump >> 20) & 0xf;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief get UMP sysex message length
|
||||
*/
|
||||
static inline uint8_t snd_ump_sysex_msg_length(const uint32_t *ump)
|
||||
{
|
||||
return (*ump >> 16) & 0xf;
|
||||
}
|
||||
|
||||
int snd_ump_msg_sysex_expand(const uint32_t *ump, uint8_t *buf, size_t maxlen,
|
||||
size_t *filled);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue