diff options
author | Jens Arnold <amiconn@rockbox.org> | 2004-10-24 20:32:15 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2004-10-24 20:32:15 +0000 |
commit | 821e625e743edad8b65807f10cf97f43422bc8ec (patch) | |
tree | 48195ec2d5293d125e468c06c056fcbe20bcdc9d /apps | |
parent | ce82d8b8c8f58aea53f34f5c843cf49222667a1c (diff) | |
download | rockbox-821e625e743edad8b65807f10cf97f43422bc8ec.tar.gz rockbox-821e625e743edad8b65807f10cf97f43422bc8ec.zip |
Fixes: (1) Selecting previous file/dir via remote in browser works again (typo). (2) The resume request should now always work as intended, properly ignoring button releases. The power button (ON for recorder/player, OFF for ondio) is now only ignored until the first release.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5337 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/tree.c | 30 | ||||
-rw-r--r-- | apps/tree.h | 7 |
2 files changed, 28 insertions, 9 deletions
diff --git a/apps/tree.c b/apps/tree.c index 89864f5be5..745b4ebef6 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -739,6 +739,7 @@ static bool ask_resume(bool ask_once) | |||
739 | { | 739 | { |
740 | int button; | 740 | int button; |
741 | bool stop = false; | 741 | bool stop = false; |
742 | static bool ignore_power = true; | ||
742 | 743 | ||
743 | #ifdef HAVE_LCD_CHARCELLS | 744 | #ifdef HAVE_LCD_CHARCELLS |
744 | lcd_double_height(false); | 745 | lcd_double_height(false); |
@@ -767,22 +768,35 @@ static bool ask_resume(bool ask_once) | |||
767 | while (!stop) { | 768 | while (!stop) { |
768 | button = button_get(true); | 769 | button = button_get(true); |
769 | switch (button) { | 770 | switch (button) { |
771 | #ifdef TREE_RUN_PRE | ||
772 | case TREE_RUN_PRE: /* catch the press, not the release */ | ||
773 | #else | ||
770 | case TREE_RUN: | 774 | case TREE_RUN: |
775 | #endif | ||
771 | #ifdef TREE_RC_RUN | 776 | #ifdef TREE_RC_RUN |
772 | case TREE_RC_RUN: | 777 | case TREE_RC_RUN: |
773 | #endif | 778 | #endif |
779 | ignore_power = false; | ||
780 | /* Don't ignore the power button for subsequent calls */ | ||
774 | return true; | 781 | return true; |
775 | 782 | ||
776 | #ifdef BUTTON_ON | 783 | #ifdef TREE_POWER_BTN |
777 | /* ignore the ON button, since it might | 784 | /* Initially ignore the button which powers on the box. It |
778 | still be pressed since booting */ | 785 | might still be pressed since booting. */ |
779 | case BUTTON_ON: | 786 | case TREE_POWER_BTN: |
780 | case BUTTON_ON | BUTTON_REL: | 787 | case TREE_POWER_BTN | BUTTON_REPEAT: |
781 | case BUTTON_ON | BUTTON_REPEAT: | 788 | if(!ignore_power) |
789 | stop = true; | ||
790 | break; | ||
791 | |||
792 | /* No longer ignore the power button after it was released */ | ||
793 | case TREE_POWER_BTN | BUTTON_REL: | ||
794 | ignore_power = false; | ||
782 | break; | 795 | break; |
783 | #endif | 796 | #endif |
797 | /* Handle sys events, ignore button releases */ | ||
784 | default: | 798 | default: |
785 | if(default_event_handler(button) || (button & BUTTON_REL)) | 799 | if(default_event_handler(button) || !(button & BUTTON_REL)) |
786 | stop = true; | 800 | stop = true; |
787 | break; | 801 | break; |
788 | } | 802 | } |
@@ -793,6 +807,8 @@ static bool ask_resume(bool ask_once) | |||
793 | settings_save(); | 807 | settings_save(); |
794 | } | 808 | } |
795 | 809 | ||
810 | ignore_power = false; | ||
811 | /* Don't ignore the power button for subsequent calls */ | ||
796 | return false; | 812 | return false; |
797 | } | 813 | } |
798 | 814 | ||
diff --git a/apps/tree.h b/apps/tree.h index de5f2d0e01..880c26af4e 100644 --- a/apps/tree.h +++ b/apps/tree.h | |||
@@ -36,9 +36,10 @@ | |||
36 | #define TREE_PGDN (BUTTON_ON | BUTTON_DOWN) | 36 | #define TREE_PGDN (BUTTON_ON | BUTTON_DOWN) |
37 | #define TREE_CONTEXT (BUTTON_PLAY | BUTTON_REPEAT) | 37 | #define TREE_CONTEXT (BUTTON_PLAY | BUTTON_REPEAT) |
38 | #define TREE_CONTEXT2 (BUTTON_ON | BUTTON_PLAY) | 38 | #define TREE_CONTEXT2 (BUTTON_ON | BUTTON_PLAY) |
39 | #define TREE_POWER_BTN BUTTON_ON | ||
39 | 40 | ||
40 | #define TREE_RC_NEXT BUTTON_RC_RIGHT | 41 | #define TREE_RC_NEXT BUTTON_RC_RIGHT |
41 | #define TREE_RC_REV BUTTON_RC_LEFT | 42 | #define TREE_RC_PREV BUTTON_RC_LEFT |
42 | #define TREE_RC_EXIT BUTTON_RC_STOP | 43 | #define TREE_RC_EXIT BUTTON_RC_STOP |
43 | #define TREE_RC_ENTER BUTTON_RC_PLAY | 44 | #define TREE_RC_ENTER BUTTON_RC_PLAY |
44 | #define TREE_RC_RUN BUTTON_RC_PLAY | 45 | #define TREE_RC_RUN BUTTON_RC_PLAY |
@@ -54,9 +55,10 @@ | |||
54 | #define TREE_WPS_PRE BUTTON_ON | 55 | #define TREE_WPS_PRE BUTTON_ON |
55 | #define TREE_CONTEXT (BUTTON_PLAY | BUTTON_REPEAT) | 56 | #define TREE_CONTEXT (BUTTON_PLAY | BUTTON_REPEAT) |
56 | #define TREE_CONTEXT2 (BUTTON_ON | BUTTON_PLAY) | 57 | #define TREE_CONTEXT2 (BUTTON_ON | BUTTON_PLAY) |
58 | #define TREE_POWER_BTN BUTTON_ON | ||
57 | 59 | ||
58 | #define TREE_RC_NEXT BUTTON_RC_RIGHT | 60 | #define TREE_RC_NEXT BUTTON_RC_RIGHT |
59 | #define TREE_RC_REV BUTTON_RC_LEFT | 61 | #define TREE_RC_PREV BUTTON_RC_LEFT |
60 | #define TREE_RC_EXIT BUTTON_RC_STOP | 62 | #define TREE_RC_EXIT BUTTON_RC_STOP |
61 | #define TREE_RC_ENTER BUTTON_RC_PLAY | 63 | #define TREE_RC_ENTER BUTTON_RC_PLAY |
62 | #define TREE_RC_RUN BUTTON_RC_PLAY | 64 | #define TREE_RC_RUN BUTTON_RC_PLAY |
@@ -71,6 +73,7 @@ | |||
71 | #define TREE_WPS (BUTTON_MENU | BUTTON_REL) | 73 | #define TREE_WPS (BUTTON_MENU | BUTTON_REL) |
72 | #define TREE_WPS_PRE BUTTON_MENU | 74 | #define TREE_WPS_PRE BUTTON_MENU |
73 | #define TREE_CONTEXT (BUTTON_RIGHT | BUTTON_REPEAT) | 75 | #define TREE_CONTEXT (BUTTON_RIGHT | BUTTON_REPEAT) |
76 | #define TREE_POWER_BTN BUTTON_OFF | ||
74 | 77 | ||
75 | #endif | 78 | #endif |
76 | 79 | ||