diff options
Diffstat (limited to '')
-rw-r--r-- | src/screen_lyrics.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index dbfe4ea6f..83bffdf8d 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -38,6 +38,8 @@ static list_window_t *lw = NULL; +static const struct mpd_song *next_song; + static struct { const struct mpd_song *song; @@ -256,8 +258,13 @@ lyrics_exit(void) static void lyrics_open(mpd_unused screen_t *screen, mpdclient_t *c) { - if (c->song != NULL && c->song != current.song) - screen_lyrics_load(c->song); + if (next_song == NULL) + next_song = c->song; + + if (next_song != NULL && next_song != current.song) + screen_lyrics_load(next_song); + + next_song = NULL; } @@ -334,3 +341,12 @@ const struct screen_functions screen_lyrics = { .cmd = lyrics_cmd, .get_title = lyrics_title, }; + +void +screen_lyrics_switch(struct mpdclient *c, const struct mpd_song *song) +{ + assert(song != NULL); + + next_song = song; + screen_switch(&screen_lyrics, c); +} |