]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Updates for the control interface...
authorJaroslav Kysela <perex@perex.cz>
Tue, 22 Jun 1999 13:18:24 +0000 (13:18 +0000)
committerJaroslav Kysela <perex@perex.cz>
Tue, 22 Jun 1999 13:18:24 +0000 (13:18 +0000)
include/control.h
src/Makefile.am
src/control/control.c
test/control.c

index 338dcb1f594e312760d7eaed754f9bd414c716b9..44720cf16d56514085e5ff7ae728647aa4f2de7e 100644 (file)
@@ -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);
index 0363a6c1e00b797ddc3fde85f1f0b84e0876f556..47abbada1880d2e8b21d85a0c3d4f8e34237192f 100644 (file)
@@ -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
index 452178d8799096d5fcc3162c70d9f1e3f8c7538e..41139648ddc8d247bd830e5fa38399ff206d55bd 100644 (file)
@@ -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;
index d8a6edd1ac2f9120ad1fe5ecd0ad91c7900b2a69..afe300289d18b02b3ef945ea653fab8e80000e74 100644 (file)
@@ -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);