Allow sims to shut down normally from panic code.
[maemo-rb.git] / apps / settings_list.c
blob3618c16aa29a88bd37f000905477c61d1bbe972f
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 Jonathan Gordon
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include "config.h"
23 #include <stdbool.h>
24 #include <string.h>
25 #include "system.h"
26 #include "storage.h"
27 #include "lang.h"
28 #include "talk.h"
29 #include "lcd.h"
30 #include "button.h"
31 #include "backlight.h"
32 #include "settings.h"
33 #include "settings_list.h"
34 #include "sound.h"
35 #include "dsp.h"
36 #include "debug.h"
37 #include "mpeg.h"
38 #include "audio.h"
39 #include "power.h"
40 #include "powermgmt.h"
41 #include "kernel.h"
42 #include "lcd-remote.h"
43 #include "list.h"
44 #include "rbunicode.h"
45 #ifdef HAVE_LCD_BITMAP
46 #include "peakmeter.h"
47 #endif
48 #include "menus/eq_menu.h"
49 #if CONFIG_TUNER
50 #include "radio.h"
51 #endif
52 #ifdef IPOD_ACCESSORY_PROTOCOL
53 #include "iap.h"
54 #endif
55 #include "statusbar.h"
57 #define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT)
58 /** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h
59 and you may need to update it if you edit this file */
61 #define UNUSED {.RESERVED=NULL}
62 #define INT(a) {.int_ = a}
63 #define UINT(a) {.uint_ = a}
64 #define BOOL(a) {.bool_ = a}
65 #define CHARPTR(a) {.charptr = a}
66 #define UCHARPTR(a) {.ucharptr = a}
67 #define FUNCTYPE(a) {.func = a}
68 #define NODEFAULT INT(0)
70 /* in all the following macros the args are:
71 - flags: bitwise | or the F_ bits in settings_list.h
72 - var: pointer to the variable being changed (usually in global_settings)
73 - lang_id: LANG_* id to display in menus and setting screens for the setting
74 - default: the default value for the variable, set if settings are reset
75 - name: the name of the setting in config files
76 - cfg_vals: comma seperated list of legal values in cfg files.
77 NULL if a number is written to the file instead.
78 - cb: the callback used by the setting screen.
81 /* Use for int settings which use the set_sound() function to set them */
82 #define SOUND_SETTING(flags,var,lang_id,name,setting) \
83 {flags|F_T_INT|F_T_SOUND|F_SOUNDSETTING, &global_settings.var, \
84 lang_id, NODEFAULT,name,NULL, \
85 {.sound_setting=(struct sound_setting[]){{setting}}} }
87 /* Use for bool variables which don't use LANG_SET_BOOL_YES and LANG_SET_BOOL_NO
88 or dont save as "off" or "on" in the cfg */
89 #define BOOL_SETTING(flags,var,lang_id,default,name,cfgvals,yes,no,cb) \
90 {flags|F_BOOL_SETTING, &global_settings.var, \
91 lang_id, BOOL(default),name,cfgvals, \
92 {.bool_setting=(struct bool_setting[]){{cb,yes,no}}} }
94 /* bool setting which does use LANG_YES and _NO and save as "off,on" */
95 #define OFFON_SETTING(flags,var,lang_id,default,name,cb) \
96 {flags|F_BOOL_SETTING, &global_settings.var, \
97 lang_id, BOOL(default),name,off_on, \
98 {.bool_setting=(struct bool_setting[]) \
99 {{cb,LANG_SET_BOOL_YES,LANG_SET_BOOL_NO}}} }
101 /* int variable which is NOT saved to .cfg files,
102 (Use NVRAM() in the flags to save to the nvram (or nvram.bin file) */
103 #define SYSTEM_SETTING(flags,var,default) \
104 {flags|F_T_INT, &global_status.var,-1, INT(default), \
105 NULL, NULL, UNUSED}
107 /* setting which stores as a filename (or another string) in the .cfgvals
108 The string must be a char array (which all of our string settings are),
109 not just a char pointer.
110 prefix: The absolute path to not save in the variable, ex /.rockbox/wps_file
111 suffix: The file extention (usually...) e.g .wps_file
112 If the prefix is set (not NULL), then the suffix must be set as well.
114 #define TEXT_SETTING(flags,var,name,default,prefix,suffix) \
115 {flags|F_T_UCHARPTR, &global_settings.var,-1, \
116 CHARPTR(default),name,NULL, \
117 {.filename_setting= \
118 (struct filename_setting[]){ \
119 {prefix,suffix,sizeof(global_settings.var)}}} }
121 /* Used for settings which use the set_option() setting screen.
122 The ... arg is a list of pointers to strings to display in the setting
123 screen. These can either be literal strings, or ID2P(LANG_*) */
124 #define CHOICE_SETTING(flags,var,lang_id,default,name,cfg_vals,cb,count,...) \
125 {flags|F_CHOICE_SETTING|F_T_INT, &global_settings.var, lang_id, \
126 INT(default), name, cfg_vals, \
127 {.choice_setting = (struct choice_setting[]){ \
128 {cb, count, {.desc = (const unsigned char*[]) \
129 {__VA_ARGS__}}}}}}
131 /* Similar to above, except the strings to display are taken from cfg_vals,
132 the ... arg is a list of ID's to talk for the strings, can use TALK_ID()'s */
133 #define STRINGCHOICE_SETTING(flags,var,lang_id,default,name,cfg_vals, \
134 cb,count,...) \
135 {flags|F_CHOICE_SETTING|F_T_INT|F_CHOICETALKS, \
136 &global_settings.var, lang_id, \
137 INT(default), name, cfg_vals, \
138 {.choice_setting = (struct choice_setting[]){ \
139 {cb, count, {.talks = (const int[]){__VA_ARGS__}}}}}}
141 /* for settings which use the set_int() setting screen.
142 unit is the UNIT_ define to display/talk.
143 the first one saves a string to the config file,
144 the second one saves the variable value to the config file */
145 #define INT_SETTING_W_CFGVALS(flags, var, lang_id, default, name, cfg_vals, \
146 unit, min, max, step, formatter, get_talk_id, cb) \
147 {flags|F_INT_SETTING|F_T_INT, &global_settings.var, \
148 lang_id, INT(default), name, cfg_vals, \
149 {.int_setting = (struct int_setting[]){ \
150 {cb, unit, min, max, step, formatter, get_talk_id}}}}
151 #define INT_SETTING(flags, var, lang_id, default, name, \
152 unit, min, max, step, formatter, get_talk_id, cb) \
153 {flags|F_INT_SETTING|F_T_INT, &global_settings.var, \
154 lang_id, INT(default), name, NULL, \
155 {.int_setting = (struct int_setting[]){ \
156 {cb, unit, min, max, step, formatter, get_talk_id}}}}
157 #define INT_SETTING_NOWRAP(flags, var, lang_id, default, name, \
158 unit, min, max, step, formatter, get_talk_id, cb) \
159 {flags|F_INT_SETTING|F_T_INT|F_NO_WRAP, &global_settings.var, \
160 lang_id, INT(default), name, NULL, \
161 {.int_setting = (struct int_setting[]){ \
162 {cb, unit, min, max, step, formatter, get_talk_id}}}}
164 #define TABLE_SETTING(flags, var, lang_id, default, name, cfg_vals, \
165 unit, formatter, get_talk_id, cb, count, ...) \
166 {flags|F_TABLE_SETTING|F_T_INT, &global_settings.var, \
167 lang_id, INT(default), name, cfg_vals, \
168 {.table_setting = (struct table_setting[]) { \
169 {cb, formatter, get_talk_id, unit, count, \
170 (const int[]){__VA_ARGS__}}}}}
172 #define CUSTOM_SETTING(flags, var, lang_id, default, name, \
173 load_from_cfg, write_to_cfg, \
174 is_change, set_default) \
175 {flags|F_CUSTOM_SETTING|F_T_CUSTOM|F_BANFROMQS, \
176 &global_settings.var, lang_id, \
177 {.custom = (void*)default}, name, NULL, \
178 {.custom_setting = (struct custom_setting[]){ \
179 {load_from_cfg, write_to_cfg, is_change, set_default}}}}
180 /* some sets of values which are used more than once, to save memory */
181 static const char off_on[] = "off,on";
182 static const char off_on_ask[] = "off,on,ask";
183 static const char off_number_spell[] = "off,number,spell";
184 #ifdef HAVE_LCD_BITMAP
185 static const char graphic_numeric[] = "graphic,numeric";
186 #endif
188 /* Default theme settings */
189 #define DEFAULT_WPSNAME "cabbiev2"
191 #ifdef HAVE_LCD_BITMAP
193 #if LCD_HEIGHT <= 64
194 #define DEFAULT_FONTNAME "08-Rockfont"
195 #elif LCD_HEIGHT <= 80
196 #define DEFAULT_FONTNAME "11-Sazanami-Mincho"
197 #elif LCD_HEIGHT <= 220
198 #define DEFAULT_FONTNAME "12-Adobe-Helvetica"
199 #elif LCD_HEIGHT <= 320
200 #define DEFAULT_FONTNAME "15-Adobe-Helvetica"
201 #else
202 #define DEFAULT_FONTNAME "12-Adobe-Helvetica"
203 #endif
205 #else
206 #define DEFAULT_FONTNAME ""
207 #endif
209 #ifdef HAVE_LCD_COLOR
210 #define DEFAULT_ICONSET "tango_small"
211 #define DEFAULT_VIEWERS_ICONSET "tango_small_viewers"
212 #elif LCD_DEPTH >= 2
213 #define DEFAULT_ICONSET "tango_small_mono"
214 #define DEFAULT_VIEWERS_ICONSET "tango_small_viewers_mono"
215 #else /* monochrome */
216 #define DEFAULT_ICONSET ""
217 #define DEFAULT_VIEWERS_ICONSET ""
218 #endif
220 #define DEFAULT_THEME_FOREGROUND LCD_RGBPACK(0xce, 0xcf, 0xce)
221 #define DEFAULT_THEME_BACKGROUND LCD_RGBPACK(0x00, 0x00, 0x00)
222 #define DEFAULT_THEME_SELECTOR_START LCD_RGBPACK(0xff, 0xeb, 0x9c)
223 #define DEFAULT_THEME_SELECTOR_END LCD_RGBPACK(0xb5, 0x8e, 0x00)
224 #define DEFAULT_THEME_SELECTOR_TEXT LCD_RGBPACK(0x00, 0x00, 0x00)
226 #define DEFAULT_BACKDROP "cabbiev2"
228 #ifdef HAVE_RECORDING
229 /* these should be in the config.h files */
230 #if CONFIG_CODEC == MAS3587F
231 # define DEFAULT_REC_MIC_GAIN 8
232 # define DEFAULT_REC_LEFT_GAIN 2
233 # define DEFAULT_REC_RIGHT_GAIN 2
234 #elif CONFIG_CODEC == SWCODEC
235 # ifdef HAVE_UDA1380
236 # define DEFAULT_REC_MIC_GAIN 16
237 # define DEFAULT_REC_LEFT_GAIN 0
238 # define DEFAULT_REC_RIGHT_GAIN 0
239 # elif defined(HAVE_TLV320)
240 # define DEFAULT_REC_MIC_GAIN 0
241 # define DEFAULT_REC_LEFT_GAIN 0
242 # define DEFAULT_REC_RIGHT_GAIN 0
243 # elif defined(HAVE_WM8975)
244 # define DEFAULT_REC_MIC_GAIN 16
245 # define DEFAULT_REC_LEFT_GAIN 0
246 # define DEFAULT_REC_RIGHT_GAIN 0
247 # elif defined(HAVE_WM8758)
248 # define DEFAULT_REC_MIC_GAIN 16
249 # define DEFAULT_REC_LEFT_GAIN 0
250 # define DEFAULT_REC_RIGHT_GAIN 0
251 # elif defined(HAVE_WM8731)
252 # define DEFAULT_REC_MIC_GAIN 16
253 # define DEFAULT_REC_LEFT_GAIN 0
254 # define DEFAULT_REC_RIGHT_GAIN 0
255 # endif
256 #endif
258 #endif /* HAVE_RECORDING */
260 static void formatter_unit_0_is_off(char *buffer, size_t buffer_size,
261 int val, const char *unit)
263 if (val == 0)
264 strcpy(buffer, str(LANG_OFF));
265 else
266 snprintf(buffer, buffer_size, "%d %s", val, unit);
269 static int32_t getlang_unit_0_is_off(int value, int unit)
271 if (value == 0)
272 return LANG_OFF;
273 else
274 return TALK_ID(value,unit);
277 static void formatter_unit_0_is_skip_track(char *buffer, size_t buffer_size,
278 int val, const char *unit)
280 (void)unit;
281 if (val == 0)
282 strcpy(buffer, str(LANG_SKIP_TRACK));
283 else if (val % 60 == 0)
284 snprintf(buffer, buffer_size, "%d min", val/60);
285 else
286 snprintf(buffer, buffer_size, "%d s", val);
289 static int32_t getlang_unit_0_is_skip_track(int value, int unit)
291 (void)unit;
292 if (value == 0)
293 return LANG_SKIP_TRACK;
294 else if (value % 60 == 0)
295 return TALK_ID(value/60, UNIT_MIN);
296 else
297 return TALK_ID(value, UNIT_SEC);
300 #ifdef HAVE_BACKLIGHT
301 static void backlight_formatter(char *buffer, size_t buffer_size,
302 int val, const char *unit)
304 if (val == -1)
305 strcpy(buffer, str(LANG_OFF));
306 else if (val == 0)
307 strcpy(buffer, str(LANG_ON));
308 else
309 snprintf(buffer, buffer_size, "%d %s", val, unit);
311 static int32_t backlight_getlang(int value, int unit)
313 if (value == -1)
314 return LANG_OFF;
315 else if (value == 0)
316 return LANG_ON;
317 else
318 return TALK_ID(value, unit);
320 #endif
322 #ifndef HAVE_SCROLLWHEEL
323 static void scanaccel_formatter(char *buffer, size_t buffer_size,
324 int val, const char *unit)
326 (void)unit;
327 if (val == 0)
328 strcpy(buffer, str(LANG_OFF));
329 else
330 snprintf(buffer, buffer_size, "2x/%ds", val);
332 #endif
334 #if CONFIG_CODEC == SWCODEC
335 static void crossfeed_cross_set(int val)
337 (void)val;
338 dsp_set_crossfeed_cross_params(global_settings.crossfeed_cross_gain,
339 global_settings.crossfeed_hf_attenuation,
340 global_settings.crossfeed_hf_cutoff);
343 static void db_format(char* buffer, size_t buffer_size, int value,
344 const char* unit)
346 int v = abs(value);
348 snprintf(buffer, buffer_size, "%s%d.%d %s", value < 0 ? "-" : "",
349 v / 10, v % 10, unit);
352 static int32_t get_dec_talkid(int value, int unit)
354 return TALK_ID_DECIMAL(value, 1, unit);
357 static int32_t get_precut_talkid(int value, int unit)
359 return TALK_ID_DECIMAL(-value, 1, unit);
362 #endif
363 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
364 static void set_mdb_enable(bool value)
366 sound_set_mdb_enable((int)value);
368 static void set_superbass(bool value)
370 sound_set_superbass((int)value);
372 #endif
374 #ifdef HAVE_LCD_CHARCELLS
375 static void jumpscroll_format(char* buffer, size_t buffer_size, int value,
376 const char* unit)
378 (void)unit;
379 switch (value)
381 case 0:
382 strcpy(buffer, str(LANG_OFF));
383 break;
384 case 1:
385 strcpy(buffer, str(LANG_ONE_TIME));
386 break;
387 case 2:
388 case 3:
389 case 4:
390 snprintf(buffer, buffer_size, "%d", value);
391 break;
392 case 5:
393 strcpy(buffer, str(LANG_ALWAYS));
394 break;
397 static int32_t jumpscroll_getlang(int value, int unit)
399 switch (value)
401 case 0:
402 return LANG_OFF;
403 case 1:
404 return LANG_ONE_TIME;
405 case 2:
406 case 3:
407 case 4:
408 return TALK_ID(value, unit);
409 case 5:
410 return LANG_ALWAYS;
412 return -1;
414 #endif /* HAVE_LCD_CHARCELLS */
416 #ifdef HAVE_QUICKSCREEN
417 static int find_setting_by_name(char*name)
419 int i = 0;
420 const struct settings_list *setting;
421 while (i<nb_settings)
423 setting = &settings[i];
424 if (setting->cfg_name && !strcmp(setting->cfg_name, name))
426 return i;
428 i++;
430 return -1;
432 static void qs_load_from_cfg(void* var, char*value)
434 *(int*)var = find_setting_by_name(value);
436 static char* qs_write_to_cfg(void* setting, char*buf, int buf_len)
438 const struct settings_list *var = &settings[*(int*)setting];
439 strncpy(buf, var->cfg_name, buf_len);
440 return buf;
442 static bool qs_is_changed(void* setting, void* defaultval)
444 int i = *(int*)setting;
445 if (i < 0 || i >= nb_settings)
446 return false;
447 const struct settings_list *var = &settings[i];
448 return var != find_setting(defaultval, NULL);
450 static void qs_set_default(void* setting, void* defaultval)
452 find_setting(defaultval, (int*)setting);
454 #endif
455 const struct settings_list settings[] = {
456 /* sound settings */
457 SOUND_SETTING(F_NO_WRAP,volume, LANG_VOLUME, "volume", SOUND_VOLUME),
458 SOUND_SETTING(0, balance, LANG_BALANCE, "balance", SOUND_BALANCE),
459 SOUND_SETTING(F_NO_WRAP,bass, LANG_BASS, "bass", SOUND_BASS),
460 SOUND_SETTING(F_NO_WRAP,treble, LANG_TREBLE, "treble", SOUND_TREBLE),
462 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
463 SOUND_SETTING(0,loudness, LANG_LOUDNESS, "loudness", SOUND_LOUDNESS),
464 STRINGCHOICE_SETTING(F_SOUNDSETTING,avc,LANG_AUTOVOL,0,"auto volume",
465 "off,20ms,2,4,8,", sound_set_avc, 5,
466 LANG_OFF,TALK_ID(20, UNIT_MS),TALK_ID(2, UNIT_SEC),
467 TALK_ID(4, UNIT_SEC),TALK_ID(8, UNIT_SEC)),
468 OFFON_SETTING(F_SOUNDSETTING, superbass, LANG_SUPERBASS, false, "superbass",
469 set_superbass),
470 #endif
472 CHOICE_SETTING(F_SOUNDSETTING, channel_config, LANG_CHANNEL_CONFIGURATION,
473 0,"channels",
474 "stereo,mono,custom,mono left,mono right,karaoke",
475 sound_set_channels, 6,
476 ID2P(LANG_CHANNEL_STEREO), ID2P(LANG_CHANNEL_MONO),
477 ID2P(LANG_CHANNEL_CUSTOM), ID2P(LANG_CHANNEL_LEFT),
478 ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE)),
479 SOUND_SETTING(F_SOUNDSETTING, stereo_width, LANG_STEREO_WIDTH,
480 "stereo_width", SOUND_STEREO_WIDTH),
481 /* playback */
482 OFFON_SETTING(0, playlist_shuffle, LANG_SHUFFLE, false, "shuffle", NULL),
483 SYSTEM_SETTING(NVRAM(4), resume_index, -1),
484 SYSTEM_SETTING(NVRAM(4), resume_offset, -1),
485 CHOICE_SETTING(0, repeat_mode, LANG_REPEAT, REPEAT_OFF, "repeat",
486 "off,all,one,shuffle"
487 #ifdef AB_REPEAT_ENABLE
488 ",ab"
489 #endif
490 , NULL,
491 #ifdef AB_REPEAT_ENABLE
493 #else
495 #endif
496 ID2P(LANG_OFF), ID2P(LANG_ALL), ID2P(LANG_REPEAT_ONE),
497 ID2P(LANG_SHUFFLE)
498 #ifdef AB_REPEAT_ENABLE
499 ,ID2P(LANG_REPEAT_AB)
500 #endif
501 ), /* CHOICE_SETTING( repeat_mode ) */
502 /* LCD */
503 #ifdef HAVE_LCD_CONTRAST
504 /* its easier to leave this one un-macro()ed for the time being */
505 { F_T_INT|F_DEF_ISFUNC|F_INT_SETTING, &global_settings.contrast,
506 LANG_CONTRAST, FUNCTYPE(lcd_default_contrast), "contrast", NULL , {
507 .int_setting = (struct int_setting[]) {
508 { lcd_set_contrast, UNIT_INT, MIN_CONTRAST_SETTING,
509 MAX_CONTRAST_SETTING, 1, NULL, NULL }}}},
510 #endif
511 #ifdef HAVE_BACKLIGHT
512 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, backlight_timeout, LANG_BACKLIGHT, 15,
513 "backlight timeout", off_on, UNIT_SEC, backlight_formatter,
514 backlight_getlang, backlight_set_timeout, 20,
515 -1,0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,120),
516 #if CONFIG_CHARGING
517 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, backlight_timeout_plugged,
518 LANG_BACKLIGHT_ON_WHEN_CHARGING, 10,
519 "backlight timeout plugged", off_on, UNIT_SEC,
520 backlight_formatter, backlight_getlang,
521 backlight_set_timeout_plugged, 20,
522 -1,0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,120),
523 #endif
524 #endif /* HAVE_BACKLIGHT */
525 #ifdef HAVE_LCD_BITMAP
526 #ifdef HAVE_LCD_INVERT
527 BOOL_SETTING(0, invert, LANG_INVERT, false ,"invert", off_on,
528 LANG_INVERT_LCD_INVERSE, LANG_NORMAL, lcd_set_invert_display),
529 #endif
530 #ifdef HAVE_LCD_FLIP
531 OFFON_SETTING(0, flip_display, LANG_FLIP_DISPLAY, false, "flip display",
532 NULL),
533 #endif
534 /* display */
535 CHOICE_SETTING(F_TEMPVAR|F_THEMESETTING, cursor_style, LANG_INVERT_CURSOR,
536 #ifdef HAVE_LCD_COLOR
537 3, "selector type",
538 "pointer,bar (inverse),bar (color),bar (gradient)", NULL, 4,
539 ID2P(LANG_INVERT_CURSOR_POINTER),
540 ID2P(LANG_INVERT_CURSOR_BAR),
541 ID2P(LANG_INVERT_CURSOR_COLOR),
542 ID2P(LANG_INVERT_CURSOR_GRADIENT)),
543 #else
544 1, "selector type", "pointer,bar (inverse)", NULL, 2,
545 ID2P(LANG_INVERT_CURSOR_POINTER),
546 ID2P(LANG_INVERT_CURSOR_BAR)),
547 #endif
548 OFFON_SETTING(F_THEMESETTING|F_TEMPVAR, statusbar,
549 LANG_STATUS_BAR, true,"statusbar", gui_statusbar_changed),
550 OFFON_SETTING(0,scrollbar, LANG_SCROLL_BAR, true,"scrollbar", NULL),
551 #if CONFIG_KEYPAD == RECORDER_PAD
552 OFFON_SETTING(0,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL),
553 #endif
554 CHOICE_SETTING(0, volume_type, LANG_VOLUME_DISPLAY, 0,
555 "volume display", graphic_numeric, NULL, 2,
556 ID2P(LANG_DISPLAY_GRAPHIC),
557 ID2P(LANG_DISPLAY_NUMERIC)),
558 CHOICE_SETTING(0, battery_display, LANG_BATTERY_DISPLAY, 0,
559 "battery display", graphic_numeric, NULL, 2,
560 ID2P(LANG_DISPLAY_GRAPHIC), ID2P(LANG_DISPLAY_NUMERIC)),
561 #if CONFIG_RTC
562 CHOICE_SETTING(0, timeformat, LANG_TIMEFORMAT, 0,
563 "time format", "24hour,12hour", NULL, 2,
564 ID2P(LANG_24_HOUR_CLOCK), ID2P(LANG_12_HOUR_CLOCK)),
565 #endif
566 #endif /* HAVE_LCD_BITMAP */
567 OFFON_SETTING(0,show_icons, LANG_SHOW_ICONS ,true,"show icons", NULL),
568 /* system */
569 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, poweroff, LANG_POWEROFF_IDLE, 10,
570 "idle poweroff", "off", UNIT_MIN, formatter_unit_0_is_off,
571 getlang_unit_0_is_off, set_poweroff_timeout, 15,
572 0,1,2,3,4,5,6,7,8,9,10,15,30,45,60),
573 SYSTEM_SETTING(NVRAM(4), runtime, 0),
574 SYSTEM_SETTING(NVRAM(4), topruntime, 0),
575 INT_SETTING(F_BANFROMQS, max_files_in_playlist,
576 LANG_MAX_FILES_IN_PLAYLIST,
577 #if MEM > 1
578 10000,
579 #else
580 400,
581 #endif
582 "max files in playlist", UNIT_INT, 1000, 32000, 1000,
583 NULL, NULL, NULL),
584 INT_SETTING(F_BANFROMQS, max_files_in_dir, LANG_MAX_FILES_IN_DIR,
585 #if MEM > 1
586 1000,
587 #else
588 200,
589 #endif
590 "max files in dir", UNIT_INT, 50, 10000, 50,
591 NULL, NULL, NULL),
592 #if BATTERY_CAPACITY_INC > 0
593 INT_SETTING(0, battery_capacity, LANG_BATTERY_CAPACITY,
594 BATTERY_CAPACITY_DEFAULT, "battery capacity", UNIT_MAH,
595 BATTERY_CAPACITY_MIN, BATTERY_CAPACITY_MAX,
596 BATTERY_CAPACITY_INC, NULL, NULL, NULL),
597 #endif
598 #if CONFIG_CHARGING
599 OFFON_SETTING(NVRAM(1), car_adapter_mode,
600 LANG_CAR_ADAPTER_MODE, false, "car adapter mode", NULL),
601 #endif
602 #ifdef IPOD_ACCESSORY_PROTOCOL
603 CHOICE_SETTING(0, serial_bitrate, LANG_SERIAL_BITRATE, 0, "serial bitrate",
604 "auto,9600,19200,38400,57600", iap_bitrate_set, 5, ID2P(LANG_SERIAL_BITRATE_AUTO),
605 ID2P(LANG_SERIAL_BITRATE_9600),ID2P(LANG_SERIAL_BITRATE_19200),
606 ID2P(LANG_SERIAL_BITRATE_38400),ID2P(LANG_SERIAL_BITRATE_57600)),
607 #endif
608 #ifdef HAVE_ACCESSORY_SUPPLY
609 OFFON_SETTING(0, accessory_supply, LANG_ACCESSORY_SUPPLY,
610 true, "accessory power supply", accessory_supply_set),
611 #endif
612 /* tuner */
613 #if CONFIG_TUNER
614 OFFON_SETTING(0,fm_force_mono, LANG_FM_MONO_MODE,
615 false, "force fm mono", toggle_mono_mode),
616 SYSTEM_SETTING(NVRAM(4),last_frequency,0),
617 #endif
619 #if BATTERY_TYPES_COUNT > 1
620 CHOICE_SETTING(0, battery_type, LANG_BATTERY_TYPE, 0, "battery type",
621 "alkaline,nimh", NULL, 2, ID2P(LANG_BATTERY_TYPE_ALKALINE),
622 ID2P(LANG_BATTERY_TYPE_NIMH)),
623 #endif
624 #ifdef HAVE_REMOTE_LCD
625 /* remote lcd */
626 INT_SETTING(0, remote_contrast, LANG_CONTRAST,
627 DEFAULT_REMOTE_CONTRAST_SETTING, "remote contrast", UNIT_INT,
628 MIN_REMOTE_CONTRAST_SETTING, MAX_REMOTE_CONTRAST_SETTING, 1,
629 NULL, NULL, lcd_remote_set_contrast),
630 BOOL_SETTING(0, remote_invert, LANG_INVERT, false ,"remote invert", off_on,
631 LANG_INVERT_LCD_INVERSE, LANG_NORMAL,
632 lcd_remote_set_invert_display),
633 OFFON_SETTING(0,remote_flip_display, LANG_FLIP_DISPLAY,
634 false,"remote flip display", NULL),
635 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, remote_backlight_timeout,
636 LANG_BACKLIGHT, 5, "remote backlight timeout", off_on,
637 UNIT_SEC, backlight_formatter, backlight_getlang,
638 remote_backlight_set_timeout, 20,
639 -1,0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,120),
640 #if CONFIG_CHARGING
641 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, remote_backlight_timeout_plugged,
642 LANG_BACKLIGHT_ON_WHEN_CHARGING, 10,
643 "remote backlight timeout plugged", off_on, UNIT_SEC,
644 backlight_formatter, backlight_getlang,
645 remote_backlight_set_timeout_plugged, 20,
646 -1,0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,120),
647 #endif
648 #ifdef HAVE_REMOTE_LCD_TICKING
649 OFFON_SETTING(0, remote_reduce_ticking, LANG_REDUCE_TICKING,
650 false,"remote reduce ticking", NULL),
651 #endif
652 #endif
654 #ifdef HAVE_BACKLIGHT
655 OFFON_SETTING(0, bl_filter_first_keypress,
656 LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
657 "backlight filters first keypress", NULL),
658 #ifdef HAVE_REMOTE_LCD
659 OFFON_SETTING(0, remote_bl_filter_first_keypress,
660 LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
661 "backlight filters first remote keypress", NULL),
662 #endif
663 #endif /* HAVE_BACKLIGHT */
665 /** End of old RTC config block **/
667 #ifdef HAVE_BACKLIGHT
668 OFFON_SETTING(0, caption_backlight, LANG_CAPTION_BACKLIGHT,
669 false, "caption backlight", NULL),
670 #ifdef HAVE_REMOTE_LCD
671 OFFON_SETTING(0, remote_caption_backlight, LANG_CAPTION_BACKLIGHT,
672 false, "remote caption backlight", NULL),
673 #endif
674 #endif /* HAVE_BACKLIGHT */
675 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
676 INT_SETTING(F_NO_WRAP, brightness, LANG_BRIGHTNESS,
677 DEFAULT_BRIGHTNESS_SETTING, "brightness",UNIT_INT,
678 MIN_BRIGHTNESS_SETTING, MAX_BRIGHTNESS_SETTING, 1,
679 NULL, NULL, backlight_set_brightness),
680 #endif
681 #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
682 /* backlight fading */
683 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, backlight_fade_in,
684 LANG_BACKLIGHT_FADE_IN, 300, "backlight fade in", "off",
685 UNIT_MS, formatter_unit_0_is_off, getlang_unit_0_is_off,
686 backlight_set_fade_in, 7, 0,100,200,300,500,1000,2000),
687 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, backlight_fade_out,
688 LANG_BACKLIGHT_FADE_OUT, 2000, "backlight fade out", "off",
689 UNIT_MS, formatter_unit_0_is_off, getlang_unit_0_is_off,
690 backlight_set_fade_out, 10,
691 0,100,200,300,500,1000,2000,3000,5000,10000),
692 #elif defined(USE_BACKLIGHT_SW_FADING) \
693 || defined(USE_BACKLIGHT_CUSTOM_FADING_BOOL)
694 OFFON_SETTING(0, backlight_fade_in, LANG_BACKLIGHT_FADE_IN,
695 true, "backlight fade in", backlight_set_fade_in),
696 OFFON_SETTING(0, backlight_fade_out, LANG_BACKLIGHT_FADE_OUT,
697 true, "backlight fade out", backlight_set_fade_out),
698 #endif
699 INT_SETTING(F_PADTITLE, scroll_speed, LANG_SCROLL_SPEED, 9,"scroll speed",
700 UNIT_INT, 0, 15, 1, NULL, NULL, lcd_scroll_speed),
701 INT_SETTING(F_PADTITLE, scroll_delay, LANG_SCROLL_DELAY, 1000,
702 "scroll delay", UNIT_MS, 0, 2500, 100, NULL,
703 NULL, lcd_scroll_delay),
704 INT_SETTING(0, bidir_limit, LANG_BIDIR_SCROLL, 50, "bidir limit",
705 UNIT_PERCENT, 0, 200, 25, NULL, NULL, lcd_bidir_scroll),
706 #ifdef HAVE_REMOTE_LCD
707 INT_SETTING(0, remote_scroll_speed, LANG_SCROLL_SPEED, 9,
708 "remote scroll speed", UNIT_INT, 0,15, 1,
709 NULL, NULL, lcd_remote_scroll_speed),
710 INT_SETTING(0, remote_scroll_step, LANG_SCROLL_STEP, 6,
711 "remote scroll step", UNIT_PIXEL, 1, LCD_REMOTE_WIDTH, 1, NULL,
712 NULL, lcd_remote_scroll_step),
713 INT_SETTING(0, remote_scroll_delay, LANG_SCROLL_DELAY, 1000,
714 "remote scroll delay", UNIT_MS, 0, 2500, 100, NULL, NULL,
715 lcd_remote_scroll_delay),
716 INT_SETTING(0, remote_bidir_limit, LANG_BIDIR_SCROLL, 50,
717 "remote bidir limit", UNIT_PERCENT, 0, 200, 25, NULL, NULL,
718 lcd_remote_bidir_scroll),
719 #endif
720 #ifdef HAVE_LCD_BITMAP
721 OFFON_SETTING(0, offset_out_of_view, LANG_SCREEN_SCROLL_VIEW,
722 false, "Screen Scrolls Out Of View",
723 gui_list_screen_scroll_out_of_view),
724 INT_SETTING(F_PADTITLE, scroll_step, LANG_SCROLL_STEP, 6, "scroll step",
725 UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL, lcd_scroll_step),
726 INT_SETTING(F_PADTITLE, screen_scroll_step, LANG_SCREEN_SCROLL_STEP, 16,
727 "screen scroll step", UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL,
728 gui_list_screen_scroll_step),
729 #endif /* HAVE_LCD_BITMAP */
730 #ifdef HAVE_LCD_CHARCELLS
731 INT_SETTING(0, jump_scroll, LANG_JUMP_SCROLL, 0, "jump scroll", UNIT_INT, 0,
732 5, 1, jumpscroll_format, jumpscroll_getlang, lcd_jump_scroll),
733 INT_SETTING(0, jump_scroll_delay, LANG_JUMP_SCROLL_DELAY, 500,
734 "jump scroll delay", UNIT_MS, 0, 2500, 100, NULL, NULL,
735 lcd_jump_scroll_delay),
736 #endif
737 OFFON_SETTING(0,scroll_paginated,LANG_SCROLL_PAGINATED,
738 false,"scroll paginated",NULL),
739 #ifdef HAVE_LCD_COLOR
741 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.fg_color,-1,
742 INT(DEFAULT_THEME_FOREGROUND),"foreground color",NULL,UNUSED},
743 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.bg_color,-1,
744 INT(DEFAULT_THEME_BACKGROUND),"background color",NULL,UNUSED},
745 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.lss_color,-1,
746 INT(DEFAULT_THEME_SELECTOR_START),"line selector start color",NULL,
747 UNUSED},
748 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.lse_color,-1,
749 INT(DEFAULT_THEME_SELECTOR_END),"line selector end color",NULL,UNUSED},
750 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.lst_color,-1,
751 INT(DEFAULT_THEME_SELECTOR_TEXT),"line selector text color",NULL,
752 UNUSED},
754 #endif
755 /* more playback */
756 OFFON_SETTING(0,play_selected,LANG_PLAY_SELECTED,true,"play selected",NULL),
757 OFFON_SETTING(0,party_mode,LANG_PARTY_MODE,false,"party mode",NULL),
758 OFFON_SETTING(0,fade_on_stop,LANG_FADE_ON_STOP,true,"volume fade",NULL),
759 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, ff_rewind_min_step,
760 LANG_FFRW_STEP, 1, "scan min step", NULL, UNIT_SEC,
761 NULL, NULL, NULL, 14, 1,2,3,4,5,6,8,10,15,20,25,30,45,60),
762 CHOICE_SETTING(0, ff_rewind_accel, LANG_FFRW_ACCEL, 2,
763 "seek acceleration", "very fast,fast,normal,slow,very slow", NULL, 5,
764 ID2P(LANG_VERY_FAST), ID2P(LANG_FAST), ID2P(LANG_NORMAL),
765 ID2P(LANG_SLOW) , ID2P(LANG_VERY_SLOW)),
766 #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_DISK_STORAGE)
767 STRINGCHOICE_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0,"antiskip",
768 "5s,15s,30s,1min,2min,3min,5min,10min", NULL, 8,
769 TALK_ID(5, UNIT_SEC), TALK_ID(15, UNIT_SEC),
770 TALK_ID(30, UNIT_SEC), TALK_ID(1, UNIT_MIN),
771 TALK_ID(2, UNIT_MIN), TALK_ID(3, UNIT_MIN),
772 TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN)),
773 #elif defined(HAVE_DISK_STORAGE)
774 INT_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0, "antiskip",
775 UNIT_SEC, 0, 7, 1, NULL, NULL, audio_set_buffer_margin),
776 #endif
777 /* disk */
778 #ifdef HAVE_DISK_STORAGE
779 INT_SETTING(0, disk_spindown, LANG_SPINDOWN, 5, "disk spindown",
780 UNIT_SEC, 3, 254, 1, NULL, NULL, storage_spindown),
781 #endif /* HAVE_DISK_STORAGE */
782 /* browser */
783 CHOICE_SETTING(0, dirfilter, LANG_FILTER, SHOW_SUPPORTED, "show files",
784 "all,supported,music,playlists", NULL, 4, ID2P(LANG_ALL),
785 ID2P(LANG_FILTER_SUPPORTED), ID2P(LANG_FILTER_MUSIC),
786 ID2P(LANG_PLAYLISTS)),
787 OFFON_SETTING(0, sort_case, LANG_SORT_CASE, false, "sort case", NULL),
788 CHOICE_SETTING(0, show_filename_ext, LANG_SHOW_FILENAME_EXT, 3,
789 "show filename exts", "off,on,unknown,view_all", NULL , 4 ,
790 ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_UNKNOWN_TYPES),
791 ID2P(LANG_EXT_ONLY_VIEW_ALL)),
792 OFFON_SETTING(0,browse_current,LANG_FOLLOW,false,"follow playlist",NULL),
793 OFFON_SETTING(0,playlist_viewer_icons,LANG_SHOW_ICONS,true,
794 "playlist viewer icons",NULL),
795 OFFON_SETTING(0,playlist_viewer_indices,LANG_SHOW_INDICES,true,
796 "playlist viewer indices",NULL),
797 CHOICE_SETTING(0, playlist_viewer_track_display, LANG_TRACK_DISPLAY, 0,
798 "playlist viewer track display","track name,full path",
799 NULL, 2, ID2P(LANG_DISPLAY_TRACK_NAME_ONLY),
800 ID2P(LANG_DISPLAY_FULL_PATH)),
801 CHOICE_SETTING(0, recursive_dir_insert, LANG_RECURSE_DIRECTORY , RECURSE_ON,
802 "recursive directory insert", off_on_ask, NULL , 3 ,
803 ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_ASK)),
804 /* bookmarks */
805 CHOICE_SETTING(0, autocreatebookmark, LANG_BOOKMARK_SETTINGS_AUTOCREATE,
806 BOOKMARK_NO, "autocreate bookmarks",
807 "off,on,ask,recent only - on,recent only - ask", NULL, 5,
808 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
809 ID2P(LANG_ASK), ID2P(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES),
810 ID2P(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK)),
811 CHOICE_SETTING(0, autoloadbookmark, LANG_BOOKMARK_SETTINGS_AUTOLOAD,
812 BOOKMARK_NO, "autoload bookmarks", off_on_ask, NULL, 3,
813 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
814 ID2P(LANG_ASK)),
815 CHOICE_SETTING(0, usemrb, LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS,
816 BOOKMARK_NO, "use most-recent-bookmarks",
817 "off,on,unique only", NULL, 3, ID2P(LANG_SET_BOOL_NO),
818 ID2P(LANG_SET_BOOL_YES),
819 ID2P(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY)),
820 #ifdef HAVE_LCD_BITMAP
821 /* peak meter */
822 STRINGCHOICE_SETTING(0, peak_meter_clip_hold, LANG_PM_CLIP_HOLD, 16,
823 "peak meter clip hold",
824 "on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,2min"
825 ",3min,5min,10min,20min,45min,90min",
826 peak_meter_set_clip_hold, 25, LANG_PM_ETERNAL,
827 TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC),
828 TALK_ID(3, UNIT_SEC), TALK_ID(4, UNIT_SEC),
829 TALK_ID(5, UNIT_SEC), TALK_ID(6, UNIT_SEC),
830 TALK_ID(7, UNIT_SEC), TALK_ID(8, UNIT_SEC),
831 TALK_ID(9, UNIT_SEC), TALK_ID(10, UNIT_SEC),
832 TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC),
833 TALK_ID(25, UNIT_SEC), TALK_ID(30, UNIT_SEC),
834 TALK_ID(45, UNIT_SEC), TALK_ID(60, UNIT_SEC),
835 TALK_ID(90, UNIT_SEC), TALK_ID(2, UNIT_MIN),
836 TALK_ID(3, UNIT_MIN), TALK_ID(5, UNIT_MIN),
837 TALK_ID(10, UNIT_MIN), TALK_ID(20, UNIT_MIN),
838 TALK_ID(45, UNIT_MIN), TALK_ID(90, UNIT_MIN)),
839 STRINGCHOICE_SETTING(0, peak_meter_hold, LANG_PM_PEAK_HOLD, 3,
840 "peak meter hold",
841 "off,200ms,300ms,500ms,1,2,3,4,5,6,7,8,9,10,15,20,30,1min",
842 NULL, 18, LANG_OFF, TALK_ID(200, UNIT_MS),
843 TALK_ID(300, UNIT_MS), TALK_ID(500, UNIT_MS),
844 TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC),
845 TALK_ID(3, UNIT_SEC), TALK_ID(4, UNIT_SEC),
846 TALK_ID(5, UNIT_SEC), TALK_ID(6, UNIT_SEC),
847 TALK_ID(7, UNIT_SEC), TALK_ID(8, UNIT_SEC),
848 TALK_ID(9, UNIT_SEC), TALK_ID(10, UNIT_SEC),
849 TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC),
850 TALK_ID(30, UNIT_SEC), TALK_ID(60, UNIT_SEC)),
851 INT_SETTING(0, peak_meter_release, LANG_PM_RELEASE, 8, "peak meter release",
852 UNIT_PM_TICK, 1, 0x7e, 1, NULL, NULL,NULL),
853 OFFON_SETTING(0,peak_meter_dbfs,LANG_PM_DBFS,true,"peak meter dbfs",NULL),
854 {F_T_INT, &global_settings.peak_meter_min, LANG_PM_MIN,INT(60),
855 "peak meter min", NULL, UNUSED},
856 {F_T_INT, &global_settings.peak_meter_max, LANG_PM_MAX,INT(0),
857 "peak meter max", NULL, UNUSED},
858 #ifdef HAVE_RECORDING
859 OFFON_SETTING(0, peak_meter_clipcounter, LANG_PM_CLIPCOUNTER, false,
860 "peak meter clipcounter", NULL),
861 #endif /* HAVE_RECORDING */
862 #endif /* HAVE_LCD_BITMAP */
863 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
864 SOUND_SETTING(F_SOUNDSETTING, mdb_strength, LANG_MDB_STRENGTH,
865 "mdb strength", SOUND_MDB_STRENGTH),
866 SOUND_SETTING(F_SOUNDSETTING, mdb_harmonics, LANG_MDB_HARMONICS,
867 "mdb harmonics", SOUND_MDB_HARMONICS),
868 SOUND_SETTING(F_SOUNDSETTING, mdb_center, LANG_MDB_CENTER,
869 "mdb center", SOUND_MDB_CENTER),
870 SOUND_SETTING(F_SOUNDSETTING, mdb_shape, LANG_MDB_SHAPE,
871 "mdb shape", SOUND_MDB_SHAPE),
872 OFFON_SETTING(F_SOUNDSETTING, mdb_enable, LANG_MDB_ENABLE,
873 false, "mdb enable", set_mdb_enable),
874 #endif
875 #if CONFIG_CODEC == MAS3507D
876 OFFON_SETTING(F_SOUNDSETTING, line_in,LANG_LINE_IN,false,"line in",NULL),
877 #endif
878 /* voice */
879 OFFON_SETTING(F_TEMPVAR, talk_menu, LANG_VOICE_MENU, true, "talk menu", NULL),
880 CHOICE_SETTING(0, talk_dir, LANG_VOICE_DIR, 0,
881 "talk dir", off_number_spell, NULL, 3,
882 ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
883 ID2P(LANG_VOICE_SPELL)),
884 OFFON_SETTING(F_TEMPVAR, talk_dir_clip, LANG_VOICE_DIR_TALK, false,
885 "talk dir clip", NULL),
886 CHOICE_SETTING(0, talk_file, LANG_VOICE_FILE, 0,
887 "talk file", off_number_spell, NULL, 3,
888 ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
889 ID2P(LANG_VOICE_SPELL)),
890 OFFON_SETTING(F_TEMPVAR, talk_file_clip, LANG_VOICE_FILE_TALK, false,
891 "talk file clip", NULL),
892 OFFON_SETTING(F_TEMPVAR, talk_filetype, LANG_VOICE_FILETYPE, false,
893 "talk filetype", NULL),
894 OFFON_SETTING(F_TEMPVAR, talk_battery_level, LANG_TALK_BATTERY_LEVEL, false,
895 "Announce Battery Level", NULL),
897 /* file sorting */
898 CHOICE_SETTING(0, sort_file, LANG_SORT_FILE, 0 ,
899 "sort files", "alpha,oldest,newest,type", NULL, 4,
900 ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE),
901 ID2P(LANG_SORT_DATE_REVERSE) , ID2P(LANG_SORT_TYPE)),
902 CHOICE_SETTING(0, sort_dir, LANG_SORT_DIR, 0 ,
903 "sort dirs", "alpha,oldest,newest", NULL, 3,
904 ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE),
905 ID2P(LANG_SORT_DATE_REVERSE)),
907 #ifdef HAVE_RECORDING
908 /* recording */
909 STRINGCHOICE_SETTING(F_RECSETTING, rec_timesplit, LANG_SPLIT_TIME, 0,
910 "rec timesplit",
911 "off,00:05,00:10,00:15,00:30,01:00,01:14,01:20,02:00,"
912 "04:00,06:00,08:00,10:00,12:00,18:00,24:00",
913 NULL, 16, LANG_OFF,
914 TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN),
915 TALK_ID(15, UNIT_MIN), TALK_ID(30, UNIT_MIN),
916 TALK_ID(60, UNIT_MIN), TALK_ID(74, UNIT_MIN),
917 TALK_ID(80, UNIT_MIN), TALK_ID(2, UNIT_HOUR),
918 TALK_ID(4, UNIT_HOUR), TALK_ID(6, UNIT_HOUR),
919 TALK_ID(8, UNIT_HOUR), TALK_ID(10, UNIT_HOUR),
920 TALK_ID(12, UNIT_HOUR), TALK_ID(18, UNIT_HOUR),
921 TALK_ID(20, UNIT_HOUR), TALK_ID(24, UNIT_HOUR)),
922 STRINGCHOICE_SETTING(F_RECSETTING, rec_sizesplit, LANG_SPLIT_SIZE, 0,
923 "rec sizesplit",
924 "off,5MB,10MB,15MB,32MB,64MB,75MB,100MB,128MB,"
925 "256MB,512MB,650MB,700MB,1GB,1.5GB,1.75GB",
926 NULL, 16, LANG_OFF,
927 TALK_ID(5, UNIT_MB), TALK_ID(10, UNIT_MB),
928 TALK_ID(15, UNIT_MB), TALK_ID(32, UNIT_MB),
929 TALK_ID(64, UNIT_MB), TALK_ID(75, UNIT_MB),
930 TALK_ID(100, UNIT_MB), TALK_ID(128, UNIT_MB),
931 TALK_ID(256, UNIT_MB), TALK_ID(512, UNIT_MB),
932 TALK_ID(650, UNIT_MB), TALK_ID(700, UNIT_MB),
933 TALK_ID(1024, UNIT_MB), TALK_ID(1536, UNIT_MB),
934 TALK_ID(1792, UNIT_MB)),
935 {F_T_INT|F_RECSETTING, &global_settings.rec_channels, LANG_CHANNELS, INT(0),
936 "rec channels","stereo,mono",UNUSED},
937 #if CONFIG_CODEC == SWCODEC
938 {F_T_INT|F_RECSETTING, &global_settings.rec_mono_mode,
939 LANG_RECORDING_MONO_MODE, INT(0), "rec mono mode","L+R,L,R",UNUSED},
940 #endif
941 CHOICE_SETTING(F_RECSETTING, rec_split_type, LANG_SPLIT_TYPE, 0,
942 "rec split type", "Split,Stop,Shutdown", NULL, 3,
943 ID2P(LANG_START_NEW_FILE), ID2P(LANG_STOP_RECORDING),ID2P(LANG_STOP_RECORDING_AND_SHUTDOWN)),
944 CHOICE_SETTING(F_RECSETTING, rec_split_method, LANG_SPLIT_MEASURE, 0,
945 "rec split method", "Time,Filesize", NULL, 2,
946 ID2P(LANG_TIME), ID2P(LANG_REC_SIZE)),
947 {F_T_INT|F_RECSETTING, &global_settings.rec_source, LANG_RECORDING_SOURCE,
948 INT(0), "rec source",
949 &HAVE_MIC_REC_(",mic")
950 HAVE_LINE_REC_(",line")
951 HAVE_SPDIF_REC_(",spdif")
952 HAVE_FMRADIO_REC_(",fmradio")[1],
953 UNUSED},
954 INT_SETTING(F_RECSETTING, rec_prerecord_time, LANG_RECORD_PRERECORD_TIME, 0,
955 "prerecording time", UNIT_SEC, 0, 30, 1,
956 formatter_unit_0_is_off, getlang_unit_0_is_off, NULL),
958 TEXT_SETTING(F_RECSETTING, rec_directory, "rec path",
959 REC_BASE_DIR, NULL, NULL),
960 #ifdef HAVE_BACKLIGHT
961 CHOICE_SETTING(F_RECSETTING, cliplight, LANG_CLIP_LIGHT, 0,
962 "cliplight", "off,main,both,remote", NULL,
963 #ifdef HAVE_REMOTE_LCD
964 4, ID2P(LANG_OFF), ID2P(LANG_MAIN_UNIT),
965 ID2P(LANG_REMOTE_MAIN), ID2P(LANG_REMOTE_UNIT)
966 #else
967 2, ID2P(LANG_OFF), ID2P(LANG_ON)
968 #endif
970 #endif
971 #ifdef DEFAULT_REC_MIC_GAIN
972 {F_T_INT|F_RECSETTING,&global_settings.rec_mic_gain,
973 LANG_GAIN,INT(DEFAULT_REC_MIC_GAIN),
974 "rec mic gain",NULL,UNUSED},
975 #endif /* DEFAULT_REC_MIC_GAIN */
976 #ifdef DEFAULT_REC_LEFT_GAIN
977 {F_T_INT|F_RECSETTING,&global_settings.rec_left_gain,
978 LANG_GAIN_LEFT,INT(DEFAULT_REC_LEFT_GAIN),
979 "rec left gain",NULL,UNUSED},
980 #endif /* DEFAULT_REC_LEFT_GAIN */
981 #ifdef DEFAULT_REC_RIGHT_GAIN
982 {F_T_INT|F_RECSETTING,&global_settings.rec_right_gain,LANG_GAIN_RIGHT,
983 INT(DEFAULT_REC_RIGHT_GAIN),
984 "rec right gain",NULL,UNUSED},
985 #endif /* DEFAULT_REC_RIGHT_GAIN */
986 #if CONFIG_CODEC == MAS3587F
987 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency,
988 LANG_RECORDING_FREQUENCY, INT(0),
989 "rec frequency","44,48,32,22,24,16", UNUSED},
990 INT_SETTING(F_RECSETTING, rec_quality, LANG_RECORDING_QUALITY, 5,
991 "rec quality", UNIT_INT, 0, 7, 1, NULL, NULL, NULL),
992 OFFON_SETTING(F_RECSETTING, rec_editable, LANG_RECORDING_EDITABLE, false,
993 "editable recordings", NULL),
994 #endif /* CONFIG_CODEC == MAS3587F */
995 #if CONFIG_CODEC == SWCODEC
996 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency,
997 LANG_RECORDING_FREQUENCY,INT(REC_FREQ_DEFAULT),
998 "rec frequency",REC_FREQ_CFG_VAL_LIST,UNUSED},
999 {F_T_INT|F_RECSETTING,&global_settings.rec_format,
1000 LANG_RECORDING_FORMAT,INT(REC_FORMAT_DEFAULT),
1001 "rec format",REC_FORMAT_CFG_VAL_LIST,UNUSED},
1002 /** Encoder settings start - keep these together **/
1003 /* aiff_enc */
1004 /* (no settings yet) */
1005 /* mp3_enc */
1006 {F_T_INT|F_RECSETTING, &global_settings.mp3_enc_config.bitrate,-1,
1007 INT(MP3_ENC_BITRATE_CFG_DEFAULT),
1008 "mp3_enc bitrate",MP3_ENC_BITRATE_CFG_VALUE_LIST,UNUSED},
1009 /* wav_enc */
1010 /* (no settings yet) */
1011 /* wavpack_enc */
1012 /* (no settings yet) */
1013 /** Encoder settings end **/
1014 #endif /* CONFIG_CODEC == SWCODEC */
1015 /* values for the trigger */
1016 INT_SETTING(F_RECSETTING, rec_start_thres_db, LANG_RECORD_START_THRESHOLD, -35,
1017 "trigger start threshold dB", UNIT_DB, VOLUME_MIN/10, 0, -1, NULL, NULL, NULL),
1018 INT_SETTING(F_RECSETTING, rec_start_thres_linear, LANG_RECORD_START_THRESHOLD, 5,
1019 "trigger start threshold linear", UNIT_PERCENT, 0, 100, 1, NULL, NULL, NULL),
1020 INT_SETTING(F_RECSETTING, rec_stop_thres_db, LANG_RECORD_STOP_THRESHOLD, -45,
1021 "trigger stop threshold dB", UNIT_DB, VOLUME_MIN/10, 0, -1, NULL, NULL, NULL),
1022 INT_SETTING(F_RECSETTING, rec_stop_thres_linear, LANG_RECORD_STOP_THRESHOLD, 10,
1023 "trigger stop threshold linear", UNIT_PERCENT, 0, 100, 1, NULL, NULL, NULL),
1024 TABLE_SETTING(F_RECSETTING, rec_start_duration, LANG_MIN_DURATION, 0,
1025 "trigger start duration",
1026 "0s,1s,2s,5s,10s,15s,20s,25s,30s,1min,2min,5min,10min",
1027 UNIT_SEC, NULL, NULL, NULL, 13,
1028 0,1,2,5,10,15,20,25,30,60,120,300,600),
1029 TABLE_SETTING(F_RECSETTING, rec_stop_postrec, LANG_MIN_DURATION, 0,
1030 "trigger stop duration",
1031 "0s,1s,2s,5s,10s,15s,20s,25s,30s,1min,2min,5min,10min",
1032 UNIT_SEC, NULL, NULL, NULL, 13,
1033 0,1,2,5,10,15,20,25,30,60,120,300,600),
1034 TABLE_SETTING(F_RECSETTING, rec_stop_gap, LANG_RECORD_STOP_GAP, 1,
1035 "trigger min gap",
1036 "0s,1s,2s,5s,10s,15s,20s,25s,30s,1min,2min,5min,10min",
1037 UNIT_SEC, NULL, NULL, NULL, 13,
1038 0,1,2,5,10,15,20,25,30,60,120,300,600),
1039 CHOICE_SETTING(F_RECSETTING, rec_trigger_mode, LANG_RECORD_TRIGGER, TRIG_MODE_OFF,
1040 "trigger mode","off,once,repeat", NULL ,3,
1041 ID2P(LANG_OFF), ID2P(LANG_RECORD_TRIG_NOREARM), ID2P(LANG_REPEAT)),
1042 CHOICE_SETTING(F_RECSETTING, rec_trigger_type, LANG_RECORD_TRIGGER_TYPE, TRIG_TYPE_STOP,
1043 "trigger type","stop,pause,nf stp", NULL ,3,
1044 ID2P(LANG_RECORD_TRIGGER_STOP), ID2P(LANG_PAUSE), ID2P(LANG_RECORD_TRIGGER_NEWFILESTP)),
1045 #endif /* HAVE_RECORDING */
1047 #ifdef HAVE_SPDIF_POWER
1048 OFFON_SETTING(F_SOUNDSETTING, spdif_enable, LANG_SPDIF_ENABLE, false,
1049 "spdif enable", spdif_power_enable),
1050 #endif
1051 CHOICE_SETTING(0, next_folder, LANG_NEXT_FOLDER, FOLDER_ADVANCE_OFF,
1052 "folder navigation", "off,on,random",NULL ,3,
1053 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
1054 ID2P(LANG_RANDOM)),
1056 #ifdef HAVE_TAGCACHE
1057 OFFON_SETTING(0, runtimedb, LANG_RUNTIMEDB_ACTIVE, false,
1058 "gather runtime data", NULL),
1059 #endif
1061 #if CONFIG_CODEC == SWCODEC
1062 /* replay gain */
1063 OFFON_SETTING(F_SOUNDSETTING, replaygain, LANG_REPLAYGAIN_ENABLE, true,
1064 "replaygain", NULL),
1065 CHOICE_SETTING(F_SOUNDSETTING, replaygain_type, LANG_REPLAYGAIN_MODE,
1066 REPLAYGAIN_SHUFFLE, "replaygain type",
1067 "track,album,track shuffle", NULL, 3, ID2P(LANG_TRACK_GAIN),
1068 ID2P(LANG_ALBUM_GAIN), ID2P(LANG_SHUFFLE_GAIN)),
1069 OFFON_SETTING(F_SOUNDSETTING, replaygain_noclip, LANG_REPLAYGAIN_NOCLIP,
1070 false, "replaygain noclip", NULL),
1071 INT_SETTING_NOWRAP(F_SOUNDSETTING, replaygain_preamp,
1072 LANG_REPLAYGAIN_PREAMP, 0, "replaygain preamp",
1073 UNIT_DB, -120, 120, 5, db_format, get_dec_talkid, NULL),
1075 CHOICE_SETTING(0, beep, LANG_BEEP, 0, "beep", "off,weak,moderate,strong",
1076 NULL, 4, ID2P(LANG_OFF), ID2P(LANG_WEAK),
1077 ID2P(LANG_MODERATE), ID2P(LANG_STRONG)),
1079 /* crossfade */
1080 CHOICE_SETTING(F_SOUNDSETTING, crossfade, LANG_CROSSFADE_ENABLE, 0,
1081 "crossfade",
1082 "off,shuffle,track skip,shuffle and track skip,always", NULL,
1083 5, ID2P(LANG_OFF), ID2P(LANG_SHUFFLE), ID2P(LANG_TRACKSKIP),
1084 ID2P(LANG_SHUFFLE_TRACKSKIP), ID2P(LANG_ALWAYS)),
1085 INT_SETTING(F_SOUNDSETTING, crossfade_fade_in_delay,
1086 LANG_CROSSFADE_FADE_IN_DELAY, 0,
1087 "crossfade fade in delay", UNIT_SEC, 0, 7, 1, NULL, NULL, NULL),
1088 INT_SETTING(F_SOUNDSETTING, crossfade_fade_out_delay,
1089 LANG_CROSSFADE_FADE_OUT_DELAY, 0,
1090 "crossfade fade out delay", UNIT_SEC, 0, 7, 1, NULL, NULL,NULL),
1091 INT_SETTING(F_SOUNDSETTING, crossfade_fade_in_duration,
1092 LANG_CROSSFADE_FADE_IN_DURATION, 2,
1093 "crossfade fade in duration", UNIT_SEC, 0, 15, 1, NULL, NULL,
1094 NULL),
1095 INT_SETTING(F_SOUNDSETTING, crossfade_fade_out_duration,
1096 LANG_CROSSFADE_FADE_OUT_DURATION, 2,
1097 "crossfade fade out duration", UNIT_SEC, 0, 15, 1, NULL, NULL,
1098 NULL),
1099 CHOICE_SETTING(F_SOUNDSETTING, crossfade_fade_out_mixmode,
1100 LANG_CROSSFADE_FADE_OUT_MODE, 0,
1101 "crossfade fade out mode", "crossfade,mix", NULL, 2,
1102 ID2P(LANG_CROSSFADE), ID2P(LANG_MIX)),
1104 /* crossfeed */
1105 OFFON_SETTING(F_SOUNDSETTING, crossfeed, LANG_CROSSFEED, false,
1106 "crossfeed", dsp_set_crossfeed),
1107 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_direct_gain,
1108 LANG_CROSSFEED_DIRECT_GAIN, -15,
1109 "crossfeed direct gain", UNIT_DB, -60, 0, 5,
1110 db_format, get_dec_talkid,dsp_set_crossfeed_direct_gain),
1111 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_cross_gain,
1112 LANG_CROSSFEED_CROSS_GAIN, -60,
1113 "crossfeed cross gain", UNIT_DB, -120, -30, 5,
1114 db_format, get_dec_talkid, crossfeed_cross_set),
1115 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_hf_attenuation,
1116 LANG_CROSSFEED_HF_ATTENUATION, -160,
1117 "crossfeed hf attenuation", UNIT_DB, -240, -60, 5,
1118 db_format, get_dec_talkid, crossfeed_cross_set),
1119 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_hf_cutoff,
1120 LANG_CROSSFEED_HF_CUTOFF, 700,
1121 "crossfeed hf cutoff", UNIT_HERTZ, 500, 2000, 100,
1122 NULL, NULL, crossfeed_cross_set),
1124 /* equalizer */
1125 OFFON_SETTING(F_EQSETTING, eq_enabled, LANG_EQUALIZER_ENABLED, false,
1126 "eq enabled", NULL),
1127 INT_SETTING_NOWRAP(F_EQSETTING, eq_precut, LANG_EQUALIZER_PRECUT, 0,
1128 "eq precut", UNIT_DB, 0, 240, 5, eq_precut_format,
1129 get_precut_talkid, dsp_set_eq_precut),
1130 /* 0..32768 Hz */
1131 INT_SETTING_NOWRAP(F_EQSETTING, eq_band0_cutoff, LANG_EQUALIZER_BAND_CUTOFF,
1132 60, "eq band 0 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1133 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
1134 INT_SETTING_NOWRAP(F_EQSETTING, eq_band1_cutoff, LANG_EQUALIZER_BAND_CENTER,
1135 200, "eq band 1 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1136 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
1137 INT_SETTING_NOWRAP(F_EQSETTING, eq_band2_cutoff, LANG_EQUALIZER_BAND_CENTER,
1138 800, "eq band 2 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1139 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
1140 INT_SETTING_NOWRAP(F_EQSETTING, eq_band3_cutoff, LANG_EQUALIZER_BAND_CENTER,
1141 4000, "eq band 3 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1142 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
1143 INT_SETTING_NOWRAP(F_EQSETTING, eq_band4_cutoff, LANG_EQUALIZER_BAND_CUTOFF,
1144 12000, "eq band 4 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1145 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
1146 /* 0..64 (or 0.0 to 6.4) */
1147 INT_SETTING_NOWRAP(F_EQSETTING, eq_band0_q, LANG_EQUALIZER_BAND_Q, 7,
1148 "eq band 0 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1149 eq_q_format, get_dec_talkid, NULL),
1150 INT_SETTING_NOWRAP(F_EQSETTING, eq_band1_q, LANG_EQUALIZER_BAND_Q, 10,
1151 "eq band 1 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1152 eq_q_format, get_dec_talkid, NULL),
1153 INT_SETTING_NOWRAP(F_EQSETTING, eq_band2_q, LANG_EQUALIZER_BAND_Q, 10,
1154 "eq band 2 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1155 eq_q_format, get_dec_talkid, NULL),
1156 INT_SETTING_NOWRAP(F_EQSETTING, eq_band3_q, LANG_EQUALIZER_BAND_Q, 10,
1157 "eq band 3 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1158 eq_q_format, get_dec_talkid, NULL),
1159 INT_SETTING_NOWRAP(F_EQSETTING, eq_band4_q, LANG_EQUALIZER_BAND_Q, 7,
1160 "eq band 4 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1161 eq_q_format, get_dec_talkid, NULL),
1162 /* -240..240 (or -24db to +24db) */
1163 INT_SETTING_NOWRAP(F_EQSETTING, eq_band0_gain, LANG_GAIN, 0,
1164 "eq band 0 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX,
1165 EQ_GAIN_STEP, db_format, get_dec_talkid, NULL),
1166 INT_SETTING_NOWRAP(F_EQSETTING, eq_band1_gain, LANG_GAIN, 0,
1167 "eq band 1 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX,
1168 EQ_GAIN_STEP, db_format, get_dec_talkid, NULL),
1169 INT_SETTING_NOWRAP(F_EQSETTING, eq_band2_gain, LANG_GAIN, 0,
1170 "eq band 2 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX,
1171 EQ_GAIN_STEP, db_format, get_dec_talkid, NULL),
1172 INT_SETTING_NOWRAP(F_EQSETTING, eq_band3_gain, LANG_GAIN, 0,
1173 "eq band 3 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX,
1174 EQ_GAIN_STEP, db_format, get_dec_talkid, NULL),
1175 INT_SETTING_NOWRAP(F_EQSETTING, eq_band4_gain, LANG_GAIN, 0,
1176 "eq band 4 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX,
1177 EQ_GAIN_STEP, db_format, get_dec_talkid, NULL),
1179 /* dithering */
1180 OFFON_SETTING(F_SOUNDSETTING, dithering_enabled, LANG_DITHERING, false,
1181 "dithering enabled", dsp_dither_enable),
1182 #endif
1183 #ifdef HAVE_WM8758
1184 SOUND_SETTING(F_NO_WRAP, bass_cutoff, LANG_BASS_CUTOFF,
1185 "bass cutoff", SOUND_BASS_CUTOFF),
1186 SOUND_SETTING(F_NO_WRAP, treble_cutoff, LANG_TREBLE_CUTOFF,
1187 "treble cutoff", SOUND_TREBLE_CUTOFF),
1188 #endif
1189 #ifdef HAVE_DIRCACHE
1190 OFFON_SETTING(F_BANFROMQS,dircache,LANG_DIRCACHE_ENABLE,false,"dircache",NULL),
1191 SYSTEM_SETTING(NVRAM(4),dircache_size,0),
1192 #endif
1194 #ifdef HAVE_TAGCACHE
1195 #ifdef HAVE_TC_RAMCACHE
1196 OFFON_SETTING(F_BANFROMQS,tagcache_ram,LANG_TAGCACHE_RAM,false,"tagcache_ram",NULL),
1197 #endif
1198 OFFON_SETTING(F_BANFROMQS, tagcache_autoupdate, LANG_TAGCACHE_AUTOUPDATE, false,
1199 "tagcache_autoupdate", NULL),
1200 #endif
1201 CHOICE_SETTING(0, default_codepage, LANG_DEFAULT_CODEPAGE, 0,
1202 "default codepage",
1203 #ifdef HAVE_LCD_BITMAP
1204 /* The order must match with that in unicode.c */
1205 "iso8859-1,iso8859-7,iso8859-8,cp1251,iso8859-11,cp1256,"
1206 "iso8859-9,iso8859-2,cp1250,sjis,gb2312,ksx1001,big5,utf-8",
1207 set_codepage, 14,
1208 ID2P(LANG_CODEPAGE_LATIN1), ID2P(LANG_CODEPAGE_GREEK),
1209 ID2P(LANG_CODEPAGE_HEBREW), ID2P(LANG_CODEPAGE_CYRILLIC),
1210 ID2P(LANG_CODEPAGE_THAI), ID2P(LANG_CODEPAGE_ARABIC),
1211 ID2P(LANG_CODEPAGE_TURKISH),
1212 ID2P(LANG_CODEPAGE_LATIN_EXTENDED),
1213 ID2P(LANG_CODEPAGE_CENTRAL_EUROPEAN),
1214 ID2P(LANG_CODEPAGE_JAPANESE),
1215 ID2P(LANG_CODEPAGE_SIMPLIFIED), ID2P(LANG_CODEPAGE_KOREAN),
1216 ID2P(LANG_CODEPAGE_TRADITIONAL), ID2P(LANG_CODEPAGE_UTF8)),
1217 #else /* !HAVE_LCD_BITMAP */
1218 /* The order must match with that in unicode.c */
1219 "iso8859-1,iso8859-7,cp1251,iso8859-9,iso8859-2,cp1250,utf-8",
1220 set_codepage, 7,
1221 ID2P(LANG_CODEPAGE_LATIN1), ID2P(LANG_CODEPAGE_GREEK),
1222 ID2P(LANG_CODEPAGE_CYRILLIC), ID2P(LANG_CODEPAGE_TURKISH),
1223 ID2P(LANG_CODEPAGE_LATIN_EXTENDED),
1224 ID2P(LANG_CODEPAGE_CENTRAL_EUROPEAN),
1225 ID2P(LANG_CODEPAGE_UTF8)),
1226 #endif
1227 OFFON_SETTING(0, warnon_erase_dynplaylist, LANG_WARN_ERASEDYNPLAYLIST_MENU,
1228 true, "warn when erasing dynamic playlist",NULL),
1230 #ifdef HAVE_BACKLIGHT
1231 #ifdef HAS_BUTTON_HOLD
1232 CHOICE_SETTING(0, backlight_on_button_hold, LANG_BACKLIGHT_ON_BUTTON_HOLD,
1233 1, "backlight on button hold", "normal,off,on",
1234 backlight_set_on_button_hold, 3,
1235 ID2P(LANG_NORMAL), ID2P(LANG_OFF), ID2P(LANG_ON)),
1236 #endif
1238 #ifdef HAVE_LCD_SLEEP_SETTING
1239 STRINGCHOICE_SETTING(0, lcd_sleep_after_backlight_off,
1240 LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF, 3,
1241 "lcd sleep after backlight off",
1242 "always,never,5,10,15,20,30,45,60,90",
1243 lcd_set_sleep_after_backlight_off, 10,
1244 LANG_ALWAYS, LANG_NEVER, TALK_ID(5, UNIT_SEC),
1245 TALK_ID(10, UNIT_SEC), TALK_ID(15, UNIT_SEC),
1246 TALK_ID(20, UNIT_SEC), TALK_ID(30, UNIT_SEC),
1247 TALK_ID(45, UNIT_SEC),TALK_ID(60, UNIT_SEC),
1248 TALK_ID(90, UNIT_SEC)),
1249 #endif /* HAVE_LCD_SLEEP_SETTING */
1250 #endif /* HAVE_BACKLIGHT */
1252 OFFON_SETTING(0, hold_lr_for_scroll_in_list, -1, true,
1253 "hold_lr_for_scroll_in_list",NULL),
1254 #ifdef HAVE_LCD_BITMAP
1255 CHOICE_SETTING(0, show_path_in_browser, LANG_SHOW_PATH, SHOW_PATH_CURRENT,
1256 "show path in browser", "off,current directory,full path",
1257 NULL, 3, ID2P(LANG_OFF), ID2P(LANG_SHOW_PATH_CURRENT),
1258 ID2P(LANG_DISPLAY_FULL_PATH)),
1259 #endif
1261 #ifdef HAVE_AGC
1262 {F_T_INT,&global_settings.rec_agc_preset_mic,LANG_RECORDING_AGC_PRESET,
1263 INT(1),"agc mic preset",NULL,UNUSED},
1264 {F_T_INT,&global_settings.rec_agc_preset_line,LANG_RECORDING_AGC_PRESET,
1265 INT(1),"agc line preset",NULL,UNUSED},
1266 {F_T_INT,&global_settings.rec_agc_maxgain_mic,-1,INT(104),
1267 "agc maximum mic gain",NULL,UNUSED},
1268 {F_T_INT,&global_settings.rec_agc_maxgain_line,-1,INT(96),
1269 "agc maximum line gain",NULL,UNUSED},
1270 {F_T_INT,&global_settings.rec_agc_cliptime,LANG_RECORDING_AGC_CLIPTIME,
1271 INT(1),"agc cliptime","0.2s,0.4s,0.6s,0.8,1s",UNUSED},
1272 #endif
1274 #ifdef HAVE_REMOTE_LCD
1275 #ifdef HAS_REMOTE_BUTTON_HOLD
1276 CHOICE_SETTING(0, remote_backlight_on_button_hold,
1277 LANG_BACKLIGHT_ON_BUTTON_HOLD, 0,
1278 "remote backlight on button hold",
1279 "normal,off,on", remote_backlight_set_on_button_hold, 3,
1280 ID2P(LANG_NORMAL), ID2P(LANG_OFF), ID2P(LANG_ON)),
1281 #endif
1282 #endif
1283 #ifdef HAVE_HEADPHONE_DETECTION
1284 CHOICE_SETTING(0, unplug_mode, LANG_HEADPHONE_UNPLUG, 0,
1285 "pause on headphone unplug", "off,pause,pause and resume",
1286 NULL, 3, ID2P(LANG_OFF), ID2P(LANG_PAUSE),
1287 ID2P(LANG_HEADPHONE_UNPLUG_RESUME)),
1288 INT_SETTING(0, unplug_rw, LANG_HEADPHONE_UNPLUG_RW, 0,
1289 "rewind duration on pause", UNIT_SEC, 0, 15, 1, NULL, NULL,
1290 NULL),
1291 OFFON_SETTING(0, unplug_autoresume,
1292 LANG_HEADPHONE_UNPLUG_DISABLE_AUTORESUME, false,
1293 "disable autoresume if phones not present",NULL),
1294 #endif
1295 #if CONFIG_TUNER
1296 CHOICE_SETTING(0, fm_region, LANG_FM_REGION, 0,
1297 "fm_region", "eu,us,jp,kr", set_radio_region, 4,
1298 ID2P(LANG_FM_EUROPE), ID2P(LANG_FM_US),
1299 ID2P(LANG_FM_JAPAN), ID2P(LANG_FM_KOREA)),
1300 #endif
1302 OFFON_SETTING(F_BANFROMQS, audioscrobbler, LANG_AUDIOSCROBBLER, false,
1303 "Last.fm Logging", NULL),
1304 #if CONFIG_TUNER
1305 TEXT_SETTING(0, fmr_file, "fmr", "",
1306 FMPRESET_PATH "/", ".fmr"),
1307 #endif
1308 #ifdef HAVE_LCD_BITMAP
1309 TEXT_SETTING(F_THEMESETTING, font_file, "font",
1310 DEFAULT_FONTNAME, FONT_DIR "/", ".fnt"),
1311 #endif
1312 TEXT_SETTING(F_THEMESETTING,wps_file, "wps",
1313 DEFAULT_WPSNAME, WPS_DIR "/", ".wps"),
1314 TEXT_SETTING(0,lang_file,"lang","",LANG_DIR "/",".lng"),
1315 #ifdef HAVE_REMOTE_LCD
1316 TEXT_SETTING(F_THEMESETTING,rwps_file,"rwps",
1317 DEFAULT_WPSNAME, WPS_DIR "/", ".rwps"),
1318 #endif
1319 #if LCD_DEPTH > 1
1320 TEXT_SETTING(F_THEMESETTING,backdrop_file,"backdrop",
1321 DEFAULT_BACKDROP, BACKDROP_DIR "/", ".bmp"),
1322 #endif
1323 #ifdef HAVE_LCD_BITMAP
1324 TEXT_SETTING(0,kbd_file,"kbd","",ROCKBOX_DIR "/",".kbd"),
1325 #endif
1326 #ifdef HAVE_USB_CHARGING_ENABLE
1327 OFFON_SETTING(0,usb_charging,LANG_USB_CHARGING,false,"usb charging",NULL),
1328 #endif
1329 OFFON_SETTING(F_BANFROMQS,cuesheet,LANG_CUESHEET_ENABLE,false,"cuesheet support",
1330 NULL),
1331 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, skip_length,
1332 LANG_SKIP_LENGTH, 0, "skip length",
1333 "track,1s,2s,3s,5s,7s,10s,15s,20s,30s,45s,1min,90s,2min,3min,5min,10min,15min",
1334 UNIT_SEC, formatter_unit_0_is_skip_track,
1335 getlang_unit_0_is_skip_track, NULL,
1336 18, 0,1,2,3,5,7,10,15,20,30,45,60,90,120,180,300,600,900),
1337 CHOICE_SETTING(0, start_in_screen, LANG_START_SCREEN, 1,
1338 "start in screen", "previous,root,files,"
1339 #ifdef HAVE_TAGCACHE
1340 "db,"
1341 #endif
1342 "wps,menu,"
1343 #ifdef HAVE_RECORDING
1344 "recording,"
1345 #endif
1346 #if CONFIG_TUNER
1347 "radio,"
1348 #endif
1349 "bookmarks" ,NULL,
1350 #if defined(HAVE_TAGCACHE)
1351 #if defined(HAVE_RECORDING) && CONFIG_TUNER
1353 #elif defined(HAVE_RECORDING) || CONFIG_TUNER /* only one of them */
1355 #else
1357 #endif
1358 #else
1359 #if defined(HAVE_RECORDING) && CONFIG_TUNER
1361 #elif defined(HAVE_RECORDING) || CONFIG_TUNER /* only one of them */
1363 #else
1365 #endif
1366 #endif
1367 ID2P(LANG_PREVIOUS_SCREEN), ID2P(LANG_MAIN_MENU),
1368 ID2P(LANG_DIR_BROWSER),
1369 #ifdef HAVE_TAGCACHE
1370 ID2P(LANG_TAGCACHE),
1371 #endif
1372 ID2P(LANG_RESUME_PLAYBACK), ID2P(LANG_SETTINGS),
1373 #ifdef HAVE_RECORDING
1374 ID2P(LANG_RECORDING),
1375 #endif
1376 #if CONFIG_TUNER
1377 ID2P(LANG_FM_RADIO),
1378 #endif
1379 ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS)
1381 SYSTEM_SETTING(NVRAM(1),last_screen,-1),
1382 #if defined(HAVE_RTC_ALARM) && \
1383 (defined(HAVE_RECORDING) || CONFIG_TUNER)
1384 {F_T_INT, &global_settings.alarm_wake_up_screen, LANG_ALARM_WAKEUP_SCREEN,
1385 INT(ALARM_START_WPS), "alarm wakeup screen", ALARM_SETTING_TEXT,UNUSED},
1386 #endif /* HAVE_RTC_ALARM */
1388 /* Customizable icons */
1389 #ifdef HAVE_LCD_BITMAP
1390 TEXT_SETTING(F_THEMESETTING, icon_file, "iconset", DEFAULT_ICONSET,
1391 ICON_DIR "/", ".bmp"),
1392 TEXT_SETTING(F_THEMESETTING, viewers_icon_file, "viewers iconset",
1393 DEFAULT_VIEWERS_ICONSET,
1394 ICON_DIR "/", ".bmp"),
1395 #endif
1396 #ifdef HAVE_REMOTE_LCD
1397 TEXT_SETTING(F_THEMESETTING, remote_icon_file, "remote iconset", "",
1398 ICON_DIR "/", ".bmp"),
1399 TEXT_SETTING(F_THEMESETTING, remote_viewers_icon_file,
1400 "remote viewers iconset", "",
1401 ICON_DIR "/", ".bmp"),
1402 #endif /* HAVE_REMOTE_LCD */
1403 #ifdef HAVE_LCD_COLOR
1404 TEXT_SETTING(F_THEMESETTING, colors_file, "filetype colours", "-",
1405 THEME_DIR "/", ".colours"),
1406 #endif
1407 #ifdef HAVE_BUTTON_LIGHT
1408 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, buttonlight_timeout,
1409 LANG_BUTTONLIGHT_TIMEOUT, 5, "button light timeout", off_on,
1410 UNIT_SEC, backlight_formatter, backlight_getlang,
1411 buttonlight_set_timeout, 20,
1412 -1,0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,120),
1413 #endif
1414 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
1415 INT_SETTING(F_NO_WRAP, buttonlight_brightness, LANG_BUTTONLIGHT_BRIGHTNESS,
1416 DEFAULT_BRIGHTNESS_SETTING,
1417 "button light brightness",UNIT_INT, MIN_BRIGHTNESS_SETTING,
1418 MAX_BRIGHTNESS_SETTING, 1, NULL, NULL,
1419 buttonlight_set_brightness),
1420 #endif
1421 #ifndef HAVE_SCROLLWHEEL
1422 INT_SETTING(0, list_accel_start_delay, LANG_LISTACCEL_START_DELAY,
1423 2, "list_accel_start_delay", UNIT_MS, 0, 10, 1,
1424 formatter_unit_0_is_off, getlang_unit_0_is_off, NULL),
1425 INT_SETTING(0, list_accel_wait, LANG_LISTACCEL_ACCEL_SPEED,
1426 3, "list_accel_wait", UNIT_SEC, 1, 10, 1,
1427 scanaccel_formatter, getlang_unit_0_is_off, NULL),
1428 #endif /* HAVE_SCROLLWHEEL */
1429 #if CONFIG_TUNER
1430 SYSTEM_SETTING(0, statusbar_forced, 0),
1431 #endif
1432 #if CONFIG_CODEC == SWCODEC
1433 /* keyclick */
1434 CHOICE_SETTING(0, keyclick, LANG_KEYCLICK, 0,
1435 "keyclick", "off,weak,moderate,strong", NULL, 4,
1436 ID2P(LANG_OFF), ID2P(LANG_WEAK), ID2P(LANG_MODERATE),
1437 ID2P(LANG_STRONG)),
1438 OFFON_SETTING(0, keyclick_repeats, LANG_KEYCLICK_REPEATS, false,
1439 "keyclick repeats", NULL),
1440 #endif /* CONFIG_CODEC == SWCODEC */
1441 TEXT_SETTING(0, playlist_catalog_dir, "playlist catalog directory",
1442 PLAYLIST_CATALOG_DEFAULT_DIR, NULL, NULL),
1443 #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
1444 CHOICE_SETTING(0, touchpad_sensitivity, LANG_TOUCHPAD_SENSITIVITY, 0,
1445 "touchpad sensitivity", "normal,high", touchpad_set_sensitivity, 2,
1446 ID2P(LANG_NORMAL), ID2P(LANG_HIGH)),
1447 #endif
1448 #ifdef HAVE_QUICKSCREEN
1449 CUSTOM_SETTING(0, qs_item_left, LANG_LEFT_QS_ITEM,
1450 &global_settings.playlist_shuffle, "qs left",
1451 qs_load_from_cfg, qs_write_to_cfg,
1452 qs_is_changed, qs_set_default),
1453 CUSTOM_SETTING(0, qs_item_right, LANG_RIGHT_QS_ITEM,
1454 &global_settings.repeat_mode, "qs right",
1455 qs_load_from_cfg, qs_write_to_cfg,
1456 qs_is_changed, qs_set_default),
1457 CUSTOM_SETTING(0, qs_item_bottom, LANG_BOTTOM_QS_ITEM,
1458 &global_settings.dirfilter, "qs bottom",
1459 qs_load_from_cfg, qs_write_to_cfg,
1460 qs_is_changed, qs_set_default),
1461 #endif
1464 const int nb_settings = sizeof(settings)/sizeof(*settings);
1466 const struct settings_list* get_settings_list(int*count)
1468 *count = nb_settings;
1469 return settings;