summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e7fc0ba)
raw | patch | inline | side by side (parent: e7fc0ba)
author | Max Kellermann <max@duempel.org> | |
Wed, 30 Sep 2009 18:16:00 +0000 (20:16 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 30 Sep 2009 18:16:00 +0000 (20:16 +0200) |
src/screen_play.c | patch | blob | history |
diff --git a/src/screen_play.c b/src/screen_play.c
index 5bdfbe3f60b3551f4d97f76e7d486bce5b11ef95..b2ceb636e1369595ab48086b04df1df13d98bac5 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
#endif
static struct mpdclient_playlist *playlist;
-static unsigned visible_version = -1;
static int current_song_id = -1;
static int selected_song_id = -1;
static list_window_t *lw = NULL;
playlist_save_selection();
}
-static void
-playlist_changed_callback(G_GNUC_UNUSED struct mpdclient *c,
- G_GNUC_UNUSED int event, G_GNUC_UNUSED gpointer data)
-{
- playlist_restore_selection();
-}
-
#ifndef NCMPC_MINI
static char *
format_duration(unsigned duration)
static void
play_open(struct mpdclient *c)
{
- static gboolean install_cb = TRUE;
-
playlist = &c->playlist;
assert(timer_hide_cursor_id == 0);
timer_hide_cursor, c);
}
- if (install_cb) {
- mpdclient_install_playlist_callback(c, playlist_changed_callback);
- install_cb = FALSE;
- }
+ playlist_restore_selection();
}
static void
#endif
list_window_paint(lw, list_callback, NULL);
-
- visible_version = playlist->id;
}
static void
{
static int prev_song_id = -1;
+ if (c->events & MPD_IDLE_PLAYLIST)
+ playlist_restore_selection();
+
current_song_id = c->song != NULL && c->status != NULL &&
!IS_STOPPED(mpd_status_get_state(c->status))
? (int)mpd_song_get_id(c->song) : -1;
enabled */
playlist_repaint();
#endif
- } else if (visible_version != playlist->id) {
+ } else if (c->events & MPD_IDLE_PLAYLIST) {
/* the playlist has changed, we must paint the new
version */
playlist_repaint();