Code

screen_play: added CMD_SELECT_PLAYING
authorJeffrey Middleton <jefromi@gmail.com>
Thu, 23 Apr 2009 22:04:12 +0000 (17:04 -0500)
committerJeffrey Middleton <jefromi@gmail.com>
Fri, 24 Apr 2009 05:09:50 +0000 (00:09 -0500)
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
src/command.h
src/screen_help.c
src/screen_play.c

index 3fb491ca42f3a88d6815c79af81f7831ea0a72d8..3fe825c39fc6be6b0d79f2b4b6c55863949573b3 100644 (file)
@@ -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 */
index 7d6fb1ae0f48dbb095d2179bff7daa717e917200..b3222c5bfc7c86c0092e1d65da0db263a68a09fc 100644 (file)
@@ -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,
index f687d31046ade9ee5a42ec2d60f0b7d796de33f1..467b7b789add6b7465109345a10015d9f376f2e7 100644 (file)
@@ -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 },
index 28d39134625f8a32dbcec75a2926f1223a23e555..4b03c5d3f55637ac88858d4ff63bef8ff9f6be1a 100644 (file)
@@ -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)