From: Takashi Iwai Date: Tue, 12 Mar 2002 12:30:17 +0000 (+0000) Subject: fixed handling of capture switch / volume: X-Git-Tag: v1.0.3~454 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=8336a94225318f7ae492f17b330bdfbc4e48834f;p=alsa-lib.git fixed handling of capture switch / volume: "Capture Switch" and "Capture Volume" controls are handled capture switch and volume without playback capabilities. capture switch and volume capabilities are not set on global switches and volumes such as Bass and Treble. only playback switch/volume is set. --- diff --git a/src/mixer/simple.c b/src/mixer/simple.c index dd103bcb..4a045fc3 100644 --- a/src/mixer/simple.c +++ b/src/mixer/simple.c @@ -936,6 +936,11 @@ static int simple_event_add(snd_mixer_class_t *class, snd_hctl_elem_t *helem) len = sizeof(ename) - 1; memcpy(ename, name, len); ename[len] = 0; + /* exception: Capture Volume and Capture Switch */ + if (type == CTL_GLOBAL_VOLUME && !strcmp(ename, "Capture")) + type = CTL_CAPTURE_VOLUME; + else if (type == CTL_GLOBAL_SWITCH && !strcmp(ename, "Capture")) + type = CTL_CAPTURE_SWITCH; return simple_add1(class, ename, helem, type, 0); } } @@ -1562,7 +1567,7 @@ int snd_mixer_selem_has_capture_volume(snd_mixer_elem_t *elem) assert(elem); assert(elem->type == SND_MIXER_ELEM_SIMPLE); s = elem->private_data; - return !!(s->caps & CAP_CVOLUME) || !!(s->caps & CAP_GVOLUME); + return !!(s->caps & CAP_CVOLUME) /*|| !!(s->caps & CAP_GVOLUME)*/; } /** @@ -1590,7 +1595,7 @@ int snd_mixer_selem_has_capture_switch(snd_mixer_elem_t *elem) assert(elem); assert(elem->type == SND_MIXER_ELEM_SIMPLE); s = elem->private_data; - return !!(s->caps & CAP_CSWITCH) || !!(s->caps & CAP_GSWITCH); + return !!(s->caps & CAP_CSWITCH) /*|| !!(s->caps & CAP_GSWITCH)*/; } /**