diff options
author | Max Kellermann <max@duempel.org> | 2008-10-02 15:20:19 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-02 15:20:19 +0200 |
commit | b1a8ff5269e42088b1530ccacb52a55b60754578 (patch) | |
tree | fcac2d8606a6cd2d456160c5d6bcbae1ed8dd6de /src/screen_browser.c | |
parent | a220d744b2c2ba89c9037caae055247953b72ac9 (diff) | |
download | mpd-b1a8ff5269e42088b1530ccacb52a55b60754578.tar.gz mpd-b1a8ff5269e42088b1530ccacb52a55b60754578.tar.xz mpd-b1a8ff5269e42088b1530ccacb52a55b60754578.zip |
screen_lyrics: add screen_lyrics_switch()
screen_lyrics_switch() opens the lyrics screen and displays the lyrics
of the specified song. This way, the user may view the lyrics of any
song in the database browser.
Diffstat (limited to 'src/screen_browser.c')
-rw-r--r-- | src/screen_browser.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/screen_browser.c b/src/screen_browser.c index d7dea635e..694987fae 100644 --- a/src/screen_browser.c +++ b/src/screen_browser.c @@ -455,6 +455,8 @@ bool browser_cmd(struct screen_browser *browser, struct screen *screen, struct mpdclient *c, command_t cmd) { + struct filelist_entry *entry; + switch (cmd) { case CMD_PLAY: browser_handle_enter(browser, c); @@ -494,6 +496,20 @@ browser_cmd(struct screen_browser *browser, struct screen *screen, browser_handle_mouse_event(browser, c); return true; +#ifdef ENABLE_LYRICS_SCREEN + case CMD_SCREEN_LYRICS: + entry = browser_get_selected(browser); + if (entry == NULL) + return false; + + if (entry->entity == NULL || + entry->entity->type != MPD_INFO_ENTITY_TYPE_SONG) + return true; + + screen_lyrics_switch(c, entry->entity->info.song); + return true; +#endif + default: break; } |