Add support for the SONGWRITER cuesheet command, displayed as composer in the WPS. Also, use the album artist tag to store the disc artist defined in the cuesheet. Finally, only look for INDEX 01 commands instead of simply INDEX: we only care about INDEX 01.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12932 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f2df5b5b53
commit
025d8d6133
2 changed files with 17 additions and 2 deletions
|
@ -145,13 +145,26 @@ bool parse_cuesheet(char *file, struct cuesheet *cue)
|
|||
else strncpy(cue->tracks[cue->track_count-1].performer,
|
||||
start,MAX_NAME);
|
||||
}
|
||||
else if (!strncmp(s, "SONGWRITER", 10))
|
||||
{
|
||||
start = strchr(s,'"');
|
||||
if (!start)
|
||||
break;
|
||||
end = strchr(++start,'"');
|
||||
if (!end)
|
||||
break;
|
||||
*end = '\0';
|
||||
if (cue->track_count > 0)
|
||||
strncpy(cue->tracks[cue->track_count-1].songwriter,
|
||||
start, MAX_NAME);
|
||||
}
|
||||
else if (!strncmp(s, "TRACK", 5))
|
||||
{
|
||||
if (cue->track_count >= MAX_TRACKS)
|
||||
break; /* out of memeory! stop parsing */
|
||||
cue->track_count++;
|
||||
}
|
||||
else if (!strncmp(s, "INDEX", 5))
|
||||
else if (!strncmp(s, "INDEX 01", 8))
|
||||
{
|
||||
s = strchr(s,' ');
|
||||
s = skip_whitespace(s);
|
||||
|
@ -342,9 +355,10 @@ void cue_spoof_id3(struct cuesheet *cue, struct mp3entry *id3)
|
|||
|
||||
id3->title = cue->tracks[i].title;
|
||||
id3->artist = cue->tracks[i].performer;
|
||||
id3->composer = cue->tracks[i].songwriter;
|
||||
id3->albumartist = cue->performer;
|
||||
id3->tracknum = i+1;
|
||||
id3->album = cue->title;
|
||||
id3->composer = cue->performer;
|
||||
if (id3->track_string)
|
||||
snprintf(id3->track_string, 10, "%d/%d", i+1, cue->track_count);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
struct cue_track_info {
|
||||
char title[MAX_NAME];
|
||||
char performer[MAX_NAME];
|
||||
char songwriter[MAX_NAME];
|
||||
unsigned long offset; /* ms from start of track */
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue