diff options
author | 2009-12-20 20:50:38 +0100 | |
---|---|---|
committer | 2009-12-20 20:50:38 +0100 | |
commit | 508e6287a78962e230f317f536b74c6ea2c0b549 (patch) | |
tree | 008df27d104c140b3dbfc3458e14ba01350d78ae /plugins/gtkui/gtkplaylist.c | |
parent | ca1f890764c5dbac509940530e74971e8351a02b (diff) |
redraw queued tracks on queue changes
Diffstat (limited to 'plugins/gtkui/gtkplaylist.c')
-rw-r--r-- | plugins/gtkui/gtkplaylist.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c index 23629833..95c4f224 100644 --- a/plugins/gtkui/gtkplaylist.c +++ b/plugins/gtkui/gtkplaylist.c @@ -1928,6 +1928,26 @@ redraw_seekbar_cb (gpointer nothing) { } void +redraw_queued_tracks (gtkplaylist_t *pl) { + DB_playItem_t *it = deadbeef->pl_get_for_idx_and_iter (pl->scrollpos, pl->iterator); + int i = pl->scrollpos; + while (it && i < pl->scrollpos + pl->nvisiblerows) { + if (deadbeef->pl_playqueue_test (it) != -1) { + gtkpl_redraw_pl_row (pl, i, it); + } + it = PL_NEXT (it, pl->iterator); + i++; + } +} + +static gboolean +redraw_queued_tracks_cb (gpointer nothing) { + redraw_queued_tracks (&main_playlist); + redraw_queued_tracks (&search_playlist); + return FALSE; +} + +void gtkpl_songchanged_wrapper (int from, int to) { struct fromto_t *ft = malloc (sizeof (struct fromto_t)); ft->from = from; @@ -1937,6 +1957,7 @@ gtkpl_songchanged_wrapper (int from, int to) { // redraw seekbar g_idle_add (redraw_seekbar_cb, NULL); } + g_idle_add (redraw_queued_tracks_cb, NULL); } void |