diff options
author | Dana Conrad <dconrad@fastmail.com> | 2021-03-14 14:03:00 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2021-05-24 02:30:09 +0000 |
commit | 10d199f9d5bf85136211c0811e29679787343375 (patch) | |
tree | 6fd57cb5cf8bac3e23b65dfd469d57bee969e6fc | |
parent | b66990cf77b1726b2cda1e9225a06df71738d46b (diff) | |
download | rockbox-10d199f9d5bf85136211c0811e29679787343375.tar.gz rockbox-10d199f9d5bf85136211c0811e29679787343375.zip |
Allow Softlock to happen in most contexts
All this tested on erosq, I'm not sure if this will break on other targets or if there is a reason this shouldn't be done.
apps/menu.c:
Added CONTEXT_MAINMENU|ALLOW_SOFTLOCK in do_menu(), this allows the user to lock the keys in most places within the main menu tree.
apps/tree.c:
Added CONTEXT_TREE|ALLOW_SOFTLOCK in dirbrowse(), this allows locking the keys in most other contexts not covered by the above.
Notable exceptions I've found that still cannot be locked: View Playlist, any settings change screen (ex. Shuffle No/Yes, Volume Select dB)
Adding fix for Advanced Key Lock feature brought to light by this change in apps/action.c.
Expected behavior for Advanced keylock is now (according to my testing here):
Volume: Can be exempted from keylock anywhere
Skip/Scrollwheel: Can only be exempted in WPS
Seek: Can only be exempted in WPS
Play: Can only be exempted in WPS
Backlight exemption is same except the Volume exemption doesn't work outside the WPS, but I don't believe that is due to this change.
Change-Id: Ifa3d1a03cf4884520a37dd91ed53a825cdb66778
-rw-r--r-- | apps/action.c | 12 | ||||
-rw-r--r-- | apps/menu.c | 2 | ||||
-rw-r--r-- | apps/tree.c | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/apps/action.c b/apps/action.c index 74f0a3d7df..07032f7ae7 100644 --- a/apps/action.c +++ b/apps/action.c | |||
@@ -128,21 +128,25 @@ static bool is_action_filtered(int action, unsigned int mask, int context) | |||
128 | case ACTION_FM_PLAY: | 128 | case ACTION_FM_PLAY: |
129 | match = has_flag(mask, SEL_ACTION_PLAY); | 129 | match = has_flag(mask, SEL_ACTION_PLAY); |
130 | break; | 130 | break; |
131 | case ACTION_STD_PREVREPEAT: | 131 | //case ACTION_STD_PREVREPEAT: // seek not exempted outside of WPS |
132 | case ACTION_STD_NEXTREPEAT: | 132 | //case ACTION_STD_NEXTREPEAT: |
133 | case ACTION_WPS_SEEKBACK: | 133 | case ACTION_WPS_SEEKBACK: |
134 | case ACTION_WPS_SEEKFWD: | 134 | case ACTION_WPS_SEEKFWD: |
135 | case ACTION_WPS_STOPSEEK: | 135 | case ACTION_WPS_STOPSEEK: |
136 | match = has_flag(mask, SEL_ACTION_SEEK); | 136 | match = has_flag(mask, SEL_ACTION_SEEK); |
137 | break; | 137 | break; |
138 | case ACTION_STD_PREV: | 138 | //case ACTION_STD_PREV: // skip/scrollwheel not exempted outside of WPS |
139 | case ACTION_STD_NEXT: | 139 | //case ACTION_STD_NEXT: |
140 | case ACTION_WPS_SKIPNEXT: | 140 | case ACTION_WPS_SKIPNEXT: |
141 | case ACTION_WPS_SKIPPREV: | 141 | case ACTION_WPS_SKIPPREV: |
142 | case ACTION_FM_NEXT_PRESET: | 142 | case ACTION_FM_NEXT_PRESET: |
143 | case ACTION_FM_PREV_PRESET: | 143 | case ACTION_FM_PREV_PRESET: |
144 | match = has_flag(mask, SEL_ACTION_SKIP); | 144 | match = has_flag(mask, SEL_ACTION_SKIP); |
145 | break; | 145 | break; |
146 | #ifdef HAVE_VOLUME_IN_LIST | ||
147 | case ACTION_LIST_VOLUP: // volume exempted outside of WPS if the device supports it | ||
148 | case ACTION_LIST_VOLDOWN: | ||
149 | #endif | ||
146 | case ACTION_WPS_VOLUP: | 150 | case ACTION_WPS_VOLUP: |
147 | case ACTION_WPS_VOLDOWN: | 151 | case ACTION_WPS_VOLDOWN: |
148 | match = has_flag(mask, SEL_ACTION_VOL); | 152 | match = has_flag(mask, SEL_ACTION_VOL); |
diff --git a/apps/menu.c b/apps/menu.c index b25aa46a2c..6279ec10a6 100644 --- a/apps/menu.c +++ b/apps/menu.c | |||
@@ -394,7 +394,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, | |||
394 | int new_audio_status; | 394 | int new_audio_status; |
395 | redraw_lists = false; | 395 | redraw_lists = false; |
396 | keyclick_set_callback(gui_synclist_keyclick_callback, &lists); | 396 | keyclick_set_callback(gui_synclist_keyclick_callback, &lists); |
397 | action = get_action(CONTEXT_MAINMENU, | 397 | action = get_action(CONTEXT_MAINMENU|ALLOW_SOFTLOCK, |
398 | list_do_action_timeout(&lists, HZ)); | 398 | list_do_action_timeout(&lists, HZ)); |
399 | 399 | ||
400 | /* query audio status to see if it changed */ | 400 | /* query audio status to see if it changed */ |
diff --git a/apps/tree.c b/apps/tree.c index 9e4aafccfe..88ccff5e37 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -646,7 +646,7 @@ static int dirbrowse(void) | |||
646 | tc.dirlevel = 0; /* shouldnt be needed.. this code needs work! */ | 646 | tc.dirlevel = 0; /* shouldnt be needed.. this code needs work! */ |
647 | 647 | ||
648 | keyclick_set_callback(gui_synclist_keyclick_callback, &tree_lists); | 648 | keyclick_set_callback(gui_synclist_keyclick_callback, &tree_lists); |
649 | button = get_action(CONTEXT_TREE, | 649 | button = get_action(CONTEXT_TREE|ALLOW_SOFTLOCK, |
650 | list_do_action_timeout(&tree_lists, HZ/2)); | 650 | list_do_action_timeout(&tree_lists, HZ/2)); |
651 | oldbutton = button; | 651 | oldbutton = button; |
652 | gui_synclist_do_button(&tree_lists, &button,LIST_WRAP_UNLESS_HELD); | 652 | gui_synclist_do_button(&tree_lists, &button,LIST_WRAP_UNLESS_HELD); |