1
0
Fork 0
forked from len0rd/rockbox

Rating support for database and WPS (based on FS# 6301). A value between 0 and 10 can be assigned to the currently playing track using the WPS context menu. This value is displayed in the WPS using the %rr tag (replacing autoscore) and can be used as "rating" in tagnavi.config (examples provided).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12922 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Kukla 2007-03-26 15:08:59 +00:00
parent cd1ccad9d6
commit 226cb7b0b8
8 changed files with 74 additions and 19 deletions

View file

@ -115,13 +115,13 @@ static const int unique_tags[] = { tag_artist, tag_album, tag_genre,
/* Numeric tags (we can use these tags with conditional clauses). */
static const int numeric_tags[] = { tag_year, tag_tracknumber, tag_length,
tag_bitrate, tag_playcount, tag_playtime, tag_lastplayed, tag_commitid,
tag_bitrate, tag_playcount, tag_rating, tag_playtime, tag_lastplayed, tag_commitid,
tag_virt_entryage, tag_virt_autoscore };
/* String presentation of the tags defined in tagcache.h. Must be in correct order! */
static const char *tags_str[] = { "artist", "album", "genre", "title",
"filename", "composer", "comment", "albumartist", "year", "tracknumber",
"bitrate", "length", "playcount", "playtime", "lastplayed", "commitid" };
"bitrate", "length", "playcount", "rating", "playtime", "lastplayed", "commitid" };
/* Status information of the tagcache. */
static struct tagcache_stat tc_stat;
@ -167,7 +167,7 @@ struct master_header {
/* For the endianess correction */
static const char *tagfile_entry_ec = "ss";
static const char *index_entry_ec = "lllllllllllllllll"; /* (1 + TAG_COUNT) * l */
static const char *index_entry_ec = "llllllllllllllllll"; /* (1 + TAG_COUNT) * l */
static const char *tagcache_header_ec = "lll";
static const char *master_header_ec = "llllll";
@ -1499,8 +1499,9 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename)
id3->albumartist = get_tag_string(entry, tag_albumartist);
id3->playcount = get_tag_numeric(entry, tag_playcount);
id3->rating = get_tag_numeric(entry, tag_rating);
id3->lastplayed = get_tag_numeric(entry, tag_lastplayed);
id3->rating = get_tag_numeric(entry, tag_virt_autoscore) / 10;
id3->score = get_tag_numeric(entry, tag_virt_autoscore) / 10;
id3->year = get_tag_numeric(entry, tag_year);
id3->tracknum = get_tag_numeric(entry, tag_tracknumber);
@ -2850,7 +2851,7 @@ static int parse_changelog_line(int line_n, const char *buf, void *parameters)
char tag_data[TAG_MAXLEN+32];
int idx_id;
long masterfd = (long)parameters;
const int import_tags[] = { tag_playcount, tag_playtime, tag_lastplayed,
const int import_tags[] = { tag_playcount, tag_rating, tag_playtime, tag_lastplayed,
tag_commitid };
int i;
(void)line_n;