diff options
author | waker <wakeroid@gmail.com> | 2010-10-26 20:27:31 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2010-10-26 20:27:31 +0200 |
commit | 901e1856d514530b9f11d520da1fa1562746d1c0 (patch) | |
tree | 3408880b587c6b50841b80d9862dcedb54d88ec2 /plugins | |
parent | 520c845fa160a3924b097cb69e7dddbfef61371d (diff) |
fixed scroll/cursor follows playback vs multiple playlists
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/gtkui/gtkui.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index f0135033..35da1527 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -778,22 +778,23 @@ on_add_location_activate (GtkMenuItem *menuitem, static void songchanged (DdbListview *ps, DB_playItem_t *from, DB_playItem_t *to) { int plt = deadbeef->plt_get_curr (); -#if 0 // this breaks redraw when playqueue switches to another playlist - int str_plt = deadbeef->streamer_get_current_playlist (); - if (plt != str_plt) { - // have nothing to do here -- active playlist is not the one with playing song - return; - } -#endif int to_idx = -1; if (!ddb_listview_is_scrolling (ps) && to) { - to_idx = deadbeef->pl_get_idx_of (to); - if (to_idx != -1) { - if (deadbeef->conf_get_int ("playlist.scroll.followplayback", 0)) { - ddb_listview_scroll_to (ps, to_idx); + int cursor_follows_playback = deadbeef->conf_get_int ("playlist.scroll.cursorfollowplayback", 0); + int scroll_follows_playback = deadbeef->conf_get_int ("playlist.scroll.followplayback", 0); + int plt = deadbeef->streamer_get_current_playlist (); + if (plt != -1) { + if (cursor_follows_playback && plt != deadbeef->plt_get_curr ()) { + deadbeef->plt_set_curr (plt); } - if (deadbeef->conf_get_int ("playlist.scroll.cursorfollowplayback", 0)) { - ddb_listview_set_cursor_noscroll (ps, to_idx); + to_idx = deadbeef->pl_get_idx_of (to); + if (to_idx != -1) { + if (cursor_follows_playback) { + ddb_listview_set_cursor_noscroll (ps, to_idx); + } + if (scroll_follows_playback && plt == deadbeef->plt_get_curr ()) { + ddb_listview_scroll_to (ps, to_idx); + } } } } |