From aa657ad4b29137a46be23d1ff6694ae2b7b54baf Mon Sep 17 00:00:00 2001 From: Jeffrey Middleton Date: Thu, 23 Apr 2009 17:04:12 -0500 Subject: [PATCH] screen_play: added CMD_SELECT_PLAYING This command immediately selects (but doesn't center) the currently playing song. It is mapped by default to 'l' - there aren't many single characters left, and this one is at least similar to ctrl-l, which centers the currently playing song. --- src/command.c | 2 ++ src/command.h | 1 + src/screen_help.c | 1 + src/screen_play.c | 3 +++ 4 files changed, 7 insertions(+) diff --git a/src/command.c b/src/command.c index 3fb491c..3fe825c 100644 --- a/src/command.c +++ b/src/command.c @@ -100,6 +100,8 @@ static command_definition_t cmds[] = { N_("Scroll up half a screen") }, { { 'B', 0, 0 }, 0, CMD_LIST_SCROLL_UP_HALF, "scroll-up-half", N_("Scroll down half a screen") }, + { { 'l', 0, 0 }, 0, CMD_SELECT_PLAYING, "select-playing", + N_("Select currently playing song") }, /* basic screens */ diff --git a/src/command.h b/src/command.h index 7d6fb1a..b3222c5 100644 --- a/src/command.h +++ b/src/command.h @@ -58,6 +58,7 @@ typedef enum { CMD_SAVE_PLAYLIST, CMD_TOGGLE_FIND_WRAP, CMD_TOGGLE_AUTOCENTER, + CMD_SELECT_PLAYING, CMD_SEARCH_MODE, CMD_LIST_PREVIOUS, CMD_LIST_NEXT, diff --git a/src/screen_help.c b/src/screen_help.c index f687d31..467b7b7 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -120,6 +120,7 @@ static help_text_row_t help_text[] = { { 0, CMD_ADD, NULL }, { 0, CMD_SAVE_PLAYLIST, NULL }, { 0, CMD_SCREEN_UPDATE, N_("Center") }, + { 0, CMD_SELECT_PLAYING, NULL }, { 0, CMD_TOGGLE_AUTOCENTER, NULL }, { 0, CMD_NONE, NULL }, diff --git a/src/screen_play.c b/src/screen_play.c index 28d3913..4b03c5d 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -630,6 +630,9 @@ play_cmd(mpdclient_t *c, command_t cmd) center_playing_item(c, prev_cmd == CMD_SCREEN_UPDATE); playlist_repaint(); return false; + case CMD_SELECT_PLAYING: + list_window_set_selected(lw, playlist_get_index(c, c->song)); + return true; case CMD_SHUFFLE: { if(!lw->range_selection) -- 2.30.2