diff options
author | 2009-12-26 18:51:26 +0200 | |
---|---|---|
committer | 2009-12-26 18:05:59 +0100 | |
commit | b2ed49e475850de7e7412131f1fb8aadab394c72 (patch) | |
tree | 50a17feb080180849b6bf4b2e471b6e6163671c2 /plugins/gtkui/gtkplaylist.c | |
parent | 73ad43ffdea7853ddcb502f50f2212cf395b8881 (diff) |
"Cursor follow playback" feature
Diffstat (limited to 'plugins/gtkui/gtkplaylist.c')
-rw-r--r-- | plugins/gtkui/gtkplaylist.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c index 0ae46f9a..e48f49ba 100644 --- a/plugins/gtkui/gtkplaylist.c +++ b/plugins/gtkui/gtkplaylist.c @@ -879,6 +879,10 @@ gtkpl_songchanged (gtkplaylist_t *ps, int from, int to) { gtk_range_set_value (GTK_RANGE (ps->scrollbar), to - ps->nvisiblerows/2); } } + if (deadbeef->conf_get_int ("playlist.scroll.cursorfollowplayback", 1)) { + printf ("Moving cursor to %d\n", to); + gtkpl_set_cursor (PL_MAIN, to); + } } if (from >= 0) { @@ -1951,7 +1955,7 @@ gtkpl_set_cursor (int iter, int cursor) { int minvis = pl->scrollpos; int maxvis = pl->scrollpos + pl->nvisiblerows-1; int prev = deadbeef->pl_get_cursor (PL_MAIN); - deadbeef->pl_set_cursor (PL_MAIN, 0); + deadbeef->pl_set_cursor (PL_MAIN, cursor); struct set_cursor_t *data = malloc (sizeof (struct set_cursor_t)); data->prev = prev; data->iter = iter; |