checkwps: Do not error out on rwps for non-remote targets.
[maemo-rb.git] / apps / settings_list.c
blobf27c13c4f10e28221ec50fca57e95cc995015640
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-extra.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 "sound.h"
33 #include "settings.h"
34 #include "settings_list.h"
35 #include "usb.h"
36 #include "audio.h"
37 #include "power.h"
38 #include "powermgmt.h"
39 #include "kernel.h"
40 #ifdef HAVE_REMOTE_LCD
41 #include "lcd-remote.h"
42 #endif
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"
56 #ifdef HAVE_TOUCHSCREEN
57 #include "touchscreen.h"
58 #include "ctype.h" /* For isspace() */
59 #endif
60 #ifdef HAVE_HOTKEY
61 #include "onplay.h"
62 #endif
64 #define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT)
65 /** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h
66 and you may need to update it if you edit this file */
68 #define UNUSED {.RESERVED=NULL}
69 #define INT(a) {.int_ = a}
70 #define UINT(a) {.uint_ = a}
71 #define BOOL(a) {.bool_ = a}
72 #define CHARPTR(a) {.charptr = a}
73 #define UCHARPTR(a) {.ucharptr = a}
74 #define FUNCTYPE(a) {.func = a}
75 #define NODEFAULT INT(0)
77 /* in all the following macros the args are:
78 - flags: bitwise | or the F_ bits in settings_list.h
79 - var: pointer to the variable being changed (usually in global_settings)
80 - lang_id: LANG_* id to display in menus and setting screens for the setting
81 - default: the default value for the variable, set if settings are reset
82 - name: the name of the setting in config files
83 - cfg_vals: comma separated list of legal values to write to cfg files.
84 The values correspond to the values 0,1,2,etc. of the setting.
85 NULL if just the number itself should be written to the file.
86 No spaces between the values and the commas!
87 - cb: the callback used by the setting screen.
90 /* Use for int settings which use the set_sound() function to set them */
91 #define SOUND_SETTING(flags,var,lang_id,name,setting) \
92 {flags|F_T_INT|F_T_SOUND|F_SOUNDSETTING, &global_settings.var, \
93 lang_id, NODEFAULT,name,NULL, \
94 {.sound_setting=(struct sound_setting[]){{setting}}} }
96 /* Use for bool variables which don't use LANG_SET_BOOL_YES and LANG_SET_BOOL_NO
97 or dont save as "off" or "on" in the cfg.
98 cfgvals are comma separated values (without spaces after the comma!) to write
99 for 'false' and 'true' (in this order)
100 yes_id is the lang_id for the 'yes' (or 'on') option in the menu
101 no_id is the lang_id for the 'no' (or 'off') option in the menu
103 #define BOOL_SETTING(flags,var,lang_id,default,name,cfgvals,yes_id,no_id,cb)\
104 {flags|F_BOOL_SETTING, &global_settings.var, \
105 lang_id, BOOL(default),name,cfgvals, \
106 {.bool_setting=(struct bool_setting[]){{cb,yes_id,no_id}}} }
108 /* bool setting which does use LANG_YES and _NO and save as "off,on" */
109 #define OFFON_SETTING(flags,var,lang_id,default,name,cb) \
110 BOOL_SETTING(flags,var,lang_id,default,name,off_on, \
111 LANG_SET_BOOL_YES,LANG_SET_BOOL_NO,cb)
113 /* int variable which is NOT saved to .cfg files,
114 (Use NVRAM() in the flags to save to the nvram (or nvram.bin file) */
115 #define SYSTEM_SETTING(flags,var,default) \
116 {flags|F_T_INT, &global_status.var,-1, INT(default), \
117 NULL, NULL, UNUSED}
119 /* setting which stores as a filename (or another string) in the .cfgvals
120 The string must be a char array (which all of our string settings are),
121 not just a char pointer.
122 prefix: The absolute path to not save in the variable, ex /.rockbox/wps_file
123 suffix: The file extention (usually...) e.g .wps_file
124 If the prefix is set (not NULL), then the suffix must be set as well.
126 #define TEXT_SETTING(flags,var,name,default,prefix,suffix) \
127 {flags|F_T_UCHARPTR, &global_settings.var,-1, \
128 CHARPTR(default),name,NULL, \
129 {.filename_setting= \
130 (struct filename_setting[]){ \
131 {prefix,suffix,sizeof(global_settings.var)}}} }
133 /* Used for settings which use the set_option() setting screen.
134 The ... arg is a list of pointers to strings to display in the setting
135 screen. These can either be literal strings, or ID2P(LANG_*) */
136 #define CHOICE_SETTING(flags,var,lang_id,default,name,cfg_vals,cb,count,...) \
137 {flags|F_CHOICE_SETTING|F_T_INT, &global_settings.var, lang_id, \
138 INT(default), name, cfg_vals, \
139 {.choice_setting = (struct choice_setting[]){ \
140 {cb, count, {.desc = (const unsigned char*[]) \
141 {__VA_ARGS__}}}}}}
143 /* Similar to above, except the strings to display are taken from cfg_vals,
144 the ... arg is a list of ID's to talk for the strings, can use TALK_ID()'s */
145 #define STRINGCHOICE_SETTING(flags,var,lang_id,default,name,cfg_vals, \
146 cb,count,...) \
147 {flags|F_CHOICE_SETTING|F_T_INT|F_CHOICETALKS, \
148 &global_settings.var, lang_id, \
149 INT(default), name, cfg_vals, \
150 {.choice_setting = (struct choice_setting[]){ \
151 {cb, count, {.talks = (const int[]){__VA_ARGS__}}}}}}
153 /* for settings which use the set_int() setting screen.
154 unit is the UNIT_ define to display/talk.
155 the first one saves a string to the config file,
156 the second one saves the variable value to the config file */
157 #define INT_SETTING_W_CFGVALS(flags, var, lang_id, default, name, cfg_vals, \
158 unit, min, max, step, formatter, get_talk_id, cb) \
159 {flags|F_INT_SETTING|F_T_INT, &global_settings.var, \
160 lang_id, INT(default), name, cfg_vals, \
161 {.int_setting = (struct int_setting[]){ \
162 {cb, unit, min, max, step, formatter, get_talk_id}}}}
163 #define INT_SETTING(flags, var, lang_id, default, name, \
164 unit, min, max, step, formatter, get_talk_id, cb) \
165 {flags|F_INT_SETTING|F_T_INT, &global_settings.var, \
166 lang_id, INT(default), name, NULL, \
167 {.int_setting = (struct int_setting[]){ \
168 {cb, unit, min, max, step, formatter, get_talk_id}}}}
169 #define INT_SETTING_NOWRAP(flags, var, lang_id, default, name, \
170 unit, min, max, step, formatter, get_talk_id, cb) \
171 {flags|F_INT_SETTING|F_T_INT|F_NO_WRAP, &global_settings.var, \
172 lang_id, INT(default), name, NULL, \
173 {.int_setting = (struct int_setting[]){ \
174 {cb, unit, min, max, step, formatter, get_talk_id}}}}
176 #define TABLE_SETTING(flags, var, lang_id, default, name, cfg_vals, \
177 unit, formatter, get_talk_id, cb, count, ...) \
178 {flags|F_TABLE_SETTING|F_T_INT, &global_settings.var, \
179 lang_id, INT(default), name, cfg_vals, \
180 {.table_setting = (struct table_setting[]) { \
181 {cb, formatter, get_talk_id, unit, count, \
182 (const int[]){__VA_ARGS__}}}}}
184 #define CUSTOM_SETTING(flags, var, lang_id, default, name, \
185 load_from_cfg, write_to_cfg, \
186 is_change, set_default) \
187 {flags|F_CUSTOM_SETTING|F_T_CUSTOM|F_BANFROMQS, \
188 &global_settings.var, lang_id, \
189 {.custom = (void*)default}, name, NULL, \
190 {.custom_setting = (struct custom_setting[]){ \
191 {load_from_cfg, write_to_cfg, is_change, set_default}}}}
193 #define VIEWPORT_SETTING(var,name) \
194 TEXT_SETTING(F_THEMESETTING,var,name,"-", NULL, NULL)
196 /* some sets of values which are used more than once, to save memory */
197 static const char off_on[] = "off,on";
198 static const char off_on_ask[] = "off,on,ask";
199 static const char off_number_spell[] = "off,number,spell";
200 #ifdef HAVE_LCD_BITMAP
201 static const char graphic_numeric[] = "graphic,numeric";
202 #endif
204 /* Default theme settings */
205 #define DEFAULT_WPSNAME "cabbiev2"
206 #define DEFAULT_SBSNAME "-"
207 #define DEFAULT_FMS_NAME "cabbiev2"
209 #ifdef HAVE_LCD_BITMAP
211 #if LCD_HEIGHT <= 64
212 #define DEFAULT_FONT_HEIGHT 8
213 #define DEFAULT_FONTNAME "08-Rockfont"
214 #elif LCD_HEIGHT <= 80
215 #define DEFAULT_FONT_HEIGHT 11
216 #define DEFAULT_FONTNAME "11-Sazanami-Mincho"
217 #elif (LCD_HEIGHT == 96) && (LCD_WIDTH == 96) /* sandisk sansa clip zip */
218 #define DEFAULT_FONT_HEIGHT 8
219 #define DEFAULT_FONTNAME "08-Rockfont"
220 #elif LCD_HEIGHT <= 220
221 #define DEFAULT_FONT_HEIGHT 12
222 #elif LCD_HEIGHT <= 320
223 #define DEFAULT_FONT_HEIGHT 15
224 #elif LCD_HEIGHT <= 400
225 #define DEFAULT_FONT_HEIGHT 16
226 #elif LCD_HEIGHT <= 480 && LCD_WIDTH < 800
227 #define DEFAULT_FONT_HEIGHT 27
228 #else
229 #define DEFAULT_FONT_HEIGHT 35
230 #endif
231 #define DEFAULT_GLYPHS 250
232 #define MIN_GLYPHS 50
233 #define MAX_GLYPHS 65540
235 #else
236 #define DEFAULT_FONT_HEIGHT 12
237 #endif
239 #ifndef DEFAULT_FONTNAME
240 /* ugly expansion needed */
241 #define _EXPAND2(x) #x
242 #define _EXPAND(x) _EXPAND2(x)
243 #define DEFAULT_FONTNAME _EXPAND(DEFAULT_FONT_HEIGHT) "-Adobe-Helvetica"
244 #endif
246 #ifdef HAVE_LCD_COLOR
247 #if DEFAULT_FONT_HEIGHT >= 31
248 #define DEFAULT_ICONSET "tango_icons.32x32"
249 #define DEFAULT_VIEWERS_ICONSET "tango_icons_viewers.32x32"
250 #elif DEFAULT_FONT_HEIGHT >= 23
251 #define DEFAULT_ICONSET "tango_icons.24x24"
252 #define DEFAULT_VIEWERS_ICONSET "tango_icons_viewers.24x24"
253 #elif DEFAULT_FONT_HEIGHT >= 15
254 #define DEFAULT_ICONSET "tango_icons.16x16"
255 #define DEFAULT_VIEWERS_ICONSET "tango_icons_viewers.16x16"
256 #elif DEFAULT_FONT_HEIGHT >= 11
257 #define DEFAULT_ICONSET "tango_icons.12x12"
258 #define DEFAULT_VIEWERS_ICONSET "tango_icons_viewers.12x12"
259 #elif DEFAULT_FONT_HEIGHT >= 7
260 #define DEFAULT_ICONSET "tango_icons.8x8"
261 #define DEFAULT_VIEWERS_ICONSET "tango_icons_viewers.8x8"
262 #endif
263 #elif LCD_DEPTH > 1 /* greyscale */
264 #define DEFAULT_ICONSET "tango_small_mono"
265 #define DEFAULT_VIEWERS_ICONSET "tango_small_viewers_mono"
266 #else /* monochrome */
267 #define DEFAULT_ICONSET ""
268 #define DEFAULT_VIEWERS_ICONSET ""
269 #endif
271 #ifdef HAVE_REMOTE_LCD
272 #if LCD_REMOTE_HEIGHT <= 64
273 #define DEFAULT_REMOTE_FONTNAME "08-Rockfont"
274 #else
275 #define DEFAULT_REMOTE_FONTNAME "-"
276 #endif
277 #endif /* HAVE_REMOTE_LCD */
279 #define DEFAULT_THEME_FOREGROUND LCD_RGBPACK(0xce, 0xcf, 0xce)
280 #define DEFAULT_THEME_BACKGROUND LCD_RGBPACK(0x00, 0x00, 0x00)
281 #define DEFAULT_THEME_SELECTOR_START LCD_RGBPACK(0xff, 0xeb, 0x9c)
282 #define DEFAULT_THEME_SELECTOR_END LCD_RGBPACK(0xb5, 0x8e, 0x00)
283 #define DEFAULT_THEME_SELECTOR_TEXT LCD_RGBPACK(0x00, 0x00, 0x00)
285 #define DEFAULT_BACKDROP BACKDROP_DIR "/cabbiev2.bmp"
287 #ifdef HAVE_RECORDING
288 /* these should be in the config.h files */
289 #if CONFIG_CODEC == MAS3587F
290 # define DEFAULT_REC_MIC_GAIN 8
291 # define DEFAULT_REC_LEFT_GAIN 2
292 # define DEFAULT_REC_RIGHT_GAIN 2
293 #elif CONFIG_CODEC == SWCODEC
294 # ifdef HAVE_UDA1380
295 # define DEFAULT_REC_MIC_GAIN 16
296 # define DEFAULT_REC_LEFT_GAIN 0
297 # define DEFAULT_REC_RIGHT_GAIN 0
298 # elif defined(HAVE_TLV320)
299 # define DEFAULT_REC_MIC_GAIN 0
300 # define DEFAULT_REC_LEFT_GAIN 0
301 # define DEFAULT_REC_RIGHT_GAIN 0
302 # elif defined(HAVE_WM8975)
303 # define DEFAULT_REC_MIC_GAIN 16
304 # define DEFAULT_REC_LEFT_GAIN 0
305 # define DEFAULT_REC_RIGHT_GAIN 0
306 # elif defined(HAVE_WM8758)
307 # define DEFAULT_REC_MIC_GAIN 16
308 # define DEFAULT_REC_LEFT_GAIN 0
309 # define DEFAULT_REC_RIGHT_GAIN 0
310 # elif defined(HAVE_WM8731)
311 # define DEFAULT_REC_MIC_GAIN 16
312 # define DEFAULT_REC_LEFT_GAIN 0
313 # define DEFAULT_REC_RIGHT_GAIN 0
314 # endif
315 #endif
317 #endif /* HAVE_RECORDING */
319 #if (CONFIG_PLATFORM & PLATFORM_ANDROID)
320 #define DEFAULT_TAGCACHE_SCAN_PATHS "/sdcard"
321 #else
322 #define DEFAULT_TAGCACHE_SCAN_PATHS "/"
323 #endif
325 #ifdef HAVE_TOUCHSCREEN
327 static const char* list_pad_formatter(char *buffer, size_t buffer_size,
328 int val, const char *unit)
330 switch (val)
332 case -1: return str(LANG_AUTOMATIC);
333 case 0: return str(LANG_OFF);
334 default: break;
336 snprintf(buffer, buffer_size, "%d %s", val, unit);
337 return buffer;
340 static int32_t list_pad_getlang(int value, int unit)
342 switch (value)
344 case -1: return LANG_AUTOMATIC;
345 case 0: return LANG_OFF;
346 default: return TALK_ID(value, unit);
350 #endif /* HAVE_TOUCHSCREEN */
351 static const char* formatter_unit_0_is_off(char *buffer, size_t buffer_size,
352 int val, const char *unit)
354 if (val == 0)
355 return str(LANG_OFF);
356 else
357 snprintf(buffer, buffer_size, "%d %s", val, unit);
358 return buffer;
361 static int32_t getlang_unit_0_is_off(int value, int unit)
363 if (value == 0)
364 return LANG_OFF;
365 else
366 return TALK_ID(value,unit);
369 static const char* formatter_unit_0_is_skip_track(char *buffer, size_t buffer_size,
370 int val, const char *unit)
372 (void)unit;
373 if (val == -1)
374 return str(LANG_SKIP_OUTRO);
375 else if (val == 0)
376 return str(LANG_SKIP_TRACK);
377 else if (val % 60 == 0)
378 snprintf(buffer, buffer_size, "%d min", val/60);
379 else
380 snprintf(buffer, buffer_size, "%d s", val);
381 return buffer;
384 static int32_t getlang_unit_0_is_skip_track(int value, int unit)
386 (void)unit;
387 if (value == -1)
388 return LANG_SKIP_OUTRO;
389 else if (value == 0)
390 return LANG_SKIP_TRACK;
391 else if (value % 60 == 0)
392 return TALK_ID(value/60, UNIT_MIN);
393 else
394 return TALK_ID(value, UNIT_SEC);
397 #ifdef HAVE_BACKLIGHT
398 #ifdef SIMULATOR
399 #define DEFAULT_BACKLIGHT_TIMEOUT 0
400 #else
401 #define DEFAULT_BACKLIGHT_TIMEOUT 15
402 #endif
403 static const char* backlight_formatter(char *buffer, size_t buffer_size,
404 int val, const char *unit)
406 if (val == -1)
407 return str(LANG_OFF);
408 else if (val == 0)
409 return str(LANG_ON);
410 else
411 snprintf(buffer, buffer_size, "%d %s", val, unit);
412 return buffer;
414 static int32_t backlight_getlang(int value, int unit)
416 if (value == -1)
417 return LANG_OFF;
418 else if (value == 0)
419 return LANG_ON;
420 else
421 return TALK_ID(value, unit);
423 #endif
425 #ifndef HAVE_WHEEL_ACCELERATION
426 static const char* scanaccel_formatter(char *buffer, size_t buffer_size,
427 int val, const char *unit)
429 (void)unit;
430 if (val == 0)
431 return str(LANG_OFF);
432 else
433 snprintf(buffer, buffer_size, "Speed up every %ds", val);
434 return buffer;
436 #endif
438 #if CONFIG_CODEC == SWCODEC
439 static void crossfeed_cross_set(int val)
441 (void)val;
442 dsp_set_crossfeed_cross_params(global_settings.crossfeed_cross_gain,
443 global_settings.crossfeed_hf_attenuation,
444 global_settings.crossfeed_hf_cutoff);
447 static void compressor_set(int val)
449 (void)val;
450 dsp_set_compressor(&global_settings.compressor_settings);
453 static const char* db_format(char* buffer, size_t buffer_size, int value,
454 const char* unit)
456 int v = abs(value);
458 snprintf(buffer, buffer_size, "%s%d.%d %s", value < 0 ? "-" : "",
459 v / 10, v % 10, unit);
460 return buffer;
463 static int32_t get_dec_talkid(int value, int unit)
465 return TALK_ID_DECIMAL(value, 1, unit);
468 static int32_t get_precut_talkid(int value, int unit)
470 return TALK_ID_DECIMAL(-value, 1, unit);
473 #endif
474 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
475 static void set_mdb_enable(bool value)
477 sound_set_mdb_enable((int)value);
479 static void set_superbass(bool value)
481 sound_set_superbass((int)value);
483 #endif
485 #ifdef HAVE_QUICKSCREEN
486 static int find_setting_by_name(char*name)
488 int i = 0;
489 const struct settings_list *setting;
490 if (!strcmp(name, "-"))
491 return -1;
492 while (i<nb_settings)
494 setting = &settings[i];
495 if (setting->cfg_name && !strcmp(setting->cfg_name, name))
497 return i;
499 i++;
501 return -1;
503 static void qs_load_from_cfg(void* var, char*value)
505 *(int*)var = find_setting_by_name(value);
507 static char* qs_write_to_cfg(void* setting, char*buf, int buf_len)
509 int index = *(int*)setting;
510 if (index < 0 || index >= nb_settings - 1)
512 strlcpy(buf, "-", buf_len);
513 return buf;
515 const struct settings_list *var = &settings[index];
516 strlcpy(buf, var->cfg_name, buf_len);
517 return buf;
519 static bool qs_is_changed(void* setting, void* defaultval)
521 int i = *(int*)setting;
522 if (i < 0 || i >= nb_settings)
523 return false;
524 const struct settings_list *var = &settings[i];
525 return var != find_setting(defaultval, NULL);
527 static void qs_set_default(void* setting, void* defaultval)
529 if (defaultval == NULL)
530 *(int*)setting = -1;
531 find_setting(defaultval, (int*)setting);
533 #endif
534 #ifdef HAVE_TOUCHSCREEN
536 #if defined(APPLICATION) \
537 || defined(ONDA_VX747) \
538 || defined(ONDA_VX767) \
539 || defined(ONDA_VX747P) \
540 || defined(ONDA_VX777)
542 #define DEFAULT_TOUCHSCREEN_MODE TOUCHSCREEN_POINT
543 #else
544 #define DEFAULT_TOUCHSCREEN_MODE TOUCHSCREEN_BUTTON
545 #endif
547 static void tsc_load_from_cfg(void* setting, char*value)
549 struct touchscreen_parameter *var = (struct touchscreen_parameter*) setting;
551 /* Replacement for sscanf(value, "%d ..., &var->A, ...); */
552 int vals[7], count = 0;
553 while(*value != 0 && count < 7)
555 if(isspace(*value))
556 value++;
557 else
559 vals[count++] = atoi(value);
560 while(!isspace(*value))
561 value++;
564 var->A = vals[0];
565 var->B = vals[1];
566 var->C = vals[2];
567 var->D = vals[3];
568 var->E = vals[4];
569 var->F = vals[5];
570 var->divider = vals[6];
573 static char* tsc_write_to_cfg(void* setting, char*buf, int buf_len)
575 const struct touchscreen_parameter *var = (const struct touchscreen_parameter*) setting;
576 snprintf(buf, buf_len, "%d %d %d %d %d %d %d", var->A, var->B, var->C, var->D, var->E, var->F, var->divider);
577 return buf;
579 static bool tsc_is_changed(void* setting, void* defaultval)
581 return memcmp(setting, defaultval, sizeof(struct touchscreen_parameter)) != 0;
583 static void tsc_set_default(void* setting, void* defaultval)
585 memcpy(setting, defaultval, sizeof(struct touchscreen_parameter));
587 #endif
588 #ifdef HAVE_HOTKEY
589 static const char* hotkey_formatter(char* buffer, size_t buffer_size, int value,
590 const char* unit)
592 (void)buffer;
593 (void)buffer_size;
594 (void)unit;
595 return str(get_hotkey_lang_id(value));
597 static int32_t hotkey_getlang(int value, int unit)
599 (void)unit;
600 return get_hotkey_lang_id(value);
602 #endif /* HAVE_HOTKEY */
603 const struct settings_list settings[] = {
604 /* sound settings */
605 SOUND_SETTING(F_NO_WRAP,volume, LANG_VOLUME, "volume", SOUND_VOLUME),
606 SOUND_SETTING(0, balance, LANG_BALANCE, "balance", SOUND_BALANCE),
607 /* Tone controls */
608 #ifdef AUDIOHW_HAVE_BASS
609 SOUND_SETTING(F_NO_WRAP,bass, LANG_BASS, "bass", SOUND_BASS),
610 #endif
611 #ifdef AUDIOHW_HAVE_TREBLE
612 SOUND_SETTING(F_NO_WRAP,treble, LANG_TREBLE, "treble", SOUND_TREBLE),
613 #endif
614 /* Hardware EQ tone controls */
615 #ifdef AUDIOHW_HAVE_EQ
616 /* Band gain is generic */
617 SOUND_SETTING(F_NO_WRAP, hw_eq_bands[AUDIOHW_EQ_BAND1].gain,
618 LANG_HW_EQ_GAIN, "tone band1 gain", SOUND_EQ_BAND1_GAIN),
619 #ifdef AUDIOHW_HAVE_EQ_BAND2
620 SOUND_SETTING(F_NO_WRAP, hw_eq_bands[AUDIOHW_EQ_BAND2].gain,
621 LANG_HW_EQ_GAIN, "tone band2 gain", SOUND_EQ_BAND2_GAIN),
622 #endif /* AUDIOHW_HAVE_EQ_BAND2 */
623 #ifdef AUDIOHW_HAVE_EQ_BAND3
624 SOUND_SETTING(F_NO_WRAP, hw_eq_bands[AUDIOHW_EQ_BAND3].gain,
625 LANG_HW_EQ_GAIN, "tone band3 gain", SOUND_EQ_BAND3_GAIN),
626 #endif /* AUDIOHW_HAVE_EQ_BAND3 */
627 #ifdef AUDIOHW_HAVE_EQ_BAND4
628 SOUND_SETTING(F_NO_WRAP, hw_eq_bands[AUDIOHW_EQ_BAND4].gain,
629 LANG_HW_EQ_GAIN, "tone band4 gain", SOUND_EQ_BAND4_GAIN),
630 #endif /* AUDIOHW_HAVE_EQ_BAND4 */
631 #ifdef AUDIOHW_HAVE_EQ_BAND5
632 SOUND_SETTING(F_NO_WRAP, hw_eq_bands[AUDIOHW_EQ_BAND5].gain,
633 LANG_HW_EQ_GAIN, "tone band5 gain", SOUND_EQ_BAND5_GAIN),
634 #endif /* AUDIOHW_HAVE_EQ_BAND5 */
635 #ifdef HAVE_WM8978
636 /* Frequencies vary with samplerate but at least the user has an idea
637 * about the bands and it will be correct with normal playback rates. */
638 /* Band 1 */
639 STRINGCHOICE_SETTING(F_SOUNDSETTING,
640 hw_eq_bands[AUDIOHW_EQ_BAND1].frequency,
641 LANG_HW_EQ_FREQUENCY, 0,"tone band1 frequency",
642 "80 Hz,105 Hz,135 Hz,175 Hz",
643 sound_set_hw_eq_band1_frequency, 4,
644 TALK_ID(80, UNIT_HERTZ), TALK_ID(105, UNIT_HERTZ),
645 TALK_ID(135, UNIT_HERTZ), TALK_ID(175, UNIT_HERTZ)),
646 /* Band 2 */
647 STRINGCHOICE_SETTING(F_SOUNDSETTING,
648 hw_eq_bands[AUDIOHW_EQ_BAND2].frequency,
649 LANG_HW_EQ_FREQUENCY, 0,"tone band2 frequency",
650 "230 Hz,300 Hz,385 Hz,500 Hz",
651 sound_set_hw_eq_band2_frequency, 4,
652 TALK_ID(230, UNIT_HERTZ), TALK_ID(300, UNIT_HERTZ),
653 TALK_ID(385, UNIT_HERTZ), TALK_ID(500, UNIT_HERTZ)),
654 CHOICE_SETTING(F_SOUNDSETTING, hw_eq_bands[AUDIOHW_EQ_BAND2].width,
655 LANG_HW_EQ_WIDTH, 0, "tone band2 width", "narrow,wide",
656 sound_set_hw_eq_band2_width, 2,
657 ID2P(LANG_HW_EQ_WIDTH_NARROW), ID2P(LANG_HW_EQ_WIDTH_WIDE)),
658 /* Band 3 */
659 STRINGCHOICE_SETTING(F_SOUNDSETTING,
660 hw_eq_bands[AUDIOHW_EQ_BAND3].frequency,
661 LANG_HW_EQ_FREQUENCY, 0, "tone band3 frequency",
662 "650 Hz,850 Hz,1.1 kHz,1.4 kHz",
663 sound_set_hw_eq_band3_frequency, 4,
664 TALK_ID(650, UNIT_HERTZ), TALK_ID(850, UNIT_HERTZ),
665 TALK_ID_DECIMAL(11, 1, UNIT_KHZ),
666 TALK_ID_DECIMAL(14, 1, UNIT_KHZ)),
667 CHOICE_SETTING(F_SOUNDSETTING,hw_eq_bands[AUDIOHW_EQ_BAND3].width,
668 LANG_HW_EQ_WIDTH, 0, "tone band3 width", "narrow,wide",
669 sound_set_hw_eq_band3_width, 2,
670 ID2P(LANG_HW_EQ_WIDTH_NARROW), ID2P(LANG_HW_EQ_WIDTH_WIDE)),
671 /* Band 4 */
672 STRINGCHOICE_SETTING(F_SOUNDSETTING,
673 hw_eq_bands[AUDIOHW_EQ_BAND4].frequency,
674 LANG_HW_EQ_FREQUENCY, 0, "tone band4 frequency",
675 "1.8 kHz,2.4 kHz,3.2 kHz,4.1 kHz",
676 sound_set_hw_eq_band4_frequency, 4,
677 TALK_ID_DECIMAL(18, 1, UNIT_KHZ),
678 TALK_ID_DECIMAL(24, 1, UNIT_KHZ),
679 TALK_ID_DECIMAL(32, 1, UNIT_KHZ),
680 TALK_ID_DECIMAL(41, 1, UNIT_KHZ)),
681 CHOICE_SETTING(F_SOUNDSETTING, hw_eq_bands[AUDIOHW_EQ_BAND4].width,
682 LANG_HW_EQ_WIDTH, 0, "tone band4 width", "narrow,wide",
683 sound_set_hw_eq_band4_width, 2,
684 ID2P(LANG_HW_EQ_WIDTH_NARROW), ID2P(LANG_HW_EQ_WIDTH_WIDE)),
685 /* Band 5 */
686 STRINGCHOICE_SETTING(F_SOUNDSETTING,
687 hw_eq_bands[AUDIOHW_EQ_BAND5].frequency,
688 LANG_HW_EQ_FREQUENCY, 0, "tone band5 frequency",
689 "5.3 kHz,6.9 kHz,9.0 kHz,11.7 kHz",
690 sound_set_hw_eq_band5_frequency, 4,
691 TALK_ID_DECIMAL(53, 1, UNIT_KHZ),
692 TALK_ID_DECIMAL(69, 1, UNIT_KHZ),
693 TALK_ID_DECIMAL(90, 1, UNIT_KHZ),
694 TALK_ID_DECIMAL(117, 1, UNIT_KHZ)),
695 #endif /* HAVE_WM8978 */
696 #endif /* AUDIOHW_HAVE_EQ */
697 /* 3-d enhancement effect */
698 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
699 SOUND_SETTING(0,loudness, LANG_LOUDNESS, "loudness", SOUND_LOUDNESS),
700 STRINGCHOICE_SETTING(F_SOUNDSETTING,avc,LANG_AUTOVOL,0,"auto volume",
701 "off,20ms,2,4,8,", sound_set_avc, 5,
702 LANG_OFF,TALK_ID(20, UNIT_MS),TALK_ID(2, UNIT_SEC),
703 TALK_ID(4, UNIT_SEC),TALK_ID(8, UNIT_SEC)),
704 OFFON_SETTING(F_SOUNDSETTING, superbass, LANG_SUPERBASS, false, "superbass",
705 set_superbass),
706 #endif
708 CHOICE_SETTING(F_SOUNDSETTING, channel_config, LANG_CHANNEL_CONFIGURATION,
709 0,"channels",
710 "stereo,mono,custom,mono left,mono right,karaoke",
711 sound_set_channels, 6,
712 ID2P(LANG_CHANNEL_STEREO), ID2P(LANG_CHANNEL_MONO),
713 ID2P(LANG_CHANNEL_CUSTOM), ID2P(LANG_CHANNEL_LEFT),
714 ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE)),
715 SOUND_SETTING(F_SOUNDSETTING, stereo_width, LANG_STEREO_WIDTH,
716 "stereo_width", SOUND_STEREO_WIDTH),
717 #ifdef AUDIOHW_HAVE_DEPTH_3D
718 SOUND_SETTING(0,depth_3d, LANG_DEPTH_3D, "3-d enhancement",
719 SOUND_DEPTH_3D),
720 #endif
721 /* playback */
722 OFFON_SETTING(0, playlist_shuffle, LANG_SHUFFLE, false, "shuffle", NULL),
723 SYSTEM_SETTING(NVRAM(4), resume_index, -1),
724 SYSTEM_SETTING(NVRAM(4), resume_offset, -1),
725 CHOICE_SETTING(0, repeat_mode, LANG_REPEAT, REPEAT_OFF, "repeat",
726 "off,all,one,shuffle"
727 #ifdef AB_REPEAT_ENABLE
728 ",ab"
729 #endif
730 , NULL,
731 #ifdef AB_REPEAT_ENABLE
733 #else
735 #endif
736 ID2P(LANG_OFF), ID2P(LANG_ALL), ID2P(LANG_REPEAT_ONE),
737 ID2P(LANG_SHUFFLE)
738 #ifdef AB_REPEAT_ENABLE
739 ,ID2P(LANG_REPEAT_AB)
740 #endif
741 ), /* CHOICE_SETTING( repeat_mode ) */
742 /* LCD */
743 #ifdef HAVE_LCD_CONTRAST
744 /* its easier to leave this one un-macro()ed for the time being */
745 { F_T_INT|F_DEF_ISFUNC|F_INT_SETTING, &global_settings.contrast,
746 LANG_CONTRAST, FUNCTYPE(lcd_default_contrast), "contrast", NULL , {
747 .int_setting = (struct int_setting[]) {
748 { lcd_set_contrast, UNIT_INT, MIN_CONTRAST_SETTING,
749 MAX_CONTRAST_SETTING, 1, NULL, NULL }}}},
750 #endif
751 #ifdef HAVE_BACKLIGHT
752 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, backlight_timeout, LANG_BACKLIGHT,
753 DEFAULT_BACKLIGHT_TIMEOUT,
754 "backlight timeout", off_on, UNIT_SEC, backlight_formatter,
755 backlight_getlang, backlight_set_timeout, 20,
756 -1,0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,120),
757 #if CONFIG_CHARGING
758 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, backlight_timeout_plugged,
759 LANG_BACKLIGHT_ON_WHEN_CHARGING, 10,
760 "backlight timeout plugged", off_on, UNIT_SEC,
761 backlight_formatter, backlight_getlang,
762 backlight_set_timeout_plugged, 20,
763 -1,0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,120),
764 #endif
765 #endif /* HAVE_BACKLIGHT */
766 #ifdef HAVE_LCD_BITMAP
767 #ifdef HAVE_LCD_INVERT
768 BOOL_SETTING(0, invert, LANG_INVERT, false ,"invert", off_on,
769 LANG_INVERT_LCD_INVERSE, LANG_NORMAL, lcd_set_invert_display),
770 #endif
771 #ifdef HAVE_LCD_FLIP
772 OFFON_SETTING(0, flip_display, LANG_FLIP_DISPLAY, false, "flip display",
773 NULL),
774 #endif
775 /* display */
776 CHOICE_SETTING(F_TEMPVAR|F_THEMESETTING, cursor_style, LANG_INVERT_CURSOR,
777 #ifdef HAVE_LCD_COLOR
778 3, "selector type",
779 "pointer,bar (inverse),bar (color),bar (gradient)", NULL, 4,
780 ID2P(LANG_INVERT_CURSOR_POINTER),
781 ID2P(LANG_INVERT_CURSOR_BAR),
782 ID2P(LANG_INVERT_CURSOR_COLOR),
783 ID2P(LANG_INVERT_CURSOR_GRADIENT)),
784 #else
785 1, "selector type", "pointer,bar (inverse)", NULL, 2,
786 ID2P(LANG_INVERT_CURSOR_POINTER),
787 ID2P(LANG_INVERT_CURSOR_BAR)),
788 #endif
789 CHOICE_SETTING(F_THEMESETTING|F_TEMPVAR, statusbar,
790 LANG_STATUS_BAR, STATUSBAR_TOP, "statusbar","off,top,bottom",
791 NULL, 3, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
792 ID2P(LANG_STATUSBAR_BOTTOM)),
793 #ifdef HAVE_REMOTE_LCD
794 CHOICE_SETTING(F_THEMESETTING|F_TEMPVAR, remote_statusbar,
795 LANG_REMOTE_STATUSBAR, STATUSBAR_TOP, "remote statusbar","off,top,bottom",
796 NULL, 3, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
797 ID2P(LANG_STATUSBAR_BOTTOM)),
798 #endif
799 CHOICE_SETTING(F_THEMESETTING|F_TEMPVAR, scrollbar,
800 LANG_SCROLL_BAR, SCROLLBAR_LEFT, "scrollbar","off,left,right",
801 NULL, 3, ID2P(LANG_OFF), ID2P(LANG_LEFT), ID2P(LANG_RIGHT)),
802 INT_SETTING(F_THEMESETTING, scrollbar_width, LANG_SCROLLBAR_WIDTH, 6,
803 "scrollbar width",UNIT_INT, 3, MAX(LCD_WIDTH/10,25), 1,
804 NULL, NULL, NULL),
805 #ifdef HAVE_TOUCHSCREEN
806 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, list_line_padding, LANG_LIST_LINE_PADDING,
807 -1, "list padding", "auto,off", UNIT_PIXEL, list_pad_formatter,
808 list_pad_getlang, NULL, 16,
809 -1,0,2,4,6,8,10,12,16,20,24,28,32,38,44,50),
810 #endif
811 #if CONFIG_KEYPAD == RECORDER_PAD
812 OFFON_SETTING(F_THEMESETTING,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL),
813 #endif
814 CHOICE_SETTING(F_THEMESETTING, volume_type, LANG_VOLUME_DISPLAY, 0,
815 "volume display", graphic_numeric, NULL, 2,
816 ID2P(LANG_DISPLAY_GRAPHIC),
817 ID2P(LANG_DISPLAY_NUMERIC)),
818 CHOICE_SETTING(F_THEMESETTING, battery_display, LANG_BATTERY_DISPLAY, 0,
819 "battery display", graphic_numeric, NULL, 2,
820 ID2P(LANG_DISPLAY_GRAPHIC), ID2P(LANG_DISPLAY_NUMERIC)),
821 #if CONFIG_RTC
822 CHOICE_SETTING(0, timeformat, LANG_TIMEFORMAT, 0,
823 "time format", "24hour,12hour", NULL, 2,
824 ID2P(LANG_24_HOUR_CLOCK), ID2P(LANG_12_HOUR_CLOCK)),
825 #endif
826 #endif /* HAVE_LCD_BITMAP */
827 OFFON_SETTING(0,show_icons, LANG_SHOW_ICONS ,true,"show icons", NULL),
828 /* system */
829 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, poweroff, LANG_POWEROFF_IDLE, 10,
830 "idle poweroff", "off", UNIT_MIN, formatter_unit_0_is_off,
831 getlang_unit_0_is_off, set_poweroff_timeout, 15,
832 0,1,2,3,4,5,6,7,8,9,10,15,30,45,60),
833 SYSTEM_SETTING(NVRAM(4), runtime, 0),
834 SYSTEM_SETTING(NVRAM(4), topruntime, 0),
835 INT_SETTING(F_BANFROMQS, max_files_in_playlist,
836 LANG_MAX_FILES_IN_PLAYLIST,
837 #if MEMORYSIZE > 1
838 10000,
839 #else
840 400,
841 #endif
842 "max files in playlist", UNIT_INT, 1000, 32000, 1000,
843 NULL, NULL, NULL),
844 INT_SETTING(F_BANFROMQS, max_files_in_dir, LANG_MAX_FILES_IN_DIR,
845 #if MEMORYSIZE > 1
846 1000,
847 #else
848 200,
849 #endif
850 "max files in dir", UNIT_INT, 50, 10000, 50,
851 NULL, NULL, NULL),
852 /* use this setting for user code even if there's no exchangable battery
853 * support enabled */
854 #if BATTERY_CAPACITY_DEFAULT > 0
855 /* define min/max/inc for this file if there's only one battery */
856 #ifndef BATTERY_CAPACITY_MIN
857 #define BATTERY_CAPACITY_MIN BATTERY_CAPACITY_DEFAULT
858 #define BATTERY_CAPACITY_MAX BATTERY_CAPACITY_DEFAULT
859 #define BATTERY_CAPACITY_INC 0
860 #endif
861 #if defined(IPOD_VIDEO) && !defined(SIMULATOR)
862 /* its easier to leave this one un-macro()ed for the time being */
863 { F_T_INT|F_DEF_ISFUNC|F_INT_SETTING, &global_settings.battery_capacity,
864 LANG_BATTERY_CAPACITY, FUNCTYPE(battery_default_capacity),
865 "battery capacity", NULL , {
866 .int_setting = (struct int_setting[]) {
867 { set_battery_capacity, UNIT_MAH, BATTERY_CAPACITY_MIN,
868 BATTERY_CAPACITY_MAX, BATTERY_CAPACITY_INC, NULL, NULL }}}},
869 #else /* IPOD_VIDEO */
870 INT_SETTING(0, battery_capacity, LANG_BATTERY_CAPACITY,
871 BATTERY_CAPACITY_DEFAULT, "battery capacity", UNIT_MAH,
872 BATTERY_CAPACITY_MIN, BATTERY_CAPACITY_MAX,
873 BATTERY_CAPACITY_INC, NULL, NULL, set_battery_capacity),
874 #endif /* IPOD_VIDEO */
875 #endif
876 #if CONFIG_CHARGING
877 OFFON_SETTING(NVRAM(1), car_adapter_mode,
878 LANG_CAR_ADAPTER_MODE, false, "car adapter mode", NULL),
879 #endif
880 #ifdef IPOD_ACCESSORY_PROTOCOL
881 CHOICE_SETTING(0, serial_bitrate, LANG_SERIAL_BITRATE, 0, "serial bitrate",
882 "auto,9600,19200,38400,57600", iap_bitrate_set, 5, ID2P(LANG_SERIAL_BITRATE_AUTO),
883 ID2P(LANG_SERIAL_BITRATE_9600),ID2P(LANG_SERIAL_BITRATE_19200),
884 ID2P(LANG_SERIAL_BITRATE_38400),ID2P(LANG_SERIAL_BITRATE_57600)),
885 #endif
886 #ifdef HAVE_ACCESSORY_SUPPLY
887 OFFON_SETTING(0, accessory_supply, LANG_ACCESSORY_SUPPLY,
888 true, "accessory power supply", accessory_supply_set),
889 #endif
890 #ifdef HAVE_LINEOUT_POWEROFF
891 OFFON_SETTING(0, lineout_active, LANG_LINEOUT_ONOFF,
892 true, "lineout", lineout_set),
893 #endif
894 /* tuner */
895 #if CONFIG_TUNER
896 OFFON_SETTING(0,fm_force_mono, LANG_FM_MONO_MODE,
897 false, "force fm mono", toggle_mono_mode),
898 SYSTEM_SETTING(NVRAM(4),last_frequency,0),
899 #endif
901 #if BATTERY_TYPES_COUNT > 1
902 CHOICE_SETTING(0, battery_type, LANG_BATTERY_TYPE, 0, "battery type",
903 "alkaline,nimh", NULL, 2, ID2P(LANG_BATTERY_TYPE_ALKALINE),
904 ID2P(LANG_BATTERY_TYPE_NIMH)),
905 #endif
906 #ifdef HAVE_REMOTE_LCD
907 /* remote lcd */
908 INT_SETTING(0, remote_contrast, LANG_CONTRAST,
909 DEFAULT_REMOTE_CONTRAST_SETTING, "remote contrast", UNIT_INT,
910 MIN_REMOTE_CONTRAST_SETTING, MAX_REMOTE_CONTRAST_SETTING, 1,
911 NULL, NULL, lcd_remote_set_contrast),
912 BOOL_SETTING(0, remote_invert, LANG_INVERT, false ,"remote invert", off_on,
913 LANG_INVERT_LCD_INVERSE, LANG_NORMAL,
914 lcd_remote_set_invert_display),
915 OFFON_SETTING(0,remote_flip_display, LANG_FLIP_DISPLAY,
916 false,"remote flip display", NULL),
917 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, remote_backlight_timeout,
918 LANG_BACKLIGHT, 5, "remote backlight timeout", off_on,
919 UNIT_SEC, backlight_formatter, backlight_getlang,
920 remote_backlight_set_timeout, 20,
921 -1,0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,120),
922 #if CONFIG_CHARGING
923 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, remote_backlight_timeout_plugged,
924 LANG_BACKLIGHT_ON_WHEN_CHARGING, 10,
925 "remote backlight timeout plugged", off_on, UNIT_SEC,
926 backlight_formatter, backlight_getlang,
927 remote_backlight_set_timeout_plugged, 20,
928 -1,0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,120),
929 #endif
930 #ifdef HAVE_REMOTE_LCD_TICKING
931 OFFON_SETTING(0, remote_reduce_ticking, LANG_REDUCE_TICKING,
932 false,"remote reduce ticking", NULL),
933 #endif
934 #endif
936 #ifdef HAVE_BACKLIGHT
937 OFFON_SETTING(0, bl_filter_first_keypress,
938 LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
939 "backlight filters first keypress", NULL),
940 #ifdef HAVE_REMOTE_LCD
941 OFFON_SETTING(0, remote_bl_filter_first_keypress,
942 LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
943 "backlight filters first remote keypress", NULL),
944 #endif
945 #endif /* HAVE_BACKLIGHT */
947 /** End of old RTC config block **/
949 #ifdef HAVE_BACKLIGHT
950 OFFON_SETTING(0, caption_backlight, LANG_CAPTION_BACKLIGHT,
951 false, "caption backlight", NULL),
952 #ifdef HAVE_REMOTE_LCD
953 OFFON_SETTING(0, remote_caption_backlight, LANG_CAPTION_BACKLIGHT,
954 false, "remote caption backlight", NULL),
955 #endif
956 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
957 INT_SETTING(F_NO_WRAP, brightness, LANG_BRIGHTNESS,
958 DEFAULT_BRIGHTNESS_SETTING, "brightness",UNIT_INT,
959 MIN_BRIGHTNESS_SETTING, MAX_BRIGHTNESS_SETTING, 1,
960 NULL, NULL, backlight_set_brightness),
961 #endif
962 /* backlight fading */
963 #if defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
964 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, backlight_fade_in,
965 LANG_BACKLIGHT_FADE_IN, 300, "backlight fade in", "off",
966 UNIT_MS, formatter_unit_0_is_off, getlang_unit_0_is_off,
967 backlight_set_fade_in, 7, 0,100,200,300,500,1000,2000),
968 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, backlight_fade_out,
969 LANG_BACKLIGHT_FADE_OUT, 2000, "backlight fade out", "off",
970 UNIT_MS, formatter_unit_0_is_off, getlang_unit_0_is_off,
971 backlight_set_fade_out, 10,
972 0,100,200,300,500,1000,2000,3000,5000,10000),
973 #elif defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING)
974 OFFON_SETTING(0, backlight_fade_in, LANG_BACKLIGHT_FADE_IN,
975 true, "backlight fade in", backlight_set_fade_in),
976 OFFON_SETTING(0, backlight_fade_out, LANG_BACKLIGHT_FADE_OUT,
977 true, "backlight fade out", backlight_set_fade_out),
978 #endif
979 #endif /* HAVE_BACKLIGHT */
980 INT_SETTING(F_PADTITLE, scroll_speed, LANG_SCROLL_SPEED, 9,"scroll speed",
981 UNIT_INT, 0, 17, 1, NULL, NULL, lcd_scroll_speed),
982 INT_SETTING(F_PADTITLE, scroll_delay, LANG_SCROLL_DELAY, 1000,
983 "scroll delay", UNIT_MS, 0, 2500, 100, NULL,
984 NULL, lcd_scroll_delay),
985 INT_SETTING(0, bidir_limit, LANG_BIDIR_SCROLL, 50, "bidir limit",
986 UNIT_PERCENT, 0, 200, 25, NULL, NULL, lcd_bidir_scroll),
987 #ifdef HAVE_REMOTE_LCD
988 INT_SETTING(0, remote_scroll_speed, LANG_SCROLL_SPEED, 9,
989 "remote scroll speed", UNIT_INT, 0,17, 1,
990 NULL, NULL, lcd_remote_scroll_speed),
991 INT_SETTING(0, remote_scroll_step, LANG_SCROLL_STEP, 6,
992 "remote scroll step", UNIT_PIXEL, 1, LCD_REMOTE_WIDTH, 1, NULL,
993 NULL, lcd_remote_scroll_step),
994 INT_SETTING(0, remote_scroll_delay, LANG_SCROLL_DELAY, 1000,
995 "remote scroll delay", UNIT_MS, 0, 2500, 100, NULL, NULL,
996 lcd_remote_scroll_delay),
997 INT_SETTING(0, remote_bidir_limit, LANG_BIDIR_SCROLL, 50,
998 "remote bidir limit", UNIT_PERCENT, 0, 200, 25, NULL, NULL,
999 lcd_remote_bidir_scroll),
1000 #endif
1001 #ifdef HAVE_LCD_BITMAP
1002 OFFON_SETTING(0, offset_out_of_view, LANG_SCREEN_SCROLL_VIEW,
1003 false, "Screen Scrolls Out Of View",
1004 gui_list_screen_scroll_out_of_view),
1005 INT_SETTING(F_PADTITLE, scroll_step, LANG_SCROLL_STEP, 6, "scroll step",
1006 UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL, lcd_scroll_step),
1007 INT_SETTING(F_PADTITLE, screen_scroll_step, LANG_SCREEN_SCROLL_STEP, 16,
1008 "screen scroll step", UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL,
1009 gui_list_screen_scroll_step),
1010 #endif /* HAVE_LCD_BITMAP */
1011 OFFON_SETTING(0,scroll_paginated,LANG_SCROLL_PAGINATED,
1012 false,"scroll paginated",NULL),
1013 #ifdef HAVE_LCD_COLOR
1015 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.fg_color,-1,
1016 INT(DEFAULT_THEME_FOREGROUND),"foreground color",NULL,UNUSED},
1017 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.bg_color,-1,
1018 INT(DEFAULT_THEME_BACKGROUND),"background color",NULL,UNUSED},
1019 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.lss_color,-1,
1020 INT(DEFAULT_THEME_SELECTOR_START),"line selector start color",NULL,
1021 UNUSED},
1022 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.lse_color,-1,
1023 INT(DEFAULT_THEME_SELECTOR_END),"line selector end color",NULL,UNUSED},
1024 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.lst_color,-1,
1025 INT(DEFAULT_THEME_SELECTOR_TEXT),"line selector text color",NULL,
1026 UNUSED},
1028 #endif
1029 /* more playback */
1030 OFFON_SETTING(0,play_selected,LANG_PLAY_SELECTED,true,"play selected",NULL),
1031 OFFON_SETTING(0,party_mode,LANG_PARTY_MODE,false,"party mode",NULL),
1032 OFFON_SETTING(0,fade_on_stop,LANG_FADE_ON_STOP,true,"volume fade",NULL),
1033 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, ff_rewind_min_step,
1034 LANG_FFRW_STEP, 1, "scan min step", NULL, UNIT_SEC,
1035 NULL, NULL, NULL, 14, 1,2,3,4,5,6,8,10,15,20,25,30,45,60),
1036 CHOICE_SETTING(0, ff_rewind_accel, LANG_FFRW_ACCEL, 2,
1037 "seek acceleration", "very fast,fast,normal,slow,very slow", NULL, 5,
1038 ID2P(LANG_VERY_FAST), ID2P(LANG_FAST), ID2P(LANG_NORMAL),
1039 ID2P(LANG_SLOW) , ID2P(LANG_VERY_SLOW)),
1040 #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_DISK_STORAGE)
1041 STRINGCHOICE_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0,"antiskip",
1042 "5s,15s,30s,1min,2min,3min,5min,10min", NULL, 8,
1043 TALK_ID(5, UNIT_SEC), TALK_ID(15, UNIT_SEC),
1044 TALK_ID(30, UNIT_SEC), TALK_ID(1, UNIT_MIN),
1045 TALK_ID(2, UNIT_MIN), TALK_ID(3, UNIT_MIN),
1046 TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN)),
1047 #elif defined(HAVE_DISK_STORAGE)
1048 INT_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0, "antiskip",
1049 UNIT_SEC, 0, 7, 1, NULL, NULL, audio_set_buffer_margin),
1050 #endif
1051 /* disk */
1052 #ifdef HAVE_DISK_STORAGE
1053 INT_SETTING(0, disk_spindown, LANG_SPINDOWN, 5, "disk spindown",
1054 UNIT_SEC, 3, 254, 1, NULL, NULL, storage_spindown),
1055 #endif /* HAVE_DISK_STORAGE */
1056 /* browser */
1057 TEXT_SETTING(0, start_directory, "start directory", "/", NULL, NULL),
1058 CHOICE_SETTING(0, dirfilter, LANG_FILTER, SHOW_SUPPORTED, "show files",
1059 "all,supported,music,playlists", NULL, 4, ID2P(LANG_ALL),
1060 ID2P(LANG_FILTER_SUPPORTED), ID2P(LANG_FILTER_MUSIC),
1061 ID2P(LANG_PLAYLISTS)),
1062 /* file sorting */
1063 OFFON_SETTING(0, sort_case, LANG_SORT_CASE, false, "sort case", NULL),
1064 CHOICE_SETTING(0, sort_dir, LANG_SORT_DIR, 0 ,
1065 "sort dirs", "alpha,oldest,newest", NULL, 3,
1066 ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE),
1067 ID2P(LANG_SORT_DATE_REVERSE)),
1068 CHOICE_SETTING(0, sort_file, LANG_SORT_FILE, 0 ,
1069 "sort files", "alpha,oldest,newest,type", NULL, 4,
1070 ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE),
1071 ID2P(LANG_SORT_DATE_REVERSE) , ID2P(LANG_SORT_TYPE)),
1072 CHOICE_SETTING(0, interpret_numbers, LANG_SORT_INTERPRET_NUMBERS, 1,
1073 "sort interpret number", "digits,numbers",NULL, 2,
1074 ID2P(LANG_SORT_INTERPRET_AS_DIGIT),
1075 ID2P(LANG_SORT_INTERPRET_AS_NUMBERS)),
1076 CHOICE_SETTING(0, show_filename_ext, LANG_SHOW_FILENAME_EXT, 3,
1077 "show filename exts", "off,on,unknown,view_all", NULL , 4 ,
1078 ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_UNKNOWN_TYPES),
1079 ID2P(LANG_EXT_ONLY_VIEW_ALL)),
1080 OFFON_SETTING(0,browse_current,LANG_FOLLOW,false,"follow playlist",NULL),
1081 OFFON_SETTING(0,playlist_viewer_icons,LANG_SHOW_ICONS,true,
1082 "playlist viewer icons",NULL),
1083 OFFON_SETTING(0,playlist_viewer_indices,LANG_SHOW_INDICES,true,
1084 "playlist viewer indices",NULL),
1085 CHOICE_SETTING(0, playlist_viewer_track_display, LANG_TRACK_DISPLAY, 0,
1086 "playlist viewer track display","track name,full path",
1087 NULL, 2, ID2P(LANG_DISPLAY_TRACK_NAME_ONLY),
1088 ID2P(LANG_DISPLAY_FULL_PATH)),
1089 CHOICE_SETTING(0, recursive_dir_insert, LANG_RECURSE_DIRECTORY , RECURSE_ON,
1090 "recursive directory insert", off_on_ask, NULL , 3 ,
1091 ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_ASK)),
1092 /* bookmarks */
1093 CHOICE_SETTING(0, autocreatebookmark, LANG_BOOKMARK_SETTINGS_AUTOCREATE,
1094 BOOKMARK_NO, "autocreate bookmarks",
1095 "off,on,ask,recent only - on,recent only - ask", NULL, 5,
1096 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
1097 ID2P(LANG_ASK), ID2P(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES),
1098 ID2P(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK)),
1099 OFFON_SETTING(0, autoupdatebookmark, LANG_BOOKMARK_SETTINGS_AUTOUPDATE,
1100 false, "autoupdate bookmarks", NULL),
1101 CHOICE_SETTING(0, autoloadbookmark, LANG_BOOKMARK_SETTINGS_AUTOLOAD,
1102 BOOKMARK_NO, "autoload bookmarks", off_on_ask, NULL, 3,
1103 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
1104 ID2P(LANG_ASK)),
1105 CHOICE_SETTING(0, usemrb, LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS,
1106 BOOKMARK_NO, "use most-recent-bookmarks",
1107 "off,on,unique only", NULL, 3, ID2P(LANG_SET_BOOL_NO),
1108 ID2P(LANG_SET_BOOL_YES),
1109 ID2P(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY)),
1110 #ifdef HAVE_LCD_BITMAP
1111 /* peak meter */
1112 STRINGCHOICE_SETTING(0, peak_meter_clip_hold, LANG_PM_CLIP_HOLD, 16,
1113 "peak meter clip hold",
1114 "on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,2min"
1115 ",3min,5min,10min,20min,45min,90min",
1116 peak_meter_set_clip_hold, 25, LANG_PM_ETERNAL,
1117 TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC),
1118 TALK_ID(3, UNIT_SEC), TALK_ID(4, UNIT_SEC),
1119 TALK_ID(5, UNIT_SEC), TALK_ID(6, UNIT_SEC),
1120 TALK_ID(7, UNIT_SEC), TALK_ID(8, UNIT_SEC),
1121 TALK_ID(9, UNIT_SEC), TALK_ID(10, UNIT_SEC),
1122 TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC),
1123 TALK_ID(25, UNIT_SEC), TALK_ID(30, UNIT_SEC),
1124 TALK_ID(45, UNIT_SEC), TALK_ID(60, UNIT_SEC),
1125 TALK_ID(90, UNIT_SEC), TALK_ID(2, UNIT_MIN),
1126 TALK_ID(3, UNIT_MIN), TALK_ID(5, UNIT_MIN),
1127 TALK_ID(10, UNIT_MIN), TALK_ID(20, UNIT_MIN),
1128 TALK_ID(45, UNIT_MIN), TALK_ID(90, UNIT_MIN)),
1129 STRINGCHOICE_SETTING(0, peak_meter_hold, LANG_PM_PEAK_HOLD, 3,
1130 "peak meter hold",
1131 "off,200ms,300ms,500ms,1,2,3,4,5,6,7,8,9,10,15,20,30,1min",
1132 NULL, 18, LANG_OFF, TALK_ID(200, UNIT_MS),
1133 TALK_ID(300, UNIT_MS), TALK_ID(500, UNIT_MS),
1134 TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC),
1135 TALK_ID(3, UNIT_SEC), TALK_ID(4, UNIT_SEC),
1136 TALK_ID(5, UNIT_SEC), TALK_ID(6, UNIT_SEC),
1137 TALK_ID(7, UNIT_SEC), TALK_ID(8, UNIT_SEC),
1138 TALK_ID(9, UNIT_SEC), TALK_ID(10, UNIT_SEC),
1139 TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC),
1140 TALK_ID(30, UNIT_SEC), TALK_ID(60, UNIT_SEC)),
1141 INT_SETTING(0, peak_meter_release, LANG_PM_RELEASE, 8, "peak meter release",
1142 UNIT_PM_TICK, 1, 0x7e, 1, NULL, NULL,NULL),
1143 OFFON_SETTING(0,peak_meter_dbfs,LANG_PM_DBFS,true,"peak meter dbfs",NULL),
1144 {F_T_INT, &global_settings.peak_meter_min, LANG_PM_MIN,INT(60),
1145 "peak meter min", NULL, UNUSED},
1146 {F_T_INT, &global_settings.peak_meter_max, LANG_PM_MAX,INT(0),
1147 "peak meter max", NULL, UNUSED},
1148 #ifdef HAVE_RECORDING
1149 OFFON_SETTING(0, peak_meter_clipcounter, LANG_PM_CLIPCOUNTER, false,
1150 "peak meter clipcounter", NULL),
1151 #endif /* HAVE_RECORDING */
1152 #endif /* HAVE_LCD_BITMAP */
1153 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1154 SOUND_SETTING(F_SOUNDSETTING, mdb_strength, LANG_MDB_STRENGTH,
1155 "mdb strength", SOUND_MDB_STRENGTH),
1156 SOUND_SETTING(F_SOUNDSETTING, mdb_harmonics, LANG_MDB_HARMONICS,
1157 "mdb harmonics", SOUND_MDB_HARMONICS),
1158 SOUND_SETTING(F_SOUNDSETTING, mdb_center, LANG_MDB_CENTER,
1159 "mdb center", SOUND_MDB_CENTER),
1160 SOUND_SETTING(F_SOUNDSETTING, mdb_shape, LANG_MDB_SHAPE,
1161 "mdb shape", SOUND_MDB_SHAPE),
1162 OFFON_SETTING(F_SOUNDSETTING, mdb_enable, LANG_MDB_ENABLE,
1163 false, "mdb enable", set_mdb_enable),
1164 #endif
1165 #if CONFIG_CODEC == MAS3507D
1166 OFFON_SETTING(F_SOUNDSETTING, line_in,LANG_LINE_IN,false,"line in",NULL),
1167 #endif
1168 /* voice */
1169 OFFON_SETTING(F_TEMPVAR, talk_menu, LANG_VOICE_MENU, true, "talk menu", NULL),
1170 CHOICE_SETTING(0, talk_dir, LANG_VOICE_DIR, 0,
1171 "talk dir", off_number_spell, NULL, 3,
1172 ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
1173 ID2P(LANG_VOICE_SPELL)),
1174 OFFON_SETTING(F_TEMPVAR, talk_dir_clip, LANG_VOICE_DIR_TALK, false,
1175 "talk dir clip", NULL),
1176 CHOICE_SETTING(0, talk_file, LANG_VOICE_FILE, 0,
1177 "talk file", off_number_spell, NULL, 3,
1178 ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
1179 ID2P(LANG_VOICE_SPELL)),
1180 OFFON_SETTING(F_TEMPVAR, talk_file_clip, LANG_VOICE_FILE_TALK, false,
1181 "talk file clip", NULL),
1182 OFFON_SETTING(F_TEMPVAR, talk_filetype, LANG_VOICE_FILETYPE, false,
1183 "talk filetype", NULL),
1184 OFFON_SETTING(F_TEMPVAR, talk_battery_level, LANG_TALK_BATTERY_LEVEL, false,
1185 "Announce Battery Level", NULL),
1187 #ifdef HAVE_RECORDING
1188 /* recording */
1189 STRINGCHOICE_SETTING(F_RECSETTING, rec_timesplit, LANG_SPLIT_TIME, 0,
1190 "rec timesplit",
1191 "off,00:05,00:10,00:15,00:30,01:00,01:14,01:20,02:00,"
1192 "04:00,06:00,08:00,10:00,12:00,18:00,24:00",
1193 NULL, 16, LANG_OFF,
1194 TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN),
1195 TALK_ID(15, UNIT_MIN), TALK_ID(30, UNIT_MIN),
1196 TALK_ID(60, UNIT_MIN), TALK_ID(74, UNIT_MIN),
1197 TALK_ID(80, UNIT_MIN), TALK_ID(2, UNIT_HOUR),
1198 TALK_ID(4, UNIT_HOUR), TALK_ID(6, UNIT_HOUR),
1199 TALK_ID(8, UNIT_HOUR), TALK_ID(10, UNIT_HOUR),
1200 TALK_ID(12, UNIT_HOUR), TALK_ID(18, UNIT_HOUR),
1201 TALK_ID(20, UNIT_HOUR), TALK_ID(24, UNIT_HOUR)),
1202 STRINGCHOICE_SETTING(F_RECSETTING, rec_sizesplit, LANG_SPLIT_SIZE, 0,
1203 "rec sizesplit",
1204 "off,5MB,10MB,15MB,32MB,64MB,75MB,100MB,128MB,"
1205 "256MB,512MB,650MB,700MB,1GB,1.5GB,1.75GB",
1206 NULL, 16, LANG_OFF,
1207 TALK_ID(5, UNIT_MB), TALK_ID(10, UNIT_MB),
1208 TALK_ID(15, UNIT_MB), TALK_ID(32, UNIT_MB),
1209 TALK_ID(64, UNIT_MB), TALK_ID(75, UNIT_MB),
1210 TALK_ID(100, UNIT_MB), TALK_ID(128, UNIT_MB),
1211 TALK_ID(256, UNIT_MB), TALK_ID(512, UNIT_MB),
1212 TALK_ID(650, UNIT_MB), TALK_ID(700, UNIT_MB),
1213 TALK_ID(1024, UNIT_MB), TALK_ID(1536, UNIT_MB),
1214 TALK_ID(1792, UNIT_MB)),
1215 {F_T_INT|F_RECSETTING, &global_settings.rec_channels, LANG_CHANNELS, INT(0),
1216 "rec channels","stereo,mono",UNUSED},
1217 #if CONFIG_CODEC == SWCODEC
1218 {F_T_INT|F_RECSETTING, &global_settings.rec_mono_mode,
1219 LANG_RECORDING_MONO_MODE, INT(0), "rec mono mode","L+R,L,R",UNUSED},
1220 #endif
1221 CHOICE_SETTING(F_RECSETTING, rec_split_type, LANG_SPLIT_TYPE, 0,
1222 "rec split type", "Split,Stop,Shutdown", NULL, 3,
1223 ID2P(LANG_START_NEW_FILE), ID2P(LANG_STOP_RECORDING),ID2P(LANG_STOP_RECORDING_AND_SHUTDOWN)),
1224 CHOICE_SETTING(F_RECSETTING, rec_split_method, LANG_SPLIT_MEASURE, 0,
1225 "rec split method", "Time,Filesize", NULL, 2,
1226 ID2P(LANG_TIME), ID2P(LANG_FILESIZE)),
1227 {F_T_INT|F_RECSETTING, &global_settings.rec_source, LANG_RECORDING_SOURCE,
1228 INT(0), "rec source",
1229 &HAVE_MIC_REC_(",mic")
1230 HAVE_LINE_REC_(",line")
1231 HAVE_SPDIF_REC_(",spdif")
1232 HAVE_FMRADIO_REC_(",fmradio")[1],
1233 UNUSED},
1234 INT_SETTING(F_RECSETTING, rec_prerecord_time, LANG_RECORD_PRERECORD_TIME, 0,
1235 "prerecording time", UNIT_SEC, 0, 30, 1,
1236 formatter_unit_0_is_off, getlang_unit_0_is_off, NULL),
1238 TEXT_SETTING(F_RECSETTING, rec_directory, "rec path",
1239 REC_BASE_DIR, NULL, NULL),
1240 #ifdef HAVE_BACKLIGHT
1241 CHOICE_SETTING(F_RECSETTING, cliplight, LANG_CLIP_LIGHT, 0,
1242 "cliplight", "off,main,both,remote", NULL,
1243 #ifdef HAVE_REMOTE_LCD
1244 4, ID2P(LANG_OFF), ID2P(LANG_MAIN_UNIT),
1245 ID2P(LANG_REMOTE_MAIN), ID2P(LANG_REMOTE_UNIT)
1246 #else
1247 2, ID2P(LANG_OFF), ID2P(LANG_ON)
1248 #endif
1250 #endif
1251 #ifdef DEFAULT_REC_MIC_GAIN
1252 {F_T_INT|F_RECSETTING,&global_settings.rec_mic_gain,
1253 LANG_GAIN,INT(DEFAULT_REC_MIC_GAIN),
1254 "rec mic gain",NULL,UNUSED},
1255 #endif /* DEFAULT_REC_MIC_GAIN */
1256 #ifdef DEFAULT_REC_LEFT_GAIN
1257 {F_T_INT|F_RECSETTING,&global_settings.rec_left_gain,
1258 LANG_GAIN_LEFT,INT(DEFAULT_REC_LEFT_GAIN),
1259 "rec left gain",NULL,UNUSED},
1260 #endif /* DEFAULT_REC_LEFT_GAIN */
1261 #ifdef DEFAULT_REC_RIGHT_GAIN
1262 {F_T_INT|F_RECSETTING,&global_settings.rec_right_gain,LANG_GAIN_RIGHT,
1263 INT(DEFAULT_REC_RIGHT_GAIN),
1264 "rec right gain",NULL,UNUSED},
1265 #endif /* DEFAULT_REC_RIGHT_GAIN */
1266 #if CONFIG_CODEC == MAS3587F
1267 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency,
1268 LANG_RECORDING_FREQUENCY, INT(0),
1269 "rec frequency","44,48,32,22,24,16", UNUSED},
1270 INT_SETTING(F_RECSETTING, rec_quality, LANG_RECORDING_QUALITY, 5,
1271 "rec quality", UNIT_INT, 0, 7, 1, NULL, NULL, NULL),
1272 OFFON_SETTING(F_RECSETTING, rec_editable, LANG_RECORDING_EDITABLE, false,
1273 "editable recordings", NULL),
1274 #endif /* CONFIG_CODEC == MAS3587F */
1275 #if CONFIG_CODEC == SWCODEC
1276 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency,
1277 LANG_RECORDING_FREQUENCY,INT(REC_FREQ_DEFAULT),
1278 "rec frequency",REC_FREQ_CFG_VAL_LIST,UNUSED},
1279 {F_T_INT|F_RECSETTING,&global_settings.rec_format,
1280 LANG_RECORDING_FORMAT,INT(REC_FORMAT_DEFAULT),
1281 "rec format",REC_FORMAT_CFG_VAL_LIST,UNUSED},
1282 /** Encoder settings start - keep these together **/
1283 /* aiff_enc */
1284 /* (no settings yet) */
1285 /* mp3_enc */
1286 {F_T_INT|F_RECSETTING, &global_settings.mp3_enc_config.bitrate,-1,
1287 INT(MP3_ENC_BITRATE_CFG_DEFAULT),
1288 "mp3_enc bitrate",MP3_ENC_BITRATE_CFG_VALUE_LIST,UNUSED},
1289 /* wav_enc */
1290 /* (no settings yet) */
1291 /* wavpack_enc */
1292 /* (no settings yet) */
1293 /** Encoder settings end **/
1294 #endif /* CONFIG_CODEC == SWCODEC */
1295 /* values for the trigger */
1296 INT_SETTING(F_RECSETTING, rec_start_thres_db, LANG_RECORD_START_THRESHOLD, -35,
1297 "trigger start threshold dB", UNIT_DB, VOLUME_MIN/10, 0, 1, NULL, NULL, NULL),
1298 INT_SETTING(F_RECSETTING, rec_start_thres_linear, LANG_RECORD_START_THRESHOLD, 5,
1299 "trigger start threshold linear", UNIT_PERCENT, 0, 100, 1, NULL, NULL, NULL),
1300 INT_SETTING(F_RECSETTING, rec_stop_thres_db, LANG_RECORD_STOP_THRESHOLD, -45,
1301 "trigger stop threshold dB", UNIT_DB, VOLUME_MIN/10, 0, 1, NULL, NULL, NULL),
1302 INT_SETTING(F_RECSETTING, rec_stop_thres_linear, LANG_RECORD_STOP_THRESHOLD, 10,
1303 "trigger stop threshold linear", UNIT_PERCENT, 0, 100, 1, NULL, NULL, NULL),
1304 TABLE_SETTING(F_RECSETTING, rec_start_duration, LANG_MIN_DURATION, 0,
1305 "trigger start duration",
1306 "0s,1s,2s,5s,10s,15s,20s,25s,30s,1min,2min,5min,10min",
1307 UNIT_SEC, NULL, NULL, NULL, 13,
1308 0,1,2,5,10,15,20,25,30,60,120,300,600),
1309 TABLE_SETTING(F_RECSETTING, rec_stop_postrec, LANG_MIN_DURATION, 0,
1310 "trigger stop duration",
1311 "0s,1s,2s,5s,10s,15s,20s,25s,30s,1min,2min,5min,10min",
1312 UNIT_SEC, NULL, NULL, NULL, 13,
1313 0,1,2,5,10,15,20,25,30,60,120,300,600),
1314 TABLE_SETTING(F_RECSETTING, rec_stop_gap, LANG_RECORD_STOP_GAP, 1,
1315 "trigger min gap",
1316 "0s,1s,2s,5s,10s,15s,20s,25s,30s,1min,2min,5min,10min",
1317 UNIT_SEC, NULL, NULL, NULL, 13,
1318 0,1,2,5,10,15,20,25,30,60,120,300,600),
1319 CHOICE_SETTING(F_RECSETTING, rec_trigger_mode, LANG_RECORD_TRIGGER, TRIG_MODE_OFF,
1320 "trigger mode","off,once,repeat", NULL ,3,
1321 ID2P(LANG_OFF), ID2P(LANG_RECORD_TRIG_NOREARM), ID2P(LANG_REPEAT)),
1322 CHOICE_SETTING(F_RECSETTING, rec_trigger_type, LANG_RECORD_TRIGGER_TYPE, TRIG_TYPE_STOP,
1323 "trigger type","stop,pause,nf stp", NULL ,3,
1324 ID2P(LANG_RECORD_TRIGGER_STOP), ID2P(LANG_PAUSE), ID2P(LANG_RECORD_TRIGGER_NEWFILESTP)),
1325 #endif /* HAVE_RECORDING */
1327 #ifdef HAVE_HISTOGRAM
1328 /* TO DO: additional restictions of following REP items? */
1329 TABLE_SETTING(F_RECSETTING, histogram_interval, LANG_HISTOGRAM_INTERVAL, 0,
1330 "histogram interval","0s,1s,2s,4s",
1331 UNIT_SEC, NULL, NULL, NULL, 4, 0,1,2,4),
1332 #endif /* HAVE_HISTOGRAM */
1334 #ifdef HAVE_SPDIF_POWER
1335 OFFON_SETTING(F_SOUNDSETTING, spdif_enable, LANG_SPDIF_ENABLE, false,
1336 "spdif enable", spdif_power_enable),
1337 #endif
1338 CHOICE_SETTING(0, next_folder, LANG_NEXT_FOLDER, FOLDER_ADVANCE_OFF,
1339 "folder navigation", "off,on,random",NULL ,3,
1340 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
1341 ID2P(LANG_RANDOM)),
1342 BOOL_SETTING(0, constrain_next_folder, LANG_CONSTRAIN_NEXT_FOLDER, false,
1343 "constrain next folder", off_on,
1344 LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL),
1346 #ifdef HAVE_TAGCACHE
1347 #if CONFIG_CODEC == SWCODEC
1348 BOOL_SETTING(0, autoresume_enable, LANG_AUTORESUME, false,
1349 "autoresume enable", off_on,
1350 LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL),
1351 CHOICE_SETTING(0, autoresume_automatic, LANG_AUTORESUME_AUTOMATIC,
1352 AUTORESUME_NEXTTRACK_NEVER,
1353 "autoresume next track", "never,all,custom",
1354 NULL, 3,
1355 ID2P(LANG_SET_BOOL_NO),
1356 ID2P(LANG_ALWAYS),
1357 ID2P(LANG_AUTORESUME_CUSTOM)),
1358 TEXT_SETTING(0, autoresume_paths, "autoresume next track paths",
1359 "/podcast:/podcasts", NULL, NULL),
1360 #endif
1362 OFFON_SETTING(0, runtimedb, LANG_RUNTIMEDB_ACTIVE, false,
1363 "gather runtime data", NULL),
1364 TEXT_SETTING(0, tagcache_scan_paths, "database scan paths",
1365 DEFAULT_TAGCACHE_SCAN_PATHS, NULL, NULL),
1366 #endif
1368 #if CONFIG_CODEC == SWCODEC
1369 /* replay gain */
1370 CHOICE_SETTING(F_SOUNDSETTING, replaygain_settings.type,
1371 LANG_REPLAYGAIN_MODE, REPLAYGAIN_SHUFFLE, "replaygain type",
1372 "track,album,track shuffle,off", NULL, 4, ID2P(LANG_TRACK_GAIN),
1373 ID2P(LANG_ALBUM_GAIN), ID2P(LANG_SHUFFLE_GAIN), ID2P(LANG_OFF)),
1374 OFFON_SETTING(F_SOUNDSETTING, replaygain_settings.noclip,
1375 LANG_REPLAYGAIN_NOCLIP, false, "replaygain noclip", NULL),
1376 INT_SETTING_NOWRAP(F_SOUNDSETTING, replaygain_settings.preamp,
1377 LANG_REPLAYGAIN_PREAMP, 0, "replaygain preamp",
1378 UNIT_DB, -120, 120, 5, db_format, get_dec_talkid, NULL),
1380 CHOICE_SETTING(0, beep, LANG_BEEP, 0, "beep", "off,weak,moderate,strong",
1381 NULL, 4, ID2P(LANG_OFF), ID2P(LANG_WEAK),
1382 ID2P(LANG_MODERATE), ID2P(LANG_STRONG)),
1384 #ifdef HAVE_CROSSFADE
1385 /* crossfade */
1386 CHOICE_SETTING(F_SOUNDSETTING, crossfade, LANG_CROSSFADE_ENABLE, 0,
1387 "crossfade",
1388 "off,auto track change,man track skip,shuffle,shuffle or man track skip,always",
1389 NULL, 6, ID2P(LANG_OFF), ID2P(LANG_AUTOTRACKSKIP),
1390 ID2P(LANG_MANTRACKSKIP), ID2P(LANG_SHUFFLE),
1391 ID2P(LANG_SHUFFLE_TRACKSKIP), ID2P(LANG_ALWAYS)),
1392 INT_SETTING(F_SOUNDSETTING, crossfade_fade_in_delay,
1393 LANG_CROSSFADE_FADE_IN_DELAY, 0,
1394 "crossfade fade in delay", UNIT_SEC, 0, 7, 1, NULL, NULL, NULL),
1395 INT_SETTING(F_SOUNDSETTING, crossfade_fade_out_delay,
1396 LANG_CROSSFADE_FADE_OUT_DELAY, 0,
1397 "crossfade fade out delay", UNIT_SEC, 0, 7, 1, NULL, NULL,NULL),
1398 INT_SETTING(F_SOUNDSETTING, crossfade_fade_in_duration,
1399 LANG_CROSSFADE_FADE_IN_DURATION, 2,
1400 "crossfade fade in duration", UNIT_SEC, 0, 15, 1, NULL, NULL,
1401 NULL),
1402 INT_SETTING(F_SOUNDSETTING, crossfade_fade_out_duration,
1403 LANG_CROSSFADE_FADE_OUT_DURATION, 2,
1404 "crossfade fade out duration", UNIT_SEC, 0, 15, 1, NULL, NULL,
1405 NULL),
1406 CHOICE_SETTING(F_SOUNDSETTING, crossfade_fade_out_mixmode,
1407 LANG_CROSSFADE_FADE_OUT_MODE, 0,
1408 "crossfade fade out mode", "crossfade,mix", NULL, 2,
1409 ID2P(LANG_CROSSFADE), ID2P(LANG_MIX)),
1410 #endif
1412 /* crossfeed */
1413 CHOICE_SETTING(F_SOUNDSETTING, crossfeed, LANG_CROSSFEED, 0,"crossfeed",
1414 "off,meier,custom", dsp_set_crossfeed_type, 3,
1415 ID2P(LANG_OFF), ID2P(LANG_CROSSFEED_MEIER),
1416 ID2P(LANG_CROSSFEED_CUSTOM)),
1417 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_direct_gain,
1418 LANG_CROSSFEED_DIRECT_GAIN, -15,
1419 "crossfeed direct gain", UNIT_DB, -60, 0, 5,
1420 db_format, get_dec_talkid,dsp_set_crossfeed_direct_gain),
1421 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_cross_gain,
1422 LANG_CROSSFEED_CROSS_GAIN, -60,
1423 "crossfeed cross gain", UNIT_DB, -120, -30, 5,
1424 db_format, get_dec_talkid, crossfeed_cross_set),
1425 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_hf_attenuation,
1426 LANG_CROSSFEED_HF_ATTENUATION, -160,
1427 "crossfeed hf attenuation", UNIT_DB, -240, -60, 5,
1428 db_format, get_dec_talkid, crossfeed_cross_set),
1429 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_hf_cutoff,
1430 LANG_CROSSFEED_HF_CUTOFF, 700,
1431 "crossfeed hf cutoff", UNIT_HERTZ, 500, 2000, 100,
1432 NULL, NULL, crossfeed_cross_set),
1434 /* equalizer */
1435 OFFON_SETTING(F_EQSETTING, eq_enabled, LANG_EQUALIZER_ENABLED, false,
1436 "eq enabled", NULL),
1437 INT_SETTING_NOWRAP(F_EQSETTING, eq_precut, LANG_EQUALIZER_PRECUT, 0,
1438 "eq precut", UNIT_DB, 0, 240, 5, eq_precut_format,
1439 get_precut_talkid, dsp_set_eq_precut),
1440 /* 0..32768 Hz */
1441 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[0].cutoff, LANG_EQUALIZER_BAND_CUTOFF,
1442 60, "eq band 0 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1443 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
1444 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[1].cutoff, LANG_EQUALIZER_BAND_CENTER,
1445 200, "eq band 1 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1446 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
1447 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[2].cutoff, LANG_EQUALIZER_BAND_CENTER,
1448 800, "eq band 2 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1449 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
1450 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[3].cutoff, LANG_EQUALIZER_BAND_CENTER,
1451 4000, "eq band 3 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1452 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
1453 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[4].cutoff, LANG_EQUALIZER_BAND_CUTOFF,
1454 12000, "eq band 4 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1455 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
1456 /* 0..64 (or 0.0 to 6.4) */
1457 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[0].q, LANG_EQUALIZER_BAND_Q, 7,
1458 "eq band 0 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1459 eq_q_format, get_dec_talkid, NULL),
1460 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[1].q, LANG_EQUALIZER_BAND_Q, 10,
1461 "eq band 1 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1462 eq_q_format, get_dec_talkid, NULL),
1463 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[2].q, LANG_EQUALIZER_BAND_Q, 10,
1464 "eq band 2 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1465 eq_q_format, get_dec_talkid, NULL),
1466 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[3].q, LANG_EQUALIZER_BAND_Q, 10,
1467 "eq band 3 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1468 eq_q_format, get_dec_talkid, NULL),
1469 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[4].q, LANG_EQUALIZER_BAND_Q, 7,
1470 "eq band 4 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1471 eq_q_format, get_dec_talkid, NULL),
1472 /* -240..240 (or -24db to +24db) */
1473 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[0].gain, LANG_GAIN, 0,
1474 "eq band 0 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX,
1475 EQ_GAIN_STEP, db_format, get_dec_talkid, NULL),
1476 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[1].gain, LANG_GAIN, 0,
1477 "eq band 1 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX,
1478 EQ_GAIN_STEP, db_format, get_dec_talkid, NULL),
1479 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[2].gain, LANG_GAIN, 0,
1480 "eq band 2 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX,
1481 EQ_GAIN_STEP, db_format, get_dec_talkid, NULL),
1482 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[3].gain, LANG_GAIN, 0,
1483 "eq band 3 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX,
1484 EQ_GAIN_STEP, db_format, get_dec_talkid, NULL),
1485 INT_SETTING_NOWRAP(F_EQSETTING, eq_band_settings[4].gain, LANG_GAIN, 0,
1486 "eq band 4 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX,
1487 EQ_GAIN_STEP, db_format, get_dec_talkid, NULL),
1489 /* dithering */
1490 OFFON_SETTING(F_SOUNDSETTING, dithering_enabled, LANG_DITHERING, false,
1491 "dithering enabled", dsp_dither_enable),
1493 #ifdef HAVE_PITCHCONTROL
1494 /* timestretch */
1495 OFFON_SETTING(F_SOUNDSETTING, timestretch_enabled, LANG_TIMESTRETCH, false,
1496 "timestretch enabled", dsp_timestretch_enable),
1497 #endif
1499 /* compressor */
1500 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_settings.threshold,
1501 LANG_COMPRESSOR_THRESHOLD, 0,
1502 "compressor threshold", UNIT_DB, 0, -24,
1503 -3, formatter_unit_0_is_off, getlang_unit_0_is_off,
1504 compressor_set),
1505 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_settings.makeup_gain,
1506 LANG_COMPRESSOR_GAIN, 1, "compressor makeup gain",
1507 "off,auto", compressor_set, 2,
1508 ID2P(LANG_OFF), ID2P(LANG_AUTO)),
1509 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_settings.ratio,
1510 LANG_COMPRESSOR_RATIO, 1, "compressor ratio",
1511 "2:1,4:1,6:1,10:1,limit", compressor_set, 5,
1512 ID2P(LANG_COMPRESSOR_RATIO_2), ID2P(LANG_COMPRESSOR_RATIO_4),
1513 ID2P(LANG_COMPRESSOR_RATIO_6), ID2P(LANG_COMPRESSOR_RATIO_10),
1514 ID2P(LANG_COMPRESSOR_RATIO_LIMIT)),
1515 CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_settings.knee,
1516 LANG_COMPRESSOR_KNEE, 1, "compressor knee",
1517 "hard knee,soft knee", compressor_set, 2,
1518 ID2P(LANG_COMPRESSOR_HARD_KNEE), ID2P(LANG_COMPRESSOR_SOFT_KNEE)),
1519 INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_settings.release_time,
1520 LANG_COMPRESSOR_RELEASE, 500,
1521 "compressor release time", UNIT_MS, 100, 1000,
1522 100, NULL, NULL, compressor_set),
1523 #endif
1524 #ifdef AUDIOHW_HAVE_BASS_CUTOFF
1525 SOUND_SETTING(F_NO_WRAP, bass_cutoff, LANG_BASS_CUTOFF,
1526 "bass cutoff", SOUND_BASS_CUTOFF),
1527 #endif
1528 #ifdef AUDIOHW_HAVE_TREBLE_CUTOFF
1529 SOUND_SETTING(F_NO_WRAP, treble_cutoff, LANG_TREBLE_CUTOFF,
1530 "treble cutoff", SOUND_TREBLE_CUTOFF),
1531 #endif
1532 #ifdef HAVE_DIRCACHE
1533 /*enable dircache for all targets > 2MB of RAM by default*/
1534 OFFON_SETTING(F_BANFROMQS,dircache,LANG_DIRCACHE_ENABLE,true,"dircache",NULL),
1535 SYSTEM_SETTING(NVRAM(4),dircache_size,0),
1536 #endif
1538 #ifdef HAVE_TAGCACHE
1539 #ifdef HAVE_TC_RAMCACHE
1540 OFFON_SETTING(F_BANFROMQS,tagcache_ram,LANG_TAGCACHE_RAM,false,"tagcache_ram",NULL),
1541 #endif
1542 OFFON_SETTING(F_BANFROMQS, tagcache_autoupdate, LANG_TAGCACHE_AUTOUPDATE, false,
1543 "tagcache_autoupdate", NULL),
1544 #endif
1545 CHOICE_SETTING(0, default_codepage, LANG_DEFAULT_CODEPAGE, 0,
1546 "default codepage",
1547 #ifdef HAVE_LCD_BITMAP
1548 /* The order must match with that in unicode.c */
1549 "iso8859-1,iso8859-7,iso8859-8,cp1251,iso8859-11,cp1256,"
1550 "iso8859-9,iso8859-2,cp1250,cp1252,sjis,gb2312,ksx1001,big5,utf-8",
1551 set_codepage, 14,
1552 ID2P(LANG_CODEPAGE_LATIN1),
1553 ID2P(LANG_CODEPAGE_GREEK),
1554 ID2P(LANG_CODEPAGE_HEBREW), ID2P(LANG_CODEPAGE_CYRILLIC),
1555 ID2P(LANG_CODEPAGE_THAI), ID2P(LANG_CODEPAGE_ARABIC),
1556 ID2P(LANG_CODEPAGE_TURKISH),
1557 ID2P(LANG_CODEPAGE_LATIN_EXTENDED),
1558 ID2P(LANG_CODEPAGE_CENTRAL_EUROPEAN),
1559 ID2P(LANG_CODEPAGE_WESTERN_EUROPEAN),
1560 ID2P(LANG_CODEPAGE_JAPANESE),
1561 ID2P(LANG_CODEPAGE_SIMPLIFIED), ID2P(LANG_CODEPAGE_KOREAN),
1562 ID2P(LANG_CODEPAGE_TRADITIONAL), ID2P(LANG_CODEPAGE_UTF8)),
1563 #else /* !HAVE_LCD_BITMAP */
1564 /* The order must match with that in unicode.c */
1565 "iso8859-1,iso8859-7,cp1251,iso8859-9,iso8859-2,cp1250,cp1252,utf-8",
1566 set_codepage, 7,
1567 ID2P(LANG_CODEPAGE_LATIN1), ID2P(LANG_CODEPAGE_GREEK),
1568 ID2P(LANG_CODEPAGE_CYRILLIC), ID2P(LANG_CODEPAGE_TURKISH),
1569 ID2P(LANG_CODEPAGE_LATIN_EXTENDED),
1570 ID2P(LANG_CODEPAGE_CENTRAL_EUROPEAN),
1571 ID2P(LANG_CODEPAGE_WESTERN_EUROPEAN),
1572 ID2P(LANG_CODEPAGE_UTF8)),
1573 #endif
1574 OFFON_SETTING(0, warnon_erase_dynplaylist, LANG_WARN_ERASEDYNPLAYLIST_MENU,
1575 true, "warn when erasing dynamic playlist",NULL),
1577 #ifdef HAVE_BACKLIGHT
1578 #ifdef HAS_BUTTON_HOLD
1579 CHOICE_SETTING(0, backlight_on_button_hold, LANG_BACKLIGHT_ON_BUTTON_HOLD,
1580 1, "backlight on button hold", "normal,off,on",
1581 backlight_set_on_button_hold, 3,
1582 ID2P(LANG_NORMAL), ID2P(LANG_OFF), ID2P(LANG_ON)),
1583 #endif
1585 #ifdef HAVE_LCD_SLEEP_SETTING
1586 STRINGCHOICE_SETTING(0, lcd_sleep_after_backlight_off,
1587 LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF, 3,
1588 "lcd sleep after backlight off",
1589 "always,never,5,10,15,20,30,45,60,90",
1590 lcd_set_sleep_after_backlight_off, 10,
1591 LANG_ALWAYS, LANG_NEVER, TALK_ID(5, UNIT_SEC),
1592 TALK_ID(10, UNIT_SEC), TALK_ID(15, UNIT_SEC),
1593 TALK_ID(20, UNIT_SEC), TALK_ID(30, UNIT_SEC),
1594 TALK_ID(45, UNIT_SEC),TALK_ID(60, UNIT_SEC),
1595 TALK_ID(90, UNIT_SEC)),
1596 #endif /* HAVE_LCD_SLEEP_SETTING */
1597 #endif /* HAVE_BACKLIGHT */
1599 OFFON_SETTING(0, hold_lr_for_scroll_in_list, -1, true,
1600 "hold_lr_for_scroll_in_list",NULL),
1601 #ifdef HAVE_LCD_BITMAP
1602 CHOICE_SETTING(0, show_path_in_browser, LANG_SHOW_PATH, SHOW_PATH_CURRENT,
1603 "show path in browser", "off,current directory,full path",
1604 NULL, 3, ID2P(LANG_OFF), ID2P(LANG_SHOW_PATH_CURRENT),
1605 ID2P(LANG_DISPLAY_FULL_PATH)),
1606 #endif
1608 #ifdef HAVE_AGC
1609 {F_T_INT,&global_settings.rec_agc_preset_mic,LANG_RECORDING_AGC_PRESET,
1610 INT(1),"agc mic preset",NULL,UNUSED},
1611 {F_T_INT,&global_settings.rec_agc_preset_line,LANG_RECORDING_AGC_PRESET,
1612 INT(1),"agc line preset",NULL,UNUSED},
1613 {F_T_INT,&global_settings.rec_agc_maxgain_mic,-1,INT(104),
1614 "agc maximum mic gain",NULL,UNUSED},
1615 {F_T_INT,&global_settings.rec_agc_maxgain_line,-1,INT(96),
1616 "agc maximum line gain",NULL,UNUSED},
1617 {F_T_INT,&global_settings.rec_agc_cliptime,LANG_RECORDING_AGC_CLIPTIME,
1618 INT(1),"agc cliptime","0.2s,0.4s,0.6s,0.8,1s",UNUSED},
1619 #endif
1621 #ifdef HAVE_REMOTE_LCD
1622 #ifdef HAS_REMOTE_BUTTON_HOLD
1623 CHOICE_SETTING(0, remote_backlight_on_button_hold,
1624 LANG_BACKLIGHT_ON_BUTTON_HOLD, 0,
1625 "remote backlight on button hold",
1626 "normal,off,on", remote_backlight_set_on_button_hold, 3,
1627 ID2P(LANG_NORMAL), ID2P(LANG_OFF), ID2P(LANG_ON)),
1628 #endif
1629 #endif
1630 #ifdef HAVE_HEADPHONE_DETECTION
1631 CHOICE_SETTING(0, unplug_mode, LANG_HEADPHONE_UNPLUG, 0,
1632 "pause on headphone unplug", "off,pause,pause and resume",
1633 NULL, 3, ID2P(LANG_OFF), ID2P(LANG_PAUSE),
1634 ID2P(LANG_HEADPHONE_UNPLUG_RESUME)),
1635 OFFON_SETTING(0, unplug_autoresume,
1636 LANG_HEADPHONE_UNPLUG_DISABLE_AUTORESUME, false,
1637 "disable autoresume if phones not present",NULL),
1638 #endif
1639 INT_SETTING(0, pause_rewind, LANG_PAUSE_REWIND, 0,
1640 "rewind duration on pause", UNIT_SEC, 0, 15, 1, NULL, NULL,
1641 NULL),
1642 #if CONFIG_TUNER
1643 CHOICE_SETTING(0, fm_region, LANG_FM_REGION, 0,
1644 "fm_region", "eu,us,jp,kr,it,wo", set_radio_region, 6,
1645 ID2P(LANG_FM_EUROPE), ID2P(LANG_FM_US),
1646 ID2P(LANG_FM_JAPAN), ID2P(LANG_FM_KOREA),
1647 ID2P(LANG_FM_ITALY), ID2P(LANG_FM_OTHER)),
1648 #endif
1650 OFFON_SETTING(F_BANFROMQS, audioscrobbler, LANG_AUDIOSCROBBLER, false,
1651 "Last.fm Logging", NULL),
1652 #if CONFIG_TUNER
1653 TEXT_SETTING(0, fmr_file, "fmr", "-",
1654 FMPRESET_PATH "/", ".fmr"),
1655 TEXT_SETTING(F_THEMESETTING,fms_file, "fms",
1656 DEFAULT_FMS_NAME, SBS_DIR "/", ".fms"),
1657 #ifdef HAVE_REMOTE_LCD
1658 TEXT_SETTING(F_THEMESETTING,rfms_file, "rfms",
1659 DEFAULT_FMS_NAME, SBS_DIR "/", ".rfms"),
1660 #endif
1661 #endif /* CONFIG_TUNER */
1662 #ifdef HAVE_LCD_BITMAP
1663 TEXT_SETTING(F_THEMESETTING, font_file, "font",
1664 DEFAULT_FONTNAME, FONT_DIR "/", ".fnt"),
1665 INT_SETTING(0, glyphs_to_cache, LANG_GLYPHS, DEFAULT_GLYPHS,
1666 "glyphs", UNIT_INT, MIN_GLYPHS, MAX_GLYPHS, 10,
1667 NULL, NULL, NULL),
1668 #endif
1669 #ifdef HAVE_REMOTE_LCD
1670 TEXT_SETTING(F_THEMESETTING, remote_font_file, "remote font",
1671 DEFAULT_REMOTE_FONTNAME, FONT_DIR "/", ".fnt"),
1672 #endif
1673 TEXT_SETTING(F_THEMESETTING,wps_file, "wps",
1674 DEFAULT_WPSNAME, WPS_DIR "/", ".wps"),
1675 #ifdef HAVE_LCD_BITMAP
1676 TEXT_SETTING(F_THEMESETTING,sbs_file, "sbs",
1677 DEFAULT_SBSNAME, SBS_DIR "/", ".sbs"),
1678 #endif
1679 #ifdef HAVE_REMOTE_LCD
1680 TEXT_SETTING(F_THEMESETTING,rwps_file,"rwps",
1681 DEFAULT_WPSNAME, WPS_DIR "/", ".rwps"),
1682 TEXT_SETTING(F_THEMESETTING,rsbs_file, "rsbs",
1683 DEFAULT_SBSNAME, SBS_DIR "/", ".rsbs"),
1684 #endif
1685 TEXT_SETTING(0,lang_file,"lang","",LANG_DIR "/",".lng"),
1686 #if LCD_DEPTH > 1
1687 TEXT_SETTING(F_THEMESETTING,backdrop_file,"backdrop",
1688 DEFAULT_BACKDROP, NULL, NULL),
1689 #endif
1690 #ifdef HAVE_LCD_BITMAP
1691 TEXT_SETTING(0,kbd_file,"kbd","-",ROCKBOX_DIR "/",".kbd"),
1692 #endif
1693 #ifdef HAVE_USB_CHARGING_ENABLE
1694 CHOICE_SETTING(0, usb_charging, LANG_USB_CHARGING, 1, "usb charging",
1695 "off,on,force", NULL, 3, ID2P(LANG_SET_BOOL_NO),
1696 ID2P(LANG_SET_BOOL_YES), ID2P(LANG_FORCE)),
1697 #endif
1698 OFFON_SETTING(F_BANFROMQS,cuesheet,LANG_CUESHEET_ENABLE,false,"cuesheet support",
1699 NULL),
1700 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, skip_length,
1701 LANG_SKIP_LENGTH, 0, "skip length",
1702 "outro,track,1s,2s,3s,5s,7s,10s,15s,20s,30s,45s,1min,90s,2min,3min,5min,10min,15min",
1703 UNIT_SEC, formatter_unit_0_is_skip_track,
1704 getlang_unit_0_is_skip_track, NULL,
1705 19, -1,0,1,2,3,5,7,10,15,20,30,45,60,90,120,180,300,600,900),
1706 CHOICE_SETTING(0, start_in_screen, LANG_START_SCREEN, 1,
1707 "start in screen", "previous,root,files,"
1708 #ifdef HAVE_TAGCACHE
1709 #define START_DB_COUNT 1
1710 "db,"
1711 #else
1712 #define START_DB_COUNT 0
1713 #endif
1714 "wps,menu,"
1715 #ifdef HAVE_RECORDING
1716 #define START_REC_COUNT 1
1717 "recording,"
1718 #else
1719 #define START_REC_COUNT 0
1720 #endif
1721 #if CONFIG_TUNER
1722 #define START_TUNER_COUNT 1
1723 "radio,"
1724 #else
1725 #define START_TUNER_COUNT 0
1726 #endif
1727 "bookmarks"
1728 #ifdef HAVE_PICTUREFLOW_INTEGRATION
1729 #define START_PF_COUNT 1
1730 ",pictureflow"
1731 #else
1732 #define START_PF_COUNT 0
1733 #endif
1734 , NULL,
1735 (6 + START_DB_COUNT + START_REC_COUNT + START_TUNER_COUNT + START_PF_COUNT),
1736 ID2P(LANG_PREVIOUS_SCREEN), ID2P(LANG_MAIN_MENU),
1737 ID2P(LANG_DIR_BROWSER),
1738 #ifdef HAVE_TAGCACHE
1739 ID2P(LANG_TAGCACHE),
1740 #endif
1741 ID2P(LANG_RESUME_PLAYBACK), ID2P(LANG_SETTINGS),
1742 #ifdef HAVE_RECORDING
1743 ID2P(LANG_RECORDING),
1744 #endif
1745 #if CONFIG_TUNER
1746 ID2P(LANG_FM_RADIO),
1747 #endif
1748 ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS)
1749 #ifdef HAVE_PICTUREFLOW_INTEGRATION
1750 ,ID2P(LANG_ONPLAY_PICTUREFLOW)
1751 #endif
1753 SYSTEM_SETTING(NVRAM(1),last_screen,-1),
1754 #if defined(HAVE_RTC_ALARM) && \
1755 (defined(HAVE_RECORDING) || CONFIG_TUNER)
1756 {F_T_INT, &global_settings.alarm_wake_up_screen, LANG_ALARM_WAKEUP_SCREEN,
1757 INT(ALARM_START_WPS), "alarm wakeup screen", ALARM_SETTING_TEXT,UNUSED},
1758 #endif /* HAVE_RTC_ALARM */
1760 /* Customizable icons */
1761 #ifdef HAVE_LCD_BITMAP
1762 TEXT_SETTING(F_THEMESETTING, icon_file, "iconset", DEFAULT_ICONSET,
1763 ICON_DIR "/", ".bmp"),
1764 TEXT_SETTING(F_THEMESETTING, viewers_icon_file, "viewers iconset",
1765 DEFAULT_VIEWERS_ICONSET,
1766 ICON_DIR "/", ".bmp"),
1767 #endif
1768 #ifdef HAVE_REMOTE_LCD
1769 TEXT_SETTING(F_THEMESETTING, remote_icon_file, "remote iconset", "-",
1770 ICON_DIR "/", ".bmp"),
1771 TEXT_SETTING(F_THEMESETTING, remote_viewers_icon_file,
1772 "remote viewers iconset", "-",
1773 ICON_DIR "/", ".bmp"),
1774 #endif /* HAVE_REMOTE_LCD */
1775 #ifdef HAVE_LCD_COLOR
1776 TEXT_SETTING(F_THEMESETTING, colors_file, "filetype colours", "-",
1777 THEME_DIR "/", ".colours"),
1778 #endif
1779 #ifdef HAVE_BUTTON_LIGHT
1780 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, buttonlight_timeout,
1781 LANG_BUTTONLIGHT_TIMEOUT, 5, "button light timeout", off_on,
1782 UNIT_SEC, backlight_formatter, backlight_getlang,
1783 buttonlight_set_timeout, 20,
1784 -1,0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,120),
1785 #endif
1786 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
1787 INT_SETTING(F_NO_WRAP, buttonlight_brightness, LANG_BUTTONLIGHT_BRIGHTNESS,
1788 DEFAULT_BRIGHTNESS_SETTING,
1789 "button light brightness",UNIT_INT, MIN_BRIGHTNESS_SETTING,
1790 MAX_BRIGHTNESS_SETTING, 1, NULL, NULL,
1791 buttonlight_set_brightness),
1792 #endif
1793 #ifndef HAVE_WHEEL_ACCELERATION
1794 INT_SETTING(0, list_accel_start_delay, LANG_LISTACCEL_START_DELAY,
1795 2, "list_accel_start_delay", UNIT_SEC, 0, 10, 1,
1796 formatter_unit_0_is_off, getlang_unit_0_is_off, NULL),
1797 INT_SETTING(0, list_accel_wait, LANG_LISTACCEL_ACCEL_SPEED,
1798 3, "list_accel_wait", UNIT_SEC, 1, 10, 1,
1799 scanaccel_formatter, getlang_unit_0_is_off, NULL),
1800 #endif /* HAVE_WHEEL_ACCELERATION */
1801 #if CONFIG_CODEC == SWCODEC
1802 /* keyclick */
1803 #ifdef HAVE_HARDWARE_CLICK
1804 CHOICE_SETTING(0, keyclick, LANG_KEYCLICK_SOFTWARE, 0,
1805 "keyclick", "off,weak,moderate,strong", NULL, 4,
1806 ID2P(LANG_OFF), ID2P(LANG_WEAK), ID2P(LANG_MODERATE),
1807 ID2P(LANG_STRONG)),
1808 OFFON_SETTING(0, keyclick_repeats, LANG_KEYCLICK_REPEATS, false,
1809 "keyclick repeats", NULL),
1810 OFFON_SETTING(0, keyclick_hardware, LANG_KEYCLICK_HARDWARE, false,
1811 "hardware keyclick", NULL),
1812 #else
1813 CHOICE_SETTING(0, keyclick, LANG_KEYCLICK, 0,
1814 "keyclick", "off,weak,moderate,strong", NULL, 4,
1815 ID2P(LANG_OFF), ID2P(LANG_WEAK), ID2P(LANG_MODERATE),
1816 ID2P(LANG_STRONG)),
1817 OFFON_SETTING(0, keyclick_repeats, LANG_KEYCLICK_REPEATS, false,
1818 "keyclick repeats", NULL),
1819 #endif
1820 #endif /* CONFIG_CODEC == SWCODEC */
1821 TEXT_SETTING(0, playlist_catalog_dir, "playlist catalog directory",
1822 PLAYLIST_CATALOG_DEFAULT_DIR, NULL, NULL),
1823 INT_SETTING(0, sleeptimer_duration, LANG_SLEEP_TIMER_DURATION, 30,
1824 "sleeptimer duration",
1825 UNIT_MIN, 5, 300, 5, NULL, NULL, NULL),
1826 OFFON_SETTING(0, sleeptimer_on_startup, LANG_SLEEP_TIMER_ON_POWER_UP, false,
1827 "sleeptimer on startup", NULL),
1828 OFFON_SETTING(0, keypress_restarts_sleeptimer, LANG_KEYPRESS_RESTARTS_SLEEP_TIMER, false,
1829 "keypress restarts sleeptimer", set_keypress_restarts_sleep_timer),
1830 #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
1831 CHOICE_SETTING(0, touchpad_sensitivity, LANG_TOUCHPAD_SENSITIVITY, 0,
1832 "touchpad sensitivity", "normal,high", touchpad_set_sensitivity, 2,
1833 ID2P(LANG_NORMAL), ID2P(LANG_HIGH)),
1834 #endif
1835 #ifdef HAVE_QUICKSCREEN
1836 CUSTOM_SETTING(0, qs_items[QUICKSCREEN_TOP], LANG_TOP_QS_ITEM,
1837 NULL, "qs top",
1838 qs_load_from_cfg, qs_write_to_cfg,
1839 qs_is_changed, qs_set_default),
1840 CUSTOM_SETTING(0, qs_items[QUICKSCREEN_LEFT], LANG_LEFT_QS_ITEM,
1841 &global_settings.playlist_shuffle, "qs left",
1842 qs_load_from_cfg, qs_write_to_cfg,
1843 qs_is_changed, qs_set_default),
1844 CUSTOM_SETTING(0, qs_items[QUICKSCREEN_RIGHT], LANG_RIGHT_QS_ITEM,
1845 &global_settings.repeat_mode, "qs right",
1846 qs_load_from_cfg, qs_write_to_cfg,
1847 qs_is_changed, qs_set_default),
1848 CUSTOM_SETTING(0, qs_items[QUICKSCREEN_BOTTOM], LANG_BOTTOM_QS_ITEM,
1849 NULL, "qs bottom",
1850 qs_load_from_cfg, qs_write_to_cfg,
1851 qs_is_changed, qs_set_default),
1852 OFFON_SETTING(0, shortcuts_replaces_qs, LANG_USE_SHORTCUTS_INSTEAD_OF_QS,
1853 false, "shortcuts instead of quickscreen", NULL),
1854 #endif
1855 #ifdef HAVE_SPEAKER
1856 OFFON_SETTING(0, speaker_enabled, LANG_ENABLE_SPEAKER, false, "speaker",
1857 audiohw_enable_speaker),
1858 #endif
1859 #ifdef HAVE_TOUCHSCREEN
1860 CHOICE_SETTING(0, touch_mode, LANG_TOUCHSCREEN_MODE, DEFAULT_TOUCHSCREEN_MODE,
1861 "touchscreen mode", "point,grid", NULL, 2,
1862 ID2P(LANG_TOUCHSCREEN_POINT), ID2P(LANG_TOUCHSCREEN_GRID)),
1863 CUSTOM_SETTING(0, ts_calibration_data, -1,
1864 &default_calibration_parameters, "touchscreen calibration",
1865 tsc_load_from_cfg, tsc_write_to_cfg,
1866 tsc_is_changed, tsc_set_default),
1867 #endif
1868 OFFON_SETTING(0, prevent_skip, LANG_PREVENT_SKIPPING, false, "prevent track skip", NULL),
1870 #ifdef HAVE_PITCHCONTROL
1871 OFFON_SETTING(0, pitch_mode_semitone, LANG_SEMITONE, false,
1872 "Semitone pitch change", NULL),
1873 #if CONFIG_CODEC == SWCODEC
1874 OFFON_SETTING(0, pitch_mode_timestretch, LANG_TIMESTRETCH, false,
1875 "Timestretch mode", NULL),
1876 #endif
1877 #endif
1879 #ifdef USB_ENABLE_HID
1880 OFFON_SETTING(0, usb_hid, LANG_USB_HID, true, "usb hid", usb_set_hid),
1881 CHOICE_SETTING(0, usb_keypad_mode, LANG_USB_KEYPAD_MODE, 0,
1882 "usb keypad mode", "multimedia,presentation,browser"
1883 #ifdef HAVE_USB_HID_MOUSE
1884 ",mouse"
1885 #endif
1886 , NULL,
1887 #ifdef HAVE_USB_HID_MOUSE
1889 #else
1891 #endif
1892 ID2P(LANG_MULTIMEDIA_MODE), ID2P(LANG_PRESENTATION_MODE),
1893 ID2P(LANG_BROWSER_MODE)
1894 #ifdef HAVE_USB_HID_MOUSE
1895 , ID2P(LANG_MOUSE_MODE)
1896 #endif
1897 ), /* CHOICE_SETTING( usb_keypad_mode ) */
1898 #endif
1900 #if defined(USB_ENABLE_STORAGE) && defined(HAVE_MULTIDRIVE)
1901 OFFON_SETTING(0, usb_skip_first_drive, LANG_USB_SKIP_FIRST_DRIVE, false, "usb skip first drive", usb_set_skip_first_drive),
1902 #endif
1904 /* Customizable list */
1905 #ifdef HAVE_LCD_BITMAP
1906 VIEWPORT_SETTING(ui_vp_config, "ui viewport"),
1907 #ifdef HAVE_REMOTE_LCD
1908 VIEWPORT_SETTING(remote_ui_vp_config, "remote ui viewport"),
1909 #endif
1910 #endif
1912 #ifdef HAVE_MORSE_INPUT
1913 OFFON_SETTING(0, morse_input, LANG_MORSE_INPUT, false, "morse input", NULL),
1914 #endif
1916 #ifdef HAVE_HOTKEY
1917 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, hotkey_wps,
1918 LANG_HOTKEY_WPS, HOTKEY_VIEW_PLAYLIST, "hotkey wps",
1919 "off,view playlist,show track info,pitchscreen,open with,delete"
1920 #ifdef HAVE_PICTUREFLOW_INTEGRATION
1921 ",pictureflow"
1922 #endif
1923 ,UNIT_INT, hotkey_formatter, hotkey_getlang, NULL,
1924 #ifdef HAVE_PICTUREFLOW_INTEGRATION
1926 #else
1928 #endif
1929 HOTKEY_OFF,
1930 HOTKEY_VIEW_PLAYLIST, HOTKEY_SHOW_TRACK_INFO, HOTKEY_PITCHSCREEN,
1931 HOTKEY_OPEN_WITH, HOTKEY_DELETE
1932 #ifdef HAVE_PICTUREFLOW_INTEGRATION
1933 , HOTKEY_PICTUREFLOW
1934 #endif
1936 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, hotkey_tree,
1937 LANG_HOTKEY_FILE_BROWSER, HOTKEY_OFF, "hotkey tree",
1938 "off,open with,delete,insert,insert shuffled",
1939 UNIT_INT, hotkey_formatter, hotkey_getlang, NULL, 5, HOTKEY_OFF,
1940 HOTKEY_OPEN_WITH, HOTKEY_DELETE, HOTKEY_INSERT, HOTKEY_INSERT_SHUFFLED),
1941 #endif
1943 #if CONFIG_CODEC == SWCODEC
1944 INT_SETTING(0, resume_rewind, LANG_RESUME_REWIND, 0,
1945 "resume rewind", UNIT_SEC, 0, 60, 5,
1946 NULL, NULL, NULL),
1947 #endif
1948 CUSTOM_SETTING(0, root_menu_customized,
1949 LANG_ROCKBOX_TITLE, /* lang string here is never actually used */
1950 NULL, "root menu order",
1951 root_menu_load_from_cfg, root_menu_write_to_cfg,
1952 root_menu_is_changed, root_menu_set_default),
1955 const int nb_settings = sizeof(settings)/sizeof(*settings);
1957 const struct settings_list* get_settings_list(int*count)
1959 *count = nb_settings;
1960 return settings;