summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 607bf2d)
raw | patch | inline | side by side (parent: 607bf2d)
author | Jeffrey Middleton <jefromi@gmail.com> | |
Thu, 5 Mar 2009 23:06:42 +0000 (17:06 -0600) | ||
committer | Jeffrey Middleton <jefromi@gmail.com> | |
Thu, 5 Mar 2009 19:17:10 +0000 (13:17 -0600) |
Screen swap command toggles to the previous (most recently used) screen.
Particularly useful to return from lyrics/info screen.
Particularly useful to return from lyrics/info screen.
src/command.c | patch | blob | history | |
src/command.h | patch | blob | history | |
src/screen.c | patch | blob | history |
diff --git a/src/command.c b/src/command.c
index 809f449f07be4c0da30e60e5fb3de6626391c8a3..3c8a405011dc3f28289fb4ca787142b641cac175 100644 (file)
--- a/src/command.c
+++ b/src/command.c
N_("Next screen") },
{ { STAB, 0, 0 }, 0, CMD_SCREEN_PREVIOUS, "screen-prev",
N_("Previous screen") },
+ { { '~', 0, 0 }, 0, CMD_SCREEN_SWAP, "screen-swap",
+ N_("Swap to most recent screen") },
/* find */
diff --git a/src/command.h b/src/command.h
index 3adc3d2f758e0925511ca1bdbe8f75ea1e5fe2af..a7145822d1a8cff7018759c482a9e03b0c4a8326 100644 (file)
--- a/src/command.h
+++ b/src/command.h
CMD_SCREEN_UPDATE,
CMD_SCREEN_PREVIOUS,
CMD_SCREEN_NEXT,
+ CMD_SCREEN_SWAP,
CMD_SCREEN_PLAY,
CMD_SCREEN_FILE,
CMD_SCREEN_ARTIST,
diff --git a/src/screen.c b/src/screen.c
index 924cf4bd8149be56272366f0cdb9fc13734c081b..b53fcf46694f52daa7931f1fc989a9f72d543e99 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
struct screen screen;
static const struct screen_functions *mode_fn = &screen_playlist;
+static const struct screen_functions *mode_fn_prev = &screen_playlist;
static int seek_id = -1;
static int seek_target_time = 0;
if (sf == mode_fn)
return;
+ mode_fn_prev = mode_fn;
+
/* close the old mode */
if (mode_fn->close != NULL)
mode_fn->close();
case CMD_SCREEN_OUTPUTS:
screen_switch(&screen_outputs, c);
break;
+ case CMD_SCREEN_SWAP:
+ screen_switch(mode_fn_prev, c);
+ break;
#endif
+
default:
break;
}