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