diff options
author | Hardeep Sidhu <dyp@pobox.com> | 2005-07-04 22:50:57 +0000 |
---|---|---|
committer | Hardeep Sidhu <dyp@pobox.com> | 2005-07-04 22:50:57 +0000 |
commit | 839dbcaed7ea135dcc0812de76f9ff5c1dc924f5 (patch) | |
tree | 2a9ea28b5da29ff2749f0b4bb3be059eafc98fa4 /apps/playlist.c | |
parent | 3fd775b7d15c9c5133c68ba45caf8bfc78cadfa1 (diff) | |
download | rockbox-839dbcaed7ea135dcc0812de76f9ff5c1dc924f5.tar.gz rockbox-839dbcaed7ea135dcc0812de76f9ff5c1dc924f5.zip |
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.c | 25 |
1 files changed, 25 insertions, 0 deletions
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) | |||
2010 | return 0; | 2010 | return 0; |
2011 | } | 2011 | } |
2012 | 2012 | ||
2013 | /* Update resume info for current playing song. Returns -1 on error. */ | ||
2014 | int playlist_update_resume_info(const struct mp3entry* id3) | ||
2015 | { | ||
2016 | struct playlist_info* playlist = ¤t_playlist; | ||
2017 | |||
2018 | if (id3) | ||
2019 | { | ||
2020 | if (global_settings.resume_index != playlist->index || | ||
2021 | global_settings.resume_offset != id3->offset) | ||
2022 | { | ||
2023 | global_settings.resume_index = playlist->index; | ||
2024 | global_settings.resume_offset = id3->offset; | ||
2025 | settings_save(); | ||
2026 | } | ||
2027 | } | ||
2028 | else | ||
2029 | { | ||
2030 | global_settings.resume_index = -1; | ||
2031 | global_settings.resume_offset = -1; | ||
2032 | settings_save(); | ||
2033 | } | ||
2034 | |||
2035 | return 0; | ||
2036 | } | ||
2037 | |||
2013 | /* Returns index of current playing track for display purposes. This value | 2038 | /* Returns index of current playing track for display purposes. This value |
2014 | should not be used for resume purposes as it doesn't represent the actual | 2039 | should not be used for resume purposes as it doesn't represent the actual |
2015 | index into the playlist */ | 2040 | index into the playlist */ |