mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-26 01:40:07 -05:00
ump: Add initial support
This patch adds the initial support for UMP rawmidi access. It's merely the wrapper for the standard rawmidi to access to the UMP rawmidi device. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
6627953de0
commit
f47763d2c1
10 changed files with 769 additions and 4 deletions
|
|
@ -35,6 +35,7 @@ const char *_snd_module_rawmidi_hw = "";
|
|||
#endif
|
||||
|
||||
#define SNDRV_FILE_RAWMIDI ALSA_DEVICE_DIRECTORY "midiC%iD%i"
|
||||
#define SNDRV_FILE_UMP_RAWMIDI ALSA_DEVICE_DIRECTORY "umpC%iD%i"
|
||||
#define SNDRV_RAWMIDI_VERSION_MAX SNDRV_PROTOCOL_VERSION(2, 0, 0)
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
|
|
@ -321,8 +322,12 @@ int snd_rawmidi_hw_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
|
|||
snd_rawmidi_t *rmidi;
|
||||
snd_rawmidi_hw_t *hw = NULL;
|
||||
snd_rawmidi_info_t info;
|
||||
int is_ump;
|
||||
int fmode;
|
||||
|
||||
is_ump = !!(mode & _SND_RAWMIDI_OPEN_UMP);
|
||||
mode &= ~_SND_RAWMIDI_OPEN_UMP;
|
||||
|
||||
if (inputp)
|
||||
*inputp = NULL;
|
||||
if (outputp)
|
||||
|
|
@ -332,7 +337,10 @@ int snd_rawmidi_hw_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
|
|||
|
||||
if ((ret = snd_ctl_hw_open(&ctl, NULL, card, 0)) < 0)
|
||||
return ret;
|
||||
sprintf(filename, SNDRV_FILE_RAWMIDI, card, device);
|
||||
if (is_ump)
|
||||
sprintf(filename, SNDRV_FILE_UMP_RAWMIDI, card, device);
|
||||
else
|
||||
sprintf(filename, SNDRV_FILE_RAWMIDI, card, device);
|
||||
|
||||
__again:
|
||||
if (attempt++ > 3) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue