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
This commit is contained in:
Miika Pekkarinen 2007-04-12 20:21:56 +00:00
parent 9d9937a0ad
commit 5e47daa944
3 changed files with 12 additions and 0 deletions

View file

@ -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, static const int numeric_tags[] = { tag_year, tag_tracknumber, tag_length,
tag_bitrate, tag_playcount, tag_rating, tag_playtime, tag_lastplayed, tag_commitid, tag_bitrate, tag_playcount, tag_rating, tag_playtime, tag_lastplayed, tag_commitid,
tag_virt_length_min, tag_virt_length_sec, tag_virt_length_min, tag_virt_length_sec,
tag_virt_playtime_min, tag_virt_playtime_sec,
tag_virt_entryage, tag_virt_autoscore }; tag_virt_entryage, tag_virt_autoscore };
/* String presentation of the tags defined in tagcache.h. Must be in correct order! */ /* 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; data = (idx->tag_seek[tag_length]/1000) / 60;
break; 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: case tag_virt_autoscore:
if (idx->tag_seek[tag_length] == 0 if (idx->tag_seek[tag_length] == 0
|| idx->tag_seek[tag_playcount] == 0) || idx->tag_seek[tag_playcount] == 0)

View file

@ -28,6 +28,7 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title,
tag_playtime, tag_lastplayed, tag_commitid, tag_playtime, tag_lastplayed, tag_commitid,
/* Virtual tags */ /* Virtual tags */
tag_virt_length_min, tag_virt_length_sec, tag_virt_length_min, tag_virt_length_sec,
tag_virt_playtime_min, tag_virt_playtime_sec,
tag_virt_entryage, tag_virt_autoscore }; tag_virt_entryage, tag_virt_autoscore };
#define TAG_COUNT 17 #define TAG_COUNT 17

View file

@ -202,6 +202,8 @@ static int get_tag(int *tag)
MATCH(tag, buf, "length", tag_length); MATCH(tag, buf, "length", tag_length);
MATCH(tag, buf, "Lm", tag_virt_length_min); MATCH(tag, buf, "Lm", tag_virt_length_min);
MATCH(tag, buf, "Ls", tag_virt_length_sec); 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, "title", tag_title);
MATCH(tag, buf, "filename", tag_filename); MATCH(tag, buf, "filename", tag_filename);
MATCH(tag, buf, "tracknum", tag_tracknumber); MATCH(tag, buf, "tracknum", tag_tracknumber);