diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-08-07 20:51:37 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-08-07 20:51:37 +0000 |
commit | c1d9b156076b9c3789611cd96fda8cb10cc57fe4 (patch) | |
tree | de3fcfa3a524388d9ab4dc40af2b832e55348c1a /apps | |
parent | 0b709e1feeb945a73a5d9fd03a560c85e07f82c9 (diff) | |
download | rockbox-c1d9b156076b9c3789611cd96fda8cb10cc57fe4.tar.gz rockbox-c1d9b156076b9c3789611cd96fda8cb10cc57fe4.zip |
Removing scroll acceleration for the release (don't worry, I've saved the patch)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1603 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/tree.c | 115 |
1 files changed, 2 insertions, 113 deletions
diff --git a/apps/tree.c b/apps/tree.c index 68b893c78f..c1859a66ae 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -267,7 +267,6 @@ bool dirbrowse(char *root) | |||
267 | int lasti=-1; | 267 | int lasti=-1; |
268 | int rc; | 268 | int rc; |
269 | int button; | 269 | int button; |
270 | int browse_speed = 0; | ||
271 | 270 | ||
272 | 271 | ||
273 | memcpy(currdir,root,sizeof(currdir)); | 272 | memcpy(currdir,root,sizeof(currdir)); |
@@ -316,7 +315,6 @@ bool dirbrowse(char *root) | |||
316 | #ifdef HAVE_RECORDER_KEYPAD | 315 | #ifdef HAVE_RECORDER_KEYPAD |
317 | case BUTTON_PLAY: | 316 | case BUTTON_PLAY: |
318 | #endif | 317 | #endif |
319 | browse_speed = 0; | ||
320 | if ( !numentries ) | 318 | if ( !numentries ) |
321 | break; | 319 | break; |
322 | if ((currdir[0]=='/') && (currdir[1]==0)) { | 320 | if ((currdir[0]=='/') && (currdir[1]==0)) { |
@@ -364,61 +362,8 @@ bool dirbrowse(char *root) | |||
364 | restore = true; | 362 | restore = true; |
365 | break; | 363 | break; |
366 | 364 | ||
367 | case TREE_PREV | BUTTON_REPEAT: | ||
368 | browse_speed++; /* increase the browse speed every time we get here */ | ||
369 | if(filesindir) { | ||
370 | if(dircursor) { | ||
371 | if (browse_speed < TREE_MAX_ON_SCREEN - 1) { | ||
372 | /* moving the cursor up through a full screen */ | ||
373 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, | ||
374 | false); | ||
375 | dircursor--; | ||
376 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); | ||
377 | } | ||
378 | else { | ||
379 | /* if we have wrapped from the bottom we want to keep up the speed */ | ||
380 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, | ||
381 | false); | ||
382 | dircursor=0; | ||
383 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); | ||
384 | } | ||
385 | } | ||
386 | else { | ||
387 | if (start) { | ||
388 | /* leaving the cursor at top line and moving screen down */ | ||
389 | if (browse_speed >=TREE_MAX_ON_SCREEN-1) | ||
390 | start = start - TREE_MAX_ON_SCREEN + 1; | ||
391 | else | ||
392 | start--; | ||
393 | if (start<0) | ||
394 | start=0; | ||
395 | numentries = showdir(currdir, start); | ||
396 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); | ||
397 | } | ||
398 | else { | ||
399 | /* wrapping to the top in a directory that is not full */ | ||
400 | if (numentries < TREE_MAX_ON_SCREEN) { | ||
401 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, | ||
402 | false); | ||
403 | dircursor = numentries - 1; | ||
404 | browse_speed=0; | ||
405 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, | ||
406 | true); | ||
407 | } | ||
408 | else { | ||
409 | /* starting at the very bottom after a wrap */ | ||
410 | start = numentries - TREE_MAX_ON_SCREEN; | ||
411 | dircursor = TREE_MAX_ON_SCREEN - 1; | ||
412 | numentries = showdir(currdir, start); | ||
413 | put_cursorxy(0, CURSOR_Y + LINE_Y + | ||
414 | TREE_MAX_ON_SCREEN - 1, true); | ||
415 | } | ||
416 | } | ||
417 | } | ||
418 | } | ||
419 | break; | ||
420 | case TREE_PREV: | 365 | case TREE_PREV: |
421 | browse_speed = 0; | 366 | case TREE_PREV | BUTTON_REPEAT: |
422 | if(filesindir) { | 367 | if(filesindir) { |
423 | if(dircursor) { | 368 | if(dircursor) { |
424 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, false); | 369 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, false); |
@@ -451,63 +396,9 @@ bool dirbrowse(char *root) | |||
451 | lcd_update(); | 396 | lcd_update(); |
452 | } | 397 | } |
453 | break; | 398 | break; |
454 | case TREE_NEXT | BUTTON_REPEAT: | ||
455 | browse_speed++; /* increase the browse speed every time we get here */ | ||
456 | if(filesindir) | ||
457 | { | ||
458 | if (dircursor + start + 1 < numentries ) { | ||
459 | if(dircursor+1 < TREE_MAX_ON_SCREEN) { | ||
460 | if (browse_speed < 7) { | ||
461 | /* moving the cursor down through a full screen */ | ||
462 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, | ||
463 | false); | ||
464 | dircursor++; | ||
465 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); | ||
466 | } | ||
467 | else { | ||
468 | /* if we have wrapped from the bottom we want to keep up the speed */ | ||
469 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, | ||
470 | false); | ||
471 | dircursor=7; | ||
472 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); | ||
473 | } | ||
474 | |||
475 | } | ||
476 | else { | ||
477 | /* leaving the cursor at bottom line and moving screen up */ | ||
478 | if (browse_speed >= TREE_MAX_ON_SCREEN-1) | ||
479 | /* make sure we do not go past the end of the directory */ | ||
480 | if (start + TREE_MAX_ON_SCREEN - 1 < numentries-TREE_MAX_ON_SCREEN) | ||
481 | start = start + TREE_MAX_ON_SCREEN -1; | ||
482 | else | ||
483 | start = numentries-TREE_MAX_ON_SCREEN; | ||
484 | else | ||
485 | start++; | ||
486 | numentries = showdir(currdir, start); | ||
487 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); | ||
488 | } | ||
489 | } | ||
490 | else { | ||
491 | /* restarting at the top when there is less than 7 files */ | ||
492 | if(numentries < TREE_MAX_ON_SCREEN) { | ||
493 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, | ||
494 | false); | ||
495 | start = dircursor = browse_speed = 0; | ||
496 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); | ||
497 | } | ||
498 | else { | ||
499 | /* restarting at the top when the screen scrolls */ | ||
500 | start = dircursor = 0 ; | ||
501 | numentries = showdir(currdir, start); | ||
502 | put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); | ||
503 | } | ||
504 | } | ||
505 | lcd_update(); | ||
506 | } | ||
507 | break; | ||
508 | 399 | ||
509 | case TREE_NEXT: | 400 | case TREE_NEXT: |
510 | browse_speed = 0; | 401 | case TREE_NEXT | BUTTON_REPEAT: |
511 | if(filesindir) | 402 | if(filesindir) |
512 | { | 403 | { |
513 | if (dircursor + start + 1 < numentries ) { | 404 | if (dircursor + start + 1 < numentries ) { |
@@ -546,7 +437,6 @@ bool dirbrowse(char *root) | |||
546 | #ifdef HAVE_LCD_BITMAP | 437 | #ifdef HAVE_LCD_BITMAP |
547 | bool laststate=statusbar(false); | 438 | bool laststate=statusbar(false); |
548 | #endif | 439 | #endif |
549 | browse_speed = 0; | ||
550 | lcd_stop_scroll(); | 440 | lcd_stop_scroll(); |
551 | main_menu(); | 441 | main_menu(); |
552 | #ifdef HAVE_LCD_BITMAP | 442 | #ifdef HAVE_LCD_BITMAP |
@@ -561,7 +451,6 @@ bool dirbrowse(char *root) | |||
561 | } | 451 | } |
562 | 452 | ||
563 | case BUTTON_ON: | 453 | case BUTTON_ON: |
564 | browse_speed = 0; | ||
565 | if (mpeg_is_playing()) | 454 | if (mpeg_is_playing()) |
566 | { | 455 | { |
567 | lcd_stop_scroll(); | 456 | lcd_stop_scroll(); |