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