diff options
author | Jaroslav Kysela <perex@perex.cz> | 1998-11-29 16:30:35 +0000 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 1998-11-29 16:30:35 +0000 |
commit | e8d923761ff6a355a8683e90a7bb9da2fbd8c510 (patch) | |
tree | 2c6c75c7b8c663e73f0d27497a676286cdc36e1a | |
parent | 713c391e47b20e744f02271af66bf18e0286099f (diff) |
Added record channel operations.
-rw-r--r-- | include/mixer.h | 2 | ||||
-rw-r--r-- | src/mixer/mixer.c | 26 |
2 files changed, 28 insertions, 0 deletions
diff --git a/include/mixer.h b/include/mixer.h index 2068be47..9de2b7af 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -26,6 +26,8 @@ int snd_mixer_channel(void *handle, const char *channel_id); int snd_mixer_channel_info(void *handle, int channel, snd_mixer_channel_info_t * info); int snd_mixer_channel_read(void *handle, int channel, snd_mixer_channel_t * data); int snd_mixer_channel_write(void *handle, int channel, snd_mixer_channel_t * data); +int snd_mixer_channel_record_read(void *handle, int channel, snd_mixer_channel_t * data); +int snd_mixer_channel_record_write(void *handle, int channel, snd_mixer_channel_t * data); int snd_mixer_switches(void *handle); int snd_mixer_switch_read(void *handle, int switchn, snd_mixer_switch_t * data); int snd_mixer_switch_write(void *handle, int switchn, snd_mixer_switch_t * data); diff --git a/src/mixer/mixer.c b/src/mixer/mixer.c index 66f84a09..b48171bf 100644 --- a/src/mixer/mixer.c +++ b/src/mixer/mixer.c @@ -190,6 +190,32 @@ int snd_mixer_channel_write(void *handle, int channel, snd_mixer_channel_t * dat return 0; } +int snd_mixer_channel_record_read(void *handle, int channel, snd_mixer_channel_t * data) +{ + snd_mixer_t *mixer; + + mixer = (snd_mixer_t *) handle; + if (!mixer) + return -EINVAL; + data->channel = channel; + if (ioctl(mixer->fd, SND_MIXER_IOCTL_CHANNEL_RREAD, data) < 0) + return -errno; + return 0; +} + +int snd_mixer_channel_record_write(void *handle, int channel, snd_mixer_channel_t * data) +{ + snd_mixer_t *mixer; + + mixer = (snd_mixer_t *) handle; + if (!mixer) + return -EINVAL; + data->channel = channel; + if (ioctl(mixer->fd, SND_MIXER_IOCTL_CHANNEL_RWRITE, data) < 0) + return -errno; + return 0; +} + int snd_mixer_switches(void *handle) { snd_mixer_t *mixer; |