diff options
author | Torne Wuff <torne@wolfpuppy.org.uk> | 2010-07-05 16:39:00 +0000 |
---|---|---|
committer | Torne Wuff <torne@wolfpuppy.org.uk> | 2010-07-05 16:39:00 +0000 |
commit | db1b823ac3ea524d80a83876c9c99593d29f3817 (patch) | |
tree | 52a5ee873e0a35860e1134c6e254b862012fa9fd /apps/bookmark.c | |
parent | d265bcf965c8b51911ed8ce8d664eb9629d8bfa0 (diff) | |
download | rockbox-db1b823ac3ea524d80a83876c9c99593d29f3817.tar.gz rockbox-db1b823ac3ea524d80a83876c9c99593d29f3817.zip |
Provide the option to automatically update existing bookmark files on stop, without creating ones that don't already exist.
Idea from FS#6272, but implemented differently. If you set "Update on stop" then it will check if the bookmark file exists on stop, and if so, write a new one without prompting. If the file doesn't exist, it will do whatever the "Bookmark on stop" setting tells it to do.
This works quite well if you have an audiobook/podcast/etc folder/playlist: just bookmark it manually once and it will get bookmarked automatically after that, without creating bookmarks for regular music.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27294 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r-- | apps/bookmark.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c index 3d8df3ec0b..b8d41c7464 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c | |||
@@ -166,16 +166,21 @@ bool bookmark_mrb_load() | |||
166 | bool bookmark_autobookmark(bool prompt_ok) | 166 | bool bookmark_autobookmark(bool prompt_ok) |
167 | { | 167 | { |
168 | char* bookmark; | 168 | char* bookmark; |
169 | bool update = false; | ||
169 | if (!system_check()) | 170 | if (!system_check()) |
170 | return false; | 171 | return false; |
171 | 172 | ||
172 | audio_pause(); /* first pause playback */ | 173 | audio_pause(); /* first pause playback */ |
174 | if (global_settings.autoupdatebookmark && bookmark_exist()) | ||
175 | update = true; | ||
173 | bookmark = create_bookmark(); | 176 | bookmark = create_bookmark(); |
174 | /* Workaround for inability to speak when paused: all callers will | 177 | /* Workaround for inability to speak when paused: all callers will |
175 | just do audio_stop() when we return, so we can do it right | 178 | just do audio_stop() when we return, so we can do it right |
176 | away. This makes it possible to speak the "Create a Bookmark?" | 179 | away. This makes it possible to speak the "Create a Bookmark?" |
177 | prompt and the "Bookmark Created" splash. */ | 180 | prompt and the "Bookmark Created" splash. */ |
178 | audio_stop(); | 181 | audio_stop(); |
182 | if (update) | ||
183 | return write_bookmark(true, bookmark); | ||
179 | switch (global_settings.autocreatebookmark) | 184 | switch (global_settings.autocreatebookmark) |
180 | { | 185 | { |
181 | case BOOKMARK_YES: | 186 | case BOOKMARK_YES: |