]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Implemented voice_setup
authorAbramo Bagnara <abramo@alsa-project.org>
Sun, 16 Apr 2000 15:38:28 +0000 (15:38 +0000)
committerAbramo Bagnara <abramo@alsa-project.org>
Sun, 16 Apr 2000 15:38:28 +0000 (15:38 +0000)
src/pcm/pcm.c

index 5d85de1ce9e89d5dc8dfd5968f3e23516b682ff4..8f7e1e97c69e042c086bf7dfe4348b4a0bd9fbc0 100644 (file)
@@ -275,6 +275,21 @@ int snd_pcm_channel_setup(snd_pcm_t *pcm, snd_pcm_channel_setup_t * setup)
        return 0;
 }
 
+int snd_pcm_voice_setup(snd_pcm_t *pcm, int channel, snd_pcm_voice_setup_t * setup)
+{
+       int fd;
+       if (!pcm || !setup)
+               return -EINVAL;
+       if (channel < 0 || channel > 1)
+               return -EINVAL;
+       fd = pcm->fd[channel];
+       if (fd < 0)
+               return -EINVAL;
+       if (ioctl(fd, SND_PCM_IOCTL_VOICE_SETUP, setup) < 0)
+               return -errno;
+       return 0;
+}
+
 int snd_pcm_channel_status(snd_pcm_t *pcm, snd_pcm_channel_status_t * status)
 {
        int fd;