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