1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dana Conrad 2021-03-14 14:03:00 -05:00 committed by William Wilgus
parent b66990cf77
commit 10d199f9d5
3 changed files with 10 additions and 6 deletions

View file

@ -128,21 +128,25 @@ static bool is_action_filtered(int action, unsigned int mask, int context)
case ACTION_FM_PLAY:
match = has_flag(mask, SEL_ACTION_PLAY);
break;
case ACTION_STD_PREVREPEAT:
case ACTION_STD_NEXTREPEAT:
//case ACTION_STD_PREVREPEAT: // seek not exempted outside of WPS
//case ACTION_STD_NEXTREPEAT:
case ACTION_WPS_SEEKBACK:
case ACTION_WPS_SEEKFWD:
case ACTION_WPS_STOPSEEK:
match = has_flag(mask, SEL_ACTION_SEEK);
break;
case ACTION_STD_PREV:
case ACTION_STD_NEXT:
//case ACTION_STD_PREV: // skip/scrollwheel not exempted outside of WPS
//case ACTION_STD_NEXT:
case ACTION_WPS_SKIPNEXT:
case ACTION_WPS_SKIPPREV:
case ACTION_FM_NEXT_PRESET:
case ACTION_FM_PREV_PRESET:
match = has_flag(mask, SEL_ACTION_SKIP);
break;
#ifdef HAVE_VOLUME_IN_LIST
case ACTION_LIST_VOLUP: // volume exempted outside of WPS if the device supports it
case ACTION_LIST_VOLDOWN:
#endif
case ACTION_WPS_VOLUP:
case ACTION_WPS_VOLDOWN:
match = has_flag(mask, SEL_ACTION_VOL);

View file

@ -394,7 +394,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
int new_audio_status;
redraw_lists = false;
keyclick_set_callback(gui_synclist_keyclick_callback, &lists);
action = get_action(CONTEXT_MAINMENU,
action = get_action(CONTEXT_MAINMENU|ALLOW_SOFTLOCK,
list_do_action_timeout(&lists, HZ));
/* query audio status to see if it changed */

View file

@ -646,7 +646,7 @@ static int dirbrowse(void)
tc.dirlevel = 0; /* shouldnt be needed.. this code needs work! */
keyclick_set_callback(gui_synclist_keyclick_callback, &tree_lists);
button = get_action(CONTEXT_TREE,
button = get_action(CONTEXT_TREE|ALLOW_SOFTLOCK,
list_do_action_timeout(&tree_lists, HZ/2));
oldbutton = button;
gui_synclist_do_button(&tree_lists, &button,LIST_WRAP_UNLESS_HELD);