From 616dc9d4659ca7486dfd252efeda0531766409cc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 25 Apr 2009 14:08:31 +0200 Subject: playlist_control: use GTimer in previousSongInPlaylist() To determine whether to rewind the current song or to go to the previous song, use a GTimer instead of manually diffing time(NULL). --- src/playlist.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/playlist.h') diff --git a/src/playlist.h b/src/playlist.h index 4237cea98..57b2450fa 100644 --- a/src/playlist.h +++ b/src/playlist.h @@ -82,6 +82,13 @@ struct playlist { * This variable is only valid if #playing is true. */ int queued; + + /** + * This timer tracks the time elapsed since the last "prev" + * command. If that is less than one second ago, "prev" jumps + * to the previous song instead of rewinding the current song. + */ + GTimer *prev_elapsed; }; /** the global playlist object */ -- cgit v1.2.3