summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2011-01-02 02:49:13 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2011-01-02 02:49:13 +0000
commit66e8fc0f0d05d926a90e8d9991f78b7a855eb7f3 (patch)
tree7db19ba9c1f166c1f35e0581cd69801d7dc7e234 /apps/tagcache.c
parent4048cf27a24b93e76c4262974831669e79c71da8 (diff)
downloadrockbox-66e8fc0f0d05d926a90e8d9991f78b7a855eb7f3.zip
rockbox-66e8fc0f0d05d926a90e8d9991f78b7a855eb7f3.tar.gz
rockbox-66e8fc0f0d05d926a90e8d9991f78b7a855eb7f3.tar.bz2
rockbox-66e8fc0f0d05d926a90e8d9991f78b7a855eb7f3.tar.xz
Commit part of FS#11748 by Michael Hohmuth. Adds support for automatically resuming any song that is not played to completion at any point later in time, regardless of how many intermediate tracks are played. This is accomplished by expanding the database to record incompletely played tracks. Currently, the feature is simply on or off, in which case all tracks automatically resume, or they do not. The remainder of patches in the task expand this feature by allowing only certain file to automatically resume, only resuming in certain circumstances, etc but are not included until we reach agreement on what should be included. Additionally, the manual will need to be updated once we agree on the available settings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28942 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r--apps/tagcache.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 0831bab..1d90eee 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -195,7 +195,7 @@ static const char *tagfile_entry_ec = "ll";
/**
Note: This should be (1 + TAG_COUNT) amount of l's.
*/
-static const char *index_entry_ec = "lllllllllllllllllllll";
+static const char *index_entry_ec = "llllllllllllllllllllll";
static const char *tagcache_header_ec = "lll";
static const char *master_header_ec = "llllll";
@@ -1695,6 +1695,13 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename)
if (id3->bitrate == 0)
id3->bitrate = 1;
+ if (global_settings.autoresume_enable)
+ {
+ id3->offset = get_tag_numeric(entry, tag_lastoffset, idx_id);
+ logf("tagcache_fill_tags: Set offset for %s to %lX\n",
+ id3->title, id3->offset);
+ }
+
return true;
}
#endif
@@ -2315,6 +2322,7 @@ static bool build_numeric_indices(struct tagcache_header *h, int tmpfd)
tmpdb_copy_tag(tag_playtime);
tmpdb_copy_tag(tag_lastplayed);
tmpdb_copy_tag(tag_commitid);
+ tmpdb_copy_tag(tag_lastoffset);
/* Avoid processing this entry again. */
idx.flag |= FLAG_RESURRECTED;