Code

Make it possible to switch to the song viewer from anywhere.
authorPatrick Hallen <patrick.hallen@rwth-aachen.de>
Fri, 13 Mar 2009 17:11:20 +0000 (18:11 +0100)
committerPatrick Hallen <patrick.hallen@rwth-aachen.de>
Fri, 13 Mar 2009 17:11:20 +0000 (18:11 +0100)
src/command.c
src/command.h
src/screen.c
src/screen_browser.c
src/screen_help.c
src/screen_list.h
src/screen_lyrics.c
src/screen_play.c

index add572265ef0773e87cd6436d2fe92ee40cb19ab..53baf2688261c4543871e3f075b89120977205aa 100644 (file)
@@ -160,11 +160,6 @@ static command_definition_t cmds[] = {
        { { '"', 0, 0 }, 0, CMD_GO_PARENT_DIRECTORY, "go-parent-directory",
          N_("Go to parent directory") },
 
-#ifdef ENABLE_SONG_SCREEN
-       { { 'i', 0, 0 }, 0, CMD_VIEW, "view",
-         N_("View the song") },
-#endif
-
        { { 'G', 0, 0 }, 0, CMD_LOCATE, "locate",
          N_("Locate song in browser") },
 
@@ -224,7 +219,10 @@ static command_definition_t cmds[] = {
        { {'m', 0, 0 }, 0, CMD_SEARCH_MODE, "search-mode",
          N_("Change search mode") },
 #endif
-
+#ifdef ENABLE_SONG_SCREEN
+       { { 'i', 0, 0 }, 0, CMD_SCREEN_SONG, "view",
+         N_("View the selected and the currently playing song") },
+#endif
 #ifdef ENABLE_LYRICS_SCREEN
        { {'7', F7, 0 }, 0, CMD_SCREEN_LYRICS, "screen-lyrics",
          N_("Lyrics screen") },
index a7145822d1a8cff7018759c482a9e03b0c4a8326..b3b98c896a176cdd606e0a497625b434cc6ebf6e 100644 (file)
@@ -87,6 +87,7 @@ typedef enum {
        CMD_SCREEN_FILE,
        CMD_SCREEN_ARTIST,
        CMD_SCREEN_SEARCH,
+       CMD_SCREEN_SONG,
        CMD_SCREEN_KEYDEF,
        CMD_SCREEN_HELP,
        CMD_SCREEN_LYRICS,
@@ -95,7 +96,6 @@ typedef enum {
        CMD_INTERRUPT,
        CMD_GO_ROOT_DIRECTORY,
        CMD_GO_PARENT_DIRECTORY,
-       CMD_VIEW,
        CMD_LOCATE,
        CMD_QUIT
 } command_t;
index 5c9204237de4d3affb1fdfd3b54ad267fe91311f..57b22cf8a784b4c1a0253690c7c6e6a67647a971 100644 (file)
@@ -843,6 +843,11 @@ screen_cmd(mpdclient_t *c, command_t cmd)
                screen_switch(&screen_artist, c);
                break;
 #endif
+#ifdef ENABLE_SONG_SCREEN
+       case CMD_SCREEN_SONG:
+               screen_switch(&screen_song, c);
+               break;
+#endif
 #ifdef ENABLE_KEYDEF_SCREEN
        case CMD_SCREEN_KEYDEF:
                screen_switch(&screen_keydef, c);
index 325b4f45e779c37d37ea1078af1f3f8ed09d16b3..b118a7ec3c7e457a2350e60583beaacaff04ea58 100644 (file)
@@ -479,7 +479,7 @@ browser_cmd(struct screen_browser *browser,
 #endif
 
 #ifdef ENABLE_SONG_SCREEN
-       case CMD_VIEW:
+       case CMD_SCREEN_SONG:
                entry = browser_get_selected(browser);
                if (entry == NULL || entry->entity == NULL ||
                    entry->entity->type != MPD_INFO_ENTITY_TYPE_SONG)
index f4f07ffa026607b9db973dd433fbab61dc308aaa..4283ca350007d1bf99fee8f2d63dc17cecedbb0d 100644 (file)
@@ -100,7 +100,7 @@ static help_text_row_t help_text[] = {
        { 0, CMD_LIST_JUMP, NULL },
        { 0, CMD_TOGGLE_FIND_WRAP, NULL },
        { 0, CMD_LOCATE, NULL },
-       { 0, CMD_VIEW, NULL },
+       { 0, CMD_SCREEN_SONG, NULL },
        { 0, CMD_NONE, NULL },
        { 0, CMD_QUIT, NULL },
 
index 665e41ed721d07096690b86695dea32dbdbe9beb..2f9cffdc4275f99c4ba959a22e749e0e540da11e 100644 (file)
@@ -37,6 +37,9 @@ extern const struct screen_functions screen_help;
 #ifdef ENABLE_SEARCH_SCREEN
 extern const struct screen_functions screen_search;
 #endif
+#ifdef ENABLE_SONG_SCREEN
+extern const struct screen_functions screen_song;
+#endif
 #ifdef ENABLE_KEYDEF_SCREEN
 extern const struct screen_functions screen_keydef;
 #endif
index b9896f11bebb4a5a3d4f4dd44176ec58f97cd33f..1cb392fb86e4419f5e9de31f24a9f4e6b784e4ff 100644 (file)
@@ -248,7 +248,7 @@ lyrics_cmd(mpdclient_t *c, command_t cmd)
                return true;
 
 #ifdef ENABLE_SONG_SCREEN
-       case CMD_VIEW:
+       case CMD_SCREEN_SONG:
                if (current.song != NULL) {
                        screen_song_switch(c, current.song);
                        return true;
index ceb37c4918dcb642eaafc1e61177d446dc2c880c..4201fb81a2e7b26b6ecf53f187b5e14ee4a37ee1 100644 (file)
@@ -702,7 +702,7 @@ play_cmd(mpdclient_t *c, command_t cmd)
 #endif
 
 #ifdef ENABLE_SONG_SCREEN
-       case CMD_VIEW:
+       case CMD_SCREEN_SONG:
                if (lw->selected < playlist_length(&c->playlist)) {
                        screen_song_switch(c, playlist_get(&c->playlist, lw->selected));
                        return true;