From: Jaroslav Kysela Date: Tue, 22 Jun 1999 13:18:24 +0000 (+0000) Subject: Updates for the control interface... X-Git-Tag: v1.0.3~1464 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=227fe9d226e476c5936c4518b2a1d8537c618e0f;p=alsa-lib.git Updates for the control interface... --- diff --git a/include/control.h b/include/control.h index 338dcb1f..44720cf1 100644 --- a/include/control.h +++ b/include/control.h @@ -38,6 +38,7 @@ int snd_ctl_hw_info(snd_ctl_t *handle, struct snd_ctl_hw_info *info); int snd_ctl_switch_list(snd_ctl_t *handle, snd_switch_list_t * list); int snd_ctl_switch_read(snd_ctl_t *handle, snd_switch_t * sw); int snd_ctl_switch_write(snd_ctl_t *handle, snd_switch_t * sw); +int snd_ctl_hwdep_info(snd_ctl_t *handle, int dev, snd_hwdep_info_t * info); int snd_ctl_pcm_info(snd_ctl_t *handle, int dev, snd_pcm_info_t * info); int snd_ctl_pcm_playback_info(snd_ctl_t *handle, int dev, snd_pcm_playback_info_t * info); int snd_ctl_pcm_capture_info(snd_ctl_t *handle, int dev, snd_pcm_capture_info_t * info); diff --git a/src/Makefile.am b/src/Makefile.am index 0363a6c1..47abbada 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ libasound_la_SOURCES = error.c libasound_la_LIBADD = control/libcontrol.la mixer/libmixer.la pcm/libpcm.la \ rawmidi/librawmidi.la timer/libtimer.la seq/libseq.la \ instr/libinstr.la -libasound_la_LDFLAGS = -version-info 3:1:3 +libasound_la_LDFLAGS = -version-info 4:0:4 control/libcontrol.la: $(MAKE) -C control libcontrol.la diff --git a/src/control/control.c b/src/control/control.c index 452178d8..41139648 100644 --- a/src/control/control.c +++ b/src/control/control.c @@ -29,7 +29,7 @@ #include "asoundlib.h" #define SND_FILE_CONTROL "/dev/snd/controlC%i" -#define SND_CTL_VERSION_MAX SND_PROTOCOL_VERSION( 1, 0, 0 ) +#define SND_CTL_VERSION_MAX SND_PROTOCOL_VERSION(2, 0, 0) struct snd_ctl { int card; @@ -143,6 +143,20 @@ int snd_ctl_switch_write(snd_ctl_t *handle, snd_switch_t *sw) return 0; } +int snd_ctl_hwdep_info(snd_ctl_t *handle, int dev, snd_hwdep_info_t * info) +{ + snd_ctl_t *ctl; + + ctl = handle; + if (!ctl || !info || dev < 0) + return -EINVAL; + if (ioctl(ctl->fd, SND_CTL_IOCTL_HWDEP_DEVICE, &dev) < 0) + return -errno; + if (ioctl(ctl->fd, SND_CTL_IOCTL_HWDEP_INFO, info) < 0) + return -errno; + return 0; +} + int snd_ctl_pcm_info(snd_ctl_t *handle, int dev, snd_pcm_info_t * info) { snd_ctl_t *ctl; diff --git a/test/control.c b/test/control.c index d8a6edd1..afe30028 100644 --- a/test/control.c +++ b/test/control.c @@ -47,6 +47,8 @@ int main(void) printf(" flags - 0x%x\n", pcminfo.flags); printf(" id - '%s'\n", pcminfo.id); printf(" name - '%s'\n", pcminfo.name); + printf(" playback - %i\n", pcminfo.playback); + printf(" capture - %i\n", pcminfo.capture); } for (idx1 = 0; idx1 < info.mixerdevs; idx1++) { printf("MIXER info, device #%i:\n", idx1);