Recoded the universal switch interface...

This commit is contained in:
Jaroslav Kysela 1999-05-04 19:21:28 +00:00
parent a5b307a711
commit 6e72ca3977
8 changed files with 42 additions and 204 deletions

View file

@ -151,78 +151,6 @@ int snd_pcm_record_info(void *handle, snd_pcm_record_info_t * info)
return 0;
}
int snd_pcm_playback_switch_list(void *handle, snd_switch_list_t * list)
{
snd_pcm_t *pcm;
pcm = (snd_pcm_t *) handle;
if (!pcm || !list)
return -EINVAL;
if (ioctl(pcm->fd, SND_PCM_IOCTL_PSWITCH_LIST, &list) < 0)
return -errno;
return 0;
}
int snd_pcm_playback_switch_read(void *handle, snd_switch_t * sw)
{
snd_pcm_t *pcm;
pcm = (snd_pcm_t *) handle;
if (!pcm || !sw || sw->name[0] == '\0')
return -EINVAL;
if (ioctl(pcm->fd, SND_PCM_IOCTL_PSWITCH_READ, sw) < 0)
return -errno;
return 0;
}
int snd_pcm_playback_switch_write(void *handle, snd_switch_t * sw)
{
snd_pcm_t *pcm;
pcm = (snd_pcm_t *) handle;
if (!pcm || !sw || sw->name[0] == '\0')
return -EINVAL;
if (ioctl(pcm->fd, SND_PCM_IOCTL_PSWITCH_WRITE, sw) < 0)
return -errno;
return 0;
}
int snd_pcm_record_switch_list(void *handle, snd_switch_list_t * list)
{
snd_pcm_t *pcm;
pcm = (snd_pcm_t *) handle;
if (!pcm || !list)
return -EINVAL;
if (ioctl(pcm->fd, SND_PCM_IOCTL_RSWITCH_LIST, list) < 0)
return -errno;
return 0;
}
int snd_pcm_record_switch_read(void *handle, snd_switch_t * sw)
{
snd_pcm_t *pcm;
pcm = (snd_pcm_t *) handle;
if (!pcm || !sw || sw->name[0] == '\0')
return -EINVAL;
if (ioctl(pcm->fd, SND_PCM_IOCTL_RSWITCH_READ, sw) < 0)
return -errno;
return 0;
}
int snd_pcm_record_switch_write(void *handle, snd_switch_t * sw)
{
snd_pcm_t *pcm;
pcm = (snd_pcm_t *) handle;
if (!pcm || !sw || sw->name[0] == '\0')
return -EINVAL;
if (ioctl(pcm->fd, SND_PCM_IOCTL_RSWITCH_WRITE, sw) < 0)
return -errno;
return 0;
}
int snd_pcm_playback_format(void *handle, snd_pcm_format_t * format)
{
snd_pcm_t *pcm;