summaryrefslogtreecommitdiff
path: root/apps/menus/display_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/menus/display_menu.c')
-rw-r--r--apps/menus/display_menu.c123
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
49static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) 53static 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
72static 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
91static 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
67static int flipdisplay_callback(int action,const struct menu_item_ex *this_item) 121static 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
89MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL); 143MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL);
90#if CONFIG_CHARGING 144#if CONFIG_CHARGING
91MENUITEM_SETTING(backlight_timeout_plugged, 145MENUITEM_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
95MENUITEM_SETTING(backlight_on_button_hold, 149MENUITEM_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
98MENUITEM_SETTING(caption_backlight, &global_settings.caption_backlight, NULL); 152MENUITEM_SETTING(caption_backlight, &global_settings.caption_backlight, NULL);
@@ -101,9 +155,21 @@ MENUITEM_SETTING(caption_backlight, &global_settings.caption_backlight, NULL);
101MENUITEM_SETTING(backlight_fade_in, &global_settings.backlight_fade_in, NULL); 155MENUITEM_SETTING(backlight_fade_in, &global_settings.backlight_fade_in, NULL);
102MENUITEM_SETTING(backlight_fade_out, &global_settings.backlight_fade_out, NULL); 156MENUITEM_SETTING(backlight_fade_out, &global_settings.backlight_fade_out, NULL);
103#endif 157#endif
104MENUITEM_SETTING(bl_filter_first_keypress, 158MENUITEM_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
162MENUITEM_SETTING(bl_selective_actions,
163 &global_settings.bl_selective_actions,
164 selectivebacklight_callback);
165
166MENUITEM_FUNCTION(sel_backlight_mask, 0, ID2P(LANG_SETTINGS),
167 selectivebacklight_set_mask, NULL,
168 selectivebacklight_callback, Icon_Menu_setting);
169
170MAKE_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
108MENUITEM_SETTING(lcd_sleep_after_backlight_off, 174MENUITEM_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 */
128MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU), 196MAKE_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
170MENUITEM_SETTING(remote_backlight_timeout, 239MENUITEM_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
174MENUITEM_SETTING(remote_backlight_timeout_plugged, 243MENUITEM_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
179MENUITEM_SETTING(remote_backlight_on_button_hold, 248MENUITEM_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
183MENUITEM_SETTING(remote_caption_backlight, 252MENUITEM_SETTING(remote_caption_backlight,
184 &global_settings.remote_caption_backlight, NULL); 253 &global_settings.remote_caption_backlight, NULL);
185MENUITEM_SETTING(remote_bl_filter_first_keypress, 254MENUITEM_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);
188MENUITEM_SETTING(remote_contrast, 257MENUITEM_SETTING(remote_contrast,
189 &global_settings.remote_contrast, NULL); 258 &global_settings.remote_contrast, NULL);
190MENUITEM_SETTING(remote_invert, 259MENUITEM_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
194MENUITEM_SETTING(remote_flip_display, 263MENUITEM_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}
210MENUITEM_SETTING(remote_reduce_ticking, 279MENUITEM_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}
322MENUITEM_SETTING(peak_meter_hold, 391MENUITEM_SETTING(peak_meter_hold,
323 &global_settings.peak_meter_hold, peakmeter_callback); 392 &global_settings.peak_meter_hold, peakmeter_callback);
324MENUITEM_SETTING(peak_meter_clip_hold, 393MENUITEM_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
327MENUITEM_SETTING(peak_meter_clipcounter, 396MENUITEM_SETTING(peak_meter_clipcounter,
328 &global_settings.peak_meter_clipcounter, NULL); 397 &global_settings.peak_meter_clipcounter, NULL);
329#endif 398#endif
330MENUITEM_SETTING(peak_meter_release, 399MENUITEM_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
473MENUITEM_FUNCTION(peak_meter_scale_item, 0, ID2P(LANG_PM_SCALE), 542MENUITEM_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);
475MENUITEM_FUNCTION(peak_meter_min_item, 0, ID2P(LANG_PM_MIN), 544MENUITEM_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);
477MENUITEM_FUNCTION(peak_meter_max_item, 0, ID2P(LANG_PM_MAX), 546MENUITEM_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);
479MAKE_MENU(peak_meter_menu, ID2P(LANG_PM_MENU), NULL, Icon_NOICON, 548MAKE_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,