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.
This commit is contained in:
Takashi Iwai 2002-03-12 12:30:17 +00:00
parent 76712fb46b
commit 8336a94225

View file

@ -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)*/;
}
/**