diff options
author | 2010-10-31 18:25:37 +0100 | |
---|---|---|
committer | 2010-10-31 18:25:37 +0100 | |
commit | 86c756deeb6effd9b29968a3649f8387c0b6d62a (patch) | |
tree | 1911e2d105628de793f6c913c60f052b1f4e0a5a /plugins/gtkui/gtkui.c | |
parent | 1165a25a0ac57d3bcaf29afc9a5537523d4b0a99 (diff) | |
parent | 6e99c2322741baf2bbe50c69c29a0ffe4f2c8d0c (diff) |
Merge branch 'master' into static
Conflicts:
configure.ac
Diffstat (limited to 'plugins/gtkui/gtkui.c')
-rw-r--r-- | plugins/gtkui/gtkui.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 2dd40a73..1c2b9b9f 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); + } } } } @@ -1071,9 +1072,16 @@ void gtkui_focus_on_playing_track (void) { DB_playItem_t *it = deadbeef->streamer_get_playing_track (); if (it) { + int plt = deadbeef->streamer_get_current_playlist (); + if (plt != deadbeef->plt_get_curr ()) { + deadbeef->plt_set_curr (plt); + } int idx = deadbeef->pl_get_idx_of (it); - ddb_listview_scroll_to (DDB_LISTVIEW (lookup_widget (mainwin, "playlist")), idx); - ddb_listview_set_cursor (DDB_LISTVIEW (lookup_widget (mainwin, "playlist")), idx); + if (idx != -1) { + DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); + ddb_listview_scroll_to (pl, idx); + ddb_listview_set_cursor (pl, idx); + } deadbeef->pl_item_unref (it); } } |