diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2007-04-12 20:21:56 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2007-04-12 20:21:56 +0000 |
| commit | 5e47daa9440e77c0a3ef0ee6cf436eadef36d7cd (patch) | |
| tree | 02efe5abc176f43b6f657ed1a9972156e04b93c5 | |
| parent | 9d9937a0ad64018a7e8beb503f7207696e694856 (diff) | |
| download | rockbox-5e47daa9440e77c0a3ef0ee6cf436eadef36d7cd.zip rockbox-5e47daa9440e77c0a3ef0ee6cf436eadef36d7cd.tar.gz rockbox-5e47daa9440e77c0a3ef0ee6cf436eadef36d7cd.tar.bz2 rockbox-5e47daa9440e77c0a3ef0ee6cf436eadef36d7cd.tar.xz | |
Now track total playtime should be accessible as well by using Pm and Ps virtual tags.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13133 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/tagcache.c | 9 | ||||
| -rw-r--r-- | apps/tagcache.h | 1 | ||||
| -rw-r--r-- | apps/tagtree.c | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index c22091e..e51b120 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -117,6 +117,7 @@ static const int unique_tags[] = { tag_artist, tag_album, tag_genre, static const int numeric_tags[] = { tag_year, tag_tracknumber, tag_length, tag_bitrate, tag_playcount, tag_rating, tag_playtime, tag_lastplayed, tag_commitid, tag_virt_length_min, tag_virt_length_sec, + tag_virt_playtime_min, tag_virt_playtime_sec, tag_virt_entryage, tag_virt_autoscore }; /* String presentation of the tags defined in tagcache.h. Must be in correct order! */ @@ -668,6 +669,14 @@ static long check_virtual_tags(int tag, const struct index_entry *idx) data = (idx->tag_seek[tag_length]/1000) / 60; break; + case tag_virt_playtime_sec: + data = (idx->tag_seek[tag_playtime]/1000) % 60; + break; + + case tag_virt_playtime_min: + data = (idx->tag_seek[tag_playtime]/1000) / 60; + break; + case tag_virt_autoscore: if (idx->tag_seek[tag_length] == 0 || idx->tag_seek[tag_playcount] == 0) diff --git a/apps/tagcache.h b/apps/tagcache.h index f449f13..70677c6 100644 --- a/apps/tagcache.h +++ b/apps/tagcache.h @@ -28,6 +28,7 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title, tag_playtime, tag_lastplayed, tag_commitid, /* Virtual tags */ tag_virt_length_min, tag_virt_length_sec, + tag_virt_playtime_min, tag_virt_playtime_sec, tag_virt_entryage, tag_virt_autoscore }; #define TAG_COUNT 17 diff --git a/apps/tagtree.c b/apps/tagtree.c index cc8c145..56e8740 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -202,6 +202,8 @@ static int get_tag(int *tag) MATCH(tag, buf, "length", tag_length); MATCH(tag, buf, "Lm", tag_virt_length_min); MATCH(tag, buf, "Ls", tag_virt_length_sec); + MATCH(tag, buf, "Pm", tag_virt_playtime_min); + MATCH(tag, buf, "Ps", tag_virt_playtime_sec); MATCH(tag, buf, "title", tag_title); MATCH(tag, buf, "filename", tag_filename); MATCH(tag, buf, "tracknum", tag_tracknumber); |