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