diff options
author | Raymond Yau <superquad.vortex2@gmail.com> | 2011-02-28 15:36:36 +0100 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2011-02-28 15:36:36 +0100 |
commit | cd26f244e7f2648a63411741552c658ca67334e9 (patch) | |
tree | 6b78da2c05c63954527b8dc2b0d0936a8351afb5 /alsamixer | |
parent | 209796937a0cea3977bf991e0af54a987b73effd (diff) |
alsamixer: fix display of active/inactive controls
Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'alsamixer')
-rw-r--r-- | alsamixer/mixer_widget.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/alsamixer/mixer_widget.c b/alsamixer/mixer_widget.c index fb352d3..caaf777 100644 --- a/alsamixer/mixer_widget.c +++ b/alsamixer/mixer_widget.c @@ -59,10 +59,21 @@ enum channel_mask { static int elem_callback(snd_mixer_elem_t *elem, unsigned int mask) { + unsigned int i; + if (mask & (SND_CTL_EVENT_MASK_REMOVE | SND_CTL_EVENT_MASK_INFO | SND_CTL_EVENT_MASK_VALUE)) 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; } |