mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-14 05:05:43 +01:00
alsamixer: fix display of active/inactive controls
Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
This commit is contained in:
parent
209796937a
commit
cd26f244e7
1 changed files with 11 additions and 0 deletions
|
@ -59,10 +59,21 @@ enum channel_mask {
|
||||||
|
|
||||||
static int elem_callback(snd_mixer_elem_t *elem, unsigned int mask)
|
static int elem_callback(snd_mixer_elem_t *elem, unsigned int mask)
|
||||||
{
|
{
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
if (mask & (SND_CTL_EVENT_MASK_REMOVE |
|
if (mask & (SND_CTL_EVENT_MASK_REMOVE |
|
||||||
SND_CTL_EVENT_MASK_INFO |
|
SND_CTL_EVENT_MASK_INFO |
|
||||||
SND_CTL_EVENT_MASK_VALUE))
|
SND_CTL_EVENT_MASK_VALUE))
|
||||||
controls_changed = TRUE;
|
controls_changed = TRUE;
|
||||||
|
|
||||||
|
if (mask & SND_CTL_EVENT_MASK_INFO)
|
||||||
|
for (i = 0; i < controls_count; ++i)
|
||||||
|
if (controls[i].elem == elem) {
|
||||||
|
controls[i].flags &= ~IS_ACTIVE;
|
||||||
|
if (snd_mixer_selem_is_active(controls[i].elem))
|
||||||
|
controls[i].flags |= IS_ACTIVE;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue