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