summaryrefslogtreecommitdiffstats
path: root/apps/cuesheet.c
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-03-29 18:39:04 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-03-29 18:39:04 +0000
commitd77274aeb9859cc26aa49201bb0938babbd44069 (patch)
treef8771705a329aaa3ed9f7795a9dc95ec7f9c7dcd /apps/cuesheet.c
parentf2fd44359617f7548a8dd64b147d9cd76844f5d3 (diff)
downloadrockbox-d77274aeb9859cc26aa49201bb0938babbd44069.tar.gz
rockbox-d77274aeb9859cc26aa49201bb0938babbd44069.tar.bz2
rockbox-d77274aeb9859cc26aa49201bb0938babbd44069.zip
Cuesheet tweaks:
* Max length for the info strings is now 80, according to the cue spec. * Don't display the album artist if it's the same as the track artist. * If the cue has composer info but not the tracks, the cue composer info is displayed for all the tracks. * Slightly change the display in the cue viewer. * A few cosmetic changes in the code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12964 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/cuesheet.c')
-rw-r--r--apps/cuesheet.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c
index abf92e1657..2b876be77f 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -175,7 +175,7 @@ bool parse_cuesheet(char *file, struct cuesheet *cue)
break;
case 'S': /* SONGWRITER */
- dest = (cue->track_count <= 0) ? NULL :
+ dest = (cue->track_count <= 0) ? cue->songwriter :
cue->tracks[cue->track_count-1].songwriter;
break;
}
@@ -192,6 +192,9 @@ bool parse_cuesheet(char *file, struct cuesheet *cue)
{
if (*(cue->tracks[i].performer) == '\0')
strncpy(cue->tracks[i].performer, cue->performer, MAX_NAME);
+
+ if (*(cue->tracks[i].songwriter) == '\0')
+ strncpy(cue->tracks[i].songwriter, cue->songwriter, MAX_NAME);
}
return true;
@@ -225,9 +228,8 @@ int cue_find_current_track(struct cuesheet *cue, unsigned long curpos)
{
int i=0;
while (i < cue->track_count-1 && cue->tracks[i+1].offset < curpos)
- {
i++;
- }
+
cue->curr_track_idx = i;
cue->curr_track = cue->tracks + i;
return i;
@@ -241,16 +243,12 @@ static char *list_get_name_cb(int selected_item,
struct cuesheet *cue = (struct cuesheet *)data;
if (selected_item & 1)
- {
- snprintf(buffer, MAX_PATH,
- (selected_item+1)/2 > 9 ? " %s" : " %s",
+ snprintf(buffer, MAX_PATH, "%s",
cue->tracks[selected_item/2].title);
- }
else
- {
- snprintf(buffer, MAX_PATH, "%d %s", selected_item/2+1,
+ snprintf(buffer, MAX_PATH, "%02d. %s", selected_item/2+1,
cue->tracks[selected_item/2].performer);
- }
+
return buffer;
}
@@ -361,7 +359,13 @@ 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;
+
+ /* if the album artist is the same as the track artist, we hide it. */
+ if (strcmp(cue->performer, cue->tracks[i].performer))
+ id3->albumartist = cue->performer;
+ else
+ id3->albumartist = "\0";
+
id3->tracknum = i+1;
id3->album = cue->title;
if (id3->track_string)