From 7b0c73832375e5229837c31a32e72a0682e56280 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 2 Dec 2004 17:27:41 +0000 Subject: [PATCH] Change the view toggle behavior Added [F5] key to toggle to "All channels". Back from help/proc screen keeps the old channel view mode. --- alsamixer/alsamixer.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/alsamixer/alsamixer.c b/alsamixer/alsamixer.c index 95edb2a..560988a 100644 --- a/alsamixer/alsamixer.c +++ b/alsamixer/alsamixer.c @@ -180,6 +180,7 @@ static int mixer_needs_resize = 0; static int mixer_minimize = 0; static int mixer_no_lrcorner = 0; static int mixer_view = VIEW_PLAYBACK; +static int mixer_view_saved = VIEW_PLAYBACK; static int mixer_max_x = 0; static int mixer_max_y = 0; static int mixer_ofs_x = 0; @@ -253,12 +254,12 @@ static int mixer_help_xoffs = 0; static int mixer_help_yoffs = 0; static char *mixer_help_text = ( - "\n" " Esc exit alsamixer\n" " F1 show Help screen\n" " F2 show /proc info screen\n" " F3 show Playback controls only\n" " F4 show Capture controls only\n" + " F5 show all controls\n" " Return return to main screen\n" " Space toggle Capture facility\n" " Tab toggle ExactMode\n" @@ -1791,13 +1792,11 @@ mixer_iteration (void) break; case 13: /* Return */ case 10: /* NewLine */ - if (mixer_view == VIEW_CHANNELS) { - mixer_clear (FALSE); - } else { - mixer_view = VIEW_CHANNELS; + if (mixer_view != mixer_view_saved) { + mixer_view = mixer_view_saved; mixer_changed_state=1; mixer_reinit (); - } + } key = 0; break; case 'h': @@ -1816,7 +1815,7 @@ mixer_iteration (void) if (mixer_view == VIEW_PLAYBACK) { mixer_clear (FALSE); } else { - mixer_view = VIEW_PLAYBACK; + mixer_view = mixer_view_saved = VIEW_PLAYBACK; mixer_changed_state=1; mixer_reinit (); } @@ -1826,7 +1825,17 @@ mixer_iteration (void) if (mixer_view == VIEW_CAPTURE) { mixer_clear (FALSE); } else { - mixer_view = VIEW_CAPTURE; + mixer_view = mixer_view_saved = VIEW_CAPTURE; + mixer_changed_state=1; + mixer_reinit (); + } + key = 0; + break; + case KEY_F (5): + if (mixer_view == VIEW_CHANNELS) { + mixer_clear (FALSE); + } else { + mixer_view = mixer_view_saved = VIEW_CHANNELS; mixer_changed_state=1; mixer_reinit (); }