summaryrefslogtreecommitdiff
path: root/apps/gui/gwps.c
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-02-14 14:40:24 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-02-14 14:40:24 +0000
commit9f4bd8712fc122f61ec162c544d613a95c3ca66e (patch)
tree4e652a1e7c19ac8a6bb789ee79304744c133d029 /apps/gui/gwps.c
parent0403c2a572154667f3f2bd671d7d5a7cc08c64af (diff)
downloadrockbox-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/gui/gwps.c')
-rw-r--r--apps/gui/gwps.c48
1 files changed, 46 insertions, 2 deletions
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 @@
54#include "abrepeat.h" 54#include "abrepeat.h"
55#include "playback.h" 55#include "playback.h"
56#include "splash.h" 56#include "splash.h"
57#include "cuesheet.h"
57#if LCD_DEPTH > 1 58#if LCD_DEPTH > 1
58#include "backdrop.h" 59#include "backdrop.h"
59#endif 60#endif
@@ -333,7 +334,16 @@ long gui_wps_show(void)
333 if (global_settings.party_mode) 334 if (global_settings.party_mode)
334 break; 335 break;
335 if (current_tick -last_right < HZ) 336 if (current_tick -last_right < HZ)
336 audio_next_dir(); 337 {
338 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
339 {
340 audio_next();
341 }
342 else
343 {
344 audio_next_dir();
345 }
346 }
337 else ffwd_rew(ACTION_WPS_SEEKFWD); 347 else ffwd_rew(ACTION_WPS_SEEKFWD);
338 last_right = 0; 348 last_right = 0;
339 break; 349 break;
@@ -343,7 +353,22 @@ long gui_wps_show(void)
343 if (global_settings.party_mode) 353 if (global_settings.party_mode)
344 break; 354 break;
345 if (current_tick -last_left < HZ) 355 if (current_tick -last_left < HZ)
346 audio_prev_dir(); 356 {
357 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
358 {
359 if (!wps_state.paused)
360#if (CONFIG_CODEC == SWCODEC)
361 audio_pre_ff_rewind();
362#else
363 audio_pause();
364#endif
365 audio_ff_rewind(0);
366 }
367 else
368 {
369 audio_prev_dir();
370 }
371 }
347 else ffwd_rew(ACTION_WPS_SEEKBACK); 372 else ffwd_rew(ACTION_WPS_SEEKBACK);
348 last_left = 0; 373 last_left = 0;
349 break; 374 break;
@@ -377,6 +402,13 @@ long gui_wps_show(void)
377 audio_prev(); 402 audio_prev();
378 } 403 }
379 else { 404 else {
405
406 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
407 {
408 curr_cuesheet_skip(-1, wps_state.id3->elapsed);
409 break;
410 }
411
380 if (!wps_state.paused) 412 if (!wps_state.paused)
381#if (CONFIG_CODEC == SWCODEC) 413#if (CONFIG_CODEC == SWCODEC)
382 audio_pre_ff_rewind(); 414 audio_pre_ff_rewind();
@@ -417,6 +449,18 @@ long gui_wps_show(void)
417 } 449 }
418 /* ...otherwise, do it normally */ 450 /* ...otherwise, do it normally */
419#endif 451#endif
452
453 /* take care of if we're playing a cuesheet */
454 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
455 {
456 if (curr_cuesheet_skip(1, wps_state.id3->elapsed))
457 {
458 /* if the result was false, then we really want
459 to skip to the next track */
460 break;
461 }
462 }
463
420 audio_next(); 464 audio_next();
421 break; 465 break;
422 /* next / prev directories */ 466 /* next / prev directories */