summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2008-06-28 17:55:53 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2008-06-28 17:55:53 +0000
commit2fb70bcabb1c871baf17ace7a82f9fda9ab721c6 (patch)
tree9047a029a90fd88805a09f5c85e1f8eb39de37c0 /apps/gui
parentbcf9b5dfa6c575ac70271bdddf3ee7e5c1b0c9c6 (diff)
downloadrockbox-2fb70bcabb1c871baf17ace7a82f9fda9ab721c6.tar.gz
rockbox-2fb70bcabb1c871baf17ace7a82f9fda9ab721c6.zip
implement smooth seeking acceleration for audio playback and mpegplayer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17843 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/gwps-common.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index b53d68d6ba..3fd77a2211 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -196,10 +196,10 @@ bool ffwd_rew(int button)
196 unsigned int max_step = 0; /* maximum ff/rewind step */ 196 unsigned int max_step = 0; /* maximum ff/rewind step */
197 int ff_rewind_count = 0; /* current ff/rewind count (in ticks) */ 197 int ff_rewind_count = 0; /* current ff/rewind count (in ticks) */
198 int direction = -1; /* forward=1 or backward=-1 */ 198 int direction = -1; /* forward=1 or backward=-1 */
199 long accel_tick = 0; /* next time at which to bump the step size */
200 bool exit = false; 199 bool exit = false;
201 bool usb = false; 200 bool usb = false;
202 int i = 0; 201 int i = 0;
202 const long ff_rw_accel = (global_settings.ff_rewind_accel + 3);
203 203
204 if (button == ACTION_NONE) 204 if (button == ACTION_NONE)
205 { 205 {
@@ -237,13 +237,8 @@ bool ffwd_rew(int button)
237 237
238 ff_rewind_count += step * direction; 238 ff_rewind_count += step * direction;
239 239
240 if (global_settings.ff_rewind_accel != 0 && 240 /* smooth seeking by multiplying step by: 1 + (2 ^ -accel) */
241 current_tick >= accel_tick) 241 step += step >> ff_rw_accel;
242 {
243 step *= 2;
244 accel_tick = current_tick +
245 global_settings.ff_rewind_accel*HZ;
246 }
247 } 242 }
248 else 243 else
249 { 244 {
@@ -268,9 +263,6 @@ bool ffwd_rew(int button)
268 wps_state.ff_rewind = true; 263 wps_state.ff_rewind = true;
269 264
270 step = 1000 * global_settings.ff_rewind_min_step; 265 step = 1000 * global_settings.ff_rewind_min_step;
271
272 accel_tick = current_tick +
273 global_settings.ff_rewind_accel*HZ;
274 } 266 }
275 else 267 else
276 break; 268 break;