control: Add UMP device query support

Add a function to query the next available UMP device via control
interface, just like the existing one for rawmidi.  As the UMP rawmidi
is compatible with the standard rawmidi, no extra helper for the
rawmidi_info is present.  Ditto for the preferred subdevice, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2022-12-25 12:09:51 +01:00
parent f47763d2c1
commit 8bc10c83b1
5 changed files with 26 additions and 0 deletions

View file

@ -1267,6 +1267,20 @@ int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev)
return ctl->ops->rawmidi_prefer_subdevice(ctl, subdev);
}
/**
* \brief Get next UMP device number
* \param ctl CTL handle
* \param device current device on entry and next device on return
* \return 0 on success otherwise a negative error code
*/
int snd_ctl_ump_next_device(snd_ctl_t *ctl, int *device)
{
assert(ctl && device);
if (ctl->ops->ump_next_device)
return ctl->ops->ump_next_device(ctl, device);
return -ENXIO;
}
/**
* \brief Set Power State to given SND_CTL_POWER_* value and do the power management
* \param ctl CTL handle