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/gui/gwps.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'apps/gui/gwps.c') diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 7128a958f7..00290a8871 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -54,6 +54,7 @@ #include "abrepeat.h" #include "playback.h" #include "splash.h" +#include "cuesheet.h" #if LCD_DEPTH > 1 #include "backdrop.h" #endif @@ -333,7 +334,16 @@ long gui_wps_show(void) if (global_settings.party_mode) break; if (current_tick -last_right < HZ) - audio_next_dir(); + { + if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type) + { + audio_next(); + } + else + { + audio_next_dir(); + } + } else ffwd_rew(ACTION_WPS_SEEKFWD); last_right = 0; break; @@ -343,7 +353,22 @@ long gui_wps_show(void) if (global_settings.party_mode) break; if (current_tick -last_left < HZ) - audio_prev_dir(); + { + if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type) + { + if (!wps_state.paused) +#if (CONFIG_CODEC == SWCODEC) + audio_pre_ff_rewind(); +#else + audio_pause(); +#endif + audio_ff_rewind(0); + } + else + { + audio_prev_dir(); + } + } else ffwd_rew(ACTION_WPS_SEEKBACK); last_left = 0; break; @@ -377,6 +402,13 @@ long gui_wps_show(void) audio_prev(); } else { + + if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type) + { + curr_cuesheet_skip(-1, wps_state.id3->elapsed); + break; + } + if (!wps_state.paused) #if (CONFIG_CODEC == SWCODEC) audio_pre_ff_rewind(); @@ -417,6 +449,18 @@ long gui_wps_show(void) } /* ...otherwise, do it normally */ #endif + + /* take care of if we're playing a cuesheet */ + if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type) + { + if (curr_cuesheet_skip(1, wps_state.id3->elapsed)) + { + /* if the result was false, then we really want + to skip to the next track */ + break; + } + } + audio_next(); break; /* next / prev directories */ -- cgit v1.2.3