mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
rawmidi: Extensions for tied device and substream inactive flag
This is the enhancements of rawmidi API for the new feature added in 6.14 kernel: the indication of a tied device and the inactive flag for the selected substream. The new function is added for obtaining the tied device, snd_rawmidi_info_get_tied_device(). And the new bit flag is defined for indicating the inactive substream, SNDRV_RAWMIDI_INFO_STREAM_INACTIVE, which is exposed via snd_rawmidi_info_get_flags(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
e1cf4d3f68
commit
137eca7720
2 changed files with 18 additions and 0 deletions
|
|
@ -639,6 +639,22 @@ unsigned int snd_rawmidi_info_get_subdevices_avail(const snd_rawmidi_info_t *inf
|
|||
return info->subdevices_avail;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief get the tied device number for the given rawmidi device
|
||||
* \param info pointer to a snd_rawmidi_info_t structure
|
||||
* \return the device number for the tied device, or -1 if untied / unknown.
|
||||
*
|
||||
* This function is useful for UMP rawmidi devices where each of them may
|
||||
* have the mirroring legacy rawmidi device. Those are shown as "tied".
|
||||
*/
|
||||
int snd_rawmidi_info_get_tied_device(const snd_rawmidi_info_t *info)
|
||||
{
|
||||
assert(info);
|
||||
if (info->tied_device > 0)
|
||||
return info->tied_device - 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief set rawmidi device number
|
||||
* \param info pointer to a snd_rawmidi_info_t structure
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue