diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-02-14 14:40:24 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-02-14 14:40:24 +0000 |
commit | 9f4bd8712fc122f61ec162c544d613a95c3ca66e (patch) | |
tree | 4e652a1e7c19ac8a6bb789ee79304744c133d029 /apps/playback.c | |
parent | 0403c2a572154667f3f2bd671d7d5a7cc08c64af (diff) |
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
Diffstat (limited to 'apps/playback.c')
-rw-r--r-- | apps/playback.c | 18 |
1 files changed, 18 insertions, 0 deletions
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)) |