Add platform file for Iaudio M5.
[Rockbox.git] / apps / settings_list.c
blob81ac6648065e1281ea32aa05d8456d13e549fdb1
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 Jonathan Gordon
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #include "config.h"
21 #include <stdbool.h>
22 #include <string.h>
23 #include "ata.h"
24 #include "lang.h"
25 #include "talk.h"
26 #include "lcd.h"
27 #include "button.h"
28 #include "backlight.h"
29 #include "settings.h"
30 #include "settings_list.h"
31 #include "sound.h"
32 #include "dsp.h"
33 #include "debug.h"
34 #include "mpeg.h"
35 #include "audio.h"
36 #include "power.h"
37 #include "powermgmt.h"
38 #include "kernel.h"
39 #include "lcd-remote.h"
40 #include "list.h"
41 #include "rbunicode.h"
42 #ifdef HAVE_LCD_BITMAP
43 #include "peakmeter.h"
44 #endif
45 #include "menus/eq_menu.h"
46 #if CONFIG_TUNER
47 #include "radio.h"
48 #endif
50 /* some sets of values which are used more than once, to save memory */
51 static const char off_on[] = "off,on";
52 static const char off_on_ask[] = "off,on,ask";
53 static const char off_number_spell_hover[] = "off,number,spell,hover";
54 #ifdef HAVE_LCD_BITMAP
55 static const char graphic_numeric[] = "graphic,numeric";
56 #endif
58 #ifdef HAVE_RECORDING
59 /* keep synchronous to trig_durations and
60 trigger_times in settings_apply_trigger */
61 static const char trig_durations_conf [] =
62 "0s,1s,2s,5s,10s,15s,20s,25s,30s,1min,2min,5min,10min";
63 /* these should be in the config.h files */
64 #if CONFIG_CODEC == MAS3587F
65 # define DEFAULT_REC_MIC_GAIN 8
66 # define DEFAULT_REC_LEFT_GAIN 2
67 # define DEFAULT_REC_RIGHT_GAIN 2
68 #elif CONFIG_CODEC == SWCODEC
69 # ifdef HAVE_UDA1380
70 # define DEFAULT_REC_MIC_GAIN 16
71 # define DEFAULT_REC_LEFT_GAIN 0
72 # define DEFAULT_REC_RIGHT_GAIN 0
73 # elif defined(HAVE_TLV320)
74 # define DEFAULT_REC_MIC_GAIN 0
75 # define DEFAULT_REC_LEFT_GAIN 0
76 # define DEFAULT_REC_RIGHT_GAIN 0
77 # elif defined(HAVE_WM8975)
78 # define DEFAULT_REC_MIC_GAIN 16
79 # define DEFAULT_REC_LEFT_GAIN 0
80 # define DEFAULT_REC_RIGHT_GAIN 0
81 # elif defined(HAVE_WM8758)
82 # define DEFAULT_REC_MIC_GAIN 16
83 # define DEFAULT_REC_LEFT_GAIN 0
84 # define DEFAULT_REC_RIGHT_GAIN 0
85 # elif defined(HAVE_WM8731)
86 # define DEFAULT_REC_MIC_GAIN 16
87 # define DEFAULT_REC_LEFT_GAIN 0
88 # define DEFAULT_REC_RIGHT_GAIN 0
89 # endif
90 #endif
92 #endif /* HAVE_RECORDING */
94 #if CONFIG_BACKLIGHT
95 static const char backlight_times_conf [] =
96 "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90";
97 static const int backlight_times[] =
98 {-1, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 45, 60, 90};
99 static void backlight_formatter(char *buffer, int buffer_size,
100 int val, const char *unit)
102 (void)unit;
103 if (val == 0)
104 strcpy(buffer, str(LANG_OFF));
105 else if (val == 1)
106 strcpy(buffer, str(LANG_ON));
107 else
108 snprintf(buffer, buffer_size, "%d s", backlight_times[val]);
110 static long backlight_getlang(int value)
112 if (value == 0)
113 return LANG_OFF;
114 else if (value == 1)
115 return LANG_ON;
116 return TALK_ID(backlight_times[value], UNIT_SEC);
118 #endif
119 /* ffwd/rewind and scan acceleration stuff */
120 static int ff_rewind_min_stepvals[] = {1,2,3,4,5,6,8,10,15,20,25,30,45,60};
121 static long ff_rewind_min_step_getlang(int value)
123 return TALK_ID(ff_rewind_min_stepvals[value], UNIT_SEC);
125 static void ff_rewind_min_step_formatter(char *buffer, int buffer_size,
126 int val, const char *unit)
128 (void)unit;
129 snprintf(buffer, buffer_size, "%ds", ff_rewind_min_stepvals[val]);
131 static long scanaccel_getlang(int value)
133 if (value == 0)
134 return LANG_OFF;
135 return TALK_ID(value, UNIT_SEC);
137 static void scanaccel_formatter(char *buffer, int buffer_size,
138 int val, const char *unit)
140 (void)unit;
141 if (val == 0)
142 strcpy(buffer, str(LANG_OFF));
143 else
144 snprintf(buffer, buffer_size, "2x/%ds", val);
147 static int poweroff_idle_timer_times[] = {0,1,2,3,4,5,6,7,8,9,10,15,30,45,60};
148 static long poweroff_idle_timer_getlang(int value)
150 if (value == 0)
151 return LANG_OFF;
152 return TALK_ID(poweroff_idle_timer_times[value], UNIT_MIN);
154 static void poweroff_idle_timer_formatter(char *buffer, int buffer_size,
155 int val, const char *unit)
157 (void)unit;
158 if (val == 0)
159 strcpy(buffer, str(LANG_OFF));
160 else
161 snprintf(buffer, buffer_size, "%dm", poweroff_idle_timer_times[val]);
164 #define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT)
165 /** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h
166 and you may need to update it if you edit this file */
168 #define UNUSED {.RESERVED=NULL}
169 #define INT(a) {.int_ = a}
170 #define UINT(a) {.uint_ = a}
171 #define BOOL(a) {.bool_ = a}
172 #define CHARPTR(a) {.charptr = a}
173 #define UCHARPTR(a) {.ucharptr = a}
174 #define FUNCTYPE(a) {.func = a}
175 #define NODEFAULT INT(0)
177 /* in all the following macros the args are:
178 - flags: bitwise | or the F_ bits in settings_list.h
179 - var: pointer to the variable being changed (usually in global_settings)
180 - lang_ig: LANG_* id to display in menus and setting screens for the settings
181 - default: the default value for the variable, set if settings are reset
182 - name: the name of the setting in config files
183 - cfg_vals: comma seperated list of legal values in cfg files.
184 NULL if a number is written to the file instead.
185 - cb: the callback used by the setting screen.
188 /* Use for int settings which use the set_sound() function to set them */
189 #define SOUND_SETTING(flags,var,lang_id,name,setting) \
190 {flags|F_T_INT|F_T_SOUND, &global_settings.var, \
191 lang_id, NODEFAULT,name,NULL, \
192 {.sound_setting=(struct sound_setting[]){{setting}}} }
194 /* Use for bool variables which don't use LANG_SET_BOOL_YES and LANG_SET_BOOL_NO,
195 or dont save as "off" or "on" in the cfg */
196 #define BOOL_SETTING(flags,var,lang_id,default,name,cfgvals,yes,no,cb) \
197 {flags|F_BOOL_SETTING, &global_settings.var, \
198 lang_id, BOOL(default),name,cfgvals, \
199 {.bool_setting=(struct bool_setting[]){{cb,yes,no}}} }
201 /* bool setting which does use LANG_YES and _NO and save as "off,on" */
202 #define OFFON_SETTING(flags,var,lang_id,default,name,cb) \
203 {flags|F_BOOL_SETTING, &global_settings.var, \
204 lang_id, BOOL(default),name,off_on, \
205 {.bool_setting=(struct bool_setting[]) \
206 {{cb,LANG_SET_BOOL_YES,LANG_SET_BOOL_NO}}} }
208 /* int variable which is NOT saved to .cfg files,
209 (Use NVRAM() in the flags to save to the nvram (or nvram.bin file) */
210 #define SYSTEM_SETTING(flags,var,default) \
211 {flags|F_T_INT, &global_status.var,-1, INT(default), \
212 NULL, NULL, UNUSED}
214 /* setting which stores as a filename in the .cfgvals
215 prefix: The absolute path to not save in the variable, e.g /.rockbox/wps_file
216 suffx: The file extention (usually...) e.g .wps_file */
217 #define FILENAME_SETTING(flags,var,name,default,prefix,suffix,len) \
218 {flags|F_T_UCHARPTR, &global_settings.var,-1, \
219 CHARPTR(default),name,NULL, \
220 {.filename_setting= \
221 (struct filename_setting[]){{prefix,suffix,len}}} }
223 /* Used for settings which use the set_option() setting screen.
224 the ... arg is a list of pointers to strings to display in the setting screen.
225 These can either be literal strings, or ID2P(LANG_*) */
226 #define CHOICE_SETTING(flags,var,lang_id,default,name,cfg_vals,cb,count,...) \
227 {flags|F_CHOICE_SETTING|F_T_INT, &global_settings.var, lang_id, \
228 INT(default), name, cfg_vals, \
229 {.choice_setting = (struct choice_setting[]){ \
230 {cb, count, {.desc = (unsigned char*[]){__VA_ARGS__}}}}}}
232 /* Similar to above, except the strings to display are taken from cfg_vals,
233 the ... arg is a list of ID's to talk for the strings... can use TALK_ID()'s */
234 #define STRINGCHOICE_SETTING(flags,var,lang_id,default,name,cfg_vals,cb,count,...) \
235 {flags|F_CHOICE_SETTING|F_T_INT|F_CHOICETALKS, \
236 &global_settings.var, lang_id, \
237 INT(default), name, cfg_vals, \
238 {.choice_setting = (struct choice_setting[]){ \
239 {cb, count, {.talks = (int[]){__VA_ARGS__}}}}}}
241 /* for settings which use the set_int() setting screen.
242 unit is the UNIT_ define to display/talk.
243 the first one saves a string to the config file,
244 the second one saves the variable value to the config file */
245 #define INT_SETTING_W_CFGVALS(flags, var, lang_id, default, name, cfg_vals, \
246 unit, min, max, step, formatter, get_talk_id, cb) \
247 {flags|F_INT_SETTING|F_T_INT, &global_settings.var, \
248 lang_id, INT(default), name, cfg_vals, \
249 {.int_setting = (struct int_setting[]){ \
250 {cb, unit, min, max, step, formatter, get_talk_id}}}}
251 #define INT_SETTING(flags, var, lang_id, default, name, \
252 unit, min, max, step, formatter, get_talk_id, cb) \
253 {flags|F_INT_SETTING|F_T_INT, &global_settings.var, \
254 lang_id, INT(default), name, NULL, \
255 {.int_setting = (struct int_setting[]){ \
256 {cb, unit, min, max, step, formatter, get_talk_id}}}}
258 #if CONFIG_CODEC == SWCODEC
259 static void crossfeed_format(char* buffer, int buffer_size, int value,
260 const char* unit)
262 snprintf(buffer, buffer_size, "%s%d.%d %s", value == 0 ? " " : "-",
263 value / 10, value % 10, unit);
265 static void crossfeed_cross_gain_helper(int val)
267 dsp_set_crossfeed_cross_params(val,
268 val + global_settings.crossfeed_hf_attenuation,
269 global_settings.crossfeed_hf_cutoff);
271 static void crossfeed_hf_att_helper(int val)
273 dsp_set_crossfeed_cross_params(global_settings.crossfeed_cross_gain,
274 global_settings.crossfeed_cross_gain + val,
275 global_settings.crossfeed_hf_cutoff);
277 static void crossfeed_hf_cutoff_helper(int val)
279 dsp_set_crossfeed_cross_params(global_settings.crossfeed_cross_gain,
280 global_settings.crossfeed_cross_gain
281 + global_settings.crossfeed_hf_attenuation, val);
284 static void replaygain_preamp_format(char* buffer, int buffer_size, int value,
285 const char* unit)
287 int v = abs(value);
289 snprintf(buffer, buffer_size, "%s%d.%d %s", value < 0 ? "-" : "",
290 v / 10, v % 10, unit);
293 #endif
294 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
295 static void set_mdb_enable(bool value)
297 sound_set_mdb_enable((int)value);
299 static void set_superbass(bool value)
301 sound_set_superbass((int)value);
303 #endif
305 #ifdef HAVE_LCD_CHARCELLS
306 static void jumpscroll_format(char* buffer, int buffer_size, int value,
307 const char* unit)
309 (void)unit;
310 switch (value)
312 case 0:
313 strcpy(buffer, str(LANG_OFF));
314 break;
315 case 1:
316 strcpy(buffer, str(LANG_ONE_TIME));
317 break;
318 case 2:
319 case 3:
320 case 4:
321 snprintf(buffer, buffer_size, "%d", value);
322 break;
323 case 5:
324 strcpy(buffer, str(LANG_ALWAYS));
325 break;
328 static long jumpscroll_getlang(int value)
330 switch (value)
332 case 0:
333 return LANG_OFF;
334 case 1:
335 return LANG_ONE_TIME;
336 case 2:
337 case 3:
338 case 4:
339 return TALK_ID(2, UNIT_INT);
340 case 5:
341 return LANG_ALWAYS;
343 return -1;
345 #endif /* HAVE_LCD_CHARCELLS */
348 const struct settings_list settings[] = {
349 /* sound settings */
350 SOUND_SETTING(0,volume, LANG_VOLUME, "volume", SOUND_VOLUME),
351 SOUND_SETTING(0,balance, LANG_BALANCE, "balance", SOUND_BALANCE),
352 SOUND_SETTING(0,bass, LANG_BASS, "bass", SOUND_BASS),
353 SOUND_SETTING(0,treble, LANG_TREBLE, "treble", SOUND_TREBLE),
355 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
356 SOUND_SETTING(0,loudness, LANG_LOUDNESS, "loudness", SOUND_LOUDNESS),
357 STRINGCHOICE_SETTING(0,avc,LANG_AUTOVOL,0,"auto volume",
358 "off,20ms,4,4,8,", sound_set_avc, 5,
359 LANG_OFF,TALK_ID(20, UNIT_MS),TALK_ID(2, UNIT_SEC),
360 TALK_ID(4, UNIT_SEC),TALK_ID(8, UNIT_SEC)),
361 OFFON_SETTING(0, superbass, LANG_SUPERBASS, false, "superbass", set_superbass),
362 #endif
364 CHOICE_SETTING(0,channel_config,LANG_CHANNEL,0,"channels",
365 "stereo,mono,custom,mono left,mono right,karaoke",
366 #if CONFIG_CODEC == SWCODEC
367 channels_set,
368 #else
369 sound_set_channels,
370 #endif
371 6, ID2P(LANG_CHANNEL_STEREO), ID2P(LANG_CHANNEL_MONO),
372 ID2P(LANG_CHANNEL_CUSTOM), ID2P(LANG_CHANNEL_LEFT),
373 ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE)),
374 SOUND_SETTING(0,stereo_width, LANG_STEREO_WIDTH,
375 "stereo_width", SOUND_STEREO_WIDTH),
376 /* playback */
377 OFFON_SETTING(0, playlist_shuffle, LANG_SHUFFLE, false, "shuffle", NULL),
378 SYSTEM_SETTING(NVRAM(4),resume_index,-1),
379 SYSTEM_SETTING(NVRAM(4),resume_first_index,0),
380 SYSTEM_SETTING(NVRAM(4),resume_offset,-1),
381 SYSTEM_SETTING(NVRAM(4),resume_seed,-1),
382 CHOICE_SETTING(0, repeat_mode, LANG_REPEAT, REPEAT_ALL, "repeat",
383 "off,all,one,shuffle"
384 #ifdef AB_REPEAT_ENABLE
385 ",ab"
386 #endif
387 , NULL,
388 #ifdef AB_REPEAT_ENABLE
390 #else
392 #endif
393 ID2P(LANG_OFF), ID2P(LANG_REPEAT_ALL), ID2P(LANG_REPEAT_ONE), ID2P(LANG_SHUFFLE)
394 #ifdef AB_REPEAT_ENABLE
395 ,ID2P(LANG_REPEAT_AB)
396 #endif
397 ), /* CHOICE_SETTING( repeat_mode ) */
398 /* LCD */
399 #ifdef HAVE_LCD_CONTRAST
400 /* its easier to leave this one un-macro()ed for the time being */
401 {F_T_INT|F_DEF_ISFUNC|F_INT_SETTING, &global_settings.contrast,
402 LANG_CONTRAST, FUNCTYPE(lcd_default_contrast),
403 "contrast", NULL , {.int_setting = (struct int_setting[]){
404 { lcd_set_contrast, UNIT_INT, MIN_CONTRAST_SETTING,
405 MAX_CONTRAST_SETTING, 1, NULL, NULL}}}},
406 #endif
407 #if CONFIG_BACKLIGHT
408 INT_SETTING_W_CFGVALS(F_FLIPLIST, backlight_timeout, LANG_BACKLIGHT, 6,
409 "backlight timeout", backlight_times_conf, UNIT_SEC,
410 0, 18, 1, backlight_formatter, backlight_getlang,
411 backlight_set_timeout),
412 #if CONFIG_CHARGING
413 INT_SETTING_W_CFGVALS(F_FLIPLIST, backlight_timeout_plugged,
414 LANG_BACKLIGHT_ON_WHEN_CHARGING, 11,
415 "backlight timeout plugged", backlight_times_conf, UNIT_SEC,
416 0, 18, 1, backlight_formatter, backlight_getlang,
417 backlight_set_timeout_plugged),
418 #endif
419 #endif /* CONFIG_BACKLIGHT */
420 #ifdef HAVE_LCD_BITMAP
421 BOOL_SETTING(0, invert, LANG_INVERT, false ,"invert", off_on,
422 LANG_INVERT_LCD_INVERSE, LANG_INVERT_LCD_NORMAL, lcd_set_invert_display),
423 OFFON_SETTING(0,flip_display, LANG_FLIP_DISPLAY, false,"flip display", NULL),
424 /* display */
425 BOOL_SETTING(F_TEMPVAR, invert_cursor, LANG_INVERT_CURSOR, true ,"invert cursor", off_on,
426 LANG_INVERT_CURSOR_BAR, LANG_INVERT_CURSOR_POINTER, NULL),
427 OFFON_SETTING(F_THEMESETTING,statusbar, LANG_STATUS_BAR, true,"statusbar", NULL),
428 OFFON_SETTING(0,scrollbar, LANG_SCROLL_BAR, true,"scrollbar", NULL),
429 #if CONFIG_KEYPAD == RECORDER_PAD
430 OFFON_SETTING(0,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL),
431 #endif
432 CHOICE_SETTING(0, volume_type, LANG_VOLUME_DISPLAY, 0,
433 "volume display", graphic_numeric, NULL, 2,
434 ID2P(LANG_DISPLAY_GRAPHIC), ID2P(LANG_DISPLAY_NUMERIC)),
435 CHOICE_SETTING(0, battery_display, LANG_BATTERY_DISPLAY, 0,
436 "battery display", graphic_numeric, NULL, 2,
437 ID2P(LANG_DISPLAY_GRAPHIC), ID2P(LANG_DISPLAY_NUMERIC)),
438 CHOICE_SETTING(0, timeformat, LANG_TIMEFORMAT, 0,
439 "time format", "24hour,12hour", NULL, 2,
440 ID2P(LANG_24_HOUR_CLOCK), ID2P(LANG_12_HOUR_CLOCK)),
441 #endif /* HAVE_LCD_BITMAP */
442 OFFON_SETTING(0,show_icons, LANG_SHOW_ICONS ,true,"show icons", NULL),
443 /* system */
444 INT_SETTING_W_CFGVALS(F_FLIPLIST, poweroff, LANG_POWEROFF_IDLE, 10, "idle poweroff",
445 "off,1,2,3,4,5,6,7,8,9,10,15,30,45,60", UNIT_MIN,
446 0, 14, 1, poweroff_idle_timer_formatter,
447 poweroff_idle_timer_getlang, set_poweroff_timeout),
448 SYSTEM_SETTING(NVRAM(4),runtime,0),
449 SYSTEM_SETTING(NVRAM(4),topruntime,0),
451 INT_SETTING(0,max_files_in_playlist,LANG_MAX_FILES_IN_PLAYLIST,
452 #if MEM > 1
453 10000,
454 #else
455 400,
456 #endif
457 "max files in playlist", UNIT_INT,1000,20000,1000,NULL,NULL,NULL),
458 INT_SETTING(0,max_files_in_dir,LANG_MAX_FILES_IN_DIR,
459 #if MEM > 1
460 1000,
461 #else
462 200,
463 #endif
464 "max files in dir", UNIT_INT,50,10000,50,NULL,NULL,NULL),
465 #ifndef SIMULATOR
467 INT_SETTING(0, battery_capacity, LANG_BATTERY_CAPACITY, BATTERY_CAPACITY_DEFAULT,
468 "battery capacity", UNIT_MAH,
469 BATTERY_CAPACITY_MIN, BATTERY_CAPACITY_MAX, BATTERY_CAPACITY_INC,
470 NULL, NULL, NULL),
471 #endif
472 #if CONFIG_CHARGING
473 OFFON_SETTING(NVRAM(1), car_adapter_mode,
474 LANG_CAR_ADAPTER_MODE, false, "car adapter mode", NULL),
475 #endif
476 /* tuner */
477 #if CONFIG_TUNER
478 OFFON_SETTING(0,fm_force_mono, LANG_FM_MONO_MODE,
479 false, "force fm mono", toggle_mono_mode),
480 SYSTEM_SETTING(NVRAM(4),last_frequency,0),
481 #endif
483 #if BATTERY_TYPES_COUNT > 1
484 CHOICE_SETTING(0, battery_type, LANG_BATTERY_TYPE, 0,
485 "battery type","alkaline,nimh", NULL, 2,
486 ID2P(LANG_BATTERY_TYPE_ALKALINE), ID2P(LANG_BATTERY_TYPE_NIMH)),
487 #endif
488 #ifdef HAVE_REMOTE_LCD
489 /* remote lcd */
490 INT_SETTING(0, remote_contrast, LANG_CONTRAST, DEFAULT_REMOTE_CONTRAST_SETTING,
491 "remote contrast", UNIT_INT, MIN_REMOTE_CONTRAST_SETTING,
492 MAX_REMOTE_CONTRAST_SETTING, 1, NULL, NULL, lcd_remote_set_contrast),
493 BOOL_SETTING(0, remote_invert, LANG_INVERT, false ,"remote invert", off_on,
494 LANG_INVERT_LCD_INVERSE, LANG_INVERT_LCD_NORMAL, lcd_remote_set_invert_display),
495 OFFON_SETTING(0,remote_flip_display, LANG_FLIP_DISPLAY,
496 false,"remote flip display", NULL),
497 INT_SETTING_W_CFGVALS(F_FLIPLIST, remote_backlight_timeout, LANG_BACKLIGHT, 6,
498 "remote backlight timeout", backlight_times_conf, UNIT_SEC,
499 0, 18, 1, backlight_formatter, backlight_getlang,
500 remote_backlight_set_timeout),
501 #if CONFIG_CHARGING
502 INT_SETTING_W_CFGVALS(F_FLIPLIST, remote_backlight_timeout_plugged,
503 LANG_BACKLIGHT_ON_WHEN_CHARGING, 11,
504 "remote backlight timeout plugged", backlight_times_conf, UNIT_SEC,
505 0, 18, 1, backlight_formatter, backlight_getlang,
506 remote_backlight_set_timeout_plugged),
507 #endif
508 #ifdef HAVE_REMOTE_LCD_TICKING
509 OFFON_SETTING(0,remote_reduce_ticking, LANG_REDUCE_TICKING,
510 false,"remote reduce ticking", NULL),
511 #endif
512 #endif
514 #if CONFIG_BACKLIGHT
515 OFFON_SETTING(0,bl_filter_first_keypress,
516 LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
517 "backlight filters first keypress", NULL),
518 #ifdef HAVE_REMOTE_LCD
519 OFFON_SETTING(0,remote_bl_filter_first_keypress,
520 LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
521 "backlight filters first remote keypress", NULL),
522 #endif
523 #endif /* CONFIG_BACKLIGHT */
525 /** End of old RTC config block **/
527 #if CONFIG_BACKLIGHT
528 OFFON_SETTING(0,caption_backlight, LANG_CAPTION_BACKLIGHT,
529 false,"caption backlight",NULL),
530 #ifdef HAVE_REMOTE_LCD
531 OFFON_SETTING(0,remote_caption_backlight, LANG_CAPTION_BACKLIGHT,
532 false,"remote caption backlight",NULL),
533 #endif
534 #endif /* CONFIG_BACKLIGHT */
535 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
536 INT_SETTING(0, brightness, LANG_BRIGHTNESS, DEFAULT_BRIGHTNESS_SETTING,
537 "brightness",UNIT_INT, MIN_BRIGHTNESS_SETTING, MAX_BRIGHTNESS_SETTING, 1,
538 NULL, NULL, backlight_set_brightness),
539 #endif
540 #if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
541 /* backlight fading */
542 STRINGCHOICE_SETTING(0,backlight_fade_in, LANG_BACKLIGHT_FADE_IN, 1,
543 "backlight fade in","off,500ms,1s,2s", backlight_set_fade_in, 4,
544 LANG_OFF, TALK_ID(500, UNIT_MS),
545 TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC)),
546 STRINGCHOICE_SETTING(0,backlight_fade_out, LANG_BACKLIGHT_FADE_OUT, 1,
547 "backlight fade out","off,500ms,1s,2s", backlight_set_fade_out, 4,
548 LANG_OFF, TALK_ID(500, UNIT_MS),
549 TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC)),
550 #endif
551 INT_SETTING(0, scroll_speed, LANG_SCROLL_SPEED, 9,"scroll speed",
552 UNIT_INT, 0, 15, 1, NULL, NULL, lcd_scroll_speed),
553 INT_SETTING(0, scroll_delay, LANG_SCROLL_DELAY, 1000, "scroll delay",
554 UNIT_MS, 0, 2500, 100, NULL,
555 NULL, lcd_scroll_delay) ,
556 INT_SETTING(0, bidir_limit, LANG_BIDIR_SCROLL, 50, "bidir limit",
557 UNIT_PERCENT, 0, 200, 25, NULL, NULL, lcd_bidir_scroll),
558 #ifdef HAVE_REMOTE_LCD
559 INT_SETTING(0, remote_scroll_speed, LANG_SCROLL_SPEED, 9, "remote scroll speed",
560 UNIT_INT, 0,15, 1, NULL, NULL, lcd_remote_scroll_speed),
561 INT_SETTING(0, remote_scroll_step, LANG_SCROLL_STEP, 6, "remote scroll step",
562 UNIT_PIXEL, 1, LCD_REMOTE_WIDTH, 1, NULL, NULL, lcd_remote_scroll_step),
563 INT_SETTING(0, remote_scroll_delay, LANG_SCROLL_DELAY, 1000, "remote scroll delay",
564 UNIT_MS, 0, 2500, 100, NULL, NULL, lcd_remote_scroll_delay),
565 INT_SETTING(0, remote_bidir_limit, LANG_BIDIR_SCROLL, 50, "remote bidir limit",
566 UNIT_PERCENT, 0, 200, 25, NULL, NULL, lcd_remote_bidir_scroll),
567 #endif
568 #ifdef HAVE_LCD_BITMAP
569 OFFON_SETTING(0, offset_out_of_view, LANG_SCREEN_SCROLL_VIEW,
570 false, "Screen Scrolls Out Of View", NULL),
571 INT_SETTING(0, scroll_step, LANG_SCROLL_STEP, 6, "scroll step",
572 UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL, lcd_scroll_step),
573 INT_SETTING(0, screen_scroll_step, LANG_SCREEN_SCROLL_STEP,
574 16, "screen scroll step",
575 UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL, NULL),
576 #endif /* HAVE_LCD_BITMAP */
577 #ifdef HAVE_LCD_CHARCELLS
578 INT_SETTING(0, jump_scroll, LANG_JUMP_SCROLL, 0, "jump scroll",
579 UNIT_INT, 0, 5, 1, jumpscroll_format, jumpscroll_getlang, lcd_jump_scroll),
580 INT_SETTING(0, jump_scroll_delay, LANG_JUMP_SCROLL_DELAY, 500, "jump scroll delay",
581 UNIT_MS, 0, 2500, 100, NULL, NULL, lcd_jump_scroll_delay),
582 #endif
583 OFFON_SETTING(0,scroll_paginated,LANG_SCROLL_PAGINATED,
584 false,"scroll paginated",NULL),
585 #ifdef HAVE_LCD_COLOR
586 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.fg_color,-1,INT(LCD_DEFAULT_FG),
587 "foreground color",NULL,UNUSED},
588 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.bg_color,-1,INT(LCD_DEFAULT_BG),
589 "background color",NULL,UNUSED},
590 #endif
591 /* more playback */
592 OFFON_SETTING(0,play_selected,LANG_PLAY_SELECTED,true,"play selected",NULL),
593 OFFON_SETTING(0,party_mode,LANG_PARTY_MODE,false,"party mode",NULL),
594 OFFON_SETTING(0,fade_on_stop,LANG_FADE_ON_STOP,true,"volume fade",NULL),
595 INT_SETTING_W_CFGVALS(F_FLIPLIST, ff_rewind_min_step, LANG_FFRW_STEP, FF_REWIND_1000,
596 "scan min step", "1,2,3,4,5,6,8,10,15,20,25,30,45,60", UNIT_SEC,
597 13, 0, -1, ff_rewind_min_step_formatter,
598 ff_rewind_min_step_getlang, NULL),
599 INT_SETTING(0, ff_rewind_accel, LANG_FFRW_ACCEL, 3, "scan accel",
600 UNIT_SEC, 16, 0, -1, scanaccel_formatter, scanaccel_getlang, NULL),
601 #if CONFIG_CODEC == SWCODEC
602 STRINGCHOICE_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0,"antiskip",
603 "5s,15s,30s,1min,2min,3min,5min,10min",NULL, 8,
604 TALK_ID(5, UNIT_SEC), TALK_ID(15, UNIT_SEC),
605 TALK_ID(30, UNIT_SEC), TALK_ID(1, UNIT_MIN), TALK_ID(2, UNIT_MIN),
606 TALK_ID(3, UNIT_MIN), TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN)),
607 #else
608 INT_SETTING(0, buffer_margin, LANG_MP3BUFFER_MARGIN, 0, "antiskip",
609 UNIT_SEC, 0, 7, 1, NULL, NULL, audio_set_buffer_margin),
610 #endif
611 /* disk */
612 #ifndef HAVE_MMC
613 INT_SETTING(0, disk_spindown, LANG_SPINDOWN, 5, "disk spindown",
614 UNIT_SEC, 3, 254, 1, NULL, NULL, ata_spindown),
615 {F_T_INT,&global_settings.disk_spindown,LANG_SPINDOWN,INT(5),"disk spindown",NULL,UNUSED},
616 #endif /* HAVE_MMC */
617 /* browser */
618 CHOICE_SETTING(0, dirfilter, LANG_FILTER, SHOW_SUPPORTED, "show files",
619 "all,supported,music,playlists", NULL, 4, ID2P(LANG_FILTER_ALL),
620 ID2P(LANG_FILTER_SUPPORTED), ID2P(LANG_FILTER_MUSIC), ID2P(LANG_FILTER_PLAYLIST)),
621 OFFON_SETTING(0,sort_case,LANG_SORT_CASE,false,"sort case",NULL),
622 OFFON_SETTING(0,browse_current,LANG_FOLLOW,false,"follow playlist",NULL),
623 OFFON_SETTING(0,playlist_viewer_icons,LANG_SHOW_ICONS,true,
624 "playlist viewer icons",NULL),
625 OFFON_SETTING(0,playlist_viewer_indices,LANG_SHOW_INDICES,true,
626 "playlist viewer indices",NULL),
627 {F_T_INT,&global_settings.playlist_viewer_track_display,LANG_TRACK_DISPLAY,
628 INT(0),"playlist viewer track display","track name,full path",UNUSED},
629 CHOICE_SETTING(0, recursive_dir_insert, LANG_RECURSE_DIRECTORY , RECURSE_OFF,
630 "recursive directory insert", off_on_ask, NULL , 3 ,
631 ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_RESUME_SETTING_ASK)),
632 /* bookmarks */
633 CHOICE_SETTING(0, autocreatebookmark, LANG_BOOKMARK_SETTINGS_AUTOCREATE,
634 BOOKMARK_NO, "autocreate bookmarks",
635 "off,on,ask,recent only - on,recent only - ask", NULL, 5,
636 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
637 ID2P(LANG_RESUME_SETTING_ASK), ID2P(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES),
638 ID2P(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK)),
639 CHOICE_SETTING(0, autoloadbookmark, LANG_BOOKMARK_SETTINGS_AUTOLOAD,
640 BOOKMARK_NO, "autoload bookmarks", off_on_ask, NULL, 3,
641 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES), ID2P(LANG_RESUME_SETTING_ASK)),
642 CHOICE_SETTING(0, usemrb, LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS,
643 BOOKMARK_NO, "use most-recent-bookmarks", "off,on,unique only", NULL, 3,
644 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
645 ID2P(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY)),
646 #ifdef HAVE_LCD_BITMAP
647 /* peak meter */
648 STRINGCHOICE_SETTING(0, peak_meter_clip_hold, LANG_PM_CLIP_HOLD, 16,
649 "peak meter clip hold",
650 "on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90,2min"
651 ",3min,5min,10min,20min,45min,90min", peak_meter_set_clip_hold,
652 25, LANG_PM_ETERNAL,
653 TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC), TALK_ID(3, UNIT_SEC),
654 TALK_ID(4, UNIT_SEC), TALK_ID(5, UNIT_SEC), TALK_ID(6, UNIT_SEC),
655 TALK_ID(7, UNIT_SEC), TALK_ID(8, UNIT_SEC), TALK_ID(9, UNIT_SEC),
656 TALK_ID(10, UNIT_SEC), TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC),
657 TALK_ID(25, UNIT_SEC), TALK_ID(30, UNIT_SEC), TALK_ID(45, UNIT_SEC),
658 TALK_ID(60, UNIT_SEC), TALK_ID(90, UNIT_SEC), TALK_ID(2, UNIT_MIN),
659 TALK_ID(3, UNIT_MIN), TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN),
660 TALK_ID(20, UNIT_MIN), TALK_ID(45, UNIT_MIN), TALK_ID(90, UNIT_MIN)),
661 STRINGCHOICE_SETTING(0, peak_meter_hold, LANG_PM_PEAK_HOLD, 3,
662 "peak meter hold",
663 "off,200ms,300ms,500ms,1,2,3,4,5,6,7,8,9,10,15,20,30,1min",
664 NULL, 18, LANG_OFF,
665 TALK_ID(200, UNIT_MS), TALK_ID(300, UNIT_MS), TALK_ID(500, UNIT_MS),
666 TALK_ID(1, UNIT_SEC), TALK_ID(2, UNIT_SEC), TALK_ID(3, UNIT_SEC),
667 TALK_ID(4, UNIT_SEC), TALK_ID(5, UNIT_SEC), TALK_ID(6, UNIT_SEC),
668 TALK_ID(7, UNIT_SEC), TALK_ID(8, UNIT_SEC), TALK_ID(9, UNIT_SEC),
669 TALK_ID(10, UNIT_SEC), TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC),
670 TALK_ID(30, UNIT_SEC), TALK_ID(60, UNIT_SEC)),
671 INT_SETTING(0, peak_meter_release, LANG_PM_RELEASE, 8, "peak meter release",
672 LANG_PM_UNITS_PER_READ, 1, 0x7e1, 1, NULL, NULL,NULL),
673 OFFON_SETTING(0,peak_meter_dbfs,LANG_PM_DBFS,true,"peak meter dbfs",NULL),
674 {F_T_INT,&global_settings.peak_meter_min,LANG_PM_MIN,INT(60),"peak meter min",NULL,UNUSED},
675 {F_T_INT,&global_settings.peak_meter_max,LANG_PM_MAX,INT(0),"peak meter max",NULL,UNUSED},
676 #endif
677 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
678 SOUND_SETTING(0, mdb_strength, LANG_MDB_STRENGTH,
679 "mdb strength", SOUND_MDB_STRENGTH),
680 SOUND_SETTING(0, mdb_harmonics, LANG_MDB_HARMONICS,
681 "mdb harmonics", SOUND_MDB_HARMONICS),
682 SOUND_SETTING(0, mdb_center, LANG_MDB_CENTER,
683 "mdb center", SOUND_MDB_CENTER),
684 SOUND_SETTING(0, mdb_shape, LANG_MDB_SHAPE,
685 "mdb shape", SOUND_MDB_SHAPE),
686 OFFON_SETTING(0, mdb_enable, LANG_MDB_ENABLE,
687 false, "mdb enable", set_mdb_enable),
688 #endif
689 #if CONFIG_CODEC == MAS3507D
690 OFFON_SETTING(0,line_in,LANG_LINE_IN,false,"line in",NULL),
691 #endif
692 /* voice */
693 CHOICE_SETTING(0, talk_dir, LANG_VOICE_DIR, 0,
694 "talk dir", off_number_spell_hover, NULL, 4,
695 ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
696 ID2P(LANG_VOICE_SPELL), ID2P(LANG_VOICE_DIR_HOVER)),
697 CHOICE_SETTING(0, talk_file, LANG_VOICE_FILE, 0,
698 "talk file", off_number_spell_hover, NULL, 4,
699 ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
700 ID2P(LANG_VOICE_SPELL), ID2P(LANG_VOICE_DIR_HOVER)),
701 OFFON_SETTING(F_TEMPVAR, talk_menu, LANG_VOICE_MENU, true, "talk menu", NULL),
703 /* file sorting */
704 CHOICE_SETTING(0, sort_file, LANG_SORT_FILE, 0 ,
705 "sort files", "alpha,oldest,newest,type", NULL, 4,
706 ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE),
707 ID2P(LANG_SORT_DATE_REVERSE) , ID2P(LANG_SORT_TYPE)),
708 CHOICE_SETTING(0, sort_dir, LANG_SORT_DIR, 0 ,
709 "sort dirs", "alpha,oldest,newest", NULL, 3,
710 ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE),
711 ID2P(LANG_SORT_DATE_REVERSE)),
712 BOOL_SETTING(0, id3_v1_first, LANG_ID3_ORDER, false,
713 "id3 tag priority", "v2-v1,v1-v2",
714 LANG_ID3_V1_FIRST, LANG_ID3_V2_FIRST, mpeg_id3_options),
716 #ifdef HAVE_RECORDING
717 /* recording */
718 {F_T_INT,&global_settings.rec_timesplit, LANG_SPLIT_TIME, INT(0),"rec timesplit",
719 "off,00:05,00:10,00:15,00:30,01:00,01:14,01:20,02:00,"
720 "04:00,06:00,08:00,10:00,12:00,18:00,24:00",UNUSED},
721 {F_T_INT,&global_settings.rec_sizesplit,LANG_SPLIT_SIZE,INT(0),"rec sizesplit",
722 "off,5MB,10MB,15MB,32MB,64MB,75MB,100MB,128MB,"
723 "256MB,512MB,650MB,700MB,1GB,1.5GB,1.75GB",UNUSED},
724 {F_T_INT,&global_settings.rec_channels,LANG_RECORDING_CHANNELS,INT(0),
725 "rec channels","stereo,mono",UNUSED},
726 {F_T_INT,&global_settings.rec_split_type,LANG_RECORDING_CHANNELS,INT(0),
727 "rec split type","Split, Stop",UNUSED},
728 {F_T_INT,&global_settings.rec_split_method,LANG_SPLIT_MEASURE,INT(0),
729 "rec split method","Time,Filesize",UNUSED},
730 {F_T_INT,&global_settings.rec_source,LANG_RECORDING_SOURCE,INT(0),
731 "rec source","mic,line"
732 #ifdef HAVE_SPDIF_IN
733 ",spdif"
734 #endif
735 #ifdef HAVE_FMRADIO_IN
736 ",fmradio"
737 #endif
738 ,UNUSED},
739 {F_T_INT,&global_settings.rec_prerecord_time,LANG_RECORD_PRERECORD_TIME,
740 INT(0),"prerecording time",NULL,UNUSED},
741 {F_T_INT,&global_settings.rec_directory,LANG_RECORD_DIRECTORY,
742 INT(0),"rec directory",REC_BASE_DIR ",current",UNUSED},
743 #if CONFIG_BACKLIGHT
744 {F_T_INT,&global_settings.cliplight,LANG_CLIP_LIGHT,INT(0),
745 "cliplight","off,main,both,remote",UNUSED},
746 #endif
747 {F_T_INT,&global_settings.rec_mic_gain,LANG_RECORDING_GAIN,INT(DEFAULT_REC_MIC_GAIN),
748 "rec mic gain",NULL,UNUSED},
749 {F_T_INT,&global_settings.rec_left_gain,LANG_RECORDING_LEFT,INT(DEFAULT_REC_LEFT_GAIN),
750 "rec left gain",NULL,UNUSED},
751 {F_T_INT,&global_settings.rec_right_gain,LANG_RECORDING_RIGHT,
752 INT(DEFAULT_REC_RIGHT_GAIN),
753 "rec right gain",NULL,UNUSED},
754 #if CONFIG_CODEC == MAS3587F
755 {F_T_INT,&global_settings.rec_frequency,LANG_RECORDING_FREQUENCY,
756 INT(0),"rec frequency","44,48,32,22,24,16",UNUSED},
757 {F_T_INT,&global_settings.rec_quality,LANG_RECORDING_QUALITY,INT(5),
758 "rec quality",NULL,UNUSED},
759 OFFON_SETTING(0,rec_editable,LANG_RECORDING_EDITABLE,
760 false,"editable recordings",NULL),
761 #endif /* CONFIG_CODEC == MAS3587F */
762 #if CONFIG_CODEC == SWCODEC
763 {F_T_INT,&global_settings.rec_frequency,LANG_RECORDING_FREQUENCY,INT(REC_FREQ_DEFAULT),
764 "rec frequency",REC_FREQ_CFG_VAL_LIST,UNUSED},
765 {F_T_INT,&global_settings.rec_format,LANG_RECORDING_FORMAT,INT(REC_FORMAT_DEFAULT),
766 "rec format",REC_FORMAT_CFG_VAL_LIST,UNUSED},
767 /** Encoder settings start - keep these together **/
768 /* aiff_enc */
769 /* (no settings yet) */
770 /* mp3_enc */
771 {F_T_INT,&global_settings.mp3_enc_config.bitrate,-1,INT(MP3_ENC_BITRATE_CFG_DEFAULT),
772 "mp3_enc bitrate",MP3_ENC_BITRATE_CFG_VALUE_LIST,UNUSED},
773 /* wav_enc */
774 /* (no settings yet) */
775 /* wavpack_enc */
776 /* (no settings yet) */
777 /** Encoder settings end **/
778 #endif /* CONFIG_CODEC == SWCODEC */
779 /* values for the trigger */
780 {F_T_INT,&global_settings.rec_start_thres,LANG_RECORD_START_THRESHOLD,INT(-35),
781 "trigger start threshold",NULL,UNUSED},
782 {F_T_INT,&global_settings.rec_stop_thres,LANG_RECORD_STOP_THRESHOLD,INT(-45),
783 "trigger stop threshold",NULL,UNUSED},
784 {F_T_INT,&global_settings.rec_start_duration,LANG_RECORD_MIN_DURATION,INT(0),
785 "trigger start duration",trig_durations_conf,UNUSED},
786 {F_T_INT,&global_settings.rec_stop_postrec,LANG_RECORD_STOP_POSTREC,INT(2),
787 "trigger stop postrec",trig_durations_conf,UNUSED},
788 {F_T_INT,&global_settings.rec_stop_gap,LANG_RECORD_STOP_GAP,INT(1),
789 "trigger min gap",trig_durations_conf,UNUSED},
790 {F_T_INT,&global_settings.rec_trigger_mode,LANG_RECORD_TRIGGER_MODE,INT(0),
791 "trigger mode","off,once,repeat",UNUSED},
792 #endif /* HAVE_RECORDING */
794 #ifdef HAVE_SPDIF_POWER
795 OFFON_SETTING(0, spdif_enable, LANG_SPDIF_ENABLE, false,
796 "spdif enable", spdif_power_enable),
797 #endif
798 CHOICE_SETTING(0, next_folder, LANG_NEXT_FOLDER, FOLDER_ADVANCE_OFF,
799 "folder navigation", "off,on,random",NULL ,3,
800 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES), ID2P(LANG_RANDOM)),
801 OFFON_SETTING(0,runtimedb,LANG_RUNTIMEDB_ACTIVE,false,"gather runtime data",NULL),
803 #if CONFIG_CODEC == SWCODEC
804 /* replay gain */
805 OFFON_SETTING(0, replaygain, LANG_REPLAYGAIN_ENABLE, false, "replaygain", NULL),
806 CHOICE_SETTING(0, replaygain_type, LANG_REPLAYGAIN_MODE, REPLAYGAIN_ALBUM,
807 "replaygain type", "track,album,track shuffle", NULL, 3,
808 ID2P(LANG_TRACK_GAIN), ID2P(LANG_ALBUM_GAIN), ID2P(LANG_SHUFFLE_GAIN)),
809 OFFON_SETTING(0, replaygain_noclip, LANG_REPLAYGAIN_NOCLIP,
810 false, "replaygain noclip", NULL),
811 INT_SETTING(0, replaygain_preamp, LANG_REPLAYGAIN_PREAMP, 0, "replaygain preamp",
812 UNIT_DB, -120, 120, 5, replaygain_preamp_format, NULL, NULL),
814 CHOICE_SETTING(0, beep, LANG_BEEP, 0,
815 "beep", "off,weak,moderate,strong", NULL, 4,
816 ID2P(LANG_OFF), ID2P(LANG_WEAK), ID2P(LANG_MODERATE), ID2P(LANG_STRONG)),
818 /* crossfade */
819 CHOICE_SETTING(0, crossfade, LANG_CROSSFADE_ENABLE, 0, "crossfade",
820 "off,shuffle,track skip,shuffle and track skip,always",NULL, 5,
821 ID2P(LANG_OFF), ID2P(LANG_SHUFFLE), ID2P(LANG_TRACKSKIP),
822 ID2P(LANG_SHUFFLE_TRACKSKIP), ID2P(LANG_ALWAYS)),
823 INT_SETTING(0, crossfade_fade_in_delay, LANG_CROSSFADE_FADE_IN_DELAY, 0,
824 "crossfade fade in delay", UNIT_SEC, 0, 7, 1, NULL, NULL, NULL),
825 INT_SETTING(0, crossfade_fade_out_delay, LANG_CROSSFADE_FADE_OUT_DELAY, 0,
826 "crossfade fade out delay", UNIT_SEC, 0, 7, 1, NULL, NULL, NULL),
827 INT_SETTING(0, crossfade_fade_in_duration, LANG_CROSSFADE_FADE_IN_DURATION, 0,
828 "crossfade fade in duration", UNIT_SEC, 0, 15, 1, NULL, NULL, NULL),
829 INT_SETTING(0, crossfade_fade_out_duration, LANG_CROSSFADE_FADE_OUT_DURATION, 0,
830 "crossfade fade out duration", UNIT_SEC, 0, 15, 1, NULL, NULL, NULL),
831 CHOICE_SETTING(0, crossfade_fade_out_mixmode, LANG_CROSSFADE_FADE_OUT_MODE,
832 0, "crossfade fade out mode", "crossfade,mix" ,NULL, 2,
833 ID2P(LANG_CROSSFADE), ID2P(LANG_MIX)),
835 /* crossfeed */
836 OFFON_SETTING(0,crossfeed, LANG_CROSSFEED, false,
837 "crossfeed", dsp_set_crossfeed),
838 INT_SETTING(0, crossfeed_direct_gain, LANG_CROSSFEED_DIRECT_GAIN, 15,
839 "crossfeed direct gain", UNIT_DB, 0, 60, 5,
840 crossfeed_format, NULL, dsp_set_crossfeed_direct_gain),
841 INT_SETTING(0, crossfeed_cross_gain, LANG_CROSSFEED_CROSS_GAIN, 60,
842 "crossfeed cross gain", UNIT_DB, 30, 120, 5,
843 crossfeed_format, NULL, crossfeed_cross_gain_helper),
844 INT_SETTING(0, crossfeed_hf_attenuation, LANG_CROSSFEED_HF_ATTENUATION, 160,
845 "crossfeed hf attenuation", UNIT_DB, 60, 240, 5,
846 crossfeed_format, NULL, crossfeed_hf_att_helper),
847 INT_SETTING(0, crossfeed_hf_cutoff, LANG_CROSSFEED_HF_CUTOFF,700,
848 "crossfeed hf cutoff", UNIT_HERTZ, 500, 2000, 100,
849 NULL, NULL, crossfeed_hf_cutoff_helper),
850 /* equalizer */
851 OFFON_SETTING(0,eq_enabled,LANG_EQUALIZER_ENABLED,false,"eq enabled",NULL),
852 INT_SETTING(0, eq_precut, LANG_EQUALIZER_PRECUT, 0, "eq precut",
853 UNIT_DB, 0, 240, 5, eq_precut_format, NULL, dsp_set_eq_precut),
854 /* 0..32768 Hz */
855 INT_SETTING(0, eq_band0_cutoff, LANG_EQUALIZER_BAND_CUTOFF, 60, "eq band 0 cutoff",
856 UNIT_HERTZ, EQ_CUTOFF_MIN, EQ_CUTOFF_MAX, EQ_CUTOFF_STEP,
857 NULL, NULL, NULL),
858 INT_SETTING(0, eq_band1_cutoff, LANG_EQUALIZER_BAND_CENTER, 200, "eq band 1 cutoff",
859 UNIT_HERTZ, EQ_CUTOFF_MIN, EQ_CUTOFF_MAX, EQ_CUTOFF_STEP,
860 NULL, NULL, NULL),
861 INT_SETTING(0, eq_band2_cutoff, LANG_EQUALIZER_BAND_CENTER, 800, "eq band 2 cutoff",
862 UNIT_HERTZ, EQ_CUTOFF_MIN, EQ_CUTOFF_MAX, EQ_CUTOFF_STEP,
863 NULL, NULL, NULL),
864 INT_SETTING(0, eq_band3_cutoff, LANG_EQUALIZER_BAND_CENTER, 4000, "eq band 3 cutoff",
865 UNIT_HERTZ, EQ_CUTOFF_MIN, EQ_CUTOFF_MAX, EQ_CUTOFF_STEP,
866 NULL, NULL, NULL),
867 INT_SETTING(0, eq_band4_cutoff, LANG_EQUALIZER_BAND_CUTOFF, 12000, "eq band 4 cutoff",
868 UNIT_HERTZ, EQ_CUTOFF_MIN, EQ_CUTOFF_MAX, EQ_CUTOFF_STEP,
869 NULL, NULL, NULL),
870 /* 0..64 (or 0.0 to 6.4) */
871 INT_SETTING(0, eq_band0_q, LANG_EQUALIZER_BAND_Q, 7, "eq band 0 q",
872 UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
873 eq_q_format, NULL, NULL),
874 INT_SETTING(0, eq_band1_q, LANG_EQUALIZER_BAND_Q, 10, "eq band 1 q",
875 UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
876 eq_q_format, NULL, NULL),
877 INT_SETTING(0, eq_band2_q, LANG_EQUALIZER_BAND_Q, 10, "eq band 2 q",
878 UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
879 eq_q_format, NULL, NULL),
880 INT_SETTING(0, eq_band3_q, LANG_EQUALIZER_BAND_Q, 10, "eq band 3 q",
881 UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
882 eq_q_format, NULL, NULL),
883 INT_SETTING(0, eq_band4_q, LANG_EQUALIZER_BAND_Q, 7, "eq band 4 q",
884 UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
885 eq_q_format, NULL, NULL),
886 /* -240..240 (or -24db to +24db) */
887 INT_SETTING(0, eq_band0_gain, LANG_EQUALIZER_BAND_GAIN, 0, "eq band 0 gain",
888 UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, EQ_GAIN_STEP,
889 eq_gain_format, NULL, NULL),
890 INT_SETTING(0, eq_band1_gain, LANG_EQUALIZER_BAND_GAIN, 0, "eq band 1 gain",
891 UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, EQ_GAIN_STEP,
892 eq_gain_format, NULL, NULL),
893 INT_SETTING(0, eq_band2_gain, LANG_EQUALIZER_BAND_GAIN, 0, "eq band 2 gain",
894 UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, EQ_GAIN_STEP,
895 eq_gain_format, NULL, NULL),
896 INT_SETTING(0, eq_band3_gain, LANG_EQUALIZER_BAND_GAIN, 0, "eq band 3 gain",
897 UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, EQ_GAIN_STEP,
898 eq_gain_format, NULL, NULL),
899 INT_SETTING(0, eq_band4_gain, LANG_EQUALIZER_BAND_GAIN, 0, "eq band 4 gain",
900 UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, EQ_GAIN_STEP,
901 eq_gain_format, NULL, NULL),
903 /* dithering */
904 OFFON_SETTING(0, dithering_enabled, LANG_DITHERING,
905 false, "dithering enabled", dsp_dither_enable),
906 #endif
907 #ifdef HAVE_DIRCACHE
908 OFFON_SETTING(0,dircache,LANG_DIRCACHE_ENABLE,false,"dircache",NULL),
909 SYSTEM_SETTING(NVRAM(4),dircache_size,0),
910 #endif
912 #ifdef HAVE_TAGCACHE
913 #ifdef HAVE_TC_RAMCACHE
914 OFFON_SETTING(0,tagcache_ram,LANG_TAGCACHE_RAM,false,"tagcache_ram",NULL),
915 #endif
916 OFFON_SETTING(0,tagcache_autoupdate,
917 LANG_TAGCACHE_AUTOUPDATE,false,"tagcache_autoupdate",NULL),
918 #endif
919 CHOICE_SETTING(0, default_codepage, LANG_DEFAULT_CODEPAGE, 0,
920 "default codepage",
921 "iso8859-1,iso8859-7,iso8859-8,cp1251,iso8859-11,cp1256,"
922 "iso8859-9,iso8859-2,sjis,gb2312,ksx1001,big5,utf-8,cp1256",
923 set_codepage, 13,
924 ID2P(LANG_CODEPAGE_LATIN1), ID2P(LANG_CODEPAGE_GREEK),
925 ID2P(LANG_CODEPAGE_HEBREW), ID2P(LANG_CODEPAGE_CYRILLIC),
926 ID2P(LANG_CODEPAGE_THAI), ID2P(LANG_CODEPAGE_ARABIC),
927 ID2P(LANG_CODEPAGE_TURKISH), ID2P(LANG_CODEPAGE_LATIN_EXTENDED),
928 ID2P(LANG_CODEPAGE_JAPANESE), ID2P(LANG_CODEPAGE_SIMPLIFIED),
929 ID2P(LANG_CODEPAGE_KOREAN),
930 ID2P(LANG_CODEPAGE_TRADITIONAL), ID2P(LANG_CODEPAGE_UTF8)),
932 OFFON_SETTING(0,warnon_erase_dynplaylist,
933 LANG_WARN_ERASEDYNPLAYLIST_MENU,false,
934 "warn when erasing dynamic playlist",NULL),
936 #if CONFIG_BACKLIGHT
937 #ifdef HAS_BUTTON_HOLD
938 CHOICE_SETTING(0, backlight_on_button_hold,
939 LANG_BACKLIGHT_ON_BUTTON_HOLD, 0, "backlight on button hold",
940 "normal,off,on", backlight_set_on_button_hold, 3,
941 ID2P(LANG_BACKLIGHT_ON_BUTTON_HOLD_NORMAL), ID2P(LANG_OFF), ID2P(LANG_ON)),
942 #endif
944 #ifdef HAVE_LCD_SLEEP
945 STRINGCHOICE_SETTING(0, lcd_sleep_after_backlight_off,
946 LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF, 3,
947 "lcd sleep after backlight off",
948 "always,never,5,10,15,20,30,45,60,90", lcd_set_sleep_after_backlight_off,
949 10, LANG_ALWAYS, LANG_NEVER, TALK_ID(5, UNIT_SEC), TALK_ID(10, UNIT_SEC),
950 TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC), TALK_ID(30, UNIT_SEC),
951 TALK_ID(45, UNIT_SEC),TALK_ID(60, UNIT_SEC), TALK_ID(90, UNIT_SEC)),
952 #endif
953 #endif /* CONFIG_BACKLIGHT */
955 #ifdef HAVE_WM8758
956 OFFON_SETTING(0,eq_hw_enabled,LANG_EQUALIZER_HARDWARE_ENABLED,false,
957 "eq hardware enabled",NULL),
959 STRINGCHOICE_SETTING(0, eq_hw_band0_cutoff, LANG_EQUALIZER_BAND_CUTOFF, 1,
960 "eq hardware band 0 cutoff", "80Hz,105Hz,135Hz,175Hz", NULL, 4,
961 TALK_ID(80, UNIT_HERTZ), TALK_ID(105, UNIT_HERTZ),
962 TALK_ID(135, UNIT_HERTZ), TALK_ID(175, UNIT_HERTZ)),
963 INT_SETTING(0, eq_hw_band0_gain, LANG_EQUALIZER_BAND_GAIN, 0,
964 "eq hardware band 0 gain", UNIT_DB, EQ_HW_GAIN_MIN,
965 EQ_HW_GAIN_MAX, EQ_HW_GAIN_STEP, eq_hw_gain_format, NULL, NULL),
967 STRINGCHOICE_SETTING(0, eq_hw_band1_center, LANG_EQUALIZER_BAND_CENTER, 1,
968 "eq hardware band 1 center", "230Hz,300Hz,385Hz,500Hz", NULL, 4,
969 TALK_ID(230, UNIT_HERTZ), TALK_ID(300, UNIT_HERTZ),
970 TALK_ID(385, UNIT_HERTZ), TALK_ID(500, UNIT_HERTZ)),
971 CHOICE_SETTING(0, eq_hw_band1_bandwidth, LANG_EQUALIZER_BANDWIDTH, 0,
972 "eq hardware band 1 bandwidth", "narrow,wide", NULL, 2,
973 ID2P(LANG_EQUALIZER_HARDWARE_BANDWIDTH_NARROW),
974 ID2P(LANG_EQUALIZER_HARDWARE_BANDWIDTH_WIDE)),
975 INT_SETTING(0, eq_hw_band1_gain, LANG_EQUALIZER_BAND_GAIN, 0,
976 "eq hardware band 1 gain", UNIT_DB, EQ_HW_GAIN_MIN,
977 EQ_HW_GAIN_MAX, EQ_HW_GAIN_STEP, eq_hw_gain_format, NULL, NULL),
979 STRINGCHOICE_SETTING(0, eq_hw_band2_center, LANG_EQUALIZER_BAND_CENTER, 1,
980 "eq hardware band 2 center", "650Hz,850Hz,1.1kHz,1.4kHz", NULL, 4,
981 TALK_ID(650, UNIT_HERTZ), TALK_ID(850, UNIT_HERTZ),
982 TALK_ID(1100, UNIT_HERTZ), TALK_ID(1400, UNIT_HERTZ)),
983 CHOICE_SETTING(0, eq_hw_band2_bandwidth, LANG_EQUALIZER_BANDWIDTH, 0,
984 "eq hardware band 2 bandwidth", "narrow,wide", NULL, 2,
985 ID2P(LANG_EQUALIZER_HARDWARE_BANDWIDTH_NARROW),
986 ID2P(LANG_EQUALIZER_HARDWARE_BANDWIDTH_WIDE)),
987 INT_SETTING(0, eq_hw_band2_gain, LANG_EQUALIZER_BAND_GAIN, 0,
988 "eq hardware band 2 gain", UNIT_DB, EQ_HW_GAIN_MIN,
989 EQ_HW_GAIN_MAX, EQ_HW_GAIN_STEP, eq_hw_gain_format, NULL, NULL),
991 STRINGCHOICE_SETTING(0, eq_hw_band3_center, LANG_EQUALIZER_BAND_CENTER, 1,
992 "eq hardware band 3 center", "1.8kHz,2.4kHz,3.2kHz,4.1kHz", NULL, 4,
993 TALK_ID(1800, UNIT_HERTZ), TALK_ID(2400, UNIT_HERTZ),
994 TALK_ID(3200, UNIT_HERTZ), TALK_ID(4100, UNIT_HERTZ)),
995 CHOICE_SETTING(0, eq_hw_band3_bandwidth, LANG_EQUALIZER_BANDWIDTH, 0,
996 "eq hardware band 3 bandwidth", "narrow,wide", NULL, 2,
997 ID2P(LANG_EQUALIZER_HARDWARE_BANDWIDTH_NARROW),
998 ID2P(LANG_EQUALIZER_HARDWARE_BANDWIDTH_WIDE)),
999 INT_SETTING(0, eq_hw_band3_gain, LANG_EQUALIZER_BAND_GAIN, 0,
1000 "eq hardware band 3 gain", UNIT_DB, EQ_HW_GAIN_MIN,
1001 EQ_HW_GAIN_MAX, EQ_HW_GAIN_STEP, eq_hw_gain_format, NULL, NULL),
1003 STRINGCHOICE_SETTING(0, eq_hw_band4_cutoff, LANG_EQUALIZER_BAND_CUTOFF, 1,
1004 "eq hardware band 4 cutoff", "5.3kHz,6.9kHz,9kHz,11.7kHz", NULL, 4,
1005 TALK_ID(5300, UNIT_HERTZ), TALK_ID(6900, UNIT_HERTZ),
1006 TALK_ID(9000, UNIT_HERTZ), TALK_ID(11700, UNIT_HERTZ)),
1007 INT_SETTING(0, eq_hw_band4_gain, LANG_EQUALIZER_BAND_GAIN, 0,
1008 "eq hardware band 4 gain", UNIT_DB, EQ_HW_GAIN_MIN,
1009 EQ_HW_GAIN_MAX, EQ_HW_GAIN_STEP, eq_hw_gain_format, NULL, NULL),
1010 #endif
1012 OFFON_SETTING(0,hold_lr_for_scroll_in_list,-1,true,
1013 "hold_lr_for_scroll_in_list",NULL),
1014 CHOICE_SETTING(0, show_path_in_browser, LANG_SHOW_PATH, SHOW_PATH_OFF,
1015 "show path in browser", "off,current directory,full path", NULL, 3,
1016 ID2P(LANG_OFF), ID2P(LANG_SHOW_PATH_CURRENT), ID2P(LANG_SHOW_PATH_FULL)),
1018 #ifdef HAVE_AGC
1019 {F_T_INT,&global_settings.rec_agc_preset_mic,LANG_RECORD_AGC_PRESET,INT(1),
1020 "agc mic preset",NULL,UNUSED},
1021 {F_T_INT,&global_settings.rec_agc_preset_line,LANG_RECORD_AGC_PRESET,INT(1),
1022 "agc line preset",NULL,UNUSED},
1023 {F_T_INT,&global_settings.rec_agc_maxgain_mic,-1,INT(104),
1024 "agc maximum mic gain",NULL,UNUSED},
1025 {F_T_INT,&global_settings.rec_agc_maxgain_line,-1,INT(96),
1026 "agc maximum line gain",NULL,UNUSED},
1027 {F_T_INT,&global_settings.rec_agc_cliptime,LANG_RECORD_AGC_CLIPTIME,INT(1),
1028 "agc cliptime","0.2s,0.4s,0.6s,0.8,1s",UNUSED},
1029 #endif
1031 #ifdef HAVE_REMOTE_LCD
1032 #ifdef HAS_REMOTE_BUTTON_HOLD
1033 CHOICE_SETTING(0, remote_backlight_on_button_hold,
1034 LANG_BACKLIGHT_ON_BUTTON_HOLD, 0, "remote backlight on button hold",
1035 "normal,off,on", remote_backlight_set_on_button_hold, 3,
1036 ID2P(LANG_BACKLIGHT_ON_BUTTON_HOLD_NORMAL), ID2P(LANG_OFF), ID2P(LANG_ON)),
1037 #endif
1038 #endif
1039 #ifdef HAVE_HEADPHONE_DETECTION
1040 CHOICE_SETTING(0, unplug_mode, LANG_UNPLUG, 0,
1041 "pause on headphone unplug", "off,pause,pause and resume", NULL, 3,
1042 ID2P(LANG_OFF), ID2P(LANG_PAUSE), ID2P(LANG_UNPLUG_RESUME)),
1043 INT_SETTING(0, unplug_rw, LANG_UNPLUG_RW, 0, "rewind duration on pause",
1044 UNIT_SEC, 0, 15, 1, NULL, NULL,NULL) ,
1045 OFFON_SETTING(0,unplug_autoresume,LANG_UNPLUG_DISABLE_AUTORESUME,false,
1046 "disable autoresume if phones not present",NULL),
1047 #endif
1048 #if CONFIG_TUNER
1049 CHOICE_SETTING(0, fm_region, LANG_FM_REGION, 0,
1050 "fm_region", "eu,us,jp,kr", set_radio_region, 4, ID2P(LANG_FM_EUROPE),
1051 ID2P(LANG_FM_US), ID2P(LANG_FM_JAPAN), ID2P(LANG_FM_KOREA)),
1052 #endif
1054 OFFON_SETTING(0,audioscrobbler,LANG_AUDIOSCROBBLER,
1055 false,"Last.fm Logging",NULL),
1057 #ifdef HAVE_RECORDING
1058 {F_T_INT,&global_settings.rec_trigger_type,LANG_RECORD_TRIGGER_TYPE,
1059 INT(0),"trigger type","stop,pause,nf stp",UNUSED},
1060 #endif
1062 /** settings not in the old config blocks **/
1063 #if CONFIG_TUNER
1064 FILENAME_SETTING(0, fmr_file, "fmr",
1065 "", FMPRESET_PATH "/", ".fmr", MAX_FILENAME+1),
1066 #endif
1067 FILENAME_SETTING(F_THEMESETTING, font_file, "font",
1068 "", FONT_DIR "/", ".fnt", MAX_FILENAME+1),
1069 FILENAME_SETTING(F_THEMESETTING,wps_file, "wps",
1070 "", WPS_DIR "/", ".wps", MAX_FILENAME+1),
1071 FILENAME_SETTING(0,lang_file,"lang","",LANG_DIR "/",".lng",MAX_FILENAME+1),
1072 #ifdef HAVE_REMOTE_LCD
1073 FILENAME_SETTING(F_THEMESETTING,rwps_file,"rwps",
1074 "", WPS_DIR "/", ".rwps", MAX_FILENAME+1),
1075 #endif
1076 #if LCD_DEPTH > 1
1077 FILENAME_SETTING(F_THEMESETTING,backdrop_file,"backdrop",
1078 "", BACKDROP_DIR "/", ".bmp", MAX_FILENAME+1),
1079 #endif
1080 #ifdef HAVE_LCD_BITMAP
1081 FILENAME_SETTING(0,kbd_file,"kbd","",ROCKBOX_DIR "/",".kbd",MAX_FILENAME+1),
1082 #endif
1083 #ifdef HAVE_USB_POWER
1084 #if CONFIG_CHARGING
1085 OFFON_SETTING(0,usb_charging,LANG_USB_CHARGING,false,"usb charging",NULL),
1086 #endif
1087 #endif
1088 OFFON_SETTING(0,cuesheet,LANG_CUESHEET_ENABLE,false,"cuesheet support", NULL),
1089 CHOICE_SETTING(0, start_in_screen, LANG_START_SCREEN, 1,
1090 "start in screen", "previous,root,files,db,wps,menu,"
1091 #ifdef HAVE_RECORDING
1092 "recording,"
1093 #endif
1094 #if CONFIG_TUNER
1095 "radio,"
1096 #endif
1097 "bookmarks" ,NULL,
1098 #if defined(HAVE_RECORDING) && CONFIG_TUNER
1100 #elif defined(HAVE_RECORDING) || CONFIG_TUNER /* only one of them */
1102 #else
1104 #endif
1105 ID2P(LANG_PREVIOUS_SCREEN), ID2P(LANG_MAIN_MENU),
1106 ID2P(LANG_DIR_BROWSER), ID2P(LANG_TAGCACHE),
1107 ID2P(LANG_RESUME_PLAYBACK), ID2P(LANG_SETTINGS_MENU),
1108 #ifdef HAVE_RECORDING
1109 ID2P(LANG_RECORDING),
1110 #endif
1111 #if CONFIG_TUNER
1112 ID2P(LANG_FM_RADIO),
1113 #endif
1114 ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS)
1116 SYSTEM_SETTING(NVRAM(1),last_screen,-1),
1119 const int nb_settings = sizeof(settings)/sizeof(*settings);