mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
Added virtual tags in database to break track length to minutes and seconds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13132 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ec88dffb6c
commit
9d9937a0ad
4 changed files with 14 additions and 2 deletions
|
|
@ -116,6 +116,7 @@ static const int unique_tags[] = { tag_artist, tag_album, tag_genre,
|
||||||
/* Numeric tags (we can use these tags with conditional clauses). */
|
/* Numeric tags (we can use these tags with conditional clauses). */
|
||||||
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_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! */
|
||||||
|
|
@ -659,6 +660,14 @@ static long check_virtual_tags(int tag, const struct index_entry *idx)
|
||||||
|
|
||||||
switch (tag)
|
switch (tag)
|
||||||
{
|
{
|
||||||
|
case tag_virt_length_sec:
|
||||||
|
data = (idx->tag_seek[tag_length]/1000) % 60;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case tag_virt_length_min:
|
||||||
|
data = (idx->tag_seek[tag_length]/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)
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title,
|
||||||
tag_tracknumber, tag_bitrate, tag_length, tag_playcount, tag_rating,
|
tag_tracknumber, tag_bitrate, tag_length, tag_playcount, tag_rating,
|
||||||
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_entryage, tag_virt_autoscore };
|
tag_virt_entryage, tag_virt_autoscore };
|
||||||
|
|
||||||
#define TAG_COUNT 17
|
#define TAG_COUNT 17
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
# get overwritten automatically.
|
# get overwritten automatically.
|
||||||
|
|
||||||
# Basic format declarations
|
# Basic format declarations
|
||||||
%format "fmt_title" "%02d. %s" tracknum title ? tracknum > "0"
|
%format "fmt_title" "%02d. %s - %02d:%02d" tracknum title Lm Ls ? tracknum > "0"
|
||||||
%format "fmt_title" "%s" title
|
%format "fmt_title" "%s - %02d:%02d" title Lm Ls
|
||||||
%format "fmt_mostplayed" "%2d|%3d %s (%s)" playcount autoscore title artist %sort = "inverse" %limit = "100"
|
%format "fmt_mostplayed" "%2d|%3d %s (%s)" playcount autoscore title artist %sort = "inverse" %limit = "100"
|
||||||
%format "fmt_lastplayed" "%06d%s - %s" lastplayed artist title %sort = "inverse" %limit = "99" %strip = "6"
|
%format "fmt_lastplayed" "%06d%s - %s" lastplayed artist title %sort = "inverse" %limit = "99" %strip = "6"
|
||||||
%format "fmt_forgotten" "%06d%s - %s" lastplayed artist title %limit = "99" %strip = "6"
|
%format "fmt_forgotten" "%06d%s - %s" lastplayed artist title %limit = "99" %strip = "6"
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,8 @@ static int get_tag(int *tag)
|
||||||
MATCH(tag, buf, "ensemble", tag_albumartist);
|
MATCH(tag, buf, "ensemble", tag_albumartist);
|
||||||
MATCH(tag, buf, "genre", tag_genre);
|
MATCH(tag, buf, "genre", tag_genre);
|
||||||
MATCH(tag, buf, "length", tag_length);
|
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, "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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue