diff options
Diffstat (limited to 'apps/menus/display_menu.c')
-rw-r--r-- | apps/menus/display_menu.c | 123 |
1 files changed, 96 insertions, 27 deletions
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c index 948dcede00..5d53cbfe16 100644 --- a/apps/menus/display_menu.c +++ b/apps/menus/display_menu.c | |||
@@ -38,6 +38,10 @@ | |||
38 | #ifdef HAVE_REMOTE_LCD | 38 | #ifdef HAVE_REMOTE_LCD |
39 | #include "lcd-remote.h" | 39 | #include "lcd-remote.h" |
40 | #endif | 40 | #endif |
41 | #ifdef HAVE_BACKLIGHT | ||
42 | #include "mask_select.h" | ||
43 | #include "splash.h" | ||
44 | #endif | ||
41 | #ifdef HAVE_TOUCHSCREEN | 45 | #ifdef HAVE_TOUCHSCREEN |
42 | #include "screens.h" | 46 | #include "screens.h" |
43 | #endif | 47 | #endif |
@@ -46,9 +50,29 @@ | |||
46 | #include "rbunicode.h" | 50 | #include "rbunicode.h" |
47 | 51 | ||
48 | #ifdef HAVE_BACKLIGHT | 52 | #ifdef HAVE_BACKLIGHT |
49 | static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) | 53 | static int selectivebacklight_callback(int action,const struct menu_item_ex *this_item) |
50 | { | 54 | { |
51 | (void)this_item; | 55 | (void)this_item; |
56 | |||
57 | switch (action) | ||
58 | { | ||
59 | case ACTION_EXIT_MENUITEM: | ||
60 | case ACTION_STD_MENU: | ||
61 | case ACTION_STD_CANCEL: | ||
62 | set_selective_backlight_actions( | ||
63 | global_settings.bl_selective_actions, | ||
64 | global_settings.bl_selective_actions_mask, | ||
65 | global_settings.bl_filter_first_keypress); | ||
66 | break; | ||
67 | } | ||
68 | |||
69 | return action; | ||
70 | } | ||
71 | |||
72 | static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) | ||
73 | { | ||
74 | /*(void)this_item;REMOVED*/ | ||
75 | |||
52 | switch (action) | 76 | switch (action) |
53 | { | 77 | { |
54 | case ACTION_EXIT_MENUITEM: | 78 | case ACTION_EXIT_MENUITEM: |
@@ -56,13 +80,43 @@ static int filterfirstkeypress_callback(int action,const struct menu_item_ex *th | |||
56 | #ifdef HAVE_REMOTE_LCD | 80 | #ifdef HAVE_REMOTE_LCD |
57 | set_remote_backlight_filter_keypress( | 81 | set_remote_backlight_filter_keypress( |
58 | global_settings.remote_bl_filter_first_keypress); | 82 | global_settings.remote_bl_filter_first_keypress); |
59 | #endif | 83 | #endif /* HAVE_REMOTE_LCD */ |
60 | 84 | selectivebacklight_callback(action,this_item);/*uses Filter First KP*/ | |
61 | break; | 85 | break; |
62 | } | 86 | } |
87 | |||
63 | return action; | 88 | return action; |
64 | } | 89 | } |
90 | |||
91 | static int selectivebacklight_set_mask(void* param) | ||
92 | { | ||
93 | (void)param; | ||
94 | int mask = global_settings.bl_selective_actions_mask; | ||
95 | struct s_mask_items maskitems[]={ | ||
96 | {ID2P(LANG_VOLUME) , SEL_ACTION_VOL}, | ||
97 | {ID2P(LANG_ACTION_PLAY), SEL_ACTION_PLAY}, | ||
98 | {ID2P(LANG_ACTION_SEEK), SEL_ACTION_SEEK}, | ||
99 | {ID2P(LANG_ACTION_SKIP), SEL_ACTION_SKIP}, | ||
100 | {ID2P(LANG_ACTION_DISABLE_UNMAPPED), SEL_ACTION_NOUNMAPPED} | ||
101 | #if CONFIG_CHARGING | ||
102 | ,{ID2P(LANG_ACTION_DISABLE_EXT_POWER), SEL_ACTION_NOEXT} | ||
65 | #endif | 103 | #endif |
104 | }; | ||
105 | |||
106 | mask = mask_select(mask, ID2P(LANG_BACKLIGHT_SELECTIVE) | ||
107 | , maskitems, ARRAYLEN(maskitems)); | ||
108 | |||
109 | if (mask == SEL_ACTION_NONE || mask == SEL_ACTION_NOEXT) | ||
110 | global_settings.bl_selective_actions = false; | ||
111 | else if (global_settings.bl_selective_actions_mask != mask) | ||
112 | global_settings.bl_selective_actions = true; | ||
113 | |||
114 | global_settings.bl_selective_actions_mask = mask; | ||
115 | |||
116 | return true; | ||
117 | } | ||
118 | |||
119 | #endif /* HAVE_BACKLIGHT */ | ||
66 | #ifdef HAVE_LCD_FLIP | 120 | #ifdef HAVE_LCD_FLIP |
67 | static int flipdisplay_callback(int action,const struct menu_item_ex *this_item) | 121 | static int flipdisplay_callback(int action,const struct menu_item_ex *this_item) |
68 | { | 122 | { |
@@ -88,11 +142,11 @@ static int flipdisplay_callback(int action,const struct menu_item_ex *this_item) | |||
88 | #ifdef HAVE_BACKLIGHT | 142 | #ifdef HAVE_BACKLIGHT |
89 | MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL); | 143 | MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL); |
90 | #if CONFIG_CHARGING | 144 | #if CONFIG_CHARGING |
91 | MENUITEM_SETTING(backlight_timeout_plugged, | 145 | MENUITEM_SETTING(backlight_timeout_plugged, |
92 | &global_settings.backlight_timeout_plugged, NULL); | 146 | &global_settings.backlight_timeout_plugged, NULL); |
93 | #endif | 147 | #endif |
94 | #ifdef HAS_BUTTON_HOLD | 148 | #ifdef HAS_BUTTON_HOLD |
95 | MENUITEM_SETTING(backlight_on_button_hold, | 149 | MENUITEM_SETTING(backlight_on_button_hold, |
96 | &global_settings.backlight_on_button_hold, NULL); | 150 | &global_settings.backlight_on_button_hold, NULL); |
97 | #endif | 151 | #endif |
98 | MENUITEM_SETTING(caption_backlight, &global_settings.caption_backlight, NULL); | 152 | MENUITEM_SETTING(caption_backlight, &global_settings.caption_backlight, NULL); |
@@ -101,9 +155,21 @@ MENUITEM_SETTING(caption_backlight, &global_settings.caption_backlight, NULL); | |||
101 | MENUITEM_SETTING(backlight_fade_in, &global_settings.backlight_fade_in, NULL); | 155 | MENUITEM_SETTING(backlight_fade_in, &global_settings.backlight_fade_in, NULL); |
102 | MENUITEM_SETTING(backlight_fade_out, &global_settings.backlight_fade_out, NULL); | 156 | MENUITEM_SETTING(backlight_fade_out, &global_settings.backlight_fade_out, NULL); |
103 | #endif | 157 | #endif |
104 | MENUITEM_SETTING(bl_filter_first_keypress, | 158 | MENUITEM_SETTING(bl_filter_first_keypress, |
105 | &global_settings.bl_filter_first_keypress, | 159 | &global_settings.bl_filter_first_keypress, |
106 | filterfirstkeypress_callback); | 160 | filterfirstkeypress_callback); |
161 | |||
162 | MENUITEM_SETTING(bl_selective_actions, | ||
163 | &global_settings.bl_selective_actions, | ||
164 | selectivebacklight_callback); | ||
165 | |||
166 | MENUITEM_FUNCTION(sel_backlight_mask, 0, ID2P(LANG_SETTINGS), | ||
167 | selectivebacklight_set_mask, NULL, | ||
168 | selectivebacklight_callback, Icon_Menu_setting); | ||
169 | |||
170 | MAKE_MENU(sel_backlight, ID2P(LANG_BACKLIGHT_SELECTIVE), | ||
171 | NULL, Icon_Menu_setting, &bl_selective_actions, &sel_backlight_mask); | ||
172 | |||
107 | #ifdef HAVE_LCD_SLEEP_SETTING | 173 | #ifdef HAVE_LCD_SLEEP_SETTING |
108 | MENUITEM_SETTING(lcd_sleep_after_backlight_off, | 174 | MENUITEM_SETTING(lcd_sleep_after_backlight_off, |
109 | &global_settings.lcd_sleep_after_backlight_off, NULL); | 175 | &global_settings.lcd_sleep_after_backlight_off, NULL); |
@@ -124,6 +190,8 @@ MENUITEM_SETTING(flip_display, &global_settings.flip_display, flipdisplay_callba | |||
124 | #endif | 190 | #endif |
125 | #endif /* HAVE_LCD_BITMAP */ | 191 | #endif /* HAVE_LCD_BITMAP */ |
126 | 192 | ||
193 | |||
194 | |||
127 | /* now the actual menu */ | 195 | /* now the actual menu */ |
128 | MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU), | 196 | MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU), |
129 | NULL, Icon_Display_menu | 197 | NULL, Icon_Display_menu |
@@ -141,6 +209,7 @@ MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU), | |||
141 | ,&backlight_fade_in, &backlight_fade_out | 209 | ,&backlight_fade_in, &backlight_fade_out |
142 | #endif | 210 | #endif |
143 | ,&bl_filter_first_keypress | 211 | ,&bl_filter_first_keypress |
212 | ,&sel_backlight | ||
144 | # ifdef HAVE_LCD_SLEEP_SETTING | 213 | # ifdef HAVE_LCD_SLEEP_SETTING |
145 | ,&lcd_sleep_after_backlight_off | 214 | ,&lcd_sleep_after_backlight_off |
146 | # endif | 215 | # endif |
@@ -167,31 +236,31 @@ MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU), | |||
167 | /********************************/ | 236 | /********************************/ |
168 | /* Remote LCD settings menu */ | 237 | /* Remote LCD settings menu */ |
169 | #ifdef HAVE_REMOTE_LCD | 238 | #ifdef HAVE_REMOTE_LCD |
170 | MENUITEM_SETTING(remote_backlight_timeout, | 239 | MENUITEM_SETTING(remote_backlight_timeout, |
171 | &global_settings.remote_backlight_timeout, NULL); | 240 | &global_settings.remote_backlight_timeout, NULL); |
172 | 241 | ||
173 | #if CONFIG_CHARGING | 242 | #if CONFIG_CHARGING |
174 | MENUITEM_SETTING(remote_backlight_timeout_plugged, | 243 | MENUITEM_SETTING(remote_backlight_timeout_plugged, |
175 | &global_settings.remote_backlight_timeout_plugged, NULL); | 244 | &global_settings.remote_backlight_timeout_plugged, NULL); |
176 | #endif | 245 | #endif |
177 | 246 | ||
178 | #ifdef HAS_REMOTE_BUTTON_HOLD | 247 | #ifdef HAS_REMOTE_BUTTON_HOLD |
179 | MENUITEM_SETTING(remote_backlight_on_button_hold, | 248 | MENUITEM_SETTING(remote_backlight_on_button_hold, |
180 | &global_settings.remote_backlight_on_button_hold, NULL); | 249 | &global_settings.remote_backlight_on_button_hold, NULL); |
181 | #endif | 250 | #endif |
182 | 251 | ||
183 | MENUITEM_SETTING(remote_caption_backlight, | 252 | MENUITEM_SETTING(remote_caption_backlight, |
184 | &global_settings.remote_caption_backlight, NULL); | 253 | &global_settings.remote_caption_backlight, NULL); |
185 | MENUITEM_SETTING(remote_bl_filter_first_keypress, | 254 | MENUITEM_SETTING(remote_bl_filter_first_keypress, |
186 | &global_settings.remote_bl_filter_first_keypress, | 255 | &global_settings.remote_bl_filter_first_keypress, |
187 | filterfirstkeypress_callback); | 256 | filterfirstkeypress_callback); |
188 | MENUITEM_SETTING(remote_contrast, | 257 | MENUITEM_SETTING(remote_contrast, |
189 | &global_settings.remote_contrast, NULL); | 258 | &global_settings.remote_contrast, NULL); |
190 | MENUITEM_SETTING(remote_invert, | 259 | MENUITEM_SETTING(remote_invert, |
191 | &global_settings.remote_invert, NULL); | 260 | &global_settings.remote_invert, NULL); |
192 | 261 | ||
193 | #ifdef HAVE_LCD_FLIP | 262 | #ifdef HAVE_LCD_FLIP |
194 | MENUITEM_SETTING(remote_flip_display, | 263 | MENUITEM_SETTING(remote_flip_display, |
195 | &global_settings.remote_flip_display, flipdisplay_callback); | 264 | &global_settings.remote_flip_display, flipdisplay_callback); |
196 | #endif | 265 | #endif |
197 | 266 | ||
@@ -207,7 +276,7 @@ static int ticking_callback(int action,const struct menu_item_ex *this_item) | |||
207 | } | 276 | } |
208 | return action; | 277 | return action; |
209 | } | 278 | } |
210 | MENUITEM_SETTING(remote_reduce_ticking, | 279 | MENUITEM_SETTING(remote_reduce_ticking, |
211 | &global_settings.remote_reduce_ticking, ticking_callback); | 280 | &global_settings.remote_reduce_ticking, ticking_callback); |
212 | #endif | 281 | #endif |
213 | 282 | ||
@@ -222,7 +291,7 @@ MAKE_MENU(lcd_remote_settings, ID2P(LANG_LCD_REMOTE_MENU), | |||
222 | #endif | 291 | #endif |
223 | &remote_caption_backlight, &remote_bl_filter_first_keypress, | 292 | &remote_caption_backlight, &remote_bl_filter_first_keypress, |
224 | &remote_contrast, &remote_invert | 293 | &remote_contrast, &remote_invert |
225 | 294 | ||
226 | #ifdef HAVE_LCD_FLIP | 295 | #ifdef HAVE_LCD_FLIP |
227 | ,&remote_flip_display | 296 | ,&remote_flip_display |
228 | #endif | 297 | #endif |
@@ -319,15 +388,15 @@ static int peakmeter_callback(int action,const struct menu_item_ex *this_item) | |||
319 | } | 388 | } |
320 | return action; | 389 | return action; |
321 | } | 390 | } |
322 | MENUITEM_SETTING(peak_meter_hold, | 391 | MENUITEM_SETTING(peak_meter_hold, |
323 | &global_settings.peak_meter_hold, peakmeter_callback); | 392 | &global_settings.peak_meter_hold, peakmeter_callback); |
324 | MENUITEM_SETTING(peak_meter_clip_hold, | 393 | MENUITEM_SETTING(peak_meter_clip_hold, |
325 | &global_settings.peak_meter_clip_hold, peakmeter_callback); | 394 | &global_settings.peak_meter_clip_hold, peakmeter_callback); |
326 | #ifdef HAVE_RECORDING | 395 | #ifdef HAVE_RECORDING |
327 | MENUITEM_SETTING(peak_meter_clipcounter, | 396 | MENUITEM_SETTING(peak_meter_clipcounter, |
328 | &global_settings.peak_meter_clipcounter, NULL); | 397 | &global_settings.peak_meter_clipcounter, NULL); |
329 | #endif | 398 | #endif |
330 | MENUITEM_SETTING(peak_meter_release, | 399 | MENUITEM_SETTING(peak_meter_release, |
331 | &global_settings.peak_meter_release, peakmeter_callback); | 400 | &global_settings.peak_meter_release, peakmeter_callback); |
332 | /** | 401 | /** |
333 | * Menu to select wether the scale of the meter | 402 | * Menu to select wether the scale of the meter |
@@ -356,7 +425,7 @@ static int peak_meter_scale(void) { | |||
356 | /* we only store -dBfs */ | 425 | /* we only store -dBfs */ |
357 | global_settings.peak_meter_min = -peak_meter_get_min() / 100; | 426 | global_settings.peak_meter_min = -peak_meter_get_min() / 100; |
358 | global_settings.peak_meter_max = -peak_meter_get_max() / 100; | 427 | global_settings.peak_meter_max = -peak_meter_get_max() / 100; |
359 | 428 | ||
360 | /* limit the returned value to the allowed range */ | 429 | /* limit the returned value to the allowed range */ |
361 | if(global_settings.peak_meter_min > 89) | 430 | if(global_settings.peak_meter_min > 89) |
362 | global_settings.peak_meter_min = 89; | 431 | global_settings.peak_meter_min = 89; |
@@ -472,12 +541,12 @@ MENUITEM_FUNCTION(histogram, 0, | |||
472 | 541 | ||
473 | MENUITEM_FUNCTION(peak_meter_scale_item, 0, ID2P(LANG_PM_SCALE), | 542 | MENUITEM_FUNCTION(peak_meter_scale_item, 0, ID2P(LANG_PM_SCALE), |
474 | peak_meter_scale, NULL, NULL, Icon_NOICON); | 543 | peak_meter_scale, NULL, NULL, Icon_NOICON); |
475 | MENUITEM_FUNCTION(peak_meter_min_item, 0, ID2P(LANG_PM_MIN), | 544 | MENUITEM_FUNCTION(peak_meter_min_item, 0, ID2P(LANG_PM_MIN), |
476 | peak_meter_min, NULL, NULL, Icon_NOICON); | 545 | peak_meter_min, NULL, NULL, Icon_NOICON); |
477 | MENUITEM_FUNCTION(peak_meter_max_item, 0, ID2P(LANG_PM_MAX), | 546 | MENUITEM_FUNCTION(peak_meter_max_item, 0, ID2P(LANG_PM_MAX), |
478 | peak_meter_max, NULL, NULL, Icon_NOICON); | 547 | peak_meter_max, NULL, NULL, Icon_NOICON); |
479 | MAKE_MENU(peak_meter_menu, ID2P(LANG_PM_MENU), NULL, Icon_NOICON, | 548 | MAKE_MENU(peak_meter_menu, ID2P(LANG_PM_MENU), NULL, Icon_NOICON, |
480 | &peak_meter_release, &peak_meter_hold, | 549 | &peak_meter_release, &peak_meter_hold, |
481 | &peak_meter_clip_hold, | 550 | &peak_meter_clip_hold, |
482 | #ifdef HAVE_RECORDING | 551 | #ifdef HAVE_RECORDING |
483 | &peak_meter_clipcounter, | 552 | &peak_meter_clipcounter, |