diff options
author | Michael Chicoine <mc2739@gmail.com> | 2010-01-06 14:48:42 +0000 |
---|---|---|
committer | Michael Chicoine <mc2739@gmail.com> | 2010-01-06 14:48:42 +0000 |
commit | 8e8e2627b27b28a855881db09f2c16bfb2193050 (patch) | |
tree | 9fd69d8f4a4030dc320cd2a625bf456b5f8fb862 /apps | |
parent | f011fe2b5dfb21f6ec06c46eb979f3166a700e54 (diff) | |
download | rockbox-8e8e2627b27b28a855881db09f2c16bfb2193050.tar.gz rockbox-8e8e2627b27b28a855881db09f2c16bfb2193050.zip |
FS#10856 - Skip to previous track inconsistent when using cuesheet
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24191 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/cuesheet.c | 14 | ||||
-rw-r--r-- | apps/gui/wps.c | 3 | ||||
-rw-r--r-- | apps/gui/wps.h | 3 |
3 files changed, 16 insertions, 4 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c index 7c631c72c8..ef1eff8a85 100644 --- a/apps/cuesheet.c +++ b/apps/cuesheet.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "plugin.h" | 39 | #include "plugin.h" |
40 | #include "playback.h" | 40 | #include "playback.h" |
41 | #include "cuesheet.h" | 41 | #include "cuesheet.h" |
42 | #include "gui/wps.h" | ||
42 | 43 | ||
43 | #define CUE_DIR ROCKBOX_DIR "/cue" | 44 | #define CUE_DIR ROCKBOX_DIR "/cue" |
44 | 45 | ||
@@ -328,7 +329,18 @@ bool curr_cuesheet_skip(struct cuesheet *cue, int direction, unsigned long curr_ | |||
328 | else | 329 | else |
329 | { | 330 | { |
330 | if (!(direction <= 0 && track == 0)) | 331 | if (!(direction <= 0 && track == 0)) |
331 | track += direction; | 332 | { |
333 | /* If skipping forward, skip to next cuesheet segment. If skipping | ||
334 | backward before DEFAULT_SKIP_TRESH milliseconds have elapsed, skip | ||
335 | to previous cuesheet segment. If skipping backward after | ||
336 | DEFAULT_SKIP_TRESH seconds have elapsed, skip to the start of the | ||
337 | current cuesheet segment */ | ||
338 | if (direction == 1 || | ||
339 | ((curr_pos - cue->tracks[track].offset) < DEFAULT_SKIP_TRESH)) | ||
340 | { | ||
341 | track += direction; | ||
342 | } | ||
343 | } | ||
332 | 344 | ||
333 | seek(cue->tracks[track].offset); | 345 | seek(cue->tracks[track].offset); |
334 | return true; | 346 | return true; |
diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 69285c0bf1..14fb848ebe 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c | |||
@@ -70,9 +70,6 @@ | |||
70 | 70 | ||
71 | #define RESTORE_WPS_INSTANTLY 0l | 71 | #define RESTORE_WPS_INSTANTLY 0l |
72 | #define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick)) | 72 | #define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick)) |
73 | /* in milliseconds */ | ||
74 | #define DEFAULT_SKIP_TRESH 3000l | ||
75 | |||
76 | 73 | ||
77 | #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ | 74 | #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ |
78 | /* 3% of 30min file == 54s step size */ | 75 | /* 3% of 30min file == 54s step size */ |
diff --git a/apps/gui/wps.h b/apps/gui/wps.h index 76932a323a..0aa496748b 100644 --- a/apps/gui/wps.h +++ b/apps/gui/wps.h | |||
@@ -43,4 +43,7 @@ bool is_wps_fading(void); | |||
43 | int wps_get_ff_rewind_count(void); | 43 | int wps_get_ff_rewind_count(void); |
44 | #endif /* IPOD_ACCESSORY_PROTOCOL */ | 44 | #endif /* IPOD_ACCESSORY_PROTOCOL */ |
45 | 45 | ||
46 | /* in milliseconds */ | ||
47 | #define DEFAULT_SKIP_TRESH 3000l | ||
48 | |||
46 | #endif /* _WPS_H_ */ | 49 | #endif /* _WPS_H_ */ |