From e4d3e84845d9bb968023745c9ca4ed061c3d0e70 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 11 May 2004 16:58:48 +0000 Subject: [PATCH] show single values for mono volumes. --- alsamixer/alsamixer.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/alsamixer/alsamixer.c b/alsamixer/alsamixer.c index 560d27c..4c0b6f5 100644 --- a/alsamixer/alsamixer.c +++ b/alsamixer/alsamixer.c @@ -836,14 +836,21 @@ mixer_update_cbar (int elem_index) mvaddstr (y, x, " "); if (mixer_type[elem_index] & MIXER_ELEM_HAS_VOLUME) { mixer_dc (DC_TEXT); - sprintf (string, "%ld", vleft); - mvaddstr (y, x + 3 - strlen (string), string); - mixer_dc (DC_CBAR_FRAME); - mvaddch (y, x + 3, '<'); - mvaddch (y, x + 4, '>'); - mixer_dc (DC_TEXT); - sprintf (string, "%ld", vright); - mvaddstr (y, x + 5, string); + if (chn_right == SND_MIXER_SCHN_UNKNOWN) { + /* mono */ + sprintf (string, "%ld", vleft); + mvaddstr (y, x + 4 - strlen (string) / 2, string); + } else { + /* stereo */ + sprintf (string, "%ld", vleft); + mvaddstr (y, x + 3 - strlen (string), string); + mixer_dc (DC_CBAR_FRAME); + mvaddch (y, x + 3, '<'); + mvaddch (y, x + 4, '>'); + mixer_dc (DC_TEXT); + sprintf (string, "%ld", vright); + mvaddstr (y, x + 5, string); + } } y--;