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) | |
download | rockbox-9f4bd8712fc122f61ec162c544d613a95c3ca66e.tar.gz rockbox-9f4bd8712fc122f61ec162c544d613a95c3ca66e.zip |
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 @@ | |||
57 | #include "buffer.h" | 57 | #include "buffer.h" |
58 | #include "dsp.h" | 58 | #include "dsp.h" |
59 | #include "abrepeat.h" | 59 | #include "abrepeat.h" |
60 | #include "cuesheet.h" | ||
60 | #ifdef HAVE_TAGCACHE | 61 | #ifdef HAVE_TAGCACHE |
61 | #include "tagcache.h" | 62 | #include "tagcache.h" |
62 | #endif | 63 | #endif |
@@ -2742,6 +2743,23 @@ static bool audio_load_track(int offset, bool start_play, bool rebuffer) | |||
2742 | 2743 | ||
2743 | } | 2744 | } |
2744 | 2745 | ||
2746 | if (cuesheet_is_enabled() && tracks[track_widx].id3.cuesheet_type == 1) | ||
2747 | { | ||
2748 | char cuepath[MAX_PATH]; | ||
2749 | strncpy(cuepath, trackname, MAX_PATH); | ||
2750 | char *dot = strrchr(cuepath, '.'); | ||
2751 | strcpy(dot, ".cue"); | ||
2752 | |||
2753 | struct cuesheet *cue = start_play ? curr_cue : temp_cue; | ||
2754 | |||
2755 | if (parse_cuesheet(cuepath, cue)) | ||
2756 | { | ||
2757 | strcpy((cue)->audio_filename, trackname); | ||
2758 | if (start_play) | ||
2759 | cue_spoof_id3(curr_cue, &tracks[track_widx].id3); | ||
2760 | } | ||
2761 | } | ||
2762 | |||
2745 | /* Load the codec. */ | 2763 | /* Load the codec. */ |
2746 | tracks[track_widx].codecbuf = &filebuf[buf_widx]; | 2764 | tracks[track_widx].codecbuf = &filebuf[buf_widx]; |
2747 | if (!audio_loadcodec(start_play)) | 2765 | if (!audio_loadcodec(start_play)) |