summaryrefslogtreecommitdiffstats
path: root/apps/cuesheet.c
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-03-26 20:26:41 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-03-26 20:26:41 +0000
commit025d8d6133e50d992e34474dfe8febdd0fe0740c (patch)
treed12958259ae931fce7239535ace57502246e9eb9 /apps/cuesheet.c
parentf2df5b5b53206d09b72a2e9d0b5de1d50ea7633c (diff)
downloadrockbox-025d8d6133e50d992e34474dfe8febdd0fe0740c.tar.gz
rockbox-025d8d6133e50d992e34474dfe8febdd0fe0740c.tar.bz2
rockbox-025d8d6133e50d992e34474dfe8febdd0fe0740c.zip
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
Diffstat (limited to 'apps/cuesheet.c')
-rw-r--r--apps/cuesheet.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c
index 2509ddecfb..ea9b4d2a7e 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -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);
}