Code

screen_lyrics: handle the spacebar
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Sat, 24 Apr 2010 09:13:19 +0000 (10:13 +0100)
committerMax Kellermann <max@duempel.org>
Sun, 25 Apr 2010 18:23:10 +0000 (20:23 +0200)
screen_help says that the lyrics can be reloaded using the spacebar
(CMD_SELECT). This patch implements the documented behavior.

src/screen_lyrics.c

index 152b38d30dd28311a010222c2ab21be0dd2097ef..7f5d47c8f638a0ca40dfdb6702d7f52a514782e3 100644 (file)
@@ -321,6 +321,14 @@ lyrics_cmd(struct mpdclient *c, command_t cmd)
                        screen_text_repaint(&text);
                }
                return true;
+       case CMD_SELECT:
+               if (current.loader == NULL && current.artist != NULL &&
+                   current.title != NULL) {
+                       current.loader = lyrics_load(current.artist, current.title,
+                                                    screen_lyrics_callback, NULL);
+                       screen_text_repaint(&text);
+               }
+               return true;
 
 #ifdef ENABLE_SONG_SCREEN
        case CMD_SCREEN_SONG: