diff --git a/src/screen_song.c b/src/screen_song.c
index cf7fd606b394b4ed50364243e054aa8b6b553e60..be8a7c02a7b377b624dac3bf034ffabb240fb588 100644 (file)
--- a/src/screen_song.c
+++ b/src/screen_song.c
*
*/
-#include <sys/stat.h>
#include "i18n.h"
-#include "options.h"
-#include "mpdclient.h"
-#include "command.h"
#include "screen.h"
#include "screen_utils.h"
-#include "strfsong.h"
#include "charset.h"
static list_window_t *lw;
-struct {
+static struct {
struct mpd_song *song;
GPtrArray *lines;
} current;
g_free(g_ptr_array_index(current.lines, i));
g_ptr_array_set_size(current.lines, 0);
+
+ if (current.song != NULL) {
+ mpd_freeSong(current.song);
+ current.song = NULL;
+ }
}
static void
}
static const char *
-screen_song_list_callback(unsigned idx, G_GNUC_UNUSED int *highlight,
+screen_song_list_callback(unsigned idx, G_GNUC_UNUSED bool *highlight,
G_GNUC_UNUSED void *data)
{
static char buffer[256];
{
current.lines = g_ptr_array_new();
lw = list_window_init(w, cols, rows);
- lw->flags = LW_HIDE_CURSOR;
+ lw->hide_cursor = true;
}
static void
return false;
+#ifdef ENABLE_LYRICS_SCREEN
+ case CMD_SCREEN_LYRICS:
+ if (current.song != NULL) {
+ screen_lyrics_switch(c, current.song);
+ return true;
+ }
+
+ return false;
+#endif
+
default:
break;
}