summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-12-08 21:28:08 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2022-12-09 17:54:02 -0500
commitfc18235323d500b351f627dce4fce105ddd9a330 (patch)
tree72e693329c4e48c8f0c5d2a3af34efe90fdc5127 /apps
parentb63f4c588449f50ad427951f3512f8284a485012 (diff)
downloadrockbox-fc18235323d500b351f627dce4fce105ddd9a330.tar.gz
rockbox-fc18235323d500b351f627dce4fce105ddd9a330.zip
Selective backlight add CONTEXT_MAINMENU
I think its better to just limit this to the mainmenu rather than all contexts Change-Id: If734a9516b14ec96d9e32beceba22419c47c0720
Diffstat (limited to 'apps')
-rw-r--r--apps/action.c17
-rw-r--r--apps/action.h2
2 files changed, 10 insertions, 9 deletions
diff --git a/apps/action.c b/apps/action.c
index 8c03ca4d65..e8c3e8675e 100644
--- a/apps/action.c
+++ b/apps/action.c
@@ -125,7 +125,7 @@ static bool is_action_filtered(int action, unsigned int mask, int context)
125 { 125 {
126 case ACTION_NONE: 126 case ACTION_NONE:
127 break; 127 break;
128/*Actions that are not mapped will not turn on the backlight option NOUNMAPPED*/ 128 /* Actions that are not mapped will not turn on the backlight */
129 case ACTION_UNKNOWN: 129 case ACTION_UNKNOWN:
130 match = has_flag(mask, SEL_ACTION_NOUNMAPPED); 130 match = has_flag(mask, SEL_ACTION_NOUNMAPPED);
131 break; 131 break;
@@ -133,15 +133,15 @@ static bool is_action_filtered(int action, unsigned int mask, int context)
133 case ACTION_FM_PLAY: 133 case ACTION_FM_PLAY:
134 match = has_flag(mask, SEL_ACTION_PLAY); 134 match = has_flag(mask, SEL_ACTION_PLAY);
135 break; 135 break;
136 //case ACTION_STD_PREVREPEAT: // seek not exempted outside of WPS 136 /* case ACTION_STD_PREVREPEAT:*/ /* seek not exempted outside of WPS */
137 //case ACTION_STD_NEXTREPEAT: 137 /* case ACTION_STD_NEXTREPEAT: */
138 case ACTION_WPS_SEEKBACK: 138 case ACTION_WPS_SEEKBACK:
139 case ACTION_WPS_SEEKFWD: 139 case ACTION_WPS_SEEKFWD:
140 case ACTION_WPS_STOPSEEK: 140 case ACTION_WPS_STOPSEEK:
141 match = has_flag(mask, SEL_ACTION_SEEK); 141 match = has_flag(mask, SEL_ACTION_SEEK);
142 break; 142 break;
143 //case ACTION_STD_PREV: // skip/scrollwheel not exempted outside of WPS 143 /* case ACTION_STD_PREV: */ /* skip/scrollwheel not */
144 //case ACTION_STD_NEXT: 144 /* case ACTION_STD_NEXT: */ /* exempted outside of WPS */
145 case ACTION_WPS_SKIPNEXT: 145 case ACTION_WPS_SKIPNEXT:
146 case ACTION_WPS_SKIPPREV: 146 case ACTION_WPS_SKIPPREV:
147 case ACTION_FM_NEXT_PRESET: 147 case ACTION_FM_NEXT_PRESET:
@@ -149,8 +149,8 @@ static bool is_action_filtered(int action, unsigned int mask, int context)
149 match = has_flag(mask, SEL_ACTION_SKIP); 149 match = has_flag(mask, SEL_ACTION_SKIP);
150 break; 150 break;
151#ifdef HAVE_VOLUME_IN_LIST 151#ifdef HAVE_VOLUME_IN_LIST
152 case ACTION_LIST_VOLUP: // volume exempted outside of WPS if the device supports it 152 case ACTION_LIST_VOLUP: /* volume exempted outside of WPS */
153 case ACTION_LIST_VOLDOWN: 153 case ACTION_LIST_VOLDOWN: /* ( if the device supports it )*/
154#endif 154#endif
155 case ACTION_WPS_VOLUP: 155 case ACTION_WPS_VOLUP:
156 case ACTION_WPS_VOLDOWN: 156 case ACTION_WPS_VOLDOWN:
@@ -1001,7 +1001,8 @@ static inline int do_backlight(action_last_t *last, action_cur_t *cur, int actio
1001 && power_input_present()); 1001 && power_input_present());
1002#endif 1002#endif
1003 /* skip if backlight on | incorrect context | SEL_ACTION_NOEXT + ext pwr */ 1003 /* skip if backlight on | incorrect context | SEL_ACTION_NOEXT + ext pwr */
1004 if ((cur->context == CONTEXT_FM || cur->context == CONTEXT_WPS) && bl_is_off) 1004 if (bl_is_off && (cur->context == CONTEXT_FM || cur->context == CONTEXT_WPS ||
1005 cur->context == CONTEXT_MAINMENU))
1005 { 1006 {
1006 filtered = is_action_filtered(action, last->backlight_mask, cur->context); 1007 filtered = is_action_filtered(action, last->backlight_mask, cur->context);
1007 bl_activate = !is_action_discarded(cur, filtered, &last->bl_filter_tick); 1008 bl_activate = !is_action_discarded(cur, filtered, &last->bl_filter_tick);
diff --git a/apps/action.h b/apps/action.h
index 444437edf8..a3c21ec8a6 100644
--- a/apps/action.h
+++ b/apps/action.h
@@ -95,7 +95,7 @@ void set_selective_backlight_actions(bool selective, unsigned int mask,
95enum { 95enum {
96 CONTEXT_STD = 0, 96 CONTEXT_STD = 0,
97 /* These CONTEXT_ values were here before me, 97 /* These CONTEXT_ values were here before me,
98 there values may have significance, so dont touch! */ 98 their values may have significance, so dont touch! */
99 CONTEXT_WPS = 1, 99 CONTEXT_WPS = 1,
100 CONTEXT_TREE = 2, 100 CONTEXT_TREE = 2,
101 CONTEXT_RECORD = 3, 101 CONTEXT_RECORD = 3,