diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-02-17 14:02:48 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-02-17 14:02:48 +0000 |
commit | 40a253d46411d7fb88483bddbfbae8c25c9bc861 (patch) | |
tree | 8d6fb05645afbc5d89b17cc9d0f54e9277c490fc | |
parent | 14ba91eaa9a94411457cc396a4c7c5e39e63a00a (diff) | |
download | rockbox-40a253d46411d7fb88483bddbfbae8c25c9bc861.tar.gz rockbox-40a253d46411d7fb88483bddbfbae8c25c9bc861.zip |
Convert the Display menu to the new system.
http://forums.rockbox.org/index.php?topic=8703.0 for bugs...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12351 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/SOURCES | 1 | ||||
-rw-r--r-- | apps/menu.c | 3 | ||||
-rw-r--r-- | apps/menus/display_menu.c | 537 | ||||
-rw-r--r-- | apps/menus/main_menu.c | 1 | ||||
-rw-r--r-- | apps/menus/playback_menu.c | 2 | ||||
-rw-r--r-- | apps/menus/settings_menu.c | 3 | ||||
-rw-r--r-- | apps/recorder/icons.c | 1 | ||||
-rw-r--r-- | apps/recorder/icons.h | 1 | ||||
-rw-r--r-- | apps/settings.c | 8 | ||||
-rw-r--r-- | apps/settings_list.c | 265 | ||||
-rw-r--r-- | apps/settings_menu.c | 1075 |
11 files changed, 743 insertions, 1154 deletions
diff --git a/apps/SOURCES b/apps/SOURCES index 1793724665..95e3479341 100644 --- a/apps/SOURCES +++ b/apps/SOURCES | |||
@@ -29,7 +29,6 @@ plugin.c | |||
29 | screens.c | 29 | screens.c |
30 | settings.c | 30 | settings.c |
31 | settings_list.c | 31 | settings_list.c |
32 | settings_menu.c | ||
33 | sound_menu.c | 32 | sound_menu.c |
34 | status.c | 33 | status.c |
35 | cuesheet.c | 34 | cuesheet.c |
diff --git a/apps/menu.c b/apps/menu.c index 523a92ed74..6728481a9f 100644 --- a/apps/menu.c +++ b/apps/menu.c | |||
@@ -560,6 +560,7 @@ int do_menu(const struct menu_item_ex *start_menu) | |||
560 | if ((setting->flags&F_BOOL_SETTING) == F_BOOL_SETTING) | 560 | if ((setting->flags&F_BOOL_SETTING) == F_BOOL_SETTING) |
561 | { | 561 | { |
562 | bool temp_var, *var; | 562 | bool temp_var, *var; |
563 | bool show_icons = global_settings.show_icons; | ||
563 | if (setting->flags&F_TEMPVAR) | 564 | if (setting->flags&F_TEMPVAR) |
564 | { | 565 | { |
565 | temp_var = *(bool*)setting->setting; | 566 | temp_var = *(bool*)setting->setting; |
@@ -575,6 +576,8 @@ int do_menu(const struct menu_item_ex *start_menu) | |||
575 | setting->bool_setting->option_callback); | 576 | setting->bool_setting->option_callback); |
576 | if (setting->flags&F_TEMPVAR) | 577 | if (setting->flags&F_TEMPVAR) |
577 | *(bool*)setting->setting = temp_var; | 578 | *(bool*)setting->setting = temp_var; |
579 | if (show_icons != global_settings.show_icons) | ||
580 | init_menu_lists(menu, &lists, 0, true); | ||
578 | } | 581 | } |
579 | else if (setting->flags&F_T_SOUND) | 582 | else if (setting->flags&F_T_SOUND) |
580 | { | 583 | { |
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c index adb24395fa..a1067fc333 100644 --- a/apps/menus/display_menu.c +++ b/apps/menus/display_menu.c | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | /*************************************************************************** | 1 | /*************************************************************************** |
3 | * __________ __ ___. | 2 | * __________ __ ___. |
4 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
@@ -27,7 +26,537 @@ | |||
27 | #include "settings.h" | 26 | #include "settings.h" |
28 | #include "menu.h" | 27 | #include "menu.h" |
29 | #include "settings_menu.h" | 28 | #include "settings_menu.h" |
29 | #include "tree.h" | ||
30 | #include "list.h" | ||
31 | #ifdef HAVE_LCD_BITMAP | ||
32 | #include "backdrop.h" | ||
33 | #include "peakmeter.h" | ||
34 | #endif | ||
35 | #include "talk.h" | ||
36 | #include "color_picker.h" | ||
37 | #include "lcd.h" | ||
38 | #include "lcd-remote.h" | ||
39 | |||
40 | |||
41 | #ifdef CONFIG_BACKLIGHT | ||
42 | int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) | ||
43 | { | ||
44 | (void)this_item; | ||
45 | switch (action) | ||
46 | { | ||
47 | case ACTION_EXIT_MENUITEM: | ||
48 | set_backlight_filter_keypress(global_settings.bl_filter_first_keypress); | ||
49 | #ifdef HAVE_REMOTE_LCD | ||
50 | set_remote_backlight_filter_keypress( | ||
51 | global_settings.remote_bl_filter_first_keypress); | ||
52 | #endif | ||
53 | |||
54 | break; | ||
55 | } | ||
56 | return action; | ||
57 | } | ||
58 | #endif | ||
59 | #ifdef HAVE_LCD_BITMAP | ||
60 | int flipdisplay_callback(int action,const struct menu_item_ex *this_item) | ||
61 | { | ||
62 | (void)this_item; | ||
63 | switch (action) | ||
64 | { | ||
65 | case ACTION_EXIT_MENUITEM: | ||
66 | button_set_flip(global_settings.flip_display); | ||
67 | lcd_set_flip(global_settings.flip_display); | ||
68 | #ifdef HAVE_REMOTE_LCD | ||
69 | lcd_remote_set_flip(global_settings.remote_flip_display); | ||
70 | lcd_remote_update(); | ||
71 | #endif | ||
72 | break; | ||
73 | } | ||
74 | return action; | ||
75 | } | ||
76 | #endif | ||
77 | |||
78 | /***********************************/ | ||
79 | /* LCD MENU */ | ||
80 | #ifdef CONFIG_BACKLIGHT | ||
81 | MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL); | ||
82 | #ifdef CONFIG_CHARGING | ||
83 | MENUITEM_SETTING(backlight_timeout_plugged, | ||
84 | &global_settings.backlight_timeout_plugged, NULL); | ||
85 | #endif | ||
86 | #ifdef HAS_BUTTON_HOLD | ||
87 | MENUITEM_SETTING(backlight_on_button_hold, | ||
88 | &global_settings.backlight_on_button_hold, NULL); | ||
89 | #endif | ||
90 | MENUITEM_SETTING(caption_backlight, &global_settings.caption_backlight, NULL); | ||
91 | #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) | ||
92 | MENUITEM_SETTING(backlight_fade_in, &global_settings.backlight_fade_in, NULL); | ||
93 | MENUITEM_SETTING(backlight_fade_out, &global_settings.backlight_fade_out, NULL); | ||
94 | #endif | ||
95 | MENUITEM_SETTING(bl_filter_first_keypress, | ||
96 | &global_settings.bl_filter_first_keypress, | ||
97 | filterfirstkeypress_callback); | ||
98 | #ifdef HAVE_LCD_SLEEP | ||
99 | MENUITEM_SETTING(lcd_sleep_after_backlight_off, | ||
100 | &global_settings.lcd_sleep_after_backlight_off, NULL); | ||
101 | #endif | ||
102 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | ||
103 | MENUITEM_SETTING(brightness_item, &global_settings.brightness, NULL); | ||
104 | #endif | ||
105 | #endif /* CONFIG_BACKLIGHT */ | ||
106 | #ifdef HAVE_LCD_CONTRAST | ||
107 | MENUITEM_SETTING(contrast, &global_settings.contrast, NULL); | ||
108 | #endif | ||
109 | #ifdef HAVE_LCD_BITMAP | ||
110 | #ifdef HAVE_LCD_INVERT | ||
111 | MENUITEM_SETTING(invert, &global_settings.invert, NULL); | ||
112 | #endif | ||
113 | #ifdef HAVE_LCD_FLIP | ||
114 | MENUITEM_SETTING(flip_display, &global_settings.flip_display, flipdisplay_callback); | ||
115 | #endif | ||
116 | MENUITEM_SETTING(invert_cursor, &global_settings.invert_cursor, NULL); | ||
117 | #endif /* HAVE_LCD_BITMAP */ | ||
118 | #ifdef HAVE_LCD_COLOR | ||
119 | /** | ||
120 | * Menu to clear the backdrop image | ||
121 | */ | ||
122 | static int clear_main_backdrop(void) | ||
123 | { | ||
124 | global_settings.backdrop_file[0]=0; | ||
125 | unload_main_backdrop(); | ||
126 | show_main_backdrop(); | ||
127 | return 0; | ||
128 | } | ||
129 | |||
130 | /** | ||
131 | * Menu for fore/back colors | ||
132 | */ | ||
133 | static int set_fg_color(void) | ||
134 | { | ||
135 | int res; | ||
136 | res = (int)set_color(&screens[SCREEN_MAIN],str(LANG_FOREGROUND_COLOR), | ||
137 | &global_settings.fg_color,global_settings.bg_color); | ||
138 | |||
139 | screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); | ||
140 | return res; | ||
141 | } | ||
142 | |||
143 | static int set_bg_color(void) | ||
144 | { | ||
145 | int res; | ||
146 | res = (int)set_color(&screens[SCREEN_MAIN],str(LANG_BACKGROUND_COLOR), | ||
147 | &global_settings.bg_color,global_settings.fg_color); | ||
148 | |||
149 | screens[SCREEN_MAIN].set_background(global_settings.bg_color); | ||
150 | return res; | ||
151 | } | ||
152 | |||
153 | static int reset_color(void) | ||
154 | { | ||
155 | global_settings.fg_color = LCD_DEFAULT_FG; | ||
156 | global_settings.bg_color = LCD_DEFAULT_BG; | ||
157 | |||
158 | screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); | ||
159 | screens[SCREEN_MAIN].set_background(global_settings.bg_color); | ||
160 | return 0; | ||
161 | } | ||
162 | MENUITEM_FUNCTION(clear_main_bd, ID2P(LANG_CLEAR_BACKDROP), | ||
163 | clear_main_backdrop, NULL, NOICON); | ||
164 | MENUITEM_FUNCTION(set_bg_col, ID2P(LANG_BACKGROUND_COLOR), | ||
165 | set_bg_color, NULL, NOICON); | ||
166 | MENUITEM_FUNCTION(set_fg_col, ID2P(LANG_FOREGROUND_COLOR), | ||
167 | set_fg_color, NULL, NOICON); | ||
168 | MENUITEM_FUNCTION(reset_colors, ID2P(LANG_RESET_COLORS), | ||
169 | reset_color, NULL, NOICON); | ||
170 | #endif | ||
171 | |||
172 | /* now the actual menu */ | ||
173 | MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU), | ||
174 | NULL, bitmap_icons_6x8[Icon_Display_menu] | ||
175 | #ifdef CONFIG_BACKLIGHT | ||
176 | ,&backlight_timeout | ||
177 | # ifdef CONFIG_CHARGING | ||
178 | ,&backlight_timeout_plugged | ||
179 | # endif | ||
180 | # ifdef HAS_BUTTON_HOLD | ||
181 | ,&backlight_on_button_hold | ||
182 | # endif | ||
183 | ,&caption_backlight | ||
184 | # if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) | ||
185 | ,&backlight_fade_in, &backlight_fade_out | ||
186 | # endif | ||
187 | ,&bl_filter_first_keypress | ||
188 | # ifdef HAVE_LCD_SLEEP | ||
189 | ,&lcd_sleep_after_backlight_off | ||
190 | # endif | ||
191 | # ifdef HAVE_BACKLIGHT_BRIGHTNESS | ||
192 | ,&brightness_item | ||
193 | # endif | ||
194 | #endif /* CONFIG_BACKLIGHT */ | ||
195 | #ifdef HAVE_LCD_CONTRAST | ||
196 | ,&contrast | ||
197 | #endif | ||
198 | #ifdef HAVE_LCD_BITMAP | ||
199 | # ifdef HAVE_LCD_INVERT | ||
200 | ,&invert | ||
201 | # endif | ||
202 | # ifdef HAVE_LCD_FLIP | ||
203 | ,&flip_display | ||
204 | # endif | ||
205 | ,&invert_cursor | ||
206 | #endif /* HAVE_LCD_BITMAP */ | ||
207 | #ifdef HAVE_LCD_COLOR | ||
208 | ,&clear_main_bd, &set_bg_col, &set_fg_col, &reset_colors | ||
209 | #endif | ||
210 | ); | ||
211 | /* LCD MENU */ | ||
212 | /***********************************/ | ||
213 | |||
214 | |||
215 | /********************************/ | ||
216 | /* Remote LCD settings menu */ | ||
217 | #ifdef HAVE_REMOTE_LCD | ||
218 | MENUITEM_SETTING(remote_backlight_timeout, | ||
219 | &global_settings.remote_backlight_timeout, NULL); | ||
220 | |||
221 | #ifdef CONFIG_CHARGING | ||
222 | MENUITEM_SETTING(remote_backlight_timeout_plugged, | ||
223 | &global_settings.remote_backlight_timeout_plugged, NULL); | ||
224 | #endif | ||
225 | |||
226 | #ifdef HAS_REMOTE_BUTTON_HOLD | ||
227 | MENUITEM_SETTING(remote_backlight_on_button_hold, | ||
228 | &global_settings.remote_backlight_on_button_hold, NULL); | ||
229 | #endif | ||
230 | |||
231 | MENUITEM_SETTING(remote_caption_backlight, | ||
232 | &global_settings.remote_caption_backlight, NULL); | ||
233 | MENUITEM_SETTING(remote_bl_filter_first_keypress, | ||
234 | &global_settings.remote_bl_filter_first_keypress, | ||
235 | filterfirstkeypress_callback); | ||
236 | MENUITEM_SETTING(remote_contrast, | ||
237 | &global_settings.remote_contrast, NULL); | ||
238 | MENUITEM_SETTING(remote_invert, | ||
239 | &global_settings.remote_invert, NULL); | ||
240 | |||
241 | MENUITEM_SETTING(remote_flip_display, | ||
242 | &global_settings.remote_flip_display, flipdisplay_callback); | ||
243 | |||
244 | #ifdef HAVE_REMOTE_LCD_TICKING | ||
245 | int ticking_callback(int action,const struct menu_item_ex *this_item) | ||
246 | { | ||
247 | (void)this_item; | ||
248 | switch (action) | ||
249 | { | ||
250 | case ACTION_EXIT_MENUITEM: | ||
251 | lcd_remote_emireduce(global_settings.remote_reduce_ticking); | ||
252 | break; | ||
253 | } | ||
254 | return action; | ||
255 | } | ||
256 | MENUITEM_SETTING(remote_reduce_ticking, | ||
257 | &global_settings.remote_reduce_ticking, ticking_callback); | ||
258 | #endif | ||
259 | |||
260 | MAKE_MENU(lcd_remote_settings, ID2P(LANG_LCD_REMOTE_MENU), | ||
261 | NULL, bitmap_icons_6x8[Icon_Remote_Display_menu], | ||
262 | &remote_backlight_timeout, | ||
263 | #ifdef CONFIG_CHARGING | ||
264 | &remote_backlight_timeout_plugged, | ||
265 | #endif | ||
266 | #ifdef HAS_REMOTE_BUTTON_HOLD | ||
267 | &remote_backlight_on_button_hold, | ||
268 | #endif | ||
269 | &remote_caption_backlight, &remote_bl_filter_first_keypress, | ||
270 | &remote_contrast, &remote_invert, &remote_flip_display | ||
271 | #ifdef HAVE_REMOTE_LCD_TICKING | ||
272 | ,&remote_reduce_ticking | ||
273 | #endif | ||
274 | ); | ||
275 | |||
276 | #endif /* HAVE_REMOTE_LCD */ | ||
277 | /* Remote LCD settings menu */ | ||
278 | /********************************/ | ||
279 | |||
280 | /***********************************/ | ||
281 | /* SCROLL MENU */ | ||
282 | MENUITEM_SETTING(scroll_speed, &global_settings.scroll_speed, NULL); | ||
283 | MENUITEM_SETTING(scroll_delay, &global_settings.scroll_delay, NULL); | ||
284 | #ifdef HAVE_LCD_BITMAP | ||
285 | MENUITEM_SETTING(scroll_step, &global_settings.scroll_step, NULL); | ||
286 | #endif | ||
287 | MENUITEM_SETTING(bidir_limit, &global_settings.bidir_limit, NULL); | ||
288 | #ifdef HAVE_REMOTE_LCD | ||
289 | MENUITEM_SETTING(remote_scroll_speed, &global_settings.remote_scroll_speed, NULL); | ||
290 | MENUITEM_SETTING(remote_scroll_delay, &global_settings.remote_scroll_delay, NULL); | ||
291 | MENUITEM_SETTING(remote_scroll_step, &global_settings.remote_scroll_step, NULL); | ||
292 | MENUITEM_SETTING(remote_bidir_limit, &global_settings.remote_bidir_limit, NULL); | ||
293 | MAKE_MENU(remote_scroll_sets, ID2P(LANG_REMOTE_SCROLL_SETS), 0, NOICON, | ||
294 | &remote_scroll_speed, &remote_scroll_delay, | ||
295 | &remote_scroll_step, &remote_bidir_limit); | ||
296 | #endif /* HAVE_REMOTE_LCD */ | ||
297 | #ifdef HAVE_LCD_CHARCELLS | ||
298 | MENUITEM_SETTING(jump_scroll, &global_settings.jump_scroll, NULL); | ||
299 | MENUITEM_SETTING(jump_scroll_delay, &global_settings.jump_scroll_delay, NULL); | ||
300 | #endif | ||
301 | #ifdef HAVE_LCD_BITMAP | ||
302 | int screenscroll_callback(int action,const struct menu_item_ex *this_item) | ||
303 | { | ||
304 | (void)this_item; | ||
305 | switch (action) | ||
306 | { | ||
307 | case ACTION_EXIT_MENUITEM: | ||
308 | gui_list_screen_scroll_out_of_view(global_settings.offset_out_of_view); | ||
309 | break; | ||
310 | } | ||
311 | return action; | ||
312 | } | ||
313 | MENUITEM_SETTING(offset_out_of_view, &global_settings.offset_out_of_view, | ||
314 | screenscroll_callback); | ||
315 | MENUITEM_SETTING(screen_scroll_step, &global_settings.screen_scroll_step, NULL); | ||
316 | #endif | ||
317 | MENUITEM_SETTING(scroll_paginated, &global_settings.scroll_paginated, NULL); | ||
318 | |||
319 | MAKE_MENU(scroll_settings_menu, ID2P(LANG_SCROLL_MENU), 0, NOICON, | ||
320 | &scroll_speed, &scroll_delay, | ||
321 | #ifdef HAVE_LCD_BITMAP | ||
322 | &scroll_step, | ||
323 | #endif | ||
324 | &bidir_limit, | ||
325 | #ifdef HAVE_REMOTE_LCD | ||
326 | &remote_scroll_sets, | ||
327 | #endif | ||
328 | #ifdef HAVE_LCD_CHARCELLS | ||
329 | &jump_scroll, &jump_scroll_delay, | ||
330 | #endif | ||
331 | #ifdef HAVE_LCD_BITMAP | ||
332 | &offset_out_of_view, &screen_scroll_step, | ||
333 | #endif | ||
334 | &scroll_paginated | ||
335 | ); | ||
336 | /* SCROLL MENU */ | ||
337 | /***********************************/ | ||
338 | |||
339 | /***********************************/ | ||
340 | /* BARS MENU */ | ||
341 | #ifdef HAVE_LCD_BITMAP | ||
342 | MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL); | ||
343 | MENUITEM_SETTING(statusbar, &global_settings.statusbar, NULL); | ||
344 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
345 | MENUITEM_SETTING(buttonbar, &global_settings.buttonbar, NULL); | ||
346 | #endif | ||
347 | MENUITEM_SETTING(volume_type, &global_settings.volume_type, NULL); | ||
348 | MENUITEM_SETTING(battery_display, &global_settings.battery_display, NULL); | ||
349 | MAKE_MENU(bars_menu, ID2P(LANG_BARS_MENU), 0, NOICON, | ||
350 | &scrollbar_item, &statusbar, | ||
351 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
352 | &buttonbar, | ||
353 | #endif | ||
354 | &volume_type, &battery_display); | ||
355 | #endif /* HAVE_LCD_BITMAP */ | ||
356 | /* BARS MENU */ | ||
357 | /***********************************/ | ||
358 | |||
359 | |||
360 | /***********************************/ | ||
361 | /* PEAK METER MENU */ | ||
362 | |||
363 | #ifdef HAVE_LCD_BITMAP | ||
364 | int peakmeter_callback(int action,const struct menu_item_ex *this_item) | ||
365 | { | ||
366 | (void)this_item; | ||
367 | switch (action) | ||
368 | { | ||
369 | case ACTION_EXIT_MENUITEM: | ||
370 | peak_meter_init_times(global_settings.peak_meter_release, | ||
371 | global_settings.peak_meter_hold, | ||
372 | global_settings.peak_meter_clip_hold); | ||
373 | break; | ||
374 | } | ||
375 | return action; | ||
376 | } | ||
377 | MENUITEM_SETTING(peak_meter_clip_hold, | ||
378 | &global_settings.peak_meter_clip_hold, peakmeter_callback); | ||
379 | |||
380 | MENUITEM_SETTING(peak_meter_release, | ||
381 | &global_settings.peak_meter_release, peakmeter_callback); | ||
382 | /** | ||
383 | * Menu to select wether the scale of the meter | ||
384 | * displays dBfs of linear values. | ||
385 | */ | ||
386 | static int peak_meter_scale(void) { | ||
387 | bool retval = false; | ||
388 | bool use_dbfs = global_settings.peak_meter_dbfs; | ||
389 | retval = set_bool_options(str(LANG_PM_SCALE), | ||
390 | &use_dbfs, | ||
391 | STR(LANG_PM_DBFS), STR(LANG_PM_LINEAR), | ||
392 | NULL); | ||
393 | |||
394 | /* has the user really changed the scale? */ | ||
395 | if (use_dbfs != global_settings.peak_meter_dbfs) { | ||
396 | |||
397 | /* store the change */ | ||
398 | global_settings.peak_meter_dbfs = use_dbfs; | ||
399 | peak_meter_set_use_dbfs(use_dbfs); | ||
400 | |||
401 | /* If the user changed the scale mode the meaning of | ||
402 | peak_meter_min (peak_meter_max) has changed. Thus we have | ||
403 | to convert the values stored in global_settings. */ | ||
404 | if (use_dbfs) { | ||
405 | |||
406 | /* we only store -dBfs */ | ||
407 | global_settings.peak_meter_min = -peak_meter_get_min() / 100; | ||
408 | global_settings.peak_meter_max = -peak_meter_get_max() / 100; | ||
409 | } else { | ||
410 | int max; | ||
411 | |||
412 | /* linear percent */ | ||
413 | global_settings.peak_meter_min = peak_meter_get_min(); | ||
414 | |||
415 | /* converting dBfs -> percent results in a precision loss. | ||
416 | I assume that the user doesn't bother that conversion | ||
417 | dBfs <-> percent isn't symmetrical for odd values but that | ||
418 | he wants 0 dBfs == 100%. Thus I 'correct' the percent value | ||
419 | resulting from dBfs -> percent manually here */ | ||
420 | max = peak_meter_get_max(); | ||
421 | global_settings.peak_meter_max = max < 99 ? max : 100; | ||
422 | } | ||
423 | settings_apply_pm_range(); | ||
424 | } | ||
425 | return retval; | ||
426 | } | ||
427 | |||
428 | /** | ||
429 | * Adjust the min value of the value range that | ||
430 | * the peak meter shall visualize. | ||
431 | */ | ||
432 | static int peak_meter_min(void) { | ||
433 | bool retval = false; | ||
434 | if (global_settings.peak_meter_dbfs) { | ||
435 | |||
436 | /* for dBfs scale */ | ||
437 | int range_max = -global_settings.peak_meter_max; | ||
438 | int min = -global_settings.peak_meter_min; | ||
439 | |||
440 | retval = set_int(str(LANG_PM_MIN), str(LANG_PM_DBFS), UNIT_DB, | ||
441 | &min, NULL, 1, -89, range_max, NULL); | ||
442 | |||
443 | global_settings.peak_meter_min = - min; | ||
444 | } | ||
445 | |||
446 | /* for linear scale */ | ||
447 | else { | ||
448 | int min = global_settings.peak_meter_min; | ||
449 | |||
450 | retval = set_int(str(LANG_PM_MIN), "%", UNIT_PERCENT, | ||
451 | &min, NULL, | ||
452 | 1, 0, global_settings.peak_meter_max - 1, NULL); | ||
453 | |||
454 | global_settings.peak_meter_min = (unsigned char)min; | ||
455 | } | ||
456 | |||
457 | settings_apply_pm_range(); | ||
458 | return retval; | ||
459 | } | ||
460 | |||
461 | |||
462 | /** | ||
463 | * Adjust the max value of the value range that | ||
464 | * the peak meter shall visualize. | ||
465 | */ | ||
466 | static int peak_meter_max(void) { | ||
467 | bool retval = false; | ||
468 | if (global_settings.peak_meter_dbfs) { | ||
469 | |||
470 | /* for dBfs scale */ | ||
471 | int range_min = -global_settings.peak_meter_min; | ||
472 | int max = -global_settings.peak_meter_max;; | ||
473 | |||
474 | retval = set_int(str(LANG_PM_MAX), str(LANG_PM_DBFS), UNIT_DB, | ||
475 | &max, NULL, 1, range_min, 0, NULL); | ||
476 | |||
477 | global_settings.peak_meter_max = - max; | ||
478 | |||
479 | } | ||
480 | |||
481 | /* for linear scale */ | ||
482 | else { | ||
483 | int max = global_settings.peak_meter_max; | ||
484 | |||
485 | retval = set_int(str(LANG_PM_MAX), "%", UNIT_PERCENT, | ||
486 | &max, NULL, | ||
487 | 1, global_settings.peak_meter_min + 1, 100, NULL); | ||
488 | |||
489 | global_settings.peak_meter_max = (unsigned char)max; | ||
490 | } | ||
491 | |||
492 | settings_apply_pm_range(); | ||
493 | return retval; | ||
494 | } | ||
495 | MENUITEM_FUNCTION(peak_meter_scale_item, ID2P(LANG_PM_SCALE), | ||
496 | peak_meter_scale, NULL, NOICON); | ||
497 | MENUITEM_FUNCTION(peak_meter_min_item, ID2P(LANG_PM_MIN), | ||
498 | peak_meter_min, NULL, NOICON); | ||
499 | MENUITEM_FUNCTION(peak_meter_max_item, ID2P(LANG_PM_MAX), | ||
500 | peak_meter_max, NULL, NOICON); | ||
501 | MAKE_MENU(peak_meter_menu, ID2P(LANG_PM_MENU), NULL, NOICON, | ||
502 | &peak_meter_clip_hold, &peak_meter_release, | ||
503 | &peak_meter_scale_item, &peak_meter_min_item, &peak_meter_max_item); | ||
504 | #endif /* HAVE_LCD_BITMAP */ | ||
505 | /* PEAK METER MENU */ | ||
506 | /***********************************/ | ||
507 | |||
508 | |||
509 | |||
510 | struct browse_folder_info { | ||
511 | const char* dir; | ||
512 | int show_options; | ||
513 | }; | ||
514 | #ifdef HAVE_LCD_BITMAP | ||
515 | static struct browse_folder_info fonts = {FONT_DIR, SHOW_FONT}; | ||
516 | #endif | ||
517 | static struct browse_folder_info wps = {WPS_DIR, SHOW_WPS}; | ||
518 | #ifdef HAVE_REMOTE_LCD | ||
519 | static struct browse_folder_info rwps = {WPS_DIR, SHOW_RWPS}; | ||
520 | #endif | ||
521 | |||
522 | static int browse_folder(void *param) | ||
523 | { | ||
524 | const struct browse_folder_info *info = | ||
525 | (const struct browse_folder_info*)param; | ||
526 | return rockbox_browse(info->dir, info->show_options); | ||
527 | } | ||
528 | |||
529 | #ifdef HAVE_LCD_BITMAP | ||
530 | MENUITEM_FUNCTION_WPARAM(browse_fonts, ID2P(LANG_CUSTOM_FONT), | ||
531 | browse_folder, (void*)&fonts, NULL, NOICON); | ||
532 | #endif | ||
533 | MENUITEM_FUNCTION_WPARAM(browse_wps, ID2P(LANG_WHILE_PLAYING), | ||
534 | browse_folder, (void*)&wps, NULL, NOICON); | ||
535 | #ifdef HAVE_REMOTE_LCD | ||
536 | MENUITEM_FUNCTION_WPARAM(browse_rwps, ID2P(LANG_REMOTE_WHILE_PLAYING), | ||
537 | browse_folder, (void*)&rwps, NULL, NOICON); | ||
538 | #endif | ||
539 | |||
540 | MENUITEM_SETTING(show_icons, &global_settings.show_icons, NULL); | ||
541 | MENUITEM_SETTING(codepage_setting, &global_settings.default_codepage, NULL); | ||
542 | |||
30 | 543 | ||
31 | bool display_settings_menu(void); /* from ../settings_menu.c */ | 544 | MAKE_MENU(display_menu, ID2P(LANG_DISPLAY), |
32 | MENUITEM_FUNCTION(display_menu,ID2P(LANG_DISPLAY), | 545 | NULL, bitmap_icons_6x8[Icon_Display_menu], |
33 | (menu_function)display_settings_menu,NULL, bitmap_icons_6x8[Icon_Display_menu]); | 546 | #ifdef HAVE_LCD_BITMAP |
547 | &browse_fonts, | ||
548 | #endif | ||
549 | &browse_wps, | ||
550 | #ifdef HAVE_REMOTE_LCD | ||
551 | &browse_rwps, | ||
552 | #endif | ||
553 | &lcd_settings, | ||
554 | #ifdef HAVE_REMOTE_LCD | ||
555 | &lcd_remote_settings, | ||
556 | #endif | ||
557 | &show_icons, &scroll_settings_menu, | ||
558 | #ifdef HAVE_LCD_BITMAP | ||
559 | &bars_menu, &peak_meter_menu, | ||
560 | #endif | ||
561 | &codepage_setting, | ||
562 | ); | ||
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 0d280d90b0..52d4d6116a 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | /*************************************************************************** | 1 | /*************************************************************************** |
3 | * __________ __ ___. | 2 | * __________ __ ___. |
4 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c index 4dbfb6c40d..9fa07cc227 100644 --- a/apps/menus/playback_menu.c +++ b/apps/menus/playback_menu.c | |||
@@ -188,6 +188,7 @@ MAKE_MENU(playback_menu_item,ID2P(LANG_PLAYBACK),0, | |||
188 | ,&unplug_menu | 188 | ,&unplug_menu |
189 | #endif | 189 | #endif |
190 | ); | 190 | ); |
191 | #include "debug.h" | ||
191 | int playback_callback(int action,const struct menu_item_ex *this_item) | 192 | int playback_callback(int action,const struct menu_item_ex *this_item) |
192 | { | 193 | { |
193 | static bool old_shuffle = false; | 194 | static bool old_shuffle = false; |
@@ -196,6 +197,7 @@ int playback_callback(int action,const struct menu_item_ex *this_item) | |||
196 | switch (action) | 197 | switch (action) |
197 | { | 198 | { |
198 | case ACTION_ENTER_MENUITEM: | 199 | case ACTION_ENTER_MENUITEM: |
200 | DEBUGF("boo\n"); | ||
199 | if (this_item == &shuffle_item) | 201 | if (this_item == &shuffle_item) |
200 | old_shuffle = global_settings.playlist_shuffle; | 202 | old_shuffle = global_settings.playlist_shuffle; |
201 | else if (this_item == &repeat_mode) | 203 | else if (this_item == &repeat_mode) |
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index fec9113124..22bd1d8c09 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c | |||
@@ -73,7 +73,6 @@ MENUITEM_SETTING(sort_dir, &global_settings.sort_dir, fileview_callback); | |||
73 | MENUITEM_SETTING(sort_file, &global_settings.sort_file, fileview_callback); | 73 | MENUITEM_SETTING(sort_file, &global_settings.sort_file, fileview_callback); |
74 | MENUITEM_SETTING(dirfilter, &global_settings.dirfilter, NULL); | 74 | MENUITEM_SETTING(dirfilter, &global_settings.dirfilter, NULL); |
75 | MENUITEM_SETTING(browse_current, &global_settings.browse_current, NULL); | 75 | MENUITEM_SETTING(browse_current, &global_settings.browse_current, NULL); |
76 | MENUITEM_SETTING(show_icons, &global_settings.show_icons, NULL); | ||
77 | MENUITEM_SETTING(show_path_in_browser, &global_settings.show_path_in_browser, NULL); | 76 | MENUITEM_SETTING(show_path_in_browser, &global_settings.show_path_in_browser, NULL); |
78 | static int fileview_callback(int action,const struct menu_item_ex *this_item) | 77 | static int fileview_callback(int action,const struct menu_item_ex *this_item) |
79 | { | 78 | { |
@@ -94,7 +93,7 @@ static int fileview_callback(int action,const struct menu_item_ex *this_item) | |||
94 | 93 | ||
95 | MAKE_MENU(file_menu, ID2P(LANG_FILE), 0, NOICON, | 94 | MAKE_MENU(file_menu, ID2P(LANG_FILE), 0, NOICON, |
96 | &sort_case, &sort_dir, &sort_file, | 95 | &sort_case, &sort_dir, &sort_file, |
97 | &dirfilter, &browse_current, &show_icons, &show_path_in_browser, | 96 | &dirfilter, &browse_current, &show_path_in_browser, |
98 | #ifdef HAVE_TAGCACHE | 97 | #ifdef HAVE_TAGCACHE |
99 | &tagcache_menu | 98 | &tagcache_menu |
100 | #endif | 99 | #endif |
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index 216486effb..cf9720d94f 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c | |||
@@ -73,6 +73,7 @@ const unsigned char bitmap_icons_6x8[][6] = | |||
73 | { 0x1e, 0x22, 0x49, 0x49, 0x22, 0x1e }, /* system menu */ | 73 | { 0x1e, 0x22, 0x49, 0x49, 0x22, 0x1e }, /* system menu */ |
74 | { 0x7f, 0x7f, 0x3e, 0x1c, 0x08, 0x00 }, /* playback menu */ | 74 | { 0x7f, 0x7f, 0x3e, 0x1c, 0x08, 0x00 }, /* playback menu */ |
75 | { 0x1f, 0x51, 0x71, 0x71, 0x51, 0x1f }, /* display menu */ | 75 | { 0x1f, 0x51, 0x71, 0x71, 0x51, 0x1f }, /* display menu */ |
76 | { 0x1e, 0x32, 0x32, 0x32, 0x1e, 0x00 }, /* remote display menu */ | ||
76 | { 0x03, 0x05, 0x7f, 0x05, 0x03, 0x00 }, /* radio */ | 77 | { 0x03, 0x05, 0x7f, 0x05, 0x03, 0x00 }, /* radio */ |
77 | }; | 78 | }; |
78 | 79 | ||
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index 7b10f0c44a..668b5ca3ce 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h | |||
@@ -77,6 +77,7 @@ enum icons_6x8 { | |||
77 | Icon_System_menu, | 77 | Icon_System_menu, |
78 | Icon_Playback_menu, | 78 | Icon_Playback_menu, |
79 | Icon_Display_menu, | 79 | Icon_Display_menu, |
80 | Icon_Remote_Display_menu, | ||
80 | Icon_Radio_screen, | 81 | Icon_Radio_screen, |
81 | Icon6x8Last, | 82 | Icon6x8Last, |
82 | }; | 83 | }; |
diff --git a/apps/settings.c b/apps/settings.c index 1da552816f..1ef096a1f6 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -1219,16 +1219,20 @@ bool set_int_ex(const unsigned char* string, | |||
1219 | #if CONFIG_KEYPAD != PLAYER_PAD | 1219 | #if CONFIG_KEYPAD != PLAYER_PAD |
1220 | struct value_setting_data data = { | 1220 | struct value_setting_data data = { |
1221 | INT,max, step, voice_unit,unit,formatter,get_talk_id,NULL }; | 1221 | INT,max, step, voice_unit,unit,formatter,get_talk_id,NULL }; |
1222 | if (unit == NULL) | 1222 | if (voice_unit < UNIT_LAST) |
1223 | data.unit = unit_strings[voice_unit]; | 1223 | data.unit = unit_strings[voice_unit]; |
1224 | else | ||
1225 | data.unit = str(voice_unit); | ||
1224 | return do_set_setting(string,variable,(max-min)/step + 1, | 1226 | return do_set_setting(string,variable,(max-min)/step + 1, |
1225 | (max-*variable)/step, &data,function); | 1227 | (max-*variable)/step, &data,function); |
1226 | #else | 1228 | #else |
1227 | int count = (max-min)/step + 1; | 1229 | int count = (max-min)/step + 1; |
1228 | struct value_setting_data data = { | 1230 | struct value_setting_data data = { |
1229 | INT,min, -step, voice_unit,unit,formatter,get_talk_id,NULL }; | 1231 | INT,min, -step, voice_unit,unit,formatter,get_talk_id,NULL }; |
1230 | if (unit == NULL) | 1232 | if (voice_unit < UNIT_LAST) |
1231 | data.unit = unit_strings[voice_unit]; | 1233 | data.unit = unit_strings[voice_unit]; |
1234 | else | ||
1235 | data.unit = str(voice_unit); | ||
1232 | return do_set_setting(string,variable,count, | 1236 | return do_set_setting(string,variable,count, |
1233 | count - ((max-*variable)/step), &data,function); | 1237 | count - ((max-*variable)/step), &data,function); |
1234 | #endif | 1238 | #endif |
diff --git a/apps/settings_list.c b/apps/settings_list.c index cf77efaf6b..f07d6346b4 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include "lang.h" | 24 | #include "lang.h" |
25 | #include "talk.h" | 25 | #include "talk.h" |
26 | #include "lcd.h" | 26 | #include "lcd.h" |
27 | #include "button.h" | ||
28 | #include "backlight.h" | ||
27 | #include "settings.h" | 29 | #include "settings.h" |
28 | #include "settings_list.h" | 30 | #include "settings_list.h" |
29 | #include "sound.h" | 31 | #include "sound.h" |
@@ -33,6 +35,13 @@ | |||
33 | #include "audio.h" | 35 | #include "audio.h" |
34 | #include "power.h" | 36 | #include "power.h" |
35 | #include "powermgmt.h" | 37 | #include "powermgmt.h" |
38 | #include "kernel.h" | ||
39 | #include "lcd-remote.h" | ||
40 | #include "list.h" | ||
41 | #include "rbunicode.h" | ||
42 | #ifdef HAVE_LCD_BITMAP | ||
43 | #include "peakmeter.h" | ||
44 | #endif | ||
36 | 45 | ||
37 | /* some sets of values which are used more than once, to save memory */ | 46 | /* some sets of values which are used more than once, to save memory */ |
38 | static const char off_on[] = "off,on"; | 47 | static const char off_on[] = "off,on"; |
@@ -81,6 +90,27 @@ static const char trig_durations_conf [] = | |||
81 | #if defined(CONFIG_BACKLIGHT) | 90 | #if defined(CONFIG_BACKLIGHT) |
82 | static const char backlight_times_conf [] = | 91 | static const char backlight_times_conf [] = |
83 | "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90"; | 92 | "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90"; |
93 | static const int backlight_times[] = | ||
94 | {-1, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 45, 60, 90}; | ||
95 | static void backlight_formatter(char *buffer, int buffer_size, | ||
96 | int val, const char *unit) | ||
97 | { | ||
98 | (void)unit; | ||
99 | if (val == 0) | ||
100 | strcpy(buffer, str(LANG_OFF)); | ||
101 | else if (val == 1) | ||
102 | strcpy(buffer, str(LANG_ON)); | ||
103 | else | ||
104 | snprintf(buffer, buffer_size, "%d s", backlight_times[val]); | ||
105 | } | ||
106 | static long backlight_getlang(int value) | ||
107 | { | ||
108 | if (value == 0) | ||
109 | return LANG_OFF; | ||
110 | else if (value == 1) | ||
111 | return LANG_ON; | ||
112 | return TALK_ID(backlight_times[value], UNIT_SEC); | ||
113 | } | ||
84 | #endif | 114 | #endif |
85 | /* ffwd/rewind and scan acceleration stuff */ | 115 | /* ffwd/rewind and scan acceleration stuff */ |
86 | static int ff_rewind_min_stepvals[] = {1,2,3,4,5,6,8,10,15,20,25,30,45,60}; | 116 | static int ff_rewind_min_stepvals[] = {1,2,3,4,5,6,8,10,15,20,25,30,45,60}; |
@@ -267,6 +297,58 @@ static void set_superbass(bool value) | |||
267 | sound_set_superbass((int)value); | 297 | sound_set_superbass((int)value); |
268 | } | 298 | } |
269 | #endif | 299 | #endif |
300 | |||
301 | static void scrolldelay_format(char* buffer, int buffer_size, int value, | ||
302 | const char* unit) | ||
303 | { | ||
304 | (void)unit; | ||
305 | snprintf(buffer, buffer_size, "%d ms", value* (HZ/100)); | ||
306 | } | ||
307 | static long scrolldelay_getlang(int value) | ||
308 | { | ||
309 | return TALK_ID(value* (HZ/100), UNIT_MS); | ||
310 | } | ||
311 | #ifdef HAVE_LCD_CHARCELLS | ||
312 | static void jumpscroll_format(char* buffer, int buffer_size, int value, | ||
313 | const char* unit) | ||
314 | { | ||
315 | (void)unit; | ||
316 | switch (value) | ||
317 | { | ||
318 | case 0: | ||
319 | strcpy(buffer, str(LANG_OFF)); | ||
320 | break; | ||
321 | case 1: | ||
322 | strcpy(buffer, str(LANG_ONE_TIME)); | ||
323 | break; | ||
324 | case 2: | ||
325 | case 3: | ||
326 | case 4: | ||
327 | snprintf(buffer, buffer_size, "%d", value); | ||
328 | break; | ||
329 | case 5: | ||
330 | strcpy(buffer, str(LANG_ALWAYS)); | ||
331 | break; | ||
332 | } | ||
333 | } | ||
334 | static long jumpscroll_getlang(int value) | ||
335 | { | ||
336 | switch (value) | ||
337 | { | ||
338 | case 0: | ||
339 | return LANG_OFF; | ||
340 | case 1: | ||
341 | return LANG_ONE_TIME; | ||
342 | case 2: | ||
343 | case 3: | ||
344 | case 4: | ||
345 | return TALK_ID(2, UNIT_INT); | ||
346 | case 5: | ||
347 | return LANG_ALWAYS; | ||
348 | } | ||
349 | return -1; | ||
350 | } | ||
351 | #endif /* HAVE_LCD_CHARCELLS */ | ||
270 | 352 | ||
271 | const struct settings_list settings[] = { | 353 | const struct settings_list settings[] = { |
272 | /* sound settings */ | 354 | /* sound settings */ |
@@ -321,33 +403,43 @@ const struct settings_list settings[] = { | |||
321 | ), /* CHOICE_SETTING( repeat_mode ) */ | 403 | ), /* CHOICE_SETTING( repeat_mode ) */ |
322 | /* LCD */ | 404 | /* LCD */ |
323 | #ifdef HAVE_LCD_CONTRAST | 405 | #ifdef HAVE_LCD_CONTRAST |
406 | /* its easier to leave this one un-macro()ed for the time being */ | ||
324 | {F_T_INT|F_DEF_ISFUNC, &global_settings.contrast, LANG_CONTRAST, | 407 | {F_T_INT|F_DEF_ISFUNC, &global_settings.contrast, LANG_CONTRAST, |
325 | FUNCTYPE(lcd_default_contrast), | 408 | FUNCTYPE(lcd_default_contrast), |
326 | "contrast", NULL , UNUSED}, | 409 | "contrast", NULL , {.int_setting = (struct int_setting[]){ |
410 | { lcd_set_contrast, UNIT_INT, MIN_CONTRAST_SETTING, | ||
411 | MAX_CONTRAST_SETTING, 1, NULL, NULL}}}}, | ||
327 | #endif | 412 | #endif |
328 | #ifdef CONFIG_BACKLIGHT | 413 | #ifdef CONFIG_BACKLIGHT |
329 | {F_T_INT, &global_settings.backlight_timeout, LANG_BACKLIGHT, INT(6), | 414 | INT_SETTING_W_CFGVALS(0, backlight_timeout, LANG_BACKLIGHT, 6, |
330 | "backlight timeout",backlight_times_conf , UNUSED}, | 415 | "backlight timeout", backlight_times_conf, UNIT_SEC, |
416 | 0, 18, 1, backlight_formatter, backlight_getlang, | ||
417 | backlight_set_timeout), | ||
331 | #ifdef CONFIG_CHARGING | 418 | #ifdef CONFIG_CHARGING |
332 | {F_T_INT, &global_settings.backlight_timeout_plugged, LANG_BACKLIGHT_ON_WHEN_CHARGING, | 419 | INT_SETTING_W_CFGVALS(0, backlight_timeout_plugged, LANG_BACKLIGHT, 11, |
333 | INT(11), "backlight timeout plugged",backlight_times_conf , UNUSED}, | 420 | "backlight timeout plugged", backlight_times_conf, UNIT_SEC, |
421 | 0, 18, 1, backlight_formatter, backlight_getlang, | ||
422 | backlight_set_timeout_plugged), | ||
334 | #endif | 423 | #endif |
335 | #endif /* CONFIG_BACKLIGHT */ | 424 | #endif /* CONFIG_BACKLIGHT */ |
336 | #ifdef HAVE_LCD_BITMAP | 425 | #ifdef HAVE_LCD_BITMAP |
337 | OFFON_SETTING(0,invert, LANG_INVERT, false,"invert", NULL), | 426 | BOOL_SETTING(0, invert, LANG_INVERT, false ,"invert", off_on, |
427 | LANG_INVERT_LCD_INVERSE, LANG_INVERT_LCD_NORMAL, lcd_set_invert_display), | ||
338 | OFFON_SETTING(0,flip_display, LANG_FLIP_DISPLAY, false,"flip display", NULL), | 428 | OFFON_SETTING(0,flip_display, LANG_FLIP_DISPLAY, false,"flip display", NULL), |
339 | /* display */ | 429 | /* display */ |
340 | OFFON_SETTING(0,invert_cursor, LANG_INVERT_CURSOR, | 430 | BOOL_SETTING(F_TEMPVAR, invert_cursor, LANG_INVERT_CURSOR, true ,"invert cursor", off_on, |
341 | true,"invert cursor", NULL), | 431 | LANG_INVERT_CURSOR_BAR, LANG_INVERT_CURSOR_POINTER, lcd_set_invert_display), |
342 | OFFON_SETTING(F_THEMESETTING,statusbar, LANG_STATUS_BAR, true,"statusbar", NULL), | 432 | OFFON_SETTING(F_THEMESETTING,statusbar, LANG_STATUS_BAR, true,"statusbar", NULL), |
343 | OFFON_SETTING(0,scrollbar, LANG_SCROLL_BAR, true,"scrollbar", NULL), | 433 | OFFON_SETTING(0,scrollbar, LANG_SCROLL_BAR, true,"scrollbar", NULL), |
344 | #if CONFIG_KEYPAD == RECORDER_PAD | 434 | #if CONFIG_KEYPAD == RECORDER_PAD |
345 | OFFON_SETTING(0,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL), | 435 | OFFON_SETTING(0,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL), |
346 | #endif | 436 | #endif |
347 | {F_T_INT,&global_settings.volume_type,LANG_VOLUME_DISPLAY, INT(0), | 437 | CHOICE_SETTING(0, volume_type, LANG_VOLUME_DISPLAY, 0, |
348 | "volume display",graphic_numeric,UNUSED}, | 438 | "volume display", graphic_numeric, NULL, 2, |
349 | {F_T_INT,&global_settings.battery_display, LANG_BATTERY_DISPLAY, INT(0), | 439 | ID2P(LANG_DISPLAY_GRAPHIC), ID2P(LANG_DISPLAY_NUMERIC)), |
350 | "battery display",graphic_numeric,UNUSED}, | 440 | CHOICE_SETTING(0, battery_display, LANG_BATTERY_DISPLAY, 0, |
441 | "battery display", graphic_numeric, NULL, 2, | ||
442 | ID2P(LANG_DISPLAY_GRAPHIC), ID2P(LANG_DISPLAY_NUMERIC)), | ||
351 | CHOICE_SETTING(0, timeformat, LANG_TIMEFORMAT, 0, | 443 | CHOICE_SETTING(0, timeformat, LANG_TIMEFORMAT, 0, |
352 | "time format", "24hour,12hour", NULL, 2, | 444 | "time format", "24hour,12hour", NULL, 2, |
353 | ID2P(LANG_24_HOUR_CLOCK), ID2P(LANG_12_HOUR_CLOCK)), | 445 | ID2P(LANG_24_HOUR_CLOCK), ID2P(LANG_12_HOUR_CLOCK)), |
@@ -400,19 +492,22 @@ const struct settings_list settings[] = { | |||
400 | #endif | 492 | #endif |
401 | #ifdef HAVE_REMOTE_LCD | 493 | #ifdef HAVE_REMOTE_LCD |
402 | /* remote lcd */ | 494 | /* remote lcd */ |
403 | {F_T_INT,&global_settings.remote_contrast, LANG_CONTRAST, | 495 | INT_SETTING(0, remote_contrast, LANG_CONTRAST, DEFAULT_REMOTE_CONTRAST_SETTING, |
404 | INT(DEFAULT_REMOTE_CONTRAST_SETTING), | 496 | "remote contrast", UNIT_INT, MIN_REMOTE_CONTRAST_SETTING, |
405 | "remote contrast",NULL,UNUSED}, | 497 | MIN_REMOTE_CONTRAST_SETTING, 1, NULL, NULL, lcd_remote_set_contrast), |
406 | OFFON_SETTING(0,remote_invert, LANG_INVERT, | 498 | BOOL_SETTING(0, remote_invert, LANG_INVERT, false ,"remote invert", off_on, |
407 | false,"remote invert", NULL), | 499 | LANG_INVERT_LCD_INVERSE, LANG_INVERT_LCD_NORMAL, lcd_remote_set_invert_display), |
408 | OFFON_SETTING(0,remote_flip_display, LANG_FLIP_DISPLAY, | 500 | OFFON_SETTING(0,remote_flip_display, LANG_FLIP_DISPLAY, |
409 | false,"remote flip display", NULL), | 501 | false,"remote flip display", NULL), |
410 | {F_T_INT,&global_settings.remote_backlight_timeout, LANG_BACKLIGHT, INT(6), | 502 | INT_SETTING_W_CFGVALS(0, remote_backlight_timeout, LANG_BACKLIGHT, 6, |
411 | "remote backlight timeout",backlight_times_conf,UNUSED}, | 503 | "remote backlight timeout", backlight_times_conf, UNIT_SEC, |
504 | 0, 18, 1, backlight_formatter, backlight_getlang, | ||
505 | remote_backlight_set_timeout), | ||
412 | #ifdef CONFIG_CHARGING | 506 | #ifdef CONFIG_CHARGING |
413 | {F_T_INT,&global_settings.remote_backlight_timeout_plugged, | 507 | INT_SETTING_W_CFGVALS(0, remote_backlight_timeout_plugged, LANG_BACKLIGHT, 11, |
414 | LANG_BACKLIGHT_ON_WHEN_CHARGING, INT(11), | 508 | "remote backlight timeout plugged", backlight_times_conf, UNIT_SEC, |
415 | "remote backlight timeout plugged",backlight_times_conf,UNUSED}, | 509 | 0, 18, 1, backlight_formatter, backlight_getlang, |
510 | remote_backlight_set_timeout_plugged), | ||
416 | #endif | 511 | #endif |
417 | #ifdef HAVE_REMOTE_LCD_TICKING | 512 | #ifdef HAVE_REMOTE_LCD_TICKING |
418 | OFFON_SETTING(0,remote_reduce_ticking, LANG_REDUCE_TICKING, | 513 | OFFON_SETTING(0,remote_reduce_ticking, LANG_REDUCE_TICKING, |
@@ -442,43 +537,53 @@ const struct settings_list settings[] = { | |||
442 | #endif | 537 | #endif |
443 | #endif /* CONFIG_BACKLIGHT */ | 538 | #endif /* CONFIG_BACKLIGHT */ |
444 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | 539 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS |
445 | {F_T_INT,&global_settings.brightness,LANG_BRIGHTNESS, | 540 | INT_SETTING(0, brightness, LANG_BRIGHTNESS, DEFAULT_BRIGHTNESS_SETTING, |
446 | INT(DEFAULT_BRIGHTNESS_SETTING), "brightness", NULL ,UNUSED}, | 541 | "brightness",UNIT_INT, MIN_BRIGHTNESS_SETTING, MAX_BRIGHTNESS_SETTING, 1, |
542 | NULL, NULL, backlight_set_brightness), | ||
447 | #endif | 543 | #endif |
448 | #ifdef HAVE_BACKLIGHT_PWM_FADING | 544 | #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) |
449 | /* backlight fading */ | 545 | /* backlight fading */ |
450 | {F_T_INT,&global_settings.backlight_fade_in, LANG_BACKLIGHT_FADE_IN, INT(1), | 546 | STRINGCHOICE_SETTING(0,backlight_fade_in, LANG_BACKLIGHT_FADE_IN, 1, |
451 | "backlight fade in","off,500ms,1s,2s",UNUSED}, | 547 | "backlight fade in","off,500ms,1s,2s", backlight_set_fade_in, 4, |
452 | {F_T_INT,&global_settings.backlight_fade_out, LANG_BACKLIGHT_FADE_OUT, INT(1), | 548 | LANG_OFF, TALK_ID(500, UNIT_MS), |
453 | "backlight fade out","off,500ms,1s,2s,3s,4s,5s,10s",UNUSED}, | 549 | TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC)), |
454 | #endif | 550 | STRINGCHOICE_SETTING(0,backlight_fade_out, LANG_BACKLIGHT_FADE_OUT, 1, |
455 | {F_T_INT,&global_settings.scroll_speed, LANG_SCROLL_SPEED , | 551 | "backlight fade out","off,500ms,1s,2s", backlight_set_fade_out, 4, |
456 | INT(9),"scroll speed",NULL,UNUSED}, | 552 | LANG_OFF, TALK_ID(500, UNIT_MS), |
457 | {F_T_INT,&global_settings.scroll_delay, LANG_SCROLL_DELAY, | 553 | TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC)), |
458 | INT(100),"scroll delay",NULL,UNUSED}, | 554 | #endif |
459 | {F_T_INT,&global_settings.bidir_limit, LANG_BIDIR_SCROLL, | 555 | INT_SETTING(0, scroll_speed, LANG_SCROLL_SPEED, 9,"scroll speed", |
460 | INT(50),"bidir limit",NULL,UNUSED}, | 556 | UNIT_INT, 0, 15, 1, NULL, NULL, lcd_scroll_speed), |
557 | INT_SETTING(0, scroll_delay, LANG_SCROLL_DELAY, 100, "scroll delay", | ||
558 | UNIT_MS, 0, 2500, 100, scrolldelay_format, | ||
559 | scrolldelay_getlang, lcd_scroll_delay) , | ||
560 | INT_SETTING(0, bidir_limit, LANG_BIDIR_SCROLL, 50, "bidir limit", | ||
561 | UNIT_PERCENT, 0, 200, 25, NULL, NULL, lcd_bidir_scroll), | ||
461 | #ifdef HAVE_REMOTE_LCD | 562 | #ifdef HAVE_REMOTE_LCD |
462 | {F_T_INT,&global_settings.remote_scroll_speed,LANG_SCROLL_SPEED,INT(9), | 563 | INT_SETTING(0, remote_scroll_speed, LANG_SCROLL_SPEED, 9, "remote scroll speed", |
463 | "remote scroll speed",NULL,UNUSED}, | 564 | UNIT_INT, 0,15, 1, NULL, NULL, lcd_remote_scroll_speed), |
464 | {F_T_INT,&global_settings.remote_scroll_step,LANG_SCROLL_STEP,INT(6), | 565 | INT_SETTING(0, remote_scroll_step, LANG_SCROLL_STEP, 6, "remote scroll step", |
465 | "remote scroll step",NULL,UNUSED}, | 566 | UNIT_PIXEL, 1, LCD_REMOTE_WIDTH, 1, NULL, NULL, lcd_remote_scroll_step), |
466 | {F_T_INT,&global_settings.remote_scroll_delay,LANG_SCROLL_DELAY,INT(100), | 567 | INT_SETTING(0, remote_scroll_delay, LANG_SCROLL_DELAY, 100, "remote scroll delay", |
467 | "remote scroll delay",NULL,UNUSED}, | 568 | UNIT_MS, 0, 2500, 100, scrolldelay_format, scrolldelay_getlang, lcd_remote_scroll_delay), |
468 | {F_T_INT,&global_settings.remote_bidir_limit,LANG_BIDIR_SCROLL,INT(50), | 569 | INT_SETTING(0, remote_bidir_limit, LANG_BIDIR_SCROLL, 50, "remote bidir limit", |
469 | "remote bidir limit",NULL,UNUSED}, | 570 | UNIT_PERCENT, 0, 200, 25, NULL, NULL, lcd_remote_bidir_scroll), |
470 | #endif | 571 | #endif |
471 | #ifdef HAVE_LCD_BITMAP | 572 | #ifdef HAVE_LCD_BITMAP |
472 | OFFON_SETTING(0,offset_out_of_view,LANG_SCREEN_SCROLL_VIEW, | 573 | OFFON_SETTING(0, offset_out_of_view, LANG_SCREEN_SCROLL_VIEW, |
473 | false,"Screen Scrolls Out Of View",NULL), | 574 | false, "Screen Scrolls Out Of View", NULL), |
474 | {F_T_INT,&global_settings.scroll_step,LANG_SCROLL_STEP,INT(6),"scroll step",NULL,UNUSED}, | 575 | INT_SETTING(0, scroll_step, LANG_SCROLL_STEP, 6, "scroll step", |
475 | {F_T_INT,&global_settings.screen_scroll_step,LANG_SCREEN_SCROLL_STEP, | 576 | UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL, lcd_scroll_step), |
476 | INT(16),"screen scroll step",NULL,UNUSED}, | 577 | INT_SETTING(0, screen_scroll_step, LANG_SCREEN_SCROLL_STEP, |
578 | 16, "screen scroll step", | ||
579 | UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL, NULL), | ||
477 | #endif /* HAVE_LCD_BITMAP */ | 580 | #endif /* HAVE_LCD_BITMAP */ |
478 | #ifdef HAVE_LCD_CHARCELLS | 581 | #ifdef HAVE_LCD_CHARCELLS |
479 | {F_T_INT,&global_settings.jump_scroll,LANG_JUMP_SCROLL,INT(0),"jump scroll",NULL,UNUSED}, | 582 | INT_SETTING(0, jump_scroll, LANG_JUMP_SCROLL, 0, "jump scroll", |
480 | {F_T_INT,&global_settings.jump_scroll_delay,LANG_JUMP_SCROLL_DELAY, | 583 | UNIT_INT, 0, 5, 1, jumpscroll_format, jumpscroll_getlang, lcd_jump_scroll), |
481 | INT(50),"jump scroll delay",NULL,UNUSED}, | 584 | INT_SETTING(0, jump_scroll_delay, LANG_JUMP_SCROLL_DELAY, 50, "jump scroll delay", |
585 | UNIT_MS, 0, 2500, 100, scrolldelay_format, | ||
586 | scrolldelay_getlang, lcd_jump_scroll_delay), | ||
482 | #endif | 587 | #endif |
483 | OFFON_SETTING(0,scroll_paginated,LANG_SCROLL_PAGINATED, | 588 | OFFON_SETTING(0,scroll_paginated,LANG_SCROLL_PAGINATED, |
484 | false,"scroll paginated",NULL), | 589 | false,"scroll paginated",NULL), |
@@ -552,15 +657,24 @@ const struct settings_list settings[] = { | |||
552 | ID2P(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY)), | 657 | ID2P(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY)), |
553 | #ifdef HAVE_LCD_BITMAP | 658 | #ifdef HAVE_LCD_BITMAP |
554 | /* peak meter */ | 659 | /* peak meter */ |
555 | {F_T_INT, &global_settings.peak_meter_clip_hold, LANG_PM_CLIP_HOLD, | 660 | STRINGCHOICE_SETTING(0, peak_meter_clip_hold, LANG_PM_CLIP_HOLD, 16, |
556 | INT(16), "peak meter clip hold", | 661 | "peak meter clip hold", |
557 | "on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,2min" | 662 | "on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,2min" |
558 | ",3min,5min,10min,20min,45min,90min", UNUSED}, | 663 | ",3min,5min,10min,20min,45min,90min", peak_meter_set_clip_hold, |
664 | 25, LANG_PM_ETERNAL, | ||
665 | TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC), TALK_ID(3, UNIT_SEC), | ||
666 | TALK_ID(4, UNIT_SEC), TALK_ID(5, UNIT_SEC), TALK_ID(6, UNIT_SEC), | ||
667 | TALK_ID(7, UNIT_SEC), TALK_ID(8, UNIT_SEC), TALK_ID(9, UNIT_SEC), | ||
668 | TALK_ID(10, UNIT_SEC), TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC), | ||
669 | TALK_ID(25, UNIT_SEC), TALK_ID(30, UNIT_SEC), TALK_ID(45, UNIT_SEC), | ||
670 | TALK_ID(60, UNIT_SEC), TALK_ID(90, UNIT_SEC), TALK_ID(2, UNIT_MIN), | ||
671 | TALK_ID(3, UNIT_MIN), TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN), | ||
672 | TALK_ID(20, UNIT_MIN), TALK_ID(45, UNIT_MIN), TALK_ID(90, UNIT_MIN)), | ||
559 | {F_T_INT,&global_settings.peak_meter_hold, LANG_PM_PEAK_HOLD, | 673 | {F_T_INT,&global_settings.peak_meter_hold, LANG_PM_PEAK_HOLD, |
560 | INT(3),"peak meter hold", | 674 | INT(3),"peak meter hold", |
561 | "off,200ms,300ms,500ms,1,2,3,4,5,6,7,8,9,10,15,20,30,1min",UNUSED}, | 675 | "off,200ms,300ms,500ms,1,2,3,4,5,6,7,8,9,10,15,20,30,1min",UNUSED}, |
562 | {F_T_INT,&global_settings.peak_meter_release,LANG_PM_RELEASE, | 676 | INT_SETTING(0, peak_meter_release, LANG_PM_RELEASE, 8, "peak meter release", |
563 | INT(8),"peak meter release",NULL,UNUSED}, | 677 | LANG_PM_UNITS_PER_READ, 1, 0x7e1, 1, NULL, NULL,NULL), |
564 | OFFON_SETTING(0,peak_meter_dbfs,LANG_PM_DBFS,true,"peak meter dbfs",NULL), | 678 | OFFON_SETTING(0,peak_meter_dbfs,LANG_PM_DBFS,true,"peak meter dbfs",NULL), |
565 | {F_T_INT,&global_settings.peak_meter_min,LANG_PM_MIN,INT(60),"peak meter min",NULL,UNUSED}, | 679 | {F_T_INT,&global_settings.peak_meter_min,LANG_PM_MIN,INT(60),"peak meter min",NULL,UNUSED}, |
566 | {F_T_INT,&global_settings.peak_meter_max,LANG_PM_MAX,INT(0),"peak meter max",NULL,UNUSED}, | 680 | {F_T_INT,&global_settings.peak_meter_max,LANG_PM_MAX,INT(0),"peak meter max",NULL,UNUSED}, |
@@ -794,11 +908,18 @@ const struct settings_list settings[] = { | |||
794 | OFFON_SETTING(0,tagcache_autoupdate, | 908 | OFFON_SETTING(0,tagcache_autoupdate, |
795 | LANG_TAGCACHE_AUTOUPDATE,false,"tagcache_autoupdate",NULL), | 909 | LANG_TAGCACHE_AUTOUPDATE,false,"tagcache_autoupdate",NULL), |
796 | #endif | 910 | #endif |
797 | 911 | CHOICE_SETTING(0, default_codepage, LANG_DEFAULT_CODEPAGE, 0, | |
798 | {F_T_INT,&global_settings.default_codepage,LANG_DEFAULT_CODEPAGE, | 912 | "default codepage", |
799 | INT(0),"default codepage", | ||
800 | "iso8859-1,iso8859-7,iso8859-8,cp1251,iso8859-11,cp1256," | 913 | "iso8859-1,iso8859-7,iso8859-8,cp1251,iso8859-11,cp1256," |
801 | "iso8859-9,iso8859-2,sjis,gb2312,ksx1001,big5,utf-8,cp1256",UNUSED}, | 914 | "iso8859-9,iso8859-2,sjis,gb2312,ksx1001,big5,utf-8,cp1256", |
915 | set_codepage, 13, | ||
916 | ID2P(LANG_CODEPAGE_LATIN1), ID2P(LANG_CODEPAGE_GREEK), | ||
917 | ID2P(LANG_CODEPAGE_HEBREW), ID2P(LANG_CODEPAGE_CYRILLIC), | ||
918 | ID2P(LANG_CODEPAGE_THAI), ID2P(LANG_CODEPAGE_ARABIC), | ||
919 | ID2P(LANG_CODEPAGE_TURKISH), ID2P(LANG_CODEPAGE_LATIN_EXTENDED), | ||
920 | ID2P(LANG_CODEPAGE_JAPANESE), ID2P(LANG_CODEPAGE_SIMPLIFIED), | ||
921 | ID2P(LANG_CODEPAGE_KOREAN), | ||
922 | ID2P(LANG_CODEPAGE_TRADITIONAL), ID2P(LANG_CODEPAGE_UTF8)), | ||
802 | 923 | ||
803 | OFFON_SETTING(0,warnon_erase_dynplaylist, | 924 | OFFON_SETTING(0,warnon_erase_dynplaylist, |
804 | LANG_WARN_ERASEDYNPLAYLIST_MENU,false, | 925 | LANG_WARN_ERASEDYNPLAYLIST_MENU,false, |
@@ -806,15 +927,20 @@ const struct settings_list settings[] = { | |||
806 | 927 | ||
807 | #ifdef CONFIG_BACKLIGHT | 928 | #ifdef CONFIG_BACKLIGHT |
808 | #ifdef HAS_BUTTON_HOLD | 929 | #ifdef HAS_BUTTON_HOLD |
809 | {F_T_INT,&global_settings.backlight_on_button_hold,LANG_BACKLIGHT_ON_BUTTON_HOLD,INT(0), | 930 | CHOICE_SETTING(0, backlight_on_button_hold, |
810 | "backlight on button hold","normal,off,on",UNUSED}, | 931 | LANG_BACKLIGHT_ON_BUTTON_HOLD, 0, "backlight on button hold", |
932 | "normal,off,on", backlight_set_on_button_hold, 3, | ||
933 | ID2P(LANG_BACKLIGHT_ON_BUTTON_HOLD_NORMAL), ID2P(LANG_OFF), ID2P(LANG_ON)), | ||
811 | #endif | 934 | #endif |
812 | 935 | ||
813 | #ifdef HAVE_LCD_SLEEP | 936 | #ifdef HAVE_LCD_SLEEP |
814 | {F_T_INT,&global_settings.lcd_sleep_after_backlight_off, | 937 | STRINGCHOICE_SETTING(0, lcd_sleep_after_backlight_off, |
815 | LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF,INT(3), | 938 | LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF, 3, |
816 | "lcd sleep after backlight off", | 939 | "lcd sleep after backlight off", |
817 | "always,never,5,10,15,20,30,45,60,90",UNUSED}, | 940 | "always,never,5,10,15,20,30,45,60,90", lcd_set_sleep_after_backlight_off, |
941 | 10, LANG_ALWAYS, LANG_NEVER, TALK_ID(5, UNIT_SEC), TALK_ID(10, UNIT_SEC), | ||
942 | TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC), TALK_ID(30, UNIT_SEC), | ||
943 | TALK_ID(45, UNIT_SEC),TALK_ID(60, UNIT_SEC), TALK_ID(90, UNIT_SEC)), | ||
818 | #endif | 944 | #endif |
819 | #endif /* CONFIG_BACKLIGHT */ | 945 | #endif /* CONFIG_BACKLIGHT */ |
820 | 946 | ||
@@ -880,9 +1006,10 @@ const struct settings_list settings[] = { | |||
880 | 1006 | ||
881 | #ifdef HAVE_REMOTE_LCD | 1007 | #ifdef HAVE_REMOTE_LCD |
882 | #ifdef HAS_REMOTE_BUTTON_HOLD | 1008 | #ifdef HAS_REMOTE_BUTTON_HOLD |
883 | {F_T_INT,&global_settings.remote_backlight_on_button_hold, | 1009 | CHOICE_SETTING(0, remote_backlight_on_button_hold, |
884 | LANG_BACKLIGHT_ON_BUTTON_HOLD,INT(0), | 1010 | LANG_BACKLIGHT_ON_BUTTON_HOLD, 0, "remote backlight on button hold", |
885 | "remote backlight on button hold","normal,off,on",UNUSED}, | 1011 | "normal,off,on", remote_backlight_set_on_button_hold, 3, |
1012 | ID2P(LANG_BACKLIGHT_ON_BUTTON_HOLD_NORMAL), ID2P(LANG_OFF), ID2P(LANG_ON)), | ||
886 | #endif | 1013 | #endif |
887 | #endif | 1014 | #endif |
888 | #ifdef HAVE_HEADPHONE_DETECTION | 1015 | #ifdef HAVE_HEADPHONE_DETECTION |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c deleted file mode 100644 index 49788e6eed..0000000000 --- a/apps/settings_menu.c +++ /dev/null | |||
@@ -1,1075 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Robert Hak | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include "config.h" | ||
21 | |||
22 | #include <stdio.h> | ||
23 | #include <stdbool.h> | ||
24 | #include <string.h> | ||
25 | |||
26 | #include "lcd.h" | ||
27 | #include "menu.h" | ||
28 | #include "mpeg.h" | ||
29 | #include "audio.h" | ||
30 | #include "button.h" | ||
31 | #include "kernel.h" | ||
32 | #include "thread.h" | ||
33 | #include "sprintf.h" | ||
34 | #include "settings.h" | ||
35 | #include "settings_menu.h" | ||
36 | #include "backlight.h" | ||
37 | #include "playlist.h" /* for playlist_shuffle */ | ||
38 | #include "fat.h" /* For dotfile settings */ | ||
39 | #include "powermgmt.h" | ||
40 | #include "rtc.h" | ||
41 | #include "ata.h" | ||
42 | #include "tree.h" | ||
43 | #include "screens.h" | ||
44 | #include "talk.h" | ||
45 | #include "timefuncs.h" | ||
46 | #include "misc.h" | ||
47 | #include "abrepeat.h" | ||
48 | #include "power.h" | ||
49 | #include "dir.h" | ||
50 | #include "dircache.h" | ||
51 | #ifdef HAVE_TAGCACHE | ||
52 | #include "tagcache.h" | ||
53 | #include "tagtree.h" | ||
54 | #endif | ||
55 | #include "rbunicode.h" | ||
56 | #include "splash.h" | ||
57 | #include "yesno.h" | ||
58 | #include "list.h" | ||
59 | #include "color_picker.h" | ||
60 | #include "scrobbler.h" | ||
61 | |||
62 | #ifdef HAVE_LCD_BITMAP | ||
63 | #include "peakmeter.h" | ||
64 | #endif | ||
65 | #include "lang.h" | ||
66 | #if CONFIG_CODEC == MAS3507D | ||
67 | void dac_line_in(bool enable); | ||
68 | #endif | ||
69 | |||
70 | #ifdef HAVE_REMOTE_LCD | ||
71 | #include "lcd-remote.h" | ||
72 | #endif | ||
73 | |||
74 | #if CONFIG_CODEC == SWCODEC | ||
75 | #include "pcmbuf.h" | ||
76 | #include "pcm_playback.h" | ||
77 | #include "dsp.h" | ||
78 | #endif | ||
79 | |||
80 | #if LCD_DEPTH > 1 | ||
81 | #include "backdrop.h" | ||
82 | #endif | ||
83 | #include "menus/exported_menus.h" | ||
84 | |||
85 | |||
86 | /** | ||
87 | * Menu to set the option to scroll paginated | ||
88 | */ | ||
89 | static bool scroll_paginated(void) | ||
90 | { | ||
91 | return set_bool( (char *)str(LANG_SCROLL_PAGINATED), &global_settings.scroll_paginated ); | ||
92 | } | ||
93 | |||
94 | #ifdef HAVE_REMOTE_LCD | ||
95 | static bool remote_contrast(void) | ||
96 | { | ||
97 | return set_int( str(LANG_CONTRAST), "", UNIT_INT, | ||
98 | &global_settings.remote_contrast, | ||
99 | lcd_remote_set_contrast, 1, MIN_REMOTE_CONTRAST_SETTING, | ||
100 | MAX_REMOTE_CONTRAST_SETTING, NULL ); | ||
101 | } | ||
102 | |||
103 | static bool remote_invert(void) | ||
104 | { | ||
105 | bool rc = set_bool_options((char *)str(LANG_INVERT), | ||
106 | &global_settings.remote_invert, | ||
107 | (char *)STR(LANG_INVERT_LCD_INVERSE), | ||
108 | STR(LANG_INVERT_LCD_NORMAL), | ||
109 | lcd_remote_set_invert_display); | ||
110 | return rc; | ||
111 | } | ||
112 | |||
113 | static bool remote_flip_display(void) | ||
114 | { | ||
115 | bool rc = set_bool( (char *)str(LANG_FLIP_DISPLAY), | ||
116 | &global_settings.remote_flip_display); | ||
117 | |||
118 | lcd_remote_set_flip(global_settings.remote_flip_display); | ||
119 | lcd_remote_update(); | ||
120 | |||
121 | return rc; | ||
122 | } | ||
123 | |||
124 | #ifdef HAVE_REMOTE_LCD_TICKING | ||
125 | static bool remote_reduce_ticking(void) | ||
126 | { | ||
127 | bool rc = set_bool( str(LANG_REDUCE_TICKING), | ||
128 | &global_settings.remote_reduce_ticking); | ||
129 | |||
130 | lcd_remote_emireduce(global_settings.remote_reduce_ticking); | ||
131 | |||
132 | return rc; | ||
133 | } | ||
134 | #endif | ||
135 | #endif | ||
136 | |||
137 | #ifdef CONFIG_BACKLIGHT | ||
138 | static const struct opt_items backlight_timeouts[] = { | ||
139 | { STR(LANG_OFF) }, | ||
140 | { STR(LANG_ON) }, | ||
141 | { (unsigned char *)"1s ", TALK_ID(1, UNIT_SEC) }, | ||
142 | { (unsigned char *)"2s ", TALK_ID(2, UNIT_SEC) }, | ||
143 | { (unsigned char *)"3s ", TALK_ID(3, UNIT_SEC) }, | ||
144 | { (unsigned char *)"4s ", TALK_ID(4, UNIT_SEC) }, | ||
145 | { (unsigned char *)"5s ", TALK_ID(5, UNIT_SEC) }, | ||
146 | { (unsigned char *)"6s ", TALK_ID(6, UNIT_SEC) }, | ||
147 | { (unsigned char *)"7s ", TALK_ID(7, UNIT_SEC) }, | ||
148 | { (unsigned char *)"8s ", TALK_ID(8, UNIT_SEC) }, | ||
149 | { (unsigned char *)"9s ", TALK_ID(9, UNIT_SEC) }, | ||
150 | { (unsigned char *)"10s", TALK_ID(10, UNIT_SEC) }, | ||
151 | { (unsigned char *)"15s", TALK_ID(15, UNIT_SEC) }, | ||
152 | { (unsigned char *)"20s", TALK_ID(20, UNIT_SEC) }, | ||
153 | { (unsigned char *)"25s", TALK_ID(25, UNIT_SEC) }, | ||
154 | { (unsigned char *)"30s", TALK_ID(30, UNIT_SEC) }, | ||
155 | { (unsigned char *)"45s", TALK_ID(45, UNIT_SEC) }, | ||
156 | { (unsigned char *)"60s", TALK_ID(60, UNIT_SEC) }, | ||
157 | { (unsigned char *)"90s", TALK_ID(90, UNIT_SEC) } | ||
158 | }; | ||
159 | |||
160 | static bool caption_backlight(void) | ||
161 | { | ||
162 | return set_bool( (char *)str(LANG_CAPTION_BACKLIGHT), | ||
163 | &global_settings.caption_backlight); | ||
164 | } | ||
165 | |||
166 | #ifdef CONFIG_CHARGING | ||
167 | static bool backlight_timer_plugged(void) | ||
168 | { | ||
169 | return set_option((char *)str(LANG_BACKLIGHT_ON_WHEN_CHARGING), | ||
170 | &global_settings.backlight_timeout_plugged, | ||
171 | INT, backlight_timeouts, 19, | ||
172 | backlight_set_timeout_plugged ); | ||
173 | } | ||
174 | #endif | ||
175 | |||
176 | static bool backlight_timer(void) | ||
177 | { | ||
178 | return set_option((char *)str(LANG_BACKLIGHT), | ||
179 | &global_settings.backlight_timeout, | ||
180 | INT, backlight_timeouts, 19, | ||
181 | backlight_set_timeout ); | ||
182 | } | ||
183 | |||
184 | #ifdef HAS_BUTTON_HOLD | ||
185 | static bool backlight_on_button_hold(void) | ||
186 | { | ||
187 | static const struct opt_items names[3] = { | ||
188 | { STR(LANG_BACKLIGHT_ON_BUTTON_HOLD_NORMAL) }, | ||
189 | { STR(LANG_OFF) }, | ||
190 | { STR(LANG_ON) }, | ||
191 | }; | ||
192 | return set_option(str(LANG_BACKLIGHT_ON_BUTTON_HOLD), | ||
193 | &global_settings.backlight_on_button_hold, | ||
194 | INT, names, 3, | ||
195 | backlight_set_on_button_hold); | ||
196 | } | ||
197 | #endif /* HAS_BUTTON_HOLD */ | ||
198 | |||
199 | #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) | ||
200 | static bool backlight_fade_in(void) | ||
201 | { | ||
202 | static const struct opt_items names[] = { | ||
203 | { STR(LANG_OFF) }, | ||
204 | { (unsigned char *)"500ms", TALK_ID(500, UNIT_MS) }, | ||
205 | { (unsigned char *)"1s", TALK_ID(1, UNIT_SEC) }, | ||
206 | { (unsigned char *)"2s", TALK_ID(2, UNIT_SEC) }, | ||
207 | }; | ||
208 | return set_option(str(LANG_BACKLIGHT_FADE_IN), | ||
209 | &global_settings.backlight_fade_in, | ||
210 | INT, names, 4, backlight_set_fade_in ); | ||
211 | } | ||
212 | |||
213 | static bool backlight_fade_out(void) | ||
214 | { | ||
215 | static const struct opt_items names[] = { | ||
216 | { STR(LANG_OFF) }, | ||
217 | { (unsigned char *)"500ms", TALK_ID(500, UNIT_MS) }, | ||
218 | { (unsigned char *)"1s", TALK_ID(1, UNIT_SEC) }, | ||
219 | { (unsigned char *)"2s", TALK_ID(2, UNIT_SEC) }, | ||
220 | { (unsigned char *)"3s", TALK_ID(3, UNIT_SEC) }, | ||
221 | { (unsigned char *)"4s", TALK_ID(4, UNIT_SEC) }, | ||
222 | { (unsigned char *)"5s", TALK_ID(5, UNIT_SEC) }, | ||
223 | { (unsigned char *)"10s", TALK_ID(10, UNIT_SEC) }, | ||
224 | }; | ||
225 | return set_option(str(LANG_BACKLIGHT_FADE_OUT), | ||
226 | &global_settings.backlight_fade_out, | ||
227 | INT, names, 8, backlight_set_fade_out ); | ||
228 | } | ||
229 | #endif | ||
230 | |||
231 | #ifdef HAVE_LCD_SLEEP | ||
232 | static bool lcd_sleep_after_backlight_off(void) | ||
233 | { | ||
234 | static const struct opt_items names[] = { | ||
235 | { STR(LANG_ALWAYS) }, | ||
236 | { STR(LANG_NEVER) }, | ||
237 | { (unsigned char *)"5s", TALK_ID(5, UNIT_SEC) }, | ||
238 | { (unsigned char *)"10s", TALK_ID(10, UNIT_SEC) }, | ||
239 | { (unsigned char *)"15s", TALK_ID(15, UNIT_SEC) }, | ||
240 | { (unsigned char *)"20s", TALK_ID(20, UNIT_SEC) }, | ||
241 | { (unsigned char *)"30s", TALK_ID(30, UNIT_SEC) }, | ||
242 | { (unsigned char *)"45s", TALK_ID(45, UNIT_SEC) }, | ||
243 | { (unsigned char *)"60s", TALK_ID(60, UNIT_SEC) }, | ||
244 | { (unsigned char *)"90s", TALK_ID(90, UNIT_SEC) }, | ||
245 | }; | ||
246 | |||
247 | return set_option(str(LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF), | ||
248 | &global_settings.lcd_sleep_after_backlight_off, | ||
249 | INT, names, 10, | ||
250 | lcd_set_sleep_after_backlight_off ); | ||
251 | } | ||
252 | #endif /* HAVE_LCD_SLEEP */ | ||
253 | #endif /* CONFIG_BACKLIGHT */ | ||
254 | |||
255 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | ||
256 | static bool brightness(void) | ||
257 | { | ||
258 | return set_int( str(LANG_BRIGHTNESS), "", UNIT_INT, | ||
259 | &global_settings.brightness, | ||
260 | backlight_set_brightness, 1, MIN_BRIGHTNESS_SETTING, | ||
261 | MAX_BRIGHTNESS_SETTING, NULL ); | ||
262 | } | ||
263 | #endif | ||
264 | |||
265 | #ifdef HAVE_REMOTE_LCD | ||
266 | |||
267 | static bool remote_backlight_timer(void) | ||
268 | { | ||
269 | return set_option((char *)str(LANG_BACKLIGHT), | ||
270 | &global_settings.remote_backlight_timeout, | ||
271 | INT, backlight_timeouts, 19, | ||
272 | remote_backlight_set_timeout ); | ||
273 | } | ||
274 | |||
275 | #ifdef CONFIG_CHARGING | ||
276 | static bool remote_backlight_timer_plugged(void) | ||
277 | { | ||
278 | return set_option((char *)str(LANG_BACKLIGHT_ON_WHEN_CHARGING), | ||
279 | &global_settings.remote_backlight_timeout_plugged, | ||
280 | INT, backlight_timeouts, 19, | ||
281 | remote_backlight_set_timeout_plugged ); | ||
282 | } | ||
283 | #endif /* HAVE_REMOTE_LCD */ | ||
284 | |||
285 | static bool remote_caption_backlight(void) | ||
286 | { | ||
287 | return set_bool((char *)str(LANG_CAPTION_BACKLIGHT), | ||
288 | &global_settings.remote_caption_backlight); | ||
289 | } | ||
290 | |||
291 | #ifdef HAS_REMOTE_BUTTON_HOLD | ||
292 | static bool remote_backlight_on_button_hold(void) | ||
293 | { | ||
294 | static const struct opt_items names[3] = { | ||
295 | { STR(LANG_BACKLIGHT_ON_BUTTON_HOLD_NORMAL) }, | ||
296 | { STR(LANG_OFF) }, | ||
297 | { STR(LANG_ON) }, | ||
298 | }; | ||
299 | return set_option(str(LANG_BACKLIGHT_ON_BUTTON_HOLD), | ||
300 | &global_settings.remote_backlight_on_button_hold, | ||
301 | INT, names, 3, | ||
302 | remote_backlight_set_on_button_hold); | ||
303 | } | ||
304 | #endif /* HAS_BUTTON_HOLD */ | ||
305 | |||
306 | #endif /* HAVE_REMOTE_LCD */ | ||
307 | |||
308 | #ifdef HAVE_LCD_CONTRAST | ||
309 | static bool contrast(void) | ||
310 | { | ||
311 | return set_int( str(LANG_CONTRAST), "", UNIT_INT, | ||
312 | &global_settings.contrast, | ||
313 | lcd_set_contrast, 1, MIN_CONTRAST_SETTING, | ||
314 | MAX_CONTRAST_SETTING, NULL ); | ||
315 | } | ||
316 | #endif /* HAVE_LCD_CONTRAST */ | ||
317 | |||
318 | #ifdef HAVE_LCD_BITMAP | ||
319 | #ifdef HAVE_LCD_INVERT | ||
320 | /** | ||
321 | * Menu to set LCD Mode (normal/inverse) | ||
322 | */ | ||
323 | static bool invert(void) | ||
324 | { | ||
325 | bool rc = set_bool_options(str(LANG_INVERT), | ||
326 | &global_settings.invert, | ||
327 | (char *)STR(LANG_INVERT_LCD_INVERSE), | ||
328 | STR(LANG_INVERT_LCD_NORMAL), | ||
329 | lcd_set_invert_display); | ||
330 | return rc; | ||
331 | } | ||
332 | #endif /* HAVE_LCD_INVERT */ | ||
333 | |||
334 | #ifdef HAVE_LCD_FLIP | ||
335 | /** | ||
336 | * Menu to turn the display+buttons by 180 degrees | ||
337 | */ | ||
338 | static bool flip_display(void) | ||
339 | { | ||
340 | bool rc = set_bool( str(LANG_FLIP_DISPLAY), | ||
341 | &global_settings.flip_display); | ||
342 | |||
343 | button_set_flip(global_settings.flip_display); | ||
344 | lcd_set_flip(global_settings.flip_display); | ||
345 | |||
346 | return rc; | ||
347 | } | ||
348 | #endif /* HAVE_LCD_FLIP */ | ||
349 | |||
350 | /** | ||
351 | * Menu to set Line Selector Type (Pointer/Bar) | ||
352 | */ | ||
353 | static bool invert_cursor(void) | ||
354 | { | ||
355 | bool type = global_settings.invert_cursor; | ||
356 | bool rc = set_bool_options(str(LANG_INVERT_CURSOR), | ||
357 | &type, | ||
358 | STR(LANG_INVERT_CURSOR_BAR), | ||
359 | STR(LANG_INVERT_CURSOR_POINTER), | ||
360 | NULL); | ||
361 | global_settings.invert_cursor = type; | ||
362 | return rc; | ||
363 | } | ||
364 | |||
365 | #if LCD_DEPTH > 1 | ||
366 | /** | ||
367 | * Menu to clear the backdrop image | ||
368 | */ | ||
369 | static bool clear_main_backdrop(void) | ||
370 | { | ||
371 | global_settings.backdrop_file[0]=0; | ||
372 | unload_main_backdrop(); | ||
373 | show_main_backdrop(); | ||
374 | return false; | ||
375 | } | ||
376 | #endif | ||
377 | |||
378 | #ifdef HAVE_USB_POWER | ||
379 | #ifdef CONFIG_CHARGING | ||
380 | #include "usb.h" | ||
381 | #endif | ||
382 | #endif | ||
383 | |||
384 | #ifdef HAVE_LCD_COLOR | ||
385 | /** | ||
386 | * Menu for fore/back colors | ||
387 | */ | ||
388 | static bool set_fg_color(void) | ||
389 | { | ||
390 | bool res; | ||
391 | |||
392 | res = set_color(NULL,str(LANG_FOREGROUND_COLOR), | ||
393 | &global_settings.fg_color,global_settings.bg_color); | ||
394 | |||
395 | screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); | ||
396 | |||
397 | return res; | ||
398 | } | ||
399 | |||
400 | static bool set_bg_color(void) | ||
401 | { | ||
402 | bool res; | ||
403 | |||
404 | res = set_color(NULL,str(LANG_BACKGROUND_COLOR), | ||
405 | &global_settings.bg_color,global_settings.fg_color); | ||
406 | |||
407 | screens[SCREEN_MAIN].set_background(global_settings.bg_color); | ||
408 | |||
409 | return res; | ||
410 | } | ||
411 | |||
412 | static bool reset_color(void) | ||
413 | { | ||
414 | global_settings.fg_color = LCD_DEFAULT_FG; | ||
415 | global_settings.bg_color = LCD_DEFAULT_BG; | ||
416 | |||
417 | screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); | ||
418 | screens[SCREEN_MAIN].set_background(global_settings.bg_color); | ||
419 | return false; | ||
420 | } | ||
421 | #endif | ||
422 | |||
423 | /** | ||
424 | * Menu to configure the battery display on status bar | ||
425 | */ | ||
426 | static bool battery_display(void) | ||
427 | { | ||
428 | static const struct opt_items names[] = { | ||
429 | { STR(LANG_DISPLAY_GRAPHIC) }, | ||
430 | { STR(LANG_DISPLAY_NUMERIC) } | ||
431 | }; | ||
432 | return set_option( str(LANG_BATTERY_DISPLAY), | ||
433 | &global_settings.battery_display, INT, names, 2, NULL); | ||
434 | } | ||
435 | |||
436 | /** | ||
437 | * Menu to configure the volume display on status bar | ||
438 | */ | ||
439 | static bool volume_type(void) | ||
440 | { | ||
441 | static const struct opt_items names[] = { | ||
442 | { STR(LANG_DISPLAY_GRAPHIC) }, | ||
443 | { STR(LANG_DISPLAY_NUMERIC) } | ||
444 | }; | ||
445 | return set_option( str(LANG_VOLUME_DISPLAY), &global_settings.volume_type, | ||
446 | INT, names, 2, NULL); | ||
447 | } | ||
448 | |||
449 | /** | ||
450 | * Menu to set the hold time of normal peaks. | ||
451 | */ | ||
452 | static bool peak_meter_hold(void) { | ||
453 | bool retval = false; | ||
454 | static const struct opt_items names[] = { | ||
455 | { STR(LANG_OFF) }, | ||
456 | { "200 ms " , TALK_ID(200, UNIT_MS) }, | ||
457 | { "300 ms " , TALK_ID(300, UNIT_MS) }, | ||
458 | { "500 ms " , TALK_ID(500, UNIT_MS) }, | ||
459 | { "1 s" , TALK_ID(1, UNIT_SEC) }, | ||
460 | { "2 s" , TALK_ID(2, UNIT_SEC) }, | ||
461 | { "3 s" , TALK_ID(3, UNIT_SEC) }, | ||
462 | { "4 s" , TALK_ID(4, UNIT_SEC) }, | ||
463 | { "5 s" , TALK_ID(5, UNIT_SEC) }, | ||
464 | { "6 s" , TALK_ID(6, UNIT_SEC) }, | ||
465 | { "7 s" , TALK_ID(7, UNIT_SEC) }, | ||
466 | { "8 s" , TALK_ID(8, UNIT_SEC) }, | ||
467 | { "9 s" , TALK_ID(9, UNIT_SEC) }, | ||
468 | { "10 s" , TALK_ID(10, UNIT_SEC) }, | ||
469 | { "15 s" , TALK_ID(15, UNIT_SEC) }, | ||
470 | { "20 s" , TALK_ID(20, UNIT_SEC) }, | ||
471 | { "30 s" , TALK_ID(30, UNIT_SEC) }, | ||
472 | { "1 min" , TALK_ID(1, UNIT_MIN) } | ||
473 | }; | ||
474 | retval = set_option( str(LANG_PM_PEAK_HOLD), | ||
475 | &global_settings.peak_meter_hold, INT, names, | ||
476 | 18, NULL); | ||
477 | |||
478 | peak_meter_init_times(global_settings.peak_meter_release, | ||
479 | global_settings.peak_meter_hold, | ||
480 | global_settings.peak_meter_clip_hold); | ||
481 | |||
482 | return retval; | ||
483 | } | ||
484 | |||
485 | /** | ||
486 | * Menu to set the hold time of clips. | ||
487 | */ | ||
488 | static bool peak_meter_clip_hold(void) { | ||
489 | bool retval = false; | ||
490 | |||
491 | static const struct opt_items names[] = { | ||
492 | { STR(LANG_PM_ETERNAL) }, | ||
493 | { "1s " , TALK_ID(1, UNIT_SEC) }, | ||
494 | { "2s " , TALK_ID(2, UNIT_SEC) }, | ||
495 | { "3s " , TALK_ID(3, UNIT_SEC) }, | ||
496 | { "4s " , TALK_ID(4, UNIT_SEC) }, | ||
497 | { "5s " , TALK_ID(5, UNIT_SEC) }, | ||
498 | { "6s " , TALK_ID(6, UNIT_SEC) }, | ||
499 | { "7s " , TALK_ID(7, UNIT_SEC) }, | ||
500 | { "8s " , TALK_ID(8, UNIT_SEC) }, | ||
501 | { "9s " , TALK_ID(9, UNIT_SEC) }, | ||
502 | { "10s" , TALK_ID(10, UNIT_SEC) }, | ||
503 | { "15s" , TALK_ID(15, UNIT_SEC) }, | ||
504 | { "20s" , TALK_ID(20, UNIT_SEC) }, | ||
505 | { "25s" , TALK_ID(25, UNIT_SEC) }, | ||
506 | { "30s" , TALK_ID(30, UNIT_SEC) }, | ||
507 | { "45s" , TALK_ID(45, UNIT_SEC) }, | ||
508 | { "60s" , TALK_ID(60, UNIT_SEC) }, | ||
509 | { "90s" , TALK_ID(90, UNIT_SEC) }, | ||
510 | { "2min" , TALK_ID(2, UNIT_MIN) }, | ||
511 | { "3min" , TALK_ID(3, UNIT_MIN) }, | ||
512 | { "5min" , TALK_ID(5, UNIT_MIN) }, | ||
513 | { "10min" , TALK_ID(10, UNIT_MIN) }, | ||
514 | { "20min" , TALK_ID(20, UNIT_MIN) }, | ||
515 | { "45min" , TALK_ID(45, UNIT_MIN) }, | ||
516 | { "90min" , TALK_ID(90, UNIT_MIN) } | ||
517 | }; | ||
518 | retval = set_option( str(LANG_PM_CLIP_HOLD), | ||
519 | &global_settings.peak_meter_clip_hold, INT, names, | ||
520 | 25, peak_meter_set_clip_hold); | ||
521 | |||
522 | peak_meter_init_times(global_settings.peak_meter_release, | ||
523 | global_settings.peak_meter_hold, | ||
524 | global_settings.peak_meter_clip_hold); | ||
525 | |||
526 | return retval; | ||
527 | } | ||
528 | |||
529 | /** | ||
530 | * Menu to set the release time of the peak meter. | ||
531 | */ | ||
532 | static bool peak_meter_release(void) { | ||
533 | bool retval = false; | ||
534 | |||
535 | /* The range of peak_meter_release is restricted so that it | ||
536 | fits into a 7 bit number. The 8th bit is used for storing | ||
537 | something else in the rtc ram. | ||
538 | Also, the max value is 0x7e, since the RTC value 0xff is reserved */ | ||
539 | retval = set_int( str(LANG_PM_RELEASE), str(LANG_PM_UNITS_PER_READ), | ||
540 | LANG_PM_UNITS_PER_READ, | ||
541 | &global_settings.peak_meter_release, | ||
542 | NULL, 1, 1, 0x7e, NULL); | ||
543 | |||
544 | peak_meter_init_times(global_settings.peak_meter_release, | ||
545 | global_settings.peak_meter_hold, | ||
546 | global_settings.peak_meter_clip_hold); | ||
547 | |||
548 | return retval; | ||
549 | } | ||
550 | |||
551 | /** | ||
552 | * Menu to select wether the scale of the meter | ||
553 | * displays dBfs of linear values. | ||
554 | */ | ||
555 | static bool peak_meter_scale(void) { | ||
556 | bool retval = false; | ||
557 | bool use_dbfs = global_settings.peak_meter_dbfs; | ||
558 | retval = set_bool_options(str(LANG_PM_SCALE), | ||
559 | &use_dbfs, | ||
560 | STR(LANG_PM_DBFS), STR(LANG_PM_LINEAR), | ||
561 | NULL); | ||
562 | |||
563 | /* has the user really changed the scale? */ | ||
564 | if (use_dbfs != global_settings.peak_meter_dbfs) { | ||
565 | |||
566 | /* store the change */ | ||
567 | global_settings.peak_meter_dbfs = use_dbfs; | ||
568 | peak_meter_set_use_dbfs(use_dbfs); | ||
569 | |||
570 | /* If the user changed the scale mode the meaning of | ||
571 | peak_meter_min (peak_meter_max) has changed. Thus we have | ||
572 | to convert the values stored in global_settings. */ | ||
573 | if (use_dbfs) { | ||
574 | |||
575 | /* we only store -dBfs */ | ||
576 | global_settings.peak_meter_min = -peak_meter_get_min() / 100; | ||
577 | global_settings.peak_meter_max = -peak_meter_get_max() / 100; | ||
578 | } else { | ||
579 | int max; | ||
580 | |||
581 | /* linear percent */ | ||
582 | global_settings.peak_meter_min = peak_meter_get_min(); | ||
583 | |||
584 | /* converting dBfs -> percent results in a precision loss. | ||
585 | I assume that the user doesn't bother that conversion | ||
586 | dBfs <-> percent isn't symmetrical for odd values but that | ||
587 | he wants 0 dBfs == 100%. Thus I 'correct' the percent value | ||
588 | resulting from dBfs -> percent manually here */ | ||
589 | max = peak_meter_get_max(); | ||
590 | global_settings.peak_meter_max = max < 99 ? max : 100; | ||
591 | } | ||
592 | settings_apply_pm_range(); | ||
593 | } | ||
594 | return retval; | ||
595 | } | ||
596 | |||
597 | /** | ||
598 | * Adjust the min value of the value range that | ||
599 | * the peak meter shall visualize. | ||
600 | */ | ||
601 | static bool peak_meter_min(void) { | ||
602 | bool retval = false; | ||
603 | if (global_settings.peak_meter_dbfs) { | ||
604 | |||
605 | /* for dBfs scale */ | ||
606 | int range_max = -global_settings.peak_meter_max; | ||
607 | int min = -global_settings.peak_meter_min; | ||
608 | |||
609 | retval = set_int(str(LANG_PM_MIN), str(LANG_PM_DBFS), UNIT_DB, | ||
610 | &min, NULL, 1, -89, range_max, NULL); | ||
611 | |||
612 | global_settings.peak_meter_min = - min; | ||
613 | } | ||
614 | |||
615 | /* for linear scale */ | ||
616 | else { | ||
617 | int min = global_settings.peak_meter_min; | ||
618 | |||
619 | retval = set_int(str(LANG_PM_MIN), "%", UNIT_PERCENT, | ||
620 | &min, NULL, | ||
621 | 1, 0, global_settings.peak_meter_max - 1, NULL); | ||
622 | |||
623 | global_settings.peak_meter_min = (unsigned char)min; | ||
624 | } | ||
625 | |||
626 | settings_apply_pm_range(); | ||
627 | return retval; | ||
628 | } | ||
629 | |||
630 | |||
631 | /** | ||
632 | * Adjust the max value of the value range that | ||
633 | * the peak meter shall visualize. | ||
634 | */ | ||
635 | static bool peak_meter_max(void) { | ||
636 | bool retval = false; | ||
637 | if (global_settings.peak_meter_dbfs) { | ||
638 | |||
639 | /* for dBfs scale */ | ||
640 | int range_min = -global_settings.peak_meter_min; | ||
641 | int max = -global_settings.peak_meter_max;; | ||
642 | |||
643 | retval = set_int(str(LANG_PM_MAX), str(LANG_PM_DBFS), UNIT_DB, | ||
644 | &max, NULL, 1, range_min, 0, NULL); | ||
645 | |||
646 | global_settings.peak_meter_max = - max; | ||
647 | |||
648 | } | ||
649 | |||
650 | /* for linear scale */ | ||
651 | else { | ||
652 | int max = global_settings.peak_meter_max; | ||
653 | |||
654 | retval = set_int(str(LANG_PM_MAX), "%", UNIT_PERCENT, | ||
655 | &max, NULL, | ||
656 | 1, global_settings.peak_meter_min + 1, 100, NULL); | ||
657 | |||
658 | global_settings.peak_meter_max = (unsigned char)max; | ||
659 | } | ||
660 | |||
661 | settings_apply_pm_range(); | ||
662 | return retval; | ||
663 | } | ||
664 | |||
665 | /** | ||
666 | * Menu to configure the peak meter | ||
667 | */ | ||
668 | static bool peak_meter_menu(void) | ||
669 | { | ||
670 | int m; | ||
671 | bool result; | ||
672 | |||
673 | static const struct menu_item items[] = { | ||
674 | { ID2P(LANG_PM_RELEASE) , peak_meter_release }, | ||
675 | { ID2P(LANG_PM_PEAK_HOLD), peak_meter_hold }, | ||
676 | { ID2P(LANG_PM_CLIP_HOLD), peak_meter_clip_hold }, | ||
677 | { ID2P(LANG_PM_SCALE) , peak_meter_scale }, | ||
678 | { ID2P(LANG_PM_MIN) , peak_meter_min }, | ||
679 | { ID2P(LANG_PM_MAX) , peak_meter_max }, | ||
680 | }; | ||
681 | |||
682 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
683 | NULL, NULL, NULL ); | ||
684 | result = menu_run(m); | ||
685 | menu_exit(m); | ||
686 | return result; | ||
687 | } | ||
688 | #endif /* HAVE_LCD_BITMAP */ | ||
689 | |||
690 | static bool scroll_speed(void) | ||
691 | { | ||
692 | return set_int(str(LANG_SCROLL), "", UNIT_INT, | ||
693 | &global_settings.scroll_speed, | ||
694 | &lcd_scroll_speed, 1, 0, 15, NULL ); | ||
695 | } | ||
696 | |||
697 | static bool scroll_delay(void) | ||
698 | { | ||
699 | int dummy = global_settings.scroll_delay * (HZ/10); | ||
700 | int rc = set_int(str(LANG_SCROLL_DELAY), "ms", UNIT_MS, | ||
701 | &dummy, | ||
702 | &lcd_scroll_delay, 100, 0, 2500, NULL ); | ||
703 | global_settings.scroll_delay = dummy / (HZ/10); | ||
704 | return rc; | ||
705 | } | ||
706 | |||
707 | #ifdef HAVE_REMOTE_LCD | ||
708 | static bool remote_scroll_speed(void) | ||
709 | { | ||
710 | return set_int(str(LANG_SCROLL), "", UNIT_INT, | ||
711 | &global_settings.remote_scroll_speed, | ||
712 | &lcd_remote_scroll_speed, 1, 0, 15, NULL ); | ||
713 | } | ||
714 | |||
715 | static bool remote_scroll_step(void) | ||
716 | { | ||
717 | return set_int(str(LANG_SCROLL_STEP_EXAMPLE), str(LANG_PIXELS), UNIT_PIXEL, | ||
718 | &global_settings.remote_scroll_step, | ||
719 | &lcd_remote_scroll_step, 1, 1, LCD_WIDTH, NULL ); | ||
720 | } | ||
721 | |||
722 | static bool remote_scroll_delay(void) | ||
723 | { | ||
724 | int dummy = global_settings.remote_scroll_delay * (HZ/10); | ||
725 | int rc = set_int(str(LANG_SCROLL_DELAY), "ms", UNIT_MS, | ||
726 | &dummy, | ||
727 | &lcd_remote_scroll_delay, 100, 0, 2500, NULL ); | ||
728 | global_settings.remote_scroll_delay = dummy / (HZ/10); | ||
729 | return rc; | ||
730 | } | ||
731 | |||
732 | static bool remote_bidir_limit(void) | ||
733 | { | ||
734 | return set_int(str(LANG_BIDIR_SCROLL), "%", UNIT_PERCENT, | ||
735 | &global_settings.remote_bidir_limit, | ||
736 | &lcd_remote_bidir_scroll, 25, 0, 200, NULL ); | ||
737 | } | ||
738 | |||
739 | #endif | ||
740 | |||
741 | #ifdef HAVE_LCD_BITMAP | ||
742 | static bool screen_scroll(void) | ||
743 | { | ||
744 | bool rc = set_bool( str(LANG_SCREEN_SCROLL_VIEW), &global_settings.offset_out_of_view); | ||
745 | gui_list_screen_scroll_out_of_view(global_settings.offset_out_of_view); | ||
746 | return rc; | ||
747 | } | ||
748 | |||
749 | static bool screen_scroll_step(void) | ||
750 | { | ||
751 | return set_int(str(LANG_SCREEN_SCROLL_STEP), str(LANG_PIXELS), UNIT_PIXEL, | ||
752 | &global_settings.screen_scroll_step, | ||
753 | &gui_list_screen_scroll_step, 1, 1, LCD_WIDTH, NULL ); | ||
754 | } | ||
755 | |||
756 | static bool scroll_step(void) | ||
757 | { | ||
758 | return set_int(str(LANG_SCROLL_STEP_EXAMPLE), str(LANG_PIXELS), UNIT_PIXEL, | ||
759 | &global_settings.scroll_step, | ||
760 | &lcd_scroll_step, 1, 1, LCD_WIDTH, NULL ); | ||
761 | } | ||
762 | #endif | ||
763 | |||
764 | static bool bidir_limit(void) | ||
765 | { | ||
766 | return set_int(str(LANG_BIDIR_SCROLL), "%", UNIT_PERCENT, | ||
767 | &global_settings.bidir_limit, | ||
768 | &lcd_bidir_scroll, 25, 0, 200, NULL ); | ||
769 | } | ||
770 | |||
771 | #ifdef HAVE_LCD_CHARCELLS | ||
772 | static bool jump_scroll(void) | ||
773 | { | ||
774 | static const struct opt_items names[] = { | ||
775 | { STR(LANG_OFF) }, | ||
776 | { STR(LANG_ONE_TIME) }, | ||
777 | { "2", TALK_ID(2, UNIT_INT) }, | ||
778 | { "3", TALK_ID(3, UNIT_INT) }, | ||
779 | { "4", TALK_ID(4, UNIT_INT) }, | ||
780 | { STR(LANG_ALWAYS) } | ||
781 | }; | ||
782 | bool ret; | ||
783 | ret=set_option(str(LANG_JUMP_SCROLL), &global_settings.jump_scroll, | ||
784 | INT, names, 6, lcd_jump_scroll); | ||
785 | return ret; | ||
786 | } | ||
787 | static bool jump_scroll_delay(void) | ||
788 | { | ||
789 | int dummy = global_settings.jump_scroll_delay * (HZ/10); | ||
790 | int rc = set_int(str(LANG_JUMP_SCROLL_DELAY), "ms", UNIT_MS, | ||
791 | &dummy, | ||
792 | &lcd_jump_scroll_delay, 100, 0, 2500, NULL ); | ||
793 | global_settings.jump_scroll_delay = dummy / (HZ/10); | ||
794 | return rc; | ||
795 | } | ||
796 | #endif | ||
797 | |||
798 | |||
799 | #ifdef CONFIG_BACKLIGHT | ||
800 | static bool set_bl_filter_first_keypress(void) | ||
801 | { | ||
802 | bool result = set_bool( str(LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS), | ||
803 | &global_settings.bl_filter_first_keypress ); | ||
804 | set_backlight_filter_keypress(global_settings.bl_filter_first_keypress); | ||
805 | return result; | ||
806 | } | ||
807 | #ifdef HAVE_REMOTE_LCD | ||
808 | static bool set_remote_bl_filter_first_keypress(void) | ||
809 | { | ||
810 | bool result = set_bool( str(LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS), | ||
811 | &global_settings.remote_bl_filter_first_keypress ); | ||
812 | set_remote_backlight_filter_keypress(global_settings.remote_bl_filter_first_keypress); | ||
813 | return result; | ||
814 | } | ||
815 | #endif | ||
816 | #endif | ||
817 | |||
818 | static bool custom_wps_browse(void) | ||
819 | { | ||
820 | return rockbox_browse(WPS_DIR, SHOW_WPS); | ||
821 | } | ||
822 | |||
823 | #ifdef HAVE_REMOTE_LCD | ||
824 | static bool custom_remote_wps_browse(void) | ||
825 | { | ||
826 | return rockbox_browse(WPS_DIR, SHOW_RWPS); | ||
827 | } | ||
828 | #endif | ||
829 | |||
830 | #ifdef HAVE_LCD_BITMAP | ||
831 | static bool font_browse(void) | ||
832 | { | ||
833 | return rockbox_browse(FONT_DIR, SHOW_FONT); | ||
834 | } | ||
835 | |||
836 | static bool scroll_bar(void) | ||
837 | { | ||
838 | return set_bool( str(LANG_SCROLL_BAR), &global_settings.scrollbar ); | ||
839 | } | ||
840 | |||
841 | static bool status_bar(void) | ||
842 | { | ||
843 | return set_bool( str(LANG_STATUS_BAR), &global_settings.statusbar ); | ||
844 | } | ||
845 | |||
846 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
847 | static bool button_bar(void) | ||
848 | { | ||
849 | return set_bool( str(LANG_BUTTON_BAR), &global_settings.buttonbar ); | ||
850 | } | ||
851 | #endif /* CONFIG_KEYPAD == RECORDER_PAD */ | ||
852 | #endif /* HAVE_LCD_BITMAP */ | ||
853 | |||
854 | static bool codepage_setting(void) | ||
855 | { | ||
856 | static const struct opt_items names[] = { | ||
857 | { STR(LANG_CODEPAGE_LATIN1) }, | ||
858 | { STR(LANG_CODEPAGE_GREEK) }, | ||
859 | { STR(LANG_CODEPAGE_HEBREW) }, | ||
860 | { STR(LANG_CODEPAGE_CYRILLIC) }, | ||
861 | { STR(LANG_CODEPAGE_THAI) }, | ||
862 | { STR(LANG_CODEPAGE_ARABIC) }, | ||
863 | { STR(LANG_CODEPAGE_TURKISH) }, | ||
864 | { STR(LANG_CODEPAGE_LATIN_EXTENDED) }, | ||
865 | { STR(LANG_CODEPAGE_JAPANESE) }, | ||
866 | { STR(LANG_CODEPAGE_SIMPLIFIED) }, | ||
867 | { STR(LANG_CODEPAGE_KOREAN) }, | ||
868 | { STR(LANG_CODEPAGE_TRADITIONAL) }, | ||
869 | { STR(LANG_CODEPAGE_UTF8) }, | ||
870 | }; | ||
871 | return set_option(str(LANG_DEFAULT_CODEPAGE), | ||
872 | &global_settings.default_codepage, | ||
873 | INT, names, 13, set_codepage ); | ||
874 | } | ||
875 | |||
876 | |||
877 | #ifdef HAVE_REMOTE_LCD | ||
878 | static bool remote_scroll_sets(void) | ||
879 | { | ||
880 | int m; | ||
881 | bool result; | ||
882 | |||
883 | static const struct menu_item items[] = { | ||
884 | { ID2P(LANG_SCROLL_SPEED), remote_scroll_speed }, | ||
885 | { ID2P(LANG_SCROLL_DELAY), remote_scroll_delay }, | ||
886 | { ID2P(LANG_SCROLL_STEP), remote_scroll_step }, | ||
887 | { ID2P(LANG_BIDIR_SCROLL), remote_bidir_limit }, | ||
888 | }; | ||
889 | |||
890 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
891 | NULL, NULL, NULL); | ||
892 | result = menu_run(m); | ||
893 | menu_exit(m); | ||
894 | return result; | ||
895 | } | ||
896 | #endif | ||
897 | |||
898 | static bool scroll_settings_menu(void) | ||
899 | { | ||
900 | int m; | ||
901 | bool result; | ||
902 | |||
903 | static const struct menu_item items[] = { | ||
904 | { ID2P(LANG_SCROLL_SPEED), scroll_speed }, | ||
905 | { ID2P(LANG_SCROLL_DELAY), scroll_delay }, | ||
906 | #ifdef HAVE_LCD_BITMAP | ||
907 | { ID2P(LANG_SCROLL_STEP), scroll_step }, | ||
908 | #endif | ||
909 | { ID2P(LANG_BIDIR_SCROLL), bidir_limit }, | ||
910 | #ifdef HAVE_REMOTE_LCD | ||
911 | { ID2P(LANG_REMOTE_SCROLL_SETS), remote_scroll_sets }, | ||
912 | #endif | ||
913 | #ifdef HAVE_LCD_CHARCELLS | ||
914 | { ID2P(LANG_JUMP_SCROLL), jump_scroll }, | ||
915 | { ID2P(LANG_JUMP_SCROLL_DELAY), jump_scroll_delay }, | ||
916 | #endif | ||
917 | #ifdef HAVE_LCD_BITMAP | ||
918 | { ID2P(LANG_SCREEN_SCROLL_VIEW), screen_scroll }, | ||
919 | { ID2P(LANG_SCREEN_SCROLL_STEP), screen_scroll_step }, | ||
920 | #endif | ||
921 | { ID2P(LANG_SCROLL_PAGINATED), scroll_paginated }, | ||
922 | }; | ||
923 | |||
924 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
925 | NULL, NULL, NULL); | ||
926 | result = menu_run(m); | ||
927 | menu_exit(m); | ||
928 | return result; | ||
929 | } | ||
930 | |||
931 | static bool lcd_settings_menu(void) | ||
932 | { | ||
933 | int m; | ||
934 | bool result; | ||
935 | |||
936 | static const struct menu_item items[] = { | ||
937 | #ifdef CONFIG_BACKLIGHT | ||
938 | { ID2P(LANG_BACKLIGHT), backlight_timer }, | ||
939 | #ifdef CONFIG_CHARGING | ||
940 | { ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_timer_plugged }, | ||
941 | #endif | ||
942 | #ifdef HAS_BUTTON_HOLD | ||
943 | { ID2P(LANG_BACKLIGHT_ON_BUTTON_HOLD), backlight_on_button_hold }, | ||
944 | #endif | ||
945 | { ID2P(LANG_CAPTION_BACKLIGHT), caption_backlight }, | ||
946 | #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR) | ||
947 | { ID2P(LANG_BACKLIGHT_FADE_IN), backlight_fade_in }, | ||
948 | { ID2P(LANG_BACKLIGHT_FADE_OUT), backlight_fade_out }, | ||
949 | #endif | ||
950 | { ID2P(LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS), set_bl_filter_first_keypress }, | ||
951 | #ifdef HAVE_LCD_SLEEP | ||
952 | { ID2P(LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF), lcd_sleep_after_backlight_off }, | ||
953 | #endif | ||
954 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | ||
955 | { ID2P(LANG_BRIGHTNESS), brightness }, | ||
956 | #endif | ||
957 | #endif /* CONFIG_BACKLIGHT */ | ||
958 | #ifdef HAVE_LCD_CONTRAST | ||
959 | { ID2P(LANG_CONTRAST), contrast }, | ||
960 | #endif | ||
961 | #ifdef HAVE_LCD_BITMAP | ||
962 | #ifdef HAVE_LCD_INVERT | ||
963 | { ID2P(LANG_INVERT), invert }, | ||
964 | #endif | ||
965 | #ifdef HAVE_LCD_FLIP | ||
966 | { ID2P(LANG_FLIP_DISPLAY), flip_display }, | ||
967 | #endif | ||
968 | { ID2P(LANG_INVERT_CURSOR), invert_cursor }, | ||
969 | #endif | ||
970 | #if LCD_DEPTH > 1 | ||
971 | { ID2P(LANG_CLEAR_BACKDROP), clear_main_backdrop }, | ||
972 | #endif | ||
973 | #ifdef HAVE_LCD_COLOR | ||
974 | { ID2P(LANG_BACKGROUND_COLOR), set_bg_color }, | ||
975 | { ID2P(LANG_FOREGROUND_COLOR), set_fg_color }, | ||
976 | { ID2P(LANG_RESET_COLORS), reset_color }, | ||
977 | #endif | ||
978 | }; | ||
979 | |||
980 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
981 | NULL, NULL, NULL); | ||
982 | result = menu_run(m); | ||
983 | menu_exit(m); | ||
984 | return result; | ||
985 | } | ||
986 | |||
987 | #ifdef HAVE_REMOTE_LCD | ||
988 | static bool lcd_remote_settings_menu(void) | ||
989 | { | ||
990 | int m; | ||
991 | bool result; | ||
992 | |||
993 | static const struct menu_item items[] = { | ||
994 | { ID2P(LANG_BACKLIGHT), remote_backlight_timer }, | ||
995 | #ifdef CONFIG_CHARGING | ||
996 | { ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), | ||
997 | remote_backlight_timer_plugged }, | ||
998 | #endif | ||
999 | #ifdef HAS_REMOTE_BUTTON_HOLD | ||
1000 | { ID2P(LANG_BACKLIGHT_ON_BUTTON_HOLD), remote_backlight_on_button_hold }, | ||
1001 | #endif | ||
1002 | { ID2P(LANG_CAPTION_BACKLIGHT), remote_caption_backlight }, | ||
1003 | { ID2P(LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS), set_remote_bl_filter_first_keypress }, | ||
1004 | { ID2P(LANG_CONTRAST), remote_contrast }, | ||
1005 | { ID2P(LANG_INVERT), remote_invert }, | ||
1006 | { ID2P(LANG_FLIP_DISPLAY), remote_flip_display }, | ||
1007 | #ifdef HAVE_REMOTE_LCD_TICKING | ||
1008 | { ID2P(LANG_REDUCE_TICKING), remote_reduce_ticking }, | ||
1009 | #endif | ||
1010 | }; | ||
1011 | |||
1012 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1013 | NULL, NULL, NULL); | ||
1014 | result = menu_run(m); | ||
1015 | menu_exit(m); | ||
1016 | return result; | ||
1017 | } | ||
1018 | #endif | ||
1019 | |||
1020 | #ifdef HAVE_LCD_BITMAP | ||
1021 | static bool bars_settings_menu(void) | ||
1022 | { | ||
1023 | int m; | ||
1024 | bool result; | ||
1025 | |||
1026 | static const struct menu_item items[] = { | ||
1027 | { ID2P(LANG_SCROLL_BAR), scroll_bar }, | ||
1028 | { ID2P(LANG_STATUS_BAR), status_bar }, | ||
1029 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
1030 | { ID2P(LANG_BUTTON_BAR), button_bar }, | ||
1031 | #endif | ||
1032 | { ID2P(LANG_VOLUME_DISPLAY), volume_type }, | ||
1033 | { ID2P(LANG_BATTERY_DISPLAY), battery_display }, | ||
1034 | }; | ||
1035 | |||
1036 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1037 | NULL, NULL, NULL); | ||
1038 | result = menu_run(m); | ||
1039 | menu_exit(m); | ||
1040 | return result; | ||
1041 | } | ||
1042 | #endif | ||
1043 | |||
1044 | |||
1045 | bool display_settings_menu(void) | ||
1046 | { | ||
1047 | int m; | ||
1048 | bool result; | ||
1049 | |||
1050 | static const struct menu_item items[] = { | ||
1051 | #ifdef HAVE_LCD_BITMAP | ||
1052 | { ID2P(LANG_CUSTOM_FONT), font_browse }, | ||
1053 | #endif | ||
1054 | { ID2P(LANG_WHILE_PLAYING), custom_wps_browse }, | ||
1055 | #ifdef HAVE_REMOTE_LCD | ||
1056 | { ID2P(LANG_REMOTE_WHILE_PLAYING), custom_remote_wps_browse }, | ||
1057 | #endif | ||
1058 | { ID2P(LANG_LCD_MENU), lcd_settings_menu }, | ||
1059 | #ifdef HAVE_REMOTE_LCD | ||
1060 | { ID2P(LANG_LCD_REMOTE_MENU), lcd_remote_settings_menu }, | ||
1061 | #endif | ||
1062 | { ID2P(LANG_SCROLL_MENU), scroll_settings_menu }, | ||
1063 | #ifdef HAVE_LCD_BITMAP | ||
1064 | { ID2P(LANG_BARS_MENU), bars_settings_menu }, | ||
1065 | { ID2P(LANG_PM_MENU), peak_meter_menu }, | ||
1066 | #endif | ||
1067 | { ID2P(LANG_DEFAULT_CODEPAGE), codepage_setting }, | ||
1068 | }; | ||
1069 | |||
1070 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1071 | NULL, NULL, NULL); | ||
1072 | result = menu_run(m); | ||
1073 | menu_exit(m); | ||
1074 | return result; | ||
1075 | } | ||