From 839dbcaed7ea135dcc0812de76f9ff5c1dc924f5 Mon Sep 17 00:00:00 2001 From: Hardeep Sidhu Date: Mon, 4 Jul 2005 22:50:57 +0000 Subject: Moved resume info updating to the mpeg/playback threads so that it's saved even when not in the WPS git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7018 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'apps/playlist.c') diff --git a/apps/playlist.c b/apps/playlist.c index 304a511c37..91ca1f640a 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -2010,6 +2010,31 @@ int playlist_get_resume_info(int *resume_index) return 0; } +/* Update resume info for current playing song. Returns -1 on error. */ +int playlist_update_resume_info(const struct mp3entry* id3) +{ + struct playlist_info* playlist = ¤t_playlist; + + if (id3) + { + if (global_settings.resume_index != playlist->index || + global_settings.resume_offset != id3->offset) + { + global_settings.resume_index = playlist->index; + global_settings.resume_offset = id3->offset; + settings_save(); + } + } + else + { + global_settings.resume_index = -1; + global_settings.resume_offset = -1; + settings_save(); + } + + return 0; +} + /* Returns index of current playing track for display purposes. This value should not be used for resume purposes as it doesn't represent the actual index into the playlist */ -- cgit v1.2.3