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