summaryrefslogtreecommitdiff
path: root/apps/playlist.c
diff options
context:
space:
mode:
authorHardeep Sidhu <dyp@pobox.com>2005-07-04 22:50:57 +0000
committerHardeep Sidhu <dyp@pobox.com>2005-07-04 22:50:57 +0000
commit839dbcaed7ea135dcc0812de76f9ff5c1dc924f5 (patch)
tree2a9ea28b5da29ff2749f0b4bb3be059eafc98fa4 /apps/playlist.c
parent3fd775b7d15c9c5133c68ba45caf8bfc78cadfa1 (diff)
downloadrockbox-839dbcaed7ea135dcc0812de76f9ff5c1dc924f5.zip
rockbox-839dbcaed7ea135dcc0812de76f9ff5c1dc924f5.tar.gz
rockbox-839dbcaed7ea135dcc0812de76f9ff5c1dc924f5.tar.bz2
rockbox-839dbcaed7ea135dcc0812de76f9ff5c1dc924f5.tar.xz
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
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 304a511..91ca1f6 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 = &current_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 */