mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
Recoded the universal switch interface...
This commit is contained in:
parent
a5b307a711
commit
6e72ca3977
8 changed files with 42 additions and 204 deletions
|
|
@ -127,78 +127,6 @@ int snd_rawmidi_info(void *handle, snd_rawmidi_info_t * info)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int snd_rawmidi_output_switch_list(void *handle, snd_switch_list_t * list)
|
||||
{
|
||||
snd_rawmidi_t *rmidi;
|
||||
|
||||
rmidi = (snd_rawmidi_t *) handle;
|
||||
if (!rmidi || !list)
|
||||
return -EINVAL;
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_OSWITCH_LIST, list) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_rawmidi_output_switch_read(void *handle, snd_switch_t * sw)
|
||||
{
|
||||
snd_rawmidi_t *rmidi;
|
||||
|
||||
rmidi = (snd_rawmidi_t *) handle;
|
||||
if (!rmidi || !sw || sw->name[0] == '\0')
|
||||
return -EINVAL;
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_OSWITCH_READ, sw) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_rawmidi_output_switch_write(void *handle, snd_switch_t * sw)
|
||||
{
|
||||
snd_rawmidi_t *rmidi;
|
||||
|
||||
rmidi = (snd_rawmidi_t *) handle;
|
||||
if (!rmidi || !sw || sw->name[0] == '\0')
|
||||
return -EINVAL;
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_OSWITCH_WRITE, sw) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_rawmidi_input_switch_list(void *handle, snd_switch_list_t * list)
|
||||
{
|
||||
snd_rawmidi_t *rmidi;
|
||||
|
||||
rmidi = (snd_rawmidi_t *) handle;
|
||||
if (!rmidi)
|
||||
return -EINVAL;
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_ISWITCH_LIST, list) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_rawmidi_input_switch_read(void *handle, snd_switch_t * sw)
|
||||
{
|
||||
snd_rawmidi_t *rmidi;
|
||||
|
||||
rmidi = (snd_rawmidi_t *) handle;
|
||||
if (!rmidi || !sw || sw->name[0] == '\0')
|
||||
return -EINVAL;
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_ISWITCH_READ, sw) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_rawmidi_input_switch_write(void *handle, snd_switch_t * sw)
|
||||
{
|
||||
snd_rawmidi_t *rmidi;
|
||||
|
||||
rmidi = (snd_rawmidi_t *) handle;
|
||||
if (!rmidi || !sw || sw->name[0] == '\0')
|
||||
return -EINVAL;
|
||||
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_ISWITCH_WRITE, sw) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_rawmidi_output_params(void *handle, snd_rawmidi_output_params_t * params)
|
||||
{
|
||||
snd_rawmidi_t *rmidi;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue