From 9f4bd8712fc122f61ec162c544d613a95c3ca66e Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Wed, 14 Feb 2007 14:40:24 +0000 Subject: Cuesheet support by Jonathan Gordon and me (FS #6460). Everytime an audio file is loaded, a cue file with the same name is searched for. A setting allows to disable this (default is off). Cuesheet files can also be viewed in the file browser. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12304 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'apps/playback.c') diff --git a/apps/playback.c b/apps/playback.c index d256f5a4f0..b80c449c47 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -57,6 +57,7 @@ #include "buffer.h" #include "dsp.h" #include "abrepeat.h" +#include "cuesheet.h" #ifdef HAVE_TAGCACHE #include "tagcache.h" #endif @@ -2742,6 +2743,23 @@ static bool audio_load_track(int offset, bool start_play, bool rebuffer) } + if (cuesheet_is_enabled() && tracks[track_widx].id3.cuesheet_type == 1) + { + char cuepath[MAX_PATH]; + strncpy(cuepath, trackname, MAX_PATH); + char *dot = strrchr(cuepath, '.'); + strcpy(dot, ".cue"); + + struct cuesheet *cue = start_play ? curr_cue : temp_cue; + + if (parse_cuesheet(cuepath, cue)) + { + strcpy((cue)->audio_filename, trackname); + if (start_play) + cue_spoof_id3(curr_cue, &tracks[track_widx].id3); + } + } + /* Load the codec. */ tracks[track_widx].codecbuf = &filebuf[buf_widx]; if (!audio_loadcodec(start_play)) -- cgit v1.2.3