blob: bc03672aebcde1cda2149025ef3a7d92905c651e [file] [log] [blame]
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
Jonathan Gordon4e73b532007-02-13 00:32:17 +00008 * $Id$
Jonathan Gordonb2e50902007-01-23 13:40:44 +00009 *
10 * Copyright (C) 2007 Jonathan Gordon
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * 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.
Jonathan Gordonb2e50902007-01-23 13:40:44 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23#include <stdbool.h>
Thomas Martitz50a6ca32010-05-06 21:04:40 +000024#include "string-extra.h"
Jens Arnoldd490f442007-11-25 17:36:21 +000025#include "system.h"
Frank Gevaerts2f8a0082008-11-01 16:14:28 +000026#include "storage.h"
Jonathan Gordonb2e50902007-01-23 13:40:44 +000027#include "lang.h"
Jonathan Gordon4718a1e2007-02-08 04:33:41 +000028#include "talk.h"
Jonathan Gordonb2e50902007-01-23 13:40:44 +000029#include "lcd.h"
Thomas Martitz1c5d0b42013-04-03 16:33:23 +020030#include "scroll_engine.h"
Jonathan Gordon40a253d2007-02-17 14:02:48 +000031#include "button.h"
32#include "backlight.h"
Michael Sevakis80d0d152010-05-15 13:09:45 +000033#include "sound.h"
Jonathan Gordonb2e50902007-01-23 13:40:44 +000034#include "settings.h"
35#include "settings_list.h"
Tomer Shalev83d24f82009-10-23 13:29:19 +000036#include "usb.h"
Jonathan Gordonfb628312007-02-12 14:22:35 +000037#include "audio.h"
Jonathan Gordonc370e082007-02-12 14:34:09 +000038#include "power.h"
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +000039#include "powermgmt.h"
Jonathan Gordon40a253d2007-02-17 14:02:48 +000040#include "kernel.h"
Rafaël Carré6ab12df2012-01-07 19:18:25 +000041#ifdef HAVE_REMOTE_LCD
Jonathan Gordon40a253d2007-02-17 14:02:48 +000042#include "lcd-remote.h"
Rafaël Carré6ab12df2012-01-07 19:18:25 +000043#endif
Jonathan Gordon40a253d2007-02-17 14:02:48 +000044#include "list.h"
45#include "rbunicode.h"
46#ifdef HAVE_LCD_BITMAP
47#include "peakmeter.h"
48#endif
Jonathan Gordon2801a872007-02-19 02:14:51 +000049#include "menus/eq_menu.h"
Jonathan Gordon2816dc92007-02-27 09:06:30 +000050#if CONFIG_TUNER
51#include "radio.h"
52#endif
Michael Giacomelli70e9c7a2008-12-25 01:46:16 +000053#ifdef IPOD_ACCESSORY_PROTOCOL
54#include "iap.h"
55#endif
Jonathan Gordone385ee12008-12-31 05:59:26 +000056#include "statusbar.h"
Maurus Cuelenaereb8435f52009-06-16 17:04:47 +000057#ifdef HAVE_TOUCHSCREEN
58#include "touchscreen.h"
59#include "ctype.h" /* For isspace() */
60#endif
Jeffrey Goode1ad76ff2010-05-09 02:02:51 +000061#ifdef HAVE_HOTKEY
62#include "onplay.h"
63#endif
Jonathan Gordonb2e50902007-01-23 13:40:44 +000064
Udo Schläpfer040306a2015-01-30 22:47:30 +010065#if defined(DX50) || defined(DX90)
66#include "governor-ibasso.h"
Udo Schläpfer95fdad52015-01-21 20:51:36 +010067#include "usb-ibasso.h"
Udo Schläpfer040306a2015-01-30 22:47:30 +010068#endif
69
Jonathan Gordona5278fa2007-07-11 05:41:23 +000070#define NVRAM(bytes) (bytes<<F_NVRAM_MASK_SHIFT)
71/** NOTE: NVRAM_CONFIG_VERSION is in settings_list.h
72 and you may need to update it if you edit this file */
73
74#define UNUSED {.RESERVED=NULL}
75#define INT(a) {.int_ = a}
76#define UINT(a) {.uint_ = a}
77#define BOOL(a) {.bool_ = a}
78#define CHARPTR(a) {.charptr = a}
79#define UCHARPTR(a) {.ucharptr = a}
80#define FUNCTYPE(a) {.func = a}
81#define NODEFAULT INT(0)
82
83/* in all the following macros the args are:
84 - flags: bitwise | or the F_ bits in settings_list.h
85 - var: pointer to the variable being changed (usually in global_settings)
Peter D'Hoye5c3d5912008-05-11 23:13:59 +000086 - lang_id: LANG_* id to display in menus and setting screens for the setting
Jonathan Gordona5278fa2007-07-11 05:41:23 +000087 - default: the default value for the variable, set if settings are reset
88 - name: the name of the setting in config files
Alexander Levin40f30e62009-08-19 09:53:57 +000089 - cfg_vals: comma separated list of legal values to write to cfg files.
90 The values correspond to the values 0,1,2,etc. of the setting.
91 NULL if just the number itself should be written to the file.
92 No spaces between the values and the commas!
Jonathan Gordona5278fa2007-07-11 05:41:23 +000093 - cb: the callback used by the setting screen.
94*/
95
96/* Use for int settings which use the set_sound() function to set them */
Peter D'Hoye5c3d5912008-05-11 23:13:59 +000097#define SOUND_SETTING(flags,var,lang_id,name,setting) \
Jonathan Gordonb8bc45d2007-12-24 22:35:31 +000098 {flags|F_T_INT|F_T_SOUND|F_SOUNDSETTING, &global_settings.var, \
Peter D'Hoye5c3d5912008-05-11 23:13:59 +000099 lang_id, NODEFAULT,name,NULL, \
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000100 {.sound_setting=(struct sound_setting[]){{setting}}} }
101
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000102/* Use for bool variables which don't use LANG_SET_BOOL_YES and LANG_SET_BOOL_NO
Alexander Levinbbae89c2009-08-18 22:39:17 +0000103 or dont save as "off" or "on" in the cfg.
104 cfgvals are comma separated values (without spaces after the comma!) to write
105 for 'false' and 'true' (in this order)
Alexander Levin40f30e62009-08-19 09:53:57 +0000106 yes_id is the lang_id for the 'yes' (or 'on') option in the menu
107 no_id is the lang_id for the 'no' (or 'off') option in the menu
Alexander Levinbbae89c2009-08-18 22:39:17 +0000108 */
Alexander Levin40f30e62009-08-19 09:53:57 +0000109#define BOOL_SETTING(flags,var,lang_id,default,name,cfgvals,yes_id,no_id,cb)\
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000110 {flags|F_BOOL_SETTING, &global_settings.var, \
111 lang_id, BOOL(default),name,cfgvals, \
Alexander Levin40f30e62009-08-19 09:53:57 +0000112 {.bool_setting=(struct bool_setting[]){{cb,yes_id,no_id}}} }
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000113
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000114/* bool setting which does use LANG_YES and _NO and save as "off,on" */
115#define OFFON_SETTING(flags,var,lang_id,default,name,cb) \
Alexander Levin40f30e62009-08-19 09:53:57 +0000116 BOOL_SETTING(flags,var,lang_id,default,name,off_on, \
Alexander Levinbbae89c2009-08-18 22:39:17 +0000117 LANG_SET_BOOL_YES,LANG_SET_BOOL_NO,cb)
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000118
119/* int variable which is NOT saved to .cfg files,
120 (Use NVRAM() in the flags to save to the nvram (or nvram.bin file) */
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000121#define SYSTEM_SETTING(flags,var,default) \
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000122 {flags|F_T_INT, &global_status.var,-1, INT(default), \
123 NULL, NULL, UNUSED}
124
Jonathan Gordon106b68e2008-10-23 00:29:17 +0000125/* setting which stores as a filename (or another string) in the .cfgvals
126 The string must be a char array (which all of our string settings are),
127 not just a char pointer.
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000128 prefix: The absolute path to not save in the variable, ex /.rockbox/wps_file
Jonathan Gordon106b68e2008-10-23 00:29:17 +0000129 suffix: The file extention (usually...) e.g .wps_file
Mustapha Senhaji3ff2f142008-10-23 16:23:42 +0000130 If the prefix is set (not NULL), then the suffix must be set as well.
Jonathan Gordon106b68e2008-10-23 00:29:17 +0000131 */
132#define TEXT_SETTING(flags,var,name,default,prefix,suffix) \
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000133 {flags|F_T_UCHARPTR, &global_settings.var,-1, \
134 CHARPTR(default),name,NULL, \
Jens Arnoldd490f442007-11-25 17:36:21 +0000135 {.filename_setting= \
Jonathan Gordon106b68e2008-10-23 00:29:17 +0000136 (struct filename_setting[]){ \
137 {prefix,suffix,sizeof(global_settings.var)}}} }
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000138
139/* Used for settings which use the set_option() setting screen.
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000140 The ... arg is a list of pointers to strings to display in the setting
141 screen. These can either be literal strings, or ID2P(LANG_*) */
142#define CHOICE_SETTING(flags,var,lang_id,default,name,cfg_vals,cb,count,...) \
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000143 {flags|F_CHOICE_SETTING|F_T_INT, &global_settings.var, lang_id, \
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000144 INT(default), name, cfg_vals, \
145 {.choice_setting = (struct choice_setting[]){ \
146 {cb, count, {.desc = (const unsigned char*[]) \
147 {__VA_ARGS__}}}}}}
148
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000149/* Similar to above, except the strings to display are taken from cfg_vals,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000150 the ... arg is a list of ID's to talk for the strings, can use TALK_ID()'s */
151#define STRINGCHOICE_SETTING(flags,var,lang_id,default,name,cfg_vals, \
152 cb,count,...) \
153 {flags|F_CHOICE_SETTING|F_T_INT|F_CHOICETALKS, \
154 &global_settings.var, lang_id, \
155 INT(default), name, cfg_vals, \
156 {.choice_setting = (struct choice_setting[]){ \
Jens Arnoldd490f442007-11-25 17:36:21 +0000157 {cb, count, {.talks = (const int[]){__VA_ARGS__}}}}}}
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000158
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000159/* for settings which use the set_int() setting screen.
160 unit is the UNIT_ define to display/talk.
161 the first one saves a string to the config file,
William Wilgusdc87e9e2016-11-22 06:21:31 +0100162 the second one saves the variable value to the config file */
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000163#define INT_SETTING_W_CFGVALS(flags, var, lang_id, default, name, cfg_vals, \
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000164 unit, min, max, step, formatter, get_talk_id, cb) \
165 {flags|F_INT_SETTING|F_T_INT, &global_settings.var, \
166 lang_id, INT(default), name, cfg_vals, \
167 {.int_setting = (struct int_setting[]){ \
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000168 {cb, unit, min, max, step, formatter, get_talk_id}}}}
Jens Arnoldd490f442007-11-25 17:36:21 +0000169#define INT_SETTING(flags, var, lang_id, default, name, \
170 unit, min, max, step, formatter, get_talk_id, cb) \
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000171 {flags|F_INT_SETTING|F_T_INT, &global_settings.var, \
Jens Arnoldd490f442007-11-25 17:36:21 +0000172 lang_id, INT(default), name, NULL, \
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000173 {.int_setting = (struct int_setting[]){ \
174 {cb, unit, min, max, step, formatter, get_talk_id}}}}
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000175#define INT_SETTING_NOWRAP(flags, var, lang_id, default, name, \
176 unit, min, max, step, formatter, get_talk_id, cb) \
Dan Everton0c2ff762007-11-29 09:19:08 +0000177 {flags|F_INT_SETTING|F_T_INT|F_NO_WRAP, &global_settings.var, \
178 lang_id, INT(default), name, NULL, \
179 {.int_setting = (struct int_setting[]){ \
180 {cb, unit, min, max, step, formatter, get_talk_id}}}}
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000181
Jens Arnoldd490f442007-11-25 17:36:21 +0000182#define TABLE_SETTING(flags, var, lang_id, default, name, cfg_vals, \
183 unit, formatter, get_talk_id, cb, count, ...) \
184 {flags|F_TABLE_SETTING|F_T_INT, &global_settings.var, \
185 lang_id, INT(default), name, cfg_vals, \
186 {.table_setting = (struct table_setting[]) { \
187 {cb, formatter, get_talk_id, unit, count, \
188 (const int[]){__VA_ARGS__}}}}}
Jonathan Gordona5278fa2007-07-11 05:41:23 +0000189
William Wilgusa06d9c82018-12-17 22:27:55 -0600190#define TABLE_SETTING_LIST(flags, var, lang_id, default, name, cfg_vals, \
191 unit, formatter, get_talk_id, cb, count, list) \
192 {flags|F_TABLE_SETTING|F_T_INT, &global_settings.var, \
193 lang_id, INT(default), name, cfg_vals, \
194 {.table_setting = (struct table_setting[]) { \
195 {cb, formatter, get_talk_id, unit, count, list}}}}
196
Jonathan Gordon53959572008-11-03 10:43:37 +0000197#define CUSTOM_SETTING(flags, var, lang_id, default, name, \
198 load_from_cfg, write_to_cfg, \
199 is_change, set_default) \
200 {flags|F_CUSTOM_SETTING|F_T_CUSTOM|F_BANFROMQS, \
201 &global_settings.var, lang_id, \
202 {.custom = (void*)default}, name, NULL, \
203 {.custom_setting = (struct custom_setting[]){ \
204 {load_from_cfg, write_to_cfg, is_change, set_default}}}}
Thomas Martitz4c48b592009-08-16 22:20:11 +0000205
Thomas Martitz1e22dae2009-08-17 00:28:47 +0000206#define VIEWPORT_SETTING(var,name) \
207 TEXT_SETTING(F_THEMESETTING,var,name,"-", NULL, NULL)
Thomas Martitz4c48b592009-08-16 22:20:11 +0000208
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000209/* some sets of values which are used more than once, to save memory */
William Wilgusa06d9c82018-12-17 22:27:55 -0600210static const char off[] = "off";
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000211static const char off_on[] = "off,on";
212static const char off_on_ask[] = "off,on,ask";
Steve Bavin6fd10ba2007-06-07 09:24:53 +0000213static const char off_number_spell[] = "off,number,spell";
William Wilgusa06d9c82018-12-17 22:27:55 -0600214static const int timeout_sec_common[] = {-1,0,1,2,3,4,5,6,7,8,9,10,15,20,25,30,
215 45,60,90,120,180,240,300,600,900,1200,
216 1500,1800,2700,3600,4500,5400,6300,7200};
217static const int time_recording_trigger[] = {0,1,2,5,10,15,20,25,30,60,120,300,600};
218#if defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
219static const int backlight_fade[] = {0,100,200,300,500,1000,2000,3000,5000,10000};
220#endif
221
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000222#ifdef HAVE_LCD_BITMAP
223static const char graphic_numeric[] = "graphic,numeric";
224#endif
225
Michael Giacomelliaa269622008-02-23 03:56:39 +0000226/* Default theme settings */
Michael Giacomellib2366c82008-02-23 04:15:08 +0000227#define DEFAULT_WPSNAME "cabbiev2"
Teruaki Kawashimaf11fd782010-02-22 05:16:11 +0000228#define DEFAULT_SBSNAME "-"
Marcin Bukat5785cfb2012-06-25 22:04:36 +0200229#define DEFAULT_FMS_NAME "cabbiev2"
Michael Giacomellib2366c82008-02-23 04:15:08 +0000230
Michael Giacomelliaa269622008-02-23 03:56:39 +0000231#ifdef HAVE_LCD_BITMAP
232
233#if LCD_HEIGHT <= 64
Thomas Martitzb907f2f2011-11-26 16:01:11 +0000234 #define DEFAULT_FONT_HEIGHT 8
Jens Arnoldca0de822008-09-03 17:50:21 +0000235 #define DEFAULT_FONTNAME "08-Rockfont"
Michael Giacomelliaa269622008-02-23 03:56:39 +0000236#elif LCD_HEIGHT <= 80
Thomas Martitzb907f2f2011-11-26 16:01:11 +0000237 #define DEFAULT_FONT_HEIGHT 11
Jens Arnoldca0de822008-09-03 17:50:21 +0000238 #define DEFAULT_FONTNAME "11-Sazanami-Mincho"
Szymon Dziokf8d367b2014-02-25 20:09:57 +0000239/* sandisk sansa clip zip and samsung yh-820 */
240#elif (LCD_HEIGHT == 96) && ((LCD_WIDTH == 96) || (LCD_WIDTH == 128))
Bertrik Sikken872a3a72012-05-27 01:39:06 +0200241 #define DEFAULT_FONT_HEIGHT 8
242 #define DEFAULT_FONTNAME "08-Rockfont"
Michael Giacomelliaa269622008-02-23 03:56:39 +0000243#elif LCD_HEIGHT <= 220
Thomas Martitzb907f2f2011-11-26 16:01:11 +0000244 #define DEFAULT_FONT_HEIGHT 12
Michael Giacomelliaa269622008-02-23 03:56:39 +0000245#elif LCD_HEIGHT <= 320
Thomas Martitzb907f2f2011-11-26 16:01:11 +0000246 #define DEFAULT_FONT_HEIGHT 15
Marianne Arnolda902adf2010-07-04 12:43:47 +0000247#elif LCD_HEIGHT <= 400
Thomas Martitzb907f2f2011-11-26 16:01:11 +0000248 #define DEFAULT_FONT_HEIGHT 16
249#elif LCD_HEIGHT <= 480 && LCD_WIDTH < 800
250 #define DEFAULT_FONT_HEIGHT 27
Michael Giacomellib2366c82008-02-23 04:15:08 +0000251#else
Thomas Martitzb907f2f2011-11-26 16:01:11 +0000252 #define DEFAULT_FONT_HEIGHT 35
Michael Giacomelliaa269622008-02-23 03:56:39 +0000253#endif
Fred Bauerea7a8962011-11-19 23:34:26 +0000254#define DEFAULT_GLYPHS 250
255#define MIN_GLYPHS 50
256#define MAX_GLYPHS 65540
Michael Giacomellib2366c82008-02-23 04:15:08 +0000257
Michael Giacomelliaa269622008-02-23 03:56:39 +0000258#else
Thomas Martitzb907f2f2011-11-26 16:01:11 +0000259 #define DEFAULT_FONT_HEIGHT 12
260#endif
261
262#ifndef DEFAULT_FONTNAME
263/* ugly expansion needed */
264#define _EXPAND2(x) #x
265#define _EXPAND(x) _EXPAND2(x)
266#define DEFAULT_FONTNAME _EXPAND(DEFAULT_FONT_HEIGHT) "-Adobe-Helvetica"
267#endif
268
269#ifdef HAVE_LCD_COLOR
270 #if DEFAULT_FONT_HEIGHT >= 31
271 #define DEFAULT_ICONSET "tango_icons.32x32"
272 #define DEFAULT_VIEWERS_ICONSET "tango_icons_viewers.32x32"
273 #elif DEFAULT_FONT_HEIGHT >= 23
274 #define DEFAULT_ICONSET "tango_icons.24x24"
275 #define DEFAULT_VIEWERS_ICONSET "tango_icons_viewers.24x24"
276 #elif DEFAULT_FONT_HEIGHT >= 15
277 #define DEFAULT_ICONSET "tango_icons.16x16"
278 #define DEFAULT_VIEWERS_ICONSET "tango_icons_viewers.16x16"
Bertrik Sikken872a3a72012-05-27 01:39:06 +0200279 #elif DEFAULT_FONT_HEIGHT >= 11
Thomas Martitzb907f2f2011-11-26 16:01:11 +0000280 #define DEFAULT_ICONSET "tango_icons.12x12"
281 #define DEFAULT_VIEWERS_ICONSET "tango_icons_viewers.12x12"
Bertrik Sikken872a3a72012-05-27 01:39:06 +0200282 #elif DEFAULT_FONT_HEIGHT >= 7
283 #define DEFAULT_ICONSET "tango_icons.8x8"
284 #define DEFAULT_VIEWERS_ICONSET "tango_icons_viewers.8x8"
Thomas Martitzb907f2f2011-11-26 16:01:11 +0000285 #endif
Thomas Martitze46dd2d2011-11-26 16:03:42 +0000286#elif LCD_DEPTH > 1 /* greyscale */
287 #define DEFAULT_ICONSET "tango_small_mono"
Thomas Martitzb907f2f2011-11-26 16:01:11 +0000288 #define DEFAULT_VIEWERS_ICONSET "tango_small_viewers_mono"
289#else /* monochrome */
290 #define DEFAULT_ICONSET ""
291 #define DEFAULT_VIEWERS_ICONSET ""
Michael Giacomelliaa269622008-02-23 03:56:39 +0000292#endif
293
Rafaël Carré1dc7f492010-06-03 07:30:01 +0000294#ifdef HAVE_REMOTE_LCD
295#if LCD_REMOTE_HEIGHT <= 64
296 #define DEFAULT_REMOTE_FONTNAME "08-Rockfont"
297#else
298 #define DEFAULT_REMOTE_FONTNAME "-"
299#endif
300#endif /* HAVE_REMOTE_LCD */
301
Michael Giacomelliaa269622008-02-23 03:56:39 +0000302#define DEFAULT_THEME_FOREGROUND LCD_RGBPACK(0xce, 0xcf, 0xce)
303#define DEFAULT_THEME_BACKGROUND LCD_RGBPACK(0x00, 0x00, 0x00)
304#define DEFAULT_THEME_SELECTOR_START LCD_RGBPACK(0xff, 0xeb, 0x9c)
305#define DEFAULT_THEME_SELECTOR_END LCD_RGBPACK(0xb5, 0x8e, 0x00)
306#define DEFAULT_THEME_SELECTOR_TEXT LCD_RGBPACK(0x00, 0x00, 0x00)
Thomas Martitz05a67d02013-05-06 07:20:40 +0200307#define DEFAULT_THEME_SEPARATOR LCD_RGBPACK(0x80, 0x80, 0x80)
Michael Giacomelliaa269622008-02-23 03:56:39 +0000308
Frank Gevaertsa96a72b2011-04-16 19:26:21 +0000309#define DEFAULT_BACKDROP BACKDROP_DIR "/cabbiev2.bmp"
Michael Giacomelliaa269622008-02-23 03:56:39 +0000310
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000311#ifdef HAVE_RECORDING
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000312/* these should be in the config.h files */
313#if CONFIG_CODEC == MAS3587F
314# define DEFAULT_REC_MIC_GAIN 8
315# define DEFAULT_REC_LEFT_GAIN 2
316# define DEFAULT_REC_RIGHT_GAIN 2
317#elif CONFIG_CODEC == SWCODEC
318# ifdef HAVE_UDA1380
319# define DEFAULT_REC_MIC_GAIN 16
320# define DEFAULT_REC_LEFT_GAIN 0
321# define DEFAULT_REC_RIGHT_GAIN 0
322# elif defined(HAVE_TLV320)
323# define DEFAULT_REC_MIC_GAIN 0
324# define DEFAULT_REC_LEFT_GAIN 0
325# define DEFAULT_REC_RIGHT_GAIN 0
326# elif defined(HAVE_WM8975)
327# define DEFAULT_REC_MIC_GAIN 16
328# define DEFAULT_REC_LEFT_GAIN 0
329# define DEFAULT_REC_RIGHT_GAIN 0
330# elif defined(HAVE_WM8758)
331# define DEFAULT_REC_MIC_GAIN 16
332# define DEFAULT_REC_LEFT_GAIN 0
333# define DEFAULT_REC_RIGHT_GAIN 0
334# elif defined(HAVE_WM8731)
335# define DEFAULT_REC_MIC_GAIN 16
336# define DEFAULT_REC_LEFT_GAIN 0
337# define DEFAULT_REC_RIGHT_GAIN 0
338# endif
339#endif
340
Jens Arnold09a78612007-11-26 23:10:20 +0000341#endif /* HAVE_RECORDING */
342
Thomas Martitz63d27622012-07-18 23:36:57 +0200343#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
344#define DEFAULT_TAGCACHE_SCAN_PATHS "/sdcard"
345#else
346#define DEFAULT_TAGCACHE_SCAN_PATHS "/"
347#endif
348
William Wilgusa06d9c82018-12-17 22:27:55 -0600349#ifdef HAVE_BACKLIGHT
350#ifdef SIMULATOR
351#define DEFAULT_BACKLIGHT_TIMEOUT 0
352#else
353#define DEFAULT_BACKLIGHT_TIMEOUT 15
354#endif
355#endif /* HAVE_BACKLIGHT */
356
Thomas Martitz00434be2014-03-03 16:17:27 +0100357#if LCD_DEPTH > 1
Thomas Martitz3b126342011-10-17 17:38:10 +0000358static const char* list_pad_formatter(char *buffer, size_t buffer_size,
359 int val, const char *unit)
360{
361 switch (val)
362 {
363 case -1: return str(LANG_AUTOMATIC);
364 case 0: return str(LANG_OFF);
365 default: break;
366 }
367 snprintf(buffer, buffer_size, "%d %s", val, unit);
368 return buffer;
369}
370
371static int32_t list_pad_getlang(int value, int unit)
372{
373 switch (value)
374 {
375 case -1: return LANG_AUTOMATIC;
376 case 0: return LANG_OFF;
377 default: return TALK_ID(value, unit);
378 }
379}
Thomas Martitz00434be2014-03-03 16:17:27 +0100380#endif
Thomas Martitz3b126342011-10-17 17:38:10 +0000381
William Wilgusa06d9c82018-12-17 22:27:55 -0600382static const char* formatter_time_unit_0_is_off(char *buffer, size_t buffer_size,
383 int val, const char *unit)
384{
385 (void) buffer_size;
386 (void) unit;
387 if (val == 0)
388 return str(LANG_OFF);
389 return buffer;
390}
391
392static int32_t getlang_time_unit_0_is_off(int value, int unit)
393{
394 if (value == 0)
395 return LANG_OFF;
396 else
397 return talk_time_intervals(value, unit, false);
398}
399
400#if defined(HAVE_BACKLIGHT) || defined(HAVE_LCD_SLEEP_SETTING)
401static const char* formatter_time_unit_0_is_always(char *buffer, size_t buffer_size,
402 int val, const char *unit)
403{
404 (void) buffer_size;
405 (void) unit;
406 if (val == -1)
407 return str(LANG__NEVER);
408 else if (val == 0)
409 return str(LANG_ALWAYS);
410 return buffer;
411}
412
413static int32_t getlang_time_unit_0_is_always(int value, int unit)
414{
415 if (value == -1)
416 return LANG__NEVER;
417 else if (value == 0)
418 return LANG_ALWAYS;
419 else
420 return talk_time_intervals(value, unit, false);
421}
422#endif /* HAVE_BACKLIGHT || HAVE_LCD_SLEEP_SETTING */
423
424static const char* formatter_time_unit_0_is_skip_track(char *buffer,
425 size_t buffer_size, int val, const char *unit)
Thom Johansen4a7e0c72008-07-14 20:39:30 +0000426{
Stéphane Doyon58808b62008-08-18 01:03:07 +0000427 (void)unit;
William Wilgusa06d9c82018-12-17 22:27:55 -0600428 (void)buffer_size;
Thomas Martitza7c888c2009-10-17 16:05:23 +0000429 if (val == -1)
430 return str(LANG_SKIP_OUTRO);
431 else if (val == 0)
Nils Wallménius3200d042009-08-20 16:47:44 +0000432 return str(LANG_SKIP_TRACK);
Nils Wallménius3200d042009-08-20 16:47:44 +0000433 return buffer;
Thom Johansen4a7e0c72008-07-14 20:39:30 +0000434}
435
William Wilgusa06d9c82018-12-17 22:27:55 -0600436static int32_t getlang_time_unit_0_is_skip_track(int value, int unit)
Thom Johansen4a7e0c72008-07-14 20:39:30 +0000437{
Stéphane Doyon58808b62008-08-18 01:03:07 +0000438 (void)unit;
Alessio Lenzi06e0bfd2009-11-04 23:10:09 +0000439 if (value == -1)
440 return LANG_SKIP_OUTRO;
441 else if (value == 0)
Thom Johansen4a7e0c72008-07-14 20:39:30 +0000442 return LANG_SKIP_TRACK;
443 else
William Wilgusa06d9c82018-12-17 22:27:55 -0600444 return talk_time_intervals(value, unit, false);
Thom Johansen4a7e0c72008-07-14 20:39:30 +0000445}
446
William Wilgusa06d9c82018-12-17 22:27:55 -0600447#ifdef HAVE_LCD_BITMAP
448static const char* formatter_time_unit_0_is_eternal(char *buffer,
449 size_t buffer_size, int val, const char *unit)
Jonathan Gordon40a253d2007-02-17 14:02:48 +0000450{
William Wilgusa06d9c82018-12-17 22:27:55 -0600451 (void) buffer_size;
452 (void) unit;
453 if (val == 0)
454 return str(LANG_PM_ETERNAL);
Nils Wallménius3200d042009-08-20 16:47:44 +0000455 return buffer;
Jonathan Gordon40a253d2007-02-17 14:02:48 +0000456}
William Wilgusa06d9c82018-12-17 22:27:55 -0600457static int32_t getlang_time_unit_0_is_eternal(int value, int unit)
Jonathan Gordon40a253d2007-02-17 14:02:48 +0000458{
William Wilgusa06d9c82018-12-17 22:27:55 -0600459 if (value == 0)
460 return LANG_PM_ETERNAL;
Jens Arnold09a78612007-11-26 23:10:20 +0000461 else
William Wilgusa06d9c82018-12-17 22:27:55 -0600462 return talk_time_intervals(value, unit, false);
Jonathan Gordon40a253d2007-02-17 14:02:48 +0000463}
William Wilgusa06d9c82018-12-17 22:27:55 -0600464#endif /* HAVE_LCD_BITMAP */
Jens Arnold09a78612007-11-26 23:10:20 +0000465
Thomas Martitzfd14cac2009-03-02 19:25:50 +0000466#ifndef HAVE_WHEEL_ACCELERATION
Nils Wallménius3200d042009-08-20 16:47:44 +0000467static const char* scanaccel_formatter(char *buffer, size_t buffer_size,
Jonathan Gordonfb628312007-02-12 14:22:35 +0000468 int val, const char *unit)
469{
470 (void)unit;
471 if (val == 0)
Nils Wallménius3200d042009-08-20 16:47:44 +0000472 return str(LANG_OFF);
Jonathan Gordonfb628312007-02-12 14:22:35 +0000473 else
William Wilgusa06d9c82018-12-17 22:27:55 -0600474 snprintf(buffer, buffer_size, "Speed up every %d s", val);
Nils Wallménius3200d042009-08-20 16:47:44 +0000475 return buffer;
Jonathan Gordonfb628312007-02-12 14:22:35 +0000476}
Marcoen Hirschbergb6281982008-06-28 18:35:26 +0000477#endif
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +0000478
Jonathan Gordonfe3cfcc2007-02-08 10:28:42 +0000479#if CONFIG_CODEC == SWCODEC
William Wilgus4a8f2632018-12-22 13:53:00 -0600480
481static const char* formatter_unit_0_is_off(char *buffer, size_t buffer_size,
482 int val, const char *unit)
483{
484 if (val == 0)
485 return str(LANG_OFF);
486 else
487 snprintf(buffer, buffer_size, "%d %s", val, unit);
488 return buffer;
489}
490
491static int32_t getlang_unit_0_is_off(int value, int unit)
492{
493 if (value == 0)
494 return LANG_OFF;
495 else
496 return TALK_ID(value,unit);
497}
498
Thom Johansen8e6e2902007-03-07 15:06:33 +0000499static void crossfeed_cross_set(int val)
Jonathan Gordonfe3cfcc2007-02-08 10:28:42 +0000500{
Thom Johansen8e6e2902007-03-07 15:06:33 +0000501 (void)val;
502 dsp_set_crossfeed_cross_params(global_settings.crossfeed_cross_gain,
503 global_settings.crossfeed_hf_attenuation,
504 global_settings.crossfeed_hf_cutoff);
Jonathan Gordonfe3cfcc2007-02-08 10:28:42 +0000505}
Jonathan Gordonfb628312007-02-12 14:22:35 +0000506
Chiwen Chang3ae0f322014-08-22 23:30:35 +1000507static void surround_set_factor(int val)
508{
509 (void)val;
510 dsp_surround_set_cutoff(global_settings.surround_fx1, global_settings.surround_fx2);
511}
512
Jeffrey Goodecf19ba52009-09-25 15:46:38 +0000513static void compressor_set(int val)
514{
515 (void)val;
Michael Sevakis0842d7f2012-04-26 17:19:16 -0400516 dsp_set_compressor(&global_settings.compressor_settings);
Jeffrey Goodecf19ba52009-09-25 15:46:38 +0000517}
518
Nils Wallménius3200d042009-08-20 16:47:44 +0000519static const char* db_format(char* buffer, size_t buffer_size, int value,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000520 const char* unit)
Jonathan Gordonfb628312007-02-12 14:22:35 +0000521{
522 int v = abs(value);
523
524 snprintf(buffer, buffer_size, "%s%d.%d %s", value < 0 ? "-" : "",
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000525 v / 10, v % 10, unit);
Nils Wallménius3200d042009-08-20 16:47:44 +0000526 return buffer;
Jonathan Gordonfb628312007-02-12 14:22:35 +0000527}
528
Nils Wallménius05d2bfd2008-04-19 13:19:04 +0000529static int32_t get_dec_talkid(int value, int unit)
530{
531 return TALK_ID_DECIMAL(value, 1, unit);
532}
533
534static int32_t get_precut_talkid(int value, int unit)
535{
536 return TALK_ID_DECIMAL(-value, 1, unit);
537}
538
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +1100539struct eq_band_setting eq_defaults[EQ_NUM_BANDS] = {
540 { 32, 7, 0 },
541 { 64, 10, 0 },
542 { 125, 10, 0 },
543 { 250, 10, 0 },
544 { 500, 10, 0 },
545 { 1000, 10, 0 },
546 { 2000, 10, 0 },
547 { 4000, 10, 0 },
548 { 8000, 10, 0 },
549 { 16000, 7, 0 },
550};
551
552static void eq_load_from_cfg(void *setting, char *value)
553{
554 struct eq_band_setting *eq = setting;
555 char *val_end, *end;
556
557 val_end = value + strlen(value);
558
559 /* cutoff/center */
560 end = strchr(value, ',');
561 if (!end) return;
562 *end = '\0';
563 eq->cutoff = atoi(value);
564
565 /* q */
566 value = end + 1;
567 if (value > val_end) return;
568 end = strchr(value, ',');
569 if (!end) return;
570 *end = '\0';
571 eq->q = atoi(value);
572
573 /* gain */
574 value = end + 1;
575 if (value > val_end) return;
576 eq->gain = atoi(value);
577}
578
579static char* eq_write_to_cfg(void *setting, char *buf, int buf_len)
580{
581 struct eq_band_setting *eq = setting;
582
583 snprintf(buf, buf_len, "%d, %d, %d", eq->cutoff, eq->q, eq->gain);
584 return buf;
585}
586
587static bool eq_is_changed(void *setting, void *defaultval)
588{
589 struct eq_band_setting *eq = setting;
590
591 return memcmp(eq, defaultval, sizeof(struct eq_band_setting));
592}
593
594static void eq_set_default(void* setting, void* defaultval)
595{
596 memcpy(setting, defaultval, sizeof(struct eq_band_setting));
597}
598
Jonathan Gordonfe3cfcc2007-02-08 10:28:42 +0000599#endif
Thom Johansen44d80972007-12-08 01:56:35 +0000600#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
Jonathan Gordonfe3cfcc2007-02-08 10:28:42 +0000601static void set_mdb_enable(bool value)
602{
603 sound_set_mdb_enable((int)value);
604}
605static void set_superbass(bool value)
606{
607 sound_set_superbass((int)value);
608}
609#endif
Jonathan Gordon40a253d2007-02-17 14:02:48 +0000610
Jonathan Gordonedcacaa2008-11-03 11:11:07 +0000611#ifdef HAVE_QUICKSCREEN
Bertrik Sikken03be50a2008-11-03 22:26:32 +0000612static int find_setting_by_name(char*name)
Jonathan Gordonedcacaa2008-11-03 11:11:07 +0000613{
614 int i = 0;
615 const struct settings_list *setting;
Jonathan Gordon0cfd7a32011-09-15 09:58:28 +0000616 if (!strcmp(name, "-"))
617 return -1;
Jonathan Gordonedcacaa2008-11-03 11:11:07 +0000618 while (i<nb_settings)
619 {
620 setting = &settings[i];
621 if (setting->cfg_name && !strcmp(setting->cfg_name, name))
622 {
623 return i;
624 }
625 i++;
626 }
627 return -1;
628}
Bertrik Sikken03be50a2008-11-03 22:26:32 +0000629static void qs_load_from_cfg(void* var, char*value)
Jonathan Gordonedcacaa2008-11-03 11:11:07 +0000630{
631 *(int*)var = find_setting_by_name(value);
632}
Bertrik Sikken03be50a2008-11-03 22:26:32 +0000633static char* qs_write_to_cfg(void* setting, char*buf, int buf_len)
Jonathan Gordonedcacaa2008-11-03 11:11:07 +0000634{
Jonathan Gordon0cfd7a32011-09-15 09:58:28 +0000635 int index = *(int*)setting;
Dmitry Gamzaa9878712014-02-10 17:39:12 +0400636 if (index < 0 || index >= nb_settings)
Jonathan Gordon0cfd7a32011-09-15 09:58:28 +0000637 {
638 strlcpy(buf, "-", buf_len);
639 return buf;
640 }
641 const struct settings_list *var = &settings[index];
Nils Wallménius3d4701a2009-07-14 13:57:45 +0000642 strlcpy(buf, var->cfg_name, buf_len);
Jonathan Gordonedcacaa2008-11-03 11:11:07 +0000643 return buf;
644}
Bertrik Sikken03be50a2008-11-03 22:26:32 +0000645static bool qs_is_changed(void* setting, void* defaultval)
Jonathan Gordonedcacaa2008-11-03 11:11:07 +0000646{
647 int i = *(int*)setting;
648 if (i < 0 || i >= nb_settings)
649 return false;
650 const struct settings_list *var = &settings[i];
651 return var != find_setting(defaultval, NULL);
652}
Bertrik Sikken03be50a2008-11-03 22:26:32 +0000653static void qs_set_default(void* setting, void* defaultval)
Jonathan Gordonedcacaa2008-11-03 11:11:07 +0000654{
Jonathan Gordon4983d052011-07-20 01:30:29 +0000655 if (defaultval == NULL)
656 *(int*)setting = -1;
Jonathan Gordonedcacaa2008-11-03 11:11:07 +0000657 find_setting(defaultval, (int*)setting);
658}
659#endif
Maurus Cuelenaereb8435f52009-06-16 17:04:47 +0000660#ifdef HAVE_TOUCHSCREEN
Thomas Martitzb30447c2010-10-31 16:22:32 +0000661
Thomas Martitz40ed5f52010-10-31 16:45:14 +0000662#if defined(APPLICATION) \
663 || defined(ONDA_VX747) \
664 || defined(ONDA_VX767) \
665 || defined(ONDA_VX747P) \
Thomas Martitzb30447c2010-10-31 16:22:32 +0000666 || defined(ONDA_VX777)
667
668#define DEFAULT_TOUCHSCREEN_MODE TOUCHSCREEN_POINT
669#else
670#define DEFAULT_TOUCHSCREEN_MODE TOUCHSCREEN_BUTTON
671#endif
672
Maurus Cuelenaereb8435f52009-06-16 17:04:47 +0000673static void tsc_load_from_cfg(void* setting, char*value)
674{
675 struct touchscreen_parameter *var = (struct touchscreen_parameter*) setting;
676
677 /* Replacement for sscanf(value, "%d ..., &var->A, ...); */
678 int vals[7], count = 0;
679 while(*value != 0 && count < 7)
680 {
681 if(isspace(*value))
682 value++;
683 else
684 {
685 vals[count++] = atoi(value);
686 while(!isspace(*value))
687 value++;
688 }
689 }
690 var->A = vals[0];
691 var->B = vals[1];
692 var->C = vals[2];
693 var->D = vals[3];
694 var->E = vals[4];
695 var->F = vals[5];
696 var->divider = vals[6];
697}
698
699static char* tsc_write_to_cfg(void* setting, char*buf, int buf_len)
700{
701 const struct touchscreen_parameter *var = (const struct touchscreen_parameter*) setting;
702 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);
703 return buf;
704}
705static bool tsc_is_changed(void* setting, void* defaultval)
706{
707 return memcmp(setting, defaultval, sizeof(struct touchscreen_parameter)) != 0;
708}
709static void tsc_set_default(void* setting, void* defaultval)
710{
711 memcpy(setting, defaultval, sizeof(struct touchscreen_parameter));
712}
713#endif
Jeffrey Goode1ad76ff2010-05-09 02:02:51 +0000714#ifdef HAVE_HOTKEY
715static const char* hotkey_formatter(char* buffer, size_t buffer_size, int value,
716 const char* unit)
717{
718 (void)buffer;
719 (void)buffer_size;
720 (void)unit;
721 return str(get_hotkey_lang_id(value));
722}
723static int32_t hotkey_getlang(int value, int unit)
724{
725 (void)unit;
726 return get_hotkey_lang_id(value);
727}
728#endif /* HAVE_HOTKEY */
PurlingNayukif0bec022013-12-21 21:33:54 +0800729
730/* volume limiter */
731static void volume_limit_load_from_cfg(void* var, char*value)
732{
733 *(int*)var = atoi(value);
734}
735static char* volume_limit_write_to_cfg(void* setting, char*buf, int buf_len)
736{
737 int current = *(int*)setting;
738 snprintf(buf, buf_len, "%d", current);
739 return buf;
740}
741static bool volume_limit_is_changed(void* setting, void* defaultval)
742{
Frank Gevaerts72367f42014-01-13 15:26:13 +0100743 (void)defaultval;
PurlingNayukif0bec022013-12-21 21:33:54 +0800744 int current = *(int*)setting;
PurlingNayukif0bec022013-12-21 21:33:54 +0800745 return (current != sound_max(SOUND_VOLUME));
746}
747static void volume_limit_set_default(void* setting, void* defaultval)
748{
749 (void)defaultval;
750 *(int*)setting = sound_max(SOUND_VOLUME);
751}
752
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000753const struct settings_list settings[] = {
754 /* sound settings */
PurlingNayukif0bec022013-12-21 21:33:54 +0800755 SOUND_SETTING(F_NO_WRAP, volume, LANG_VOLUME, "volume", SOUND_VOLUME),
756 CUSTOM_SETTING(F_NO_WRAP, volume_limit, LANG_VOLUME_LIMIT,
757 NULL, "volume limit",
758 volume_limit_load_from_cfg, volume_limit_write_to_cfg,
759 volume_limit_is_changed, volume_limit_set_default),
Jonathan Gordon0f7f3462007-10-15 10:33:01 +0000760 SOUND_SETTING(0, balance, LANG_BALANCE, "balance", SOUND_BALANCE),
Michael Sevakis80d0d152010-05-15 13:09:45 +0000761/* Tone controls */
762#ifdef AUDIOHW_HAVE_BASS
Jonathan Gordon0f7f3462007-10-15 10:33:01 +0000763 SOUND_SETTING(F_NO_WRAP,bass, LANG_BASS, "bass", SOUND_BASS),
Michael Sevakis80d0d152010-05-15 13:09:45 +0000764#endif
765#ifdef AUDIOHW_HAVE_TREBLE
Jonathan Gordon0f7f3462007-10-15 10:33:01 +0000766 SOUND_SETTING(F_NO_WRAP,treble, LANG_TREBLE, "treble", SOUND_TREBLE),
Michael Sevakis80d0d152010-05-15 13:09:45 +0000767#endif
768/* Hardware EQ tone controls */
769#ifdef AUDIOHW_HAVE_EQ
770/* Band gain is generic */
771 SOUND_SETTING(F_NO_WRAP, hw_eq_bands[AUDIOHW_EQ_BAND1].gain,
772 LANG_HW_EQ_GAIN, "tone band1 gain", SOUND_EQ_BAND1_GAIN),
773#ifdef AUDIOHW_HAVE_EQ_BAND2
774 SOUND_SETTING(F_NO_WRAP, hw_eq_bands[AUDIOHW_EQ_BAND2].gain,
775 LANG_HW_EQ_GAIN, "tone band2 gain", SOUND_EQ_BAND2_GAIN),
776#endif /* AUDIOHW_HAVE_EQ_BAND2 */
777#ifdef AUDIOHW_HAVE_EQ_BAND3
778 SOUND_SETTING(F_NO_WRAP, hw_eq_bands[AUDIOHW_EQ_BAND3].gain,
779 LANG_HW_EQ_GAIN, "tone band3 gain", SOUND_EQ_BAND3_GAIN),
780#endif /* AUDIOHW_HAVE_EQ_BAND3 */
781#ifdef AUDIOHW_HAVE_EQ_BAND4
782 SOUND_SETTING(F_NO_WRAP, hw_eq_bands[AUDIOHW_EQ_BAND4].gain,
783 LANG_HW_EQ_GAIN, "tone band4 gain", SOUND_EQ_BAND4_GAIN),
784#endif /* AUDIOHW_HAVE_EQ_BAND4 */
785#ifdef AUDIOHW_HAVE_EQ_BAND5
786 SOUND_SETTING(F_NO_WRAP, hw_eq_bands[AUDIOHW_EQ_BAND5].gain,
787 LANG_HW_EQ_GAIN, "tone band5 gain", SOUND_EQ_BAND5_GAIN),
788#endif /* AUDIOHW_HAVE_EQ_BAND5 */
789#ifdef HAVE_WM8978
790 /* Frequencies vary with samplerate but at least the user has an idea
791 * about the bands and it will be correct with normal playback rates. */
792/* Band 1 */
793 STRINGCHOICE_SETTING(F_SOUNDSETTING,
794 hw_eq_bands[AUDIOHW_EQ_BAND1].frequency,
795 LANG_HW_EQ_FREQUENCY, 0,"tone band1 frequency",
796 "80 Hz,105 Hz,135 Hz,175 Hz",
797 sound_set_hw_eq_band1_frequency, 4,
798 TALK_ID(80, UNIT_HERTZ), TALK_ID(105, UNIT_HERTZ),
799 TALK_ID(135, UNIT_HERTZ), TALK_ID(175, UNIT_HERTZ)),
800/* Band 2 */
801 STRINGCHOICE_SETTING(F_SOUNDSETTING,
802 hw_eq_bands[AUDIOHW_EQ_BAND2].frequency,
803 LANG_HW_EQ_FREQUENCY, 0,"tone band2 frequency",
804 "230 Hz,300 Hz,385 Hz,500 Hz",
805 sound_set_hw_eq_band2_frequency, 4,
806 TALK_ID(230, UNIT_HERTZ), TALK_ID(300, UNIT_HERTZ),
807 TALK_ID(385, UNIT_HERTZ), TALK_ID(500, UNIT_HERTZ)),
808 CHOICE_SETTING(F_SOUNDSETTING, hw_eq_bands[AUDIOHW_EQ_BAND2].width,
809 LANG_HW_EQ_WIDTH, 0, "tone band2 width", "narrow,wide",
810 sound_set_hw_eq_band2_width, 2,
811 ID2P(LANG_HW_EQ_WIDTH_NARROW), ID2P(LANG_HW_EQ_WIDTH_WIDE)),
812/* Band 3 */
813 STRINGCHOICE_SETTING(F_SOUNDSETTING,
814 hw_eq_bands[AUDIOHW_EQ_BAND3].frequency,
815 LANG_HW_EQ_FREQUENCY, 0, "tone band3 frequency",
816 "650 Hz,850 Hz,1.1 kHz,1.4 kHz",
817 sound_set_hw_eq_band3_frequency, 4,
818 TALK_ID(650, UNIT_HERTZ), TALK_ID(850, UNIT_HERTZ),
819 TALK_ID_DECIMAL(11, 1, UNIT_KHZ),
820 TALK_ID_DECIMAL(14, 1, UNIT_KHZ)),
821 CHOICE_SETTING(F_SOUNDSETTING,hw_eq_bands[AUDIOHW_EQ_BAND3].width,
822 LANG_HW_EQ_WIDTH, 0, "tone band3 width", "narrow,wide",
823 sound_set_hw_eq_band3_width, 2,
824 ID2P(LANG_HW_EQ_WIDTH_NARROW), ID2P(LANG_HW_EQ_WIDTH_WIDE)),
825/* Band 4 */
826 STRINGCHOICE_SETTING(F_SOUNDSETTING,
827 hw_eq_bands[AUDIOHW_EQ_BAND4].frequency,
828 LANG_HW_EQ_FREQUENCY, 0, "tone band4 frequency",
829 "1.8 kHz,2.4 kHz,3.2 kHz,4.1 kHz",
830 sound_set_hw_eq_band4_frequency, 4,
831 TALK_ID_DECIMAL(18, 1, UNIT_KHZ),
832 TALK_ID_DECIMAL(24, 1, UNIT_KHZ),
833 TALK_ID_DECIMAL(32, 1, UNIT_KHZ),
834 TALK_ID_DECIMAL(41, 1, UNIT_KHZ)),
835 CHOICE_SETTING(F_SOUNDSETTING, hw_eq_bands[AUDIOHW_EQ_BAND4].width,
836 LANG_HW_EQ_WIDTH, 0, "tone band4 width", "narrow,wide",
837 sound_set_hw_eq_band4_width, 2,
838 ID2P(LANG_HW_EQ_WIDTH_NARROW), ID2P(LANG_HW_EQ_WIDTH_WIDE)),
839/* Band 5 */
840 STRINGCHOICE_SETTING(F_SOUNDSETTING,
841 hw_eq_bands[AUDIOHW_EQ_BAND5].frequency,
842 LANG_HW_EQ_FREQUENCY, 0, "tone band5 frequency",
843 "5.3 kHz,6.9 kHz,9.0 kHz,11.7 kHz",
844 sound_set_hw_eq_band5_frequency, 4,
845 TALK_ID_DECIMAL(53, 1, UNIT_KHZ),
846 TALK_ID_DECIMAL(69, 1, UNIT_KHZ),
847 TALK_ID_DECIMAL(90, 1, UNIT_KHZ),
848 TALK_ID_DECIMAL(117, 1, UNIT_KHZ)),
849#endif /* HAVE_WM8978 */
850#endif /* AUDIOHW_HAVE_EQ */
851/* 3-d enhancement effect */
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000852#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
Jonathan Gordonfe3cfcc2007-02-08 10:28:42 +0000853 SOUND_SETTING(0,loudness, LANG_LOUDNESS, "loudness", SOUND_LOUDNESS),
William Wilgusa06d9c82018-12-17 22:27:55 -0600854 /* requires index, uses table defined by driver */
Jonathan Gordonb8bc45d2007-12-24 22:35:31 +0000855 STRINGCHOICE_SETTING(F_SOUNDSETTING,avc,LANG_AUTOVOL,0,"auto volume",
William Wilgusa06d9c82018-12-17 22:27:55 -0600856 "off,20 ms,2 s,4 s,8 s,", sound_set_avc, 5,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000857 LANG_OFF,TALK_ID(20, UNIT_MS),TALK_ID(2, UNIT_SEC),
858 TALK_ID(4, UNIT_SEC),TALK_ID(8, UNIT_SEC)),
859 OFFON_SETTING(F_SOUNDSETTING, superbass, LANG_SUPERBASS, false, "superbass",
860 set_superbass),
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000861#endif
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000862
Jonathan Gordonb8bc45d2007-12-24 22:35:31 +0000863 CHOICE_SETTING(F_SOUNDSETTING, channel_config, LANG_CHANNEL_CONFIGURATION,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000864 0,"channels",
Michael Giacomellib25cd7d2011-10-26 18:37:50 +0000865 "stereo,mono,custom,mono left,mono right,karaoke",
866 sound_set_channels, 6,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000867 ID2P(LANG_CHANNEL_STEREO), ID2P(LANG_CHANNEL_MONO),
868 ID2P(LANG_CHANNEL_CUSTOM), ID2P(LANG_CHANNEL_LEFT),
Michael Giacomellib25cd7d2011-10-26 18:37:50 +0000869 ID2P(LANG_CHANNEL_RIGHT), ID2P(LANG_CHANNEL_KARAOKE)),
Jonathan Gordonb8bc45d2007-12-24 22:35:31 +0000870 SOUND_SETTING(F_SOUNDSETTING, stereo_width, LANG_STEREO_WIDTH,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000871 "stereo_width", SOUND_STEREO_WIDTH),
Michael Sevakis80d0d152010-05-15 13:09:45 +0000872#ifdef AUDIOHW_HAVE_DEPTH_3D
873 SOUND_SETTING(0,depth_3d, LANG_DEPTH_3D, "3-d enhancement",
874 SOUND_DEPTH_3D),
875#endif
Andrew Ryabinin0519f7e2013-05-12 23:23:45 +0400876
877#ifdef AUDIOHW_HAVE_FILTER_ROLL_OFF
878 CHOICE_SETTING(F_SOUNDSETTING, roll_off, LANG_FILTER_ROLL_OFF, 0,
Solomon Peachyd4942cc2018-06-29 16:09:28 -0400879#ifndef AUDIOHW_HAVE_SHORT_ROLL_OFF
Andrew Ryabinin0519f7e2013-05-12 23:23:45 +0400880 "roll_off", "sharp,slow", sound_set_filter_roll_off,
881 2, ID2P(LANG_FILTER_SHARP), ID2P(LANG_FILTER_SLOW)),
Solomon Peachyd4942cc2018-06-29 16:09:28 -0400882#else
883 "roll_off", "sharp,slow,short,bypass", sound_set_filter_roll_off,
884 4, ID2P(LANG_FILTER_SHARP), ID2P(LANG_FILTER_SLOW), ID2P(LANG_FILTER_SHORT), ID2P(LANG_FILTER_BYPASS)),
885#endif
Andrew Ryabinin0519f7e2013-05-12 23:23:45 +0400886#endif
887
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000888 /* playback */
Jonathan Gordon4ca8a432007-01-26 05:45:06 +0000889 OFFON_SETTING(0, playlist_shuffle, LANG_SHUFFLE, false, "shuffle", NULL),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000890 SYSTEM_SETTING(NVRAM(4), resume_index, -1),
Richard Quirk212e7802012-12-09 21:04:17 +0100891 SYSTEM_SETTING(NVRAM(4), resume_crc32, -1),
Michael Sevakis31b71222013-07-14 07:59:39 -0400892 SYSTEM_SETTING(NVRAM(4), resume_elapsed, -1),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000893 SYSTEM_SETTING(NVRAM(4), resume_offset, -1),
Björn Stenberg11fffaa2008-12-17 13:45:00 +0000894 CHOICE_SETTING(0, repeat_mode, LANG_REPEAT, REPEAT_OFF, "repeat",
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000895 "off,all,one,shuffle"
Daniel Stenberg0c021de2007-02-17 23:07:39 +0000896#ifdef AB_REPEAT_ENABLE
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000897 ",ab"
Jonathan Gordonb2858592007-02-15 07:37:25 +0000898#endif
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000899 , NULL,
Daniel Stenberg0c021de2007-02-17 23:07:39 +0000900#ifdef AB_REPEAT_ENABLE
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000901 5,
Jonathan Gordonb2858592007-02-15 07:37:25 +0000902#else
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000903 4,
Jonathan Gordonb2858592007-02-15 07:37:25 +0000904#endif
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000905 ID2P(LANG_OFF), ID2P(LANG_ALL), ID2P(LANG_REPEAT_ONE),
906 ID2P(LANG_SHUFFLE)
Daniel Stenberg0c021de2007-02-17 23:07:39 +0000907#ifdef AB_REPEAT_ENABLE
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000908 ,ID2P(LANG_REPEAT_AB)
Jonathan Gordonb2858592007-02-15 07:37:25 +0000909#endif
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000910 ), /* CHOICE_SETTING( repeat_mode ) */
Michael Sevakisd37bf242013-05-23 13:58:51 -0400911#ifdef HAVE_PLAY_FREQ
Michael Sevakis19b289a2013-07-06 17:14:02 -0400912 STRINGCHOICE_SETTING(0, play_frequency, LANG_FREQUENCY, 0,
Michael Sevakisd37bf242013-05-23 13:58:51 -0400913 "playback frequency", "44.1 kHz,48 kHz", NULL, 2,
914 TALK_ID_DECIMAL(441, 1, UNIT_KHZ), TALK_ID(48, UNIT_KHZ)),
915#endif /* HAVE_PLAY_FREQ */
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000916 /* LCD */
917#ifdef HAVE_LCD_CONTRAST
Jonathan Gordon40a253d2007-02-17 14:02:48 +0000918 /* its easier to leave this one un-macro()ed for the time being */
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000919 { F_T_INT|F_DEF_ISFUNC|F_INT_SETTING, &global_settings.contrast,
920 LANG_CONTRAST, FUNCTYPE(lcd_default_contrast), "contrast", NULL , {
921 .int_setting = (struct int_setting[]) {
922 { lcd_set_contrast, UNIT_INT, MIN_CONTRAST_SETTING,
923 MAX_CONTRAST_SETTING, 1, NULL, NULL }}}},
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000924#endif
Jens Arnold47bf6c52007-04-12 22:12:13 +0000925#ifdef HAVE_BACKLIGHT
William Wilgusa06d9c82018-12-17 22:27:55 -0600926 TABLE_SETTING_LIST(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS,
927 backlight_timeout, LANG_BACKLIGHT,
928 DEFAULT_BACKLIGHT_TIMEOUT, "backlight timeout",
929 off_on, UNIT_SEC, formatter_time_unit_0_is_always,
930 getlang_time_unit_0_is_always, backlight_set_timeout,
931 23, timeout_sec_common),
Jonathan Gordon9a6f4192007-02-18 05:32:06 +0000932#if CONFIG_CHARGING
William Wilgusa06d9c82018-12-17 22:27:55 -0600933 TABLE_SETTING_LIST(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS,
934 backlight_timeout_plugged, LANG_BACKLIGHT_ON_WHEN_CHARGING,
935 DEFAULT_BACKLIGHT_TIMEOUT, "backlight timeout plugged",
936 off_on, UNIT_SEC, formatter_time_unit_0_is_always,
937 getlang_time_unit_0_is_always, backlight_set_timeout_plugged,
938 23, timeout_sec_common),
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000939#endif
Jens Arnold47bf6c52007-04-12 22:12:13 +0000940#endif /* HAVE_BACKLIGHT */
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000941#ifdef HAVE_LCD_BITMAP
Nils Wallméniusb3113672007-08-05 19:19:39 +0000942#ifdef HAVE_LCD_INVERT
Jonathan Gordon40a253d2007-02-17 14:02:48 +0000943 BOOL_SETTING(0, invert, LANG_INVERT, false ,"invert", off_on,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000944 LANG_INVERT_LCD_INVERSE, LANG_NORMAL, lcd_set_invert_display),
Nils Wallméniusb3113672007-08-05 19:19:39 +0000945#endif
946#ifdef HAVE_LCD_FLIP
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000947 OFFON_SETTING(0, flip_display, LANG_FLIP_DISPLAY, false, "flip display",
948 NULL),
Nils Wallméniusb3113672007-08-05 19:19:39 +0000949#endif
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000950 /* display */
Jens Arnold69b71412008-02-23 08:28:19 +0000951 CHOICE_SETTING(F_TEMPVAR|F_THEMESETTING, cursor_style, LANG_INVERT_CURSOR,
Nicolas Pennequinf3b015f2007-09-27 15:42:55 +0000952 #ifdef HAVE_LCD_COLOR
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000953 3, "selector type",
954 "pointer,bar (inverse),bar (color),bar (gradient)", NULL, 4,
955 ID2P(LANG_INVERT_CURSOR_POINTER),
956 ID2P(LANG_INVERT_CURSOR_BAR),
957 ID2P(LANG_INVERT_CURSOR_COLOR),
958 ID2P(LANG_INVERT_CURSOR_GRADIENT)),
Nicolas Pennequinf3b015f2007-09-27 15:42:55 +0000959 #else
Peter D'Hoye5c3d5912008-05-11 23:13:59 +0000960 1, "selector type", "pointer,bar (inverse)", NULL, 2,
961 ID2P(LANG_INVERT_CURSOR_POINTER),
962 ID2P(LANG_INVERT_CURSOR_BAR)),
Nicolas Pennequinf3b015f2007-09-27 15:42:55 +0000963 #endif
Jonathan Gordonf1034e02009-07-05 18:07:58 +0000964 CHOICE_SETTING(F_THEMESETTING|F_TEMPVAR, statusbar,
Jonathan Gordona9b5f4d2010-03-06 00:29:46 +0000965 LANG_STATUS_BAR, STATUSBAR_TOP, "statusbar","off,top,bottom",
966 NULL, 3, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
967 ID2P(LANG_STATUSBAR_BOTTOM)),
Jonathan Gordonf1034e02009-07-05 18:07:58 +0000968#ifdef HAVE_REMOTE_LCD
969 CHOICE_SETTING(F_THEMESETTING|F_TEMPVAR, remote_statusbar,
Jonathan Gordona9b5f4d2010-03-06 00:29:46 +0000970 LANG_REMOTE_STATUSBAR, STATUSBAR_TOP, "remote statusbar","off,top,bottom",
971 NULL, 3, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
972 ID2P(LANG_STATUSBAR_BOTTOM)),
Jonathan Gordonf1034e02009-07-05 18:07:58 +0000973#endif
Thomas Martitz97548f32009-08-24 00:22:54 +0000974 CHOICE_SETTING(F_THEMESETTING|F_TEMPVAR, scrollbar,
Tomer Shalev1acacc22009-10-05 18:11:41 +0000975 LANG_SCROLL_BAR, SCROLLBAR_LEFT, "scrollbar","off,left,right",
976 NULL, 3, ID2P(LANG_OFF), ID2P(LANG_LEFT), ID2P(LANG_RIGHT)),
Thomas Martitz97548f32009-08-24 00:22:54 +0000977 INT_SETTING(F_THEMESETTING, scrollbar_width, LANG_SCROLLBAR_WIDTH, 6,
978 "scrollbar width",UNIT_INT, 3, MAX(LCD_WIDTH/10,25), 1,
979 NULL, NULL, NULL),
Thomas Martitz3b126342011-10-17 17:38:10 +0000980#ifdef HAVE_TOUCHSCREEN
981 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, list_line_padding, LANG_LIST_LINE_PADDING,
Michael Chicoine928bcd42011-11-10 12:23:55 +0000982 -1, "list padding", "auto,off", UNIT_PIXEL, list_pad_formatter,
Thomas Martitz3b126342011-10-17 17:38:10 +0000983 list_pad_getlang, NULL, 16,
984 -1,0,2,4,6,8,10,12,16,20,24,28,32,38,44,50),
985#endif
Thomas Martitz05a67d02013-05-06 07:20:40 +0200986#if LCD_DEPTH > 1
987 TABLE_SETTING(F_ALLOW_ARBITRARY_VALS, list_separator_height, LANG_LIST_SEPARATOR,
988 0, "list separator height", "auto,off", UNIT_PIXEL,
989 list_pad_formatter, list_pad_getlang, NULL, 15,
990 -1,0,1,2,3,4,5,7,9,11,13,16,20,25,30),
Thomas Martitz00434be2014-03-03 16:17:27 +0100991#ifdef HAVE_LCD_COLOR
Thomas Martitz05a67d02013-05-06 07:20:40 +0200992 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.list_separator_color,-1,
993 INT(DEFAULT_THEME_SEPARATOR),"list separator color",NULL,UNUSED},
994#endif
Thomas Martitz00434be2014-03-03 16:17:27 +0100995#endif
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000996#if CONFIG_KEYPAD == RECORDER_PAD
Thomas Martitz97548f32009-08-24 00:22:54 +0000997 OFFON_SETTING(F_THEMESETTING,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +0000998#endif
Thomas Martitz97548f32009-08-24 00:22:54 +0000999 CHOICE_SETTING(F_THEMESETTING, volume_type, LANG_VOLUME_DISPLAY, 0,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001000 "volume display", graphic_numeric, NULL, 2,
1001 ID2P(LANG_DISPLAY_GRAPHIC),
1002 ID2P(LANG_DISPLAY_NUMERIC)),
Thomas Martitz97548f32009-08-24 00:22:54 +00001003 CHOICE_SETTING(F_THEMESETTING, battery_display, LANG_BATTERY_DISPLAY, 0,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001004 "battery display", graphic_numeric, NULL, 2,
1005 ID2P(LANG_DISPLAY_GRAPHIC), ID2P(LANG_DISPLAY_NUMERIC)),
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +00001006 CHOICE_SETTING(0, timeformat, LANG_TIMEFORMAT, 0,
1007 "time format", "24hour,12hour", NULL, 2,
1008 ID2P(LANG_24_HOUR_CLOCK), ID2P(LANG_12_HOUR_CLOCK)),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001009#endif /* HAVE_LCD_BITMAP */
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001010 OFFON_SETTING(0,show_icons, LANG_SHOW_ICONS ,true,"show icons", NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001011 /* system */
William Wilgusa06d9c82018-12-17 22:27:55 -06001012 INT_SETTING(F_TIME_SETTING, poweroff, LANG_POWEROFF_IDLE, 10,
1013 "idle poweroff", UNIT_MIN, 0,60,1,
1014 formatter_time_unit_0_is_off, getlang_time_unit_0_is_off,
1015 set_poweroff_timeout),
Jonathan Gordon16888672008-06-07 09:17:20 +00001016 SYSTEM_SETTING(NVRAM(4), runtime, 0),
1017 SYSTEM_SETTING(NVRAM(4), topruntime, 0),
William Wilgusdc87e9e2016-11-22 06:21:31 +01001018 INT_SETTING(F_BANFROMQS, max_files_in_playlist,
Jonathan Gordon16888672008-06-07 09:17:20 +00001019 LANG_MAX_FILES_IN_PLAYLIST,
Andree Buschmann5d849a92011-02-02 17:43:32 +00001020#if MEMORYSIZE > 1
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001021 10000,
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001022#else
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001023 400,
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001024#endif
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001025 "max files in playlist", UNIT_INT, 1000, 32000, 1000,
1026 NULL, NULL, NULL),
Jonathan Gordonde6cdda2008-11-03 23:49:18 +00001027 INT_SETTING(F_BANFROMQS, max_files_in_dir, LANG_MAX_FILES_IN_DIR,
Andree Buschmann5d849a92011-02-02 17:43:32 +00001028#if MEMORYSIZE > 1
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001029 1000,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +00001030#else
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001031 200,
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +00001032#endif
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001033 "max files in dir", UNIT_INT, 50, 10000, 50,
1034 NULL, NULL, NULL),
Thomas Martitz24424ba2010-09-01 23:49:28 +00001035/* use this setting for user code even if there's no exchangable battery
1036 * support enabled */
Thomas Martitzc1bd9b02012-01-03 23:44:38 +00001037#if BATTERY_CAPACITY_DEFAULT > 0
Thomas Martitz24424ba2010-09-01 23:49:28 +00001038/* define min/max/inc for this file if there's only one battery */
1039#ifndef BATTERY_CAPACITY_MIN
1040#define BATTERY_CAPACITY_MIN BATTERY_CAPACITY_DEFAULT
1041#define BATTERY_CAPACITY_MAX BATTERY_CAPACITY_DEFAULT
1042#define BATTERY_CAPACITY_INC 0
1043#endif
Frank Gevaerts6c5c3492011-07-19 20:55:59 +00001044#if defined(IPOD_VIDEO) && !defined(SIMULATOR)
Frank Gevaertsaa27d472011-07-19 20:48:16 +00001045 /* its easier to leave this one un-macro()ed for the time being */
1046 { F_T_INT|F_DEF_ISFUNC|F_INT_SETTING, &global_settings.battery_capacity,
1047 LANG_BATTERY_CAPACITY, FUNCTYPE(battery_default_capacity),
1048 "battery capacity", NULL , {
1049 .int_setting = (struct int_setting[]) {
1050 { set_battery_capacity, UNIT_MAH, BATTERY_CAPACITY_MIN,
1051 BATTERY_CAPACITY_MAX, BATTERY_CAPACITY_INC, NULL, NULL }}}},
1052#else /* IPOD_VIDEO */
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001053 INT_SETTING(0, battery_capacity, LANG_BATTERY_CAPACITY,
1054 BATTERY_CAPACITY_DEFAULT, "battery capacity", UNIT_MAH,
1055 BATTERY_CAPACITY_MIN, BATTERY_CAPACITY_MAX,
Frank Gevaertsaa27d472011-07-19 20:48:16 +00001056 BATTERY_CAPACITY_INC, NULL, NULL, set_battery_capacity),
1057#endif /* IPOD_VIDEO */
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +00001058#endif
Jonathan Gordon9a6f4192007-02-18 05:32:06 +00001059#if CONFIG_CHARGING
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001060 OFFON_SETTING(NVRAM(1), car_adapter_mode,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001061 LANG_CAR_ADAPTER_MODE, false, "car adapter mode", NULL),
Solomon Peachy0a6cad72019-01-01 21:05:13 -05001062 INT_SETTING_NOWRAP(0, car_adapter_mode_delay, LANG_CAR_ADAPTER_MODE_DELAY,
1063 5, "delay before resume", UNIT_SEC, 5, 30, 5,
1064 NULL, NULL, NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001065#endif
Michael Giacomelli70e9c7a2008-12-25 01:46:16 +00001066#ifdef IPOD_ACCESSORY_PROTOCOL
1067 CHOICE_SETTING(0, serial_bitrate, LANG_SERIAL_BITRATE, 0, "serial bitrate",
1068 "auto,9600,19200,38400,57600", iap_bitrate_set, 5, ID2P(LANG_SERIAL_BITRATE_AUTO),
Rob Purchaseed1a3352009-03-24 21:55:05 +00001069 ID2P(LANG_SERIAL_BITRATE_9600),ID2P(LANG_SERIAL_BITRATE_19200),
1070 ID2P(LANG_SERIAL_BITRATE_38400),ID2P(LANG_SERIAL_BITRATE_57600)),
Michael Giacomelli70e9c7a2008-12-25 01:46:16 +00001071#endif
Andree Buschmann850a1122008-04-20 18:28:25 +00001072#ifdef HAVE_ACCESSORY_SUPPLY
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001073 OFFON_SETTING(0, accessory_supply, LANG_ACCESSORY_SUPPLY,
1074 true, "accessory power supply", accessory_supply_set),
Andree Buschmann850a1122008-04-20 18:28:25 +00001075#endif
Andree Buschmannb6c12a12010-03-20 15:02:29 +00001076#ifdef HAVE_LINEOUT_POWEROFF
1077 OFFON_SETTING(0, lineout_active, LANG_LINEOUT_ONOFF,
1078 true, "lineout", lineout_set),
1079#endif
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001080 /* tuner */
Jens Arnoldc6522182007-02-18 08:46:12 +00001081#if CONFIG_TUNER
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001082 OFFON_SETTING(0,fm_force_mono, LANG_FM_MONO_MODE,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001083 false, "force fm mono", toggle_mono_mode),
1084 SYSTEM_SETTING(NVRAM(4),last_frequency,0),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001085#endif
1086
1087#if BATTERY_TYPES_COUNT > 1
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001088 CHOICE_SETTING(0, battery_type, LANG_BATTERY_TYPE, 0, "battery type",
1089 "alkaline,nimh", NULL, 2, ID2P(LANG_BATTERY_TYPE_ALKALINE),
1090 ID2P(LANG_BATTERY_TYPE_NIMH)),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001091#endif
1092#ifdef HAVE_REMOTE_LCD
1093 /* remote lcd */
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001094 INT_SETTING(0, remote_contrast, LANG_CONTRAST,
1095 DEFAULT_REMOTE_CONTRAST_SETTING, "remote contrast", UNIT_INT,
1096 MIN_REMOTE_CONTRAST_SETTING, MAX_REMOTE_CONTRAST_SETTING, 1,
1097 NULL, NULL, lcd_remote_set_contrast),
Jonathan Gordon40a253d2007-02-17 14:02:48 +00001098 BOOL_SETTING(0, remote_invert, LANG_INVERT, false ,"remote invert", off_on,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001099 LANG_INVERT_LCD_INVERSE, LANG_NORMAL,
1100 lcd_remote_set_invert_display),
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001101 OFFON_SETTING(0,remote_flip_display, LANG_FLIP_DISPLAY,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001102 false,"remote flip display", NULL),
William Wilgusa06d9c82018-12-17 22:27:55 -06001103 TABLE_SETTING_LIST(F_ALLOW_ARBITRARY_VALS, remote_backlight_timeout,
1104 LANG_BACKLIGHT, 5,
1105 "remote backlight timeout", off_on, UNIT_SEC,
1106 formatter_time_unit_0_is_always, getlang_time_unit_0_is_always,
1107 remote_backlight_set_timeout, 23, timeout_sec_common),
Jonathan Gordon9a6f4192007-02-18 05:32:06 +00001108#if CONFIG_CHARGING
William Wilgusa06d9c82018-12-17 22:27:55 -06001109 TABLE_SETTING_LIST(F_ALLOW_ARBITRARY_VALS, remote_backlight_timeout_plugged,
Jens Arnold124f8de2007-11-30 10:08:28 +00001110 LANG_BACKLIGHT_ON_WHEN_CHARGING, 10,
1111 "remote backlight timeout plugged", off_on, UNIT_SEC,
William Wilgusa06d9c82018-12-17 22:27:55 -06001112 formatter_time_unit_0_is_always, getlang_time_unit_0_is_always,
1113 remote_backlight_set_timeout_plugged, 23, timeout_sec_common),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001114#endif
1115#ifdef HAVE_REMOTE_LCD_TICKING
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001116 OFFON_SETTING(0, remote_reduce_ticking, LANG_REDUCE_TICKING,
1117 false,"remote reduce ticking", NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001118#endif
1119#endif
1120
Jens Arnold47bf6c52007-04-12 22:12:13 +00001121#ifdef HAVE_BACKLIGHT
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001122 OFFON_SETTING(0, bl_filter_first_keypress,
1123 LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
1124 "backlight filters first keypress", NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001125#ifdef HAVE_REMOTE_LCD
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001126 OFFON_SETTING(0, remote_bl_filter_first_keypress,
1127 LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
1128 "backlight filters first remote keypress", NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001129#endif
Jens Arnold47bf6c52007-04-12 22:12:13 +00001130#endif /* HAVE_BACKLIGHT */
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001131
1132/** End of old RTC config block **/
1133
William Wilgusdc87e9e2016-11-22 06:21:31 +01001134#ifndef HAS_BUTTON_HOLD
William Wilgus7d24ef12018-11-05 23:53:42 -05001135 OFFON_SETTING(F_BANFROMQS, bt_selective_softlock_actions,
William Wilgusdc87e9e2016-11-22 06:21:31 +01001136 LANG_ACTION_ENABLED, false,
1137 "No Screen Lock For Selected Actions", NULL),
William Wilgus7d24ef12018-11-05 23:53:42 -05001138 INT_SETTING(F_BANFROMQS, bt_selective_softlock_actions_mask,
1139 LANG_SOFTLOCK_SELECTIVE,
William Wilgusdc87e9e2016-11-22 06:21:31 +01001140 0, "Selective Screen Lock Actions", UNIT_INT,
1141 0, 2048,2, NULL, NULL, NULL),
1142#endif /* !HAS_BUTTON_HOLD */
1143
Jens Arnold47bf6c52007-04-12 22:12:13 +00001144#ifdef HAVE_BACKLIGHT
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001145 OFFON_SETTING(0, caption_backlight, LANG_CAPTION_BACKLIGHT,
1146 false, "caption backlight", NULL),
William Wilgusdc87e9e2016-11-22 06:21:31 +01001147
William Wilgus7d24ef12018-11-05 23:53:42 -05001148 OFFON_SETTING(F_BANFROMQS, bl_selective_actions,
William Wilgusdc87e9e2016-11-22 06:21:31 +01001149 LANG_ACTION_ENABLED, false,
1150 "No Backlight On Selected Actions", NULL),
1151
William Wilgus7d24ef12018-11-05 23:53:42 -05001152 INT_SETTING(F_BANFROMQS, bl_selective_actions_mask,
1153 LANG_BACKLIGHT_SELECTIVE,
William Wilgusdc87e9e2016-11-22 06:21:31 +01001154 0, "Selective Backlight Actions", UNIT_INT,
1155 0, 2048,2, NULL, NULL, NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001156#ifdef HAVE_REMOTE_LCD
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001157 OFFON_SETTING(0, remote_caption_backlight, LANG_CAPTION_BACKLIGHT,
1158 false, "remote caption backlight", NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001159#endif
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001160#ifdef HAVE_BACKLIGHT_BRIGHTNESS
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001161 INT_SETTING(F_NO_WRAP, brightness, LANG_BRIGHTNESS,
1162 DEFAULT_BRIGHTNESS_SETTING, "brightness",UNIT_INT,
1163 MIN_BRIGHTNESS_SETTING, MAX_BRIGHTNESS_SETTING, 1,
1164 NULL, NULL, backlight_set_brightness),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001165#endif
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001166 /* backlight fading */
Thomas Martitz12a0ed32009-01-26 23:21:49 +00001167#if defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
William Wilgusa06d9c82018-12-17 22:27:55 -06001168 TABLE_SETTING_LIST(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS, backlight_fade_in,
Jens Arnold09a78612007-11-26 23:10:20 +00001169 LANG_BACKLIGHT_FADE_IN, 300, "backlight fade in", "off",
William Wilgus4a8f2632018-12-22 13:53:00 -06001170 UNIT_MS, formatter_time_unit_0_is_off, getlang_time_unit_0_is_off,
William Wilgusa06d9c82018-12-17 22:27:55 -06001171 backlight_set_fade_in, 7, backlight_fade),
1172 TABLE_SETTING_LIST(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS, backlight_fade_out,
Jens Arnold09a78612007-11-26 23:10:20 +00001173 LANG_BACKLIGHT_FADE_OUT, 2000, "backlight fade out", "off",
William Wilgusa06d9c82018-12-17 22:27:55 -06001174 UNIT_MS, formatter_time_unit_0_is_off,
1175 getlang_time_unit_0_is_off,
1176 backlight_set_fade_out, 10, backlight_fade),
Thomas Martitz12a0ed32009-01-26 23:21:49 +00001177#elif defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING)
Steve Bavinf6847262008-11-26 08:26:13 +00001178 OFFON_SETTING(0, backlight_fade_in, LANG_BACKLIGHT_FADE_IN,
1179 true, "backlight fade in", backlight_set_fade_in),
1180 OFFON_SETTING(0, backlight_fade_out, LANG_BACKLIGHT_FADE_OUT,
1181 true, "backlight fade out", backlight_set_fade_out),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001182#endif
Thomas Martitz12a0ed32009-01-26 23:21:49 +00001183#endif /* HAVE_BACKLIGHT */
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001184 INT_SETTING(F_PADTITLE, scroll_speed, LANG_SCROLL_SPEED, 9,"scroll speed",
Michael Giacomelli36613d52012-01-09 03:26:03 +00001185 UNIT_INT, 0, 17, 1, NULL, NULL, lcd_scroll_speed),
William Wilgusa06d9c82018-12-17 22:27:55 -06001186 INT_SETTING(F_TIME_SETTING | F_PADTITLE, scroll_delay, LANG_SCROLL_DELAY,
1187 1000, "scroll delay", UNIT_MS, 0, 3000, 100,
1188 formatter_time_unit_0_is_off,
1189 getlang_time_unit_0_is_off, lcd_scroll_delay),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001190 INT_SETTING(0, bidir_limit, LANG_BIDIR_SCROLL, 50, "bidir limit",
Jonathan Gordon40a253d2007-02-17 14:02:48 +00001191 UNIT_PERCENT, 0, 200, 25, NULL, NULL, lcd_bidir_scroll),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001192#ifdef HAVE_REMOTE_LCD
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001193 INT_SETTING(0, remote_scroll_speed, LANG_SCROLL_SPEED, 9,
Michael Giacomelli36613d52012-01-09 03:26:03 +00001194 "remote scroll speed", UNIT_INT, 0,17, 1,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001195 NULL, NULL, lcd_remote_scroll_speed),
1196 INT_SETTING(0, remote_scroll_step, LANG_SCROLL_STEP, 6,
1197 "remote scroll step", UNIT_PIXEL, 1, LCD_REMOTE_WIDTH, 1, NULL,
1198 NULL, lcd_remote_scroll_step),
William Wilgusa06d9c82018-12-17 22:27:55 -06001199 INT_SETTING(F_TIME_SETTING, remote_scroll_delay, LANG_SCROLL_DELAY, 1000,
1200 "remote scroll delay", UNIT_MS, 0, 3000, 100,
1201 formatter_time_unit_0_is_off, getlang_time_unit_0_is_off,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001202 lcd_remote_scroll_delay),
1203 INT_SETTING(0, remote_bidir_limit, LANG_BIDIR_SCROLL, 50,
1204 "remote bidir limit", UNIT_PERCENT, 0, 200, 25, NULL, NULL,
1205 lcd_remote_bidir_scroll),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001206#endif
1207#ifdef HAVE_LCD_BITMAP
Jonathan Gordon40a253d2007-02-17 14:02:48 +00001208 OFFON_SETTING(0, offset_out_of_view, LANG_SCREEN_SCROLL_VIEW,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001209 false, "Screen Scrolls Out Of View",
1210 gui_list_screen_scroll_out_of_view),
1211 INT_SETTING(F_PADTITLE, scroll_step, LANG_SCROLL_STEP, 6, "scroll step",
1212 UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL, lcd_scroll_step),
1213 INT_SETTING(F_PADTITLE, screen_scroll_step, LANG_SCREEN_SCROLL_STEP, 16,
1214 "screen scroll step", UNIT_PIXEL, 1, LCD_WIDTH, 1, NULL, NULL,
1215 gui_list_screen_scroll_step),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001216#endif /* HAVE_LCD_BITMAP */
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001217 OFFON_SETTING(0,scroll_paginated,LANG_SCROLL_PAGINATED,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001218 false,"scroll paginated",NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001219#ifdef HAVE_LCD_COLOR
Michael Giacomelliaa269622008-02-23 03:56:39 +00001220
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001221 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.fg_color,-1,
1222 INT(DEFAULT_THEME_FOREGROUND),"foreground color",NULL,UNUSED},
1223 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.bg_color,-1,
1224 INT(DEFAULT_THEME_BACKGROUND),"background color",NULL,UNUSED},
1225 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.lss_color,-1,
1226 INT(DEFAULT_THEME_SELECTOR_START),"line selector start color",NULL,
1227 UNUSED},
1228 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.lse_color,-1,
1229 INT(DEFAULT_THEME_SELECTOR_END),"line selector end color",NULL,UNUSED},
1230 {F_T_INT|F_RGB|F_THEMESETTING ,&global_settings.lst_color,-1,
1231 INT(DEFAULT_THEME_SELECTOR_TEXT),"line selector text color",NULL,
1232 UNUSED},
Michael Giacomelliaa269622008-02-23 03:56:39 +00001233
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001234#endif
1235 /* more playback */
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001236 OFFON_SETTING(0,play_selected,LANG_PLAY_SELECTED,true,"play selected",NULL),
1237 OFFON_SETTING(0,party_mode,LANG_PARTY_MODE,false,"party mode",NULL),
1238 OFFON_SETTING(0,fade_on_stop,LANG_FADE_ON_STOP,true,"volume fade",NULL),
William Wilgusa06d9c82018-12-17 22:27:55 -06001239 INT_SETTING(F_TIME_SETTING, ff_rewind_min_step, LANG_FFRW_STEP, 1,
1240 "scan min step", UNIT_SEC, 1, 60, 1, NULL, NULL, NULL),
Marcoen Hirschberg2fb70bc2008-06-28 17:55:53 +00001241 CHOICE_SETTING(0, ff_rewind_accel, LANG_FFRW_ACCEL, 2,
Marcoen Hirschberg32601182008-06-29 14:53:21 +00001242 "seek acceleration", "very fast,fast,normal,slow,very slow", NULL, 5,
Marcoen Hirschberg2fb70bc2008-06-28 17:55:53 +00001243 ID2P(LANG_VERY_FAST), ID2P(LANG_FAST), ID2P(LANG_NORMAL),
1244 ID2P(LANG_SLOW) , ID2P(LANG_VERY_SLOW)),
Frank Gevaerts46573012008-10-07 19:37:33 +00001245#if (CONFIG_CODEC == SWCODEC) && defined(HAVE_DISK_STORAGE)
William Wilgusa06d9c82018-12-17 22:27:55 -06001246 TABLE_SETTING(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS, buffer_margin,
1247 LANG_MP3BUFFER_MARGIN, 5, "antiskip", NULL, UNIT_SEC,
1248 NULL, NULL,
1249 NULL,8, 5,15,30,60,120,180,300,600),
Frank Gevaerts46573012008-10-07 19:37:33 +00001250#elif defined(HAVE_DISK_STORAGE)
William Wilgusa06d9c82018-12-17 22:27:55 -06001251 INT_SETTING(F_TIME_SETTING, buffer_margin, LANG_MP3BUFFER_MARGIN, 0,
1252 "antiskip", UNIT_SEC, 0, 7, 1, formatter_time_unit_0_is_off,
1253 getlang_time_unit_0_is_off, audio_set_buffer_margin),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001254#endif
1255 /* disk */
Frank Gevaerts46573012008-10-07 19:37:33 +00001256#ifdef HAVE_DISK_STORAGE
William Wilgusa06d9c82018-12-17 22:27:55 -06001257 INT_SETTING(F_TIME_SETTING, disk_spindown, LANG_SPINDOWN, 5, "disk spindown",
Frank Gevaerts2f8a0082008-11-01 16:14:28 +00001258 UNIT_SEC, 3, 254, 1, NULL, NULL, storage_spindown),
Frank Gevaerts46573012008-10-07 19:37:33 +00001259#endif /* HAVE_DISK_STORAGE */
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001260 /* browser */
Jonathan Gordonefbcece2010-10-04 10:34:38 +00001261 TEXT_SETTING(0, start_directory, "start directory", "/", NULL, NULL),
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +00001262 CHOICE_SETTING(0, dirfilter, LANG_FILTER, SHOW_SUPPORTED, "show files",
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001263 "all,supported,music,playlists", NULL, 4, ID2P(LANG_ALL),
1264 ID2P(LANG_FILTER_SUPPORTED), ID2P(LANG_FILTER_MUSIC),
1265 ID2P(LANG_PLAYLISTS)),
Thomas Martitzd13f1a42009-03-01 17:55:59 +00001266 /* file sorting */
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001267 OFFON_SETTING(0, sort_case, LANG_SORT_CASE, false, "sort case", NULL),
Thomas Martitzd13f1a42009-03-01 17:55:59 +00001268 CHOICE_SETTING(0, sort_dir, LANG_SORT_DIR, 0 ,
1269 "sort dirs", "alpha,oldest,newest", NULL, 3,
1270 ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE),
1271 ID2P(LANG_SORT_DATE_REVERSE)),
1272 CHOICE_SETTING(0, sort_file, LANG_SORT_FILE, 0 ,
1273 "sort files", "alpha,oldest,newest,type", NULL, 4,
1274 ID2P(LANG_SORT_ALPHA), ID2P(LANG_SORT_DATE),
1275 ID2P(LANG_SORT_DATE_REVERSE) , ID2P(LANG_SORT_TYPE)),
1276 CHOICE_SETTING(0, interpret_numbers, LANG_SORT_INTERPRET_NUMBERS, 1,
1277 "sort interpret number", "digits,numbers",NULL, 2,
1278 ID2P(LANG_SORT_INTERPRET_AS_DIGIT),
1279 ID2P(LANG_SORT_INTERPRET_AS_NUMBERS)),
Peter D'Hoye043c9662007-08-13 23:11:30 +00001280 CHOICE_SETTING(0, show_filename_ext, LANG_SHOW_FILENAME_EXT, 3,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001281 "show filename exts", "off,on,unknown,view_all", NULL , 4 ,
1282 ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_UNKNOWN_TYPES),
1283 ID2P(LANG_EXT_ONLY_VIEW_ALL)),
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001284 OFFON_SETTING(0,browse_current,LANG_FOLLOW,false,"follow playlist",NULL),
1285 OFFON_SETTING(0,playlist_viewer_icons,LANG_SHOW_ICONS,true,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001286 "playlist viewer icons",NULL),
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001287 OFFON_SETTING(0,playlist_viewer_indices,LANG_SHOW_INDICES,true,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001288 "playlist viewer indices",NULL),
Jonathan Gordona2740d92007-04-25 11:20:19 +00001289 CHOICE_SETTING(0, playlist_viewer_track_display, LANG_TRACK_DISPLAY, 0,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001290 "playlist viewer track display","track name,full path",
1291 NULL, 2, ID2P(LANG_DISPLAY_TRACK_NAME_ONLY),
1292 ID2P(LANG_DISPLAY_FULL_PATH)),
Nils Wallménius479a6a72007-10-01 13:39:30 +00001293 CHOICE_SETTING(0, recursive_dir_insert, LANG_RECURSE_DIRECTORY , RECURSE_ON,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001294 "recursive directory insert", off_on_ask, NULL , 3 ,
1295 ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_ASK)),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001296 /* bookmarks */
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +00001297 CHOICE_SETTING(0, autocreatebookmark, LANG_BOOKMARK_SETTINGS_AUTOCREATE,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001298 BOOKMARK_NO, "autocreate bookmarks",
1299 "off,on,ask,recent only - on,recent only - ask", NULL, 5,
1300 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
1301 ID2P(LANG_ASK), ID2P(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES),
1302 ID2P(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK)),
Torne Wuffdb1b8232010-07-05 16:39:00 +00001303 OFFON_SETTING(0, autoupdatebookmark, LANG_BOOKMARK_SETTINGS_AUTOUPDATE,
1304 false, "autoupdate bookmarks", NULL),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001305 CHOICE_SETTING(0, autoloadbookmark, LANG_BOOKMARK_SETTINGS_AUTOLOAD,
1306 BOOKMARK_NO, "autoload bookmarks", off_on_ask, NULL, 3,
1307 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
1308 ID2P(LANG_ASK)),
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +00001309 CHOICE_SETTING(0, usemrb, LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001310 BOOKMARK_NO, "use most-recent-bookmarks",
Solomon Peachybea9cf72018-10-30 09:43:32 -04001311 "off,on,unique only,one per track", NULL, 4, ID2P(LANG_SET_BOOL_NO),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001312 ID2P(LANG_SET_BOOL_YES),
Solomon Peachybea9cf72018-10-30 09:43:32 -04001313 ID2P(LANG_BOOKMARK_SETTINGS_ONE_PER_PLAYLIST),
1314 ID2P(LANG_BOOKMARK_SETTINGS_ONE_PER_TRACK)),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001315#ifdef HAVE_LCD_BITMAP
1316 /* peak meter */
William Wilgusa06d9c82018-12-17 22:27:55 -06001317 TABLE_SETTING_LIST(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS, peak_meter_clip_hold,
1318 LANG_PM_CLIP_HOLD, 60, "peak meter clip hold", "eternal",
1319 UNIT_SEC, formatter_time_unit_0_is_eternal,
1320 getlang_time_unit_0_is_eternal, peak_meter_set_clip_hold,
1321 31, &timeout_sec_common[1]), /* skip -1 entry */
1322 TABLE_SETTING(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS, peak_meter_hold,
1323 LANG_PM_PEAK_HOLD, 500, "peak meter hold", off, UNIT_MS,
1324 formatter_time_unit_0_is_off, getlang_time_unit_0_is_off,NULL,
1325 18, 0,200,300,500,1000,2000,3000,4000,5000,6000,7000,8000,
1326 9000,10000,15000,20000,30000,60000),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001327 INT_SETTING(0, peak_meter_release, LANG_PM_RELEASE, 8, "peak meter release",
1328 UNIT_PM_TICK, 1, 0x7e, 1, NULL, NULL,NULL),
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001329 OFFON_SETTING(0,peak_meter_dbfs,LANG_PM_DBFS,true,"peak meter dbfs",NULL),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001330 {F_T_INT, &global_settings.peak_meter_min, LANG_PM_MIN,INT(60),
1331 "peak meter min", NULL, UNUSED},
1332 {F_T_INT, &global_settings.peak_meter_max, LANG_PM_MAX,INT(0),
1333 "peak meter max", NULL, UNUSED},
Peter D'Hoye6109d392007-08-26 21:34:36 +00001334#ifdef HAVE_RECORDING
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001335 OFFON_SETTING(0, peak_meter_clipcounter, LANG_PM_CLIPCOUNTER, false,
1336 "peak meter clipcounter", NULL),
Peter D'Hoye6109d392007-08-26 21:34:36 +00001337#endif /* HAVE_RECORDING */
1338#endif /* HAVE_LCD_BITMAP */
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001339#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
Jonathan Gordonb8bc45d2007-12-24 22:35:31 +00001340 SOUND_SETTING(F_SOUNDSETTING, mdb_strength, LANG_MDB_STRENGTH,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001341 "mdb strength", SOUND_MDB_STRENGTH),
Jonathan Gordonb8bc45d2007-12-24 22:35:31 +00001342 SOUND_SETTING(F_SOUNDSETTING, mdb_harmonics, LANG_MDB_HARMONICS,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001343 "mdb harmonics", SOUND_MDB_HARMONICS),
Jonathan Gordonb8bc45d2007-12-24 22:35:31 +00001344 SOUND_SETTING(F_SOUNDSETTING, mdb_center, LANG_MDB_CENTER,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001345 "mdb center", SOUND_MDB_CENTER),
Jonathan Gordonb8bc45d2007-12-24 22:35:31 +00001346 SOUND_SETTING(F_SOUNDSETTING, mdb_shape, LANG_MDB_SHAPE,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001347 "mdb shape", SOUND_MDB_SHAPE),
Jonathan Gordonb8bc45d2007-12-24 22:35:31 +00001348 OFFON_SETTING(F_SOUNDSETTING, mdb_enable, LANG_MDB_ENABLE,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001349 false, "mdb enable", set_mdb_enable),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001350#endif
1351#if CONFIG_CODEC == MAS3507D
Jonathan Gordonb8bc45d2007-12-24 22:35:31 +00001352 OFFON_SETTING(F_SOUNDSETTING, line_in,LANG_LINE_IN,false,"line in",NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001353#endif
1354 /* voice */
Jonathan Gordoncd2d62c2007-02-13 07:50:47 +00001355 OFFON_SETTING(F_TEMPVAR, talk_menu, LANG_VOICE_MENU, true, "talk menu", NULL),
Steve Bavin6fd10ba2007-06-07 09:24:53 +00001356 CHOICE_SETTING(0, talk_dir, LANG_VOICE_DIR, 0,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001357 "talk dir", off_number_spell, NULL, 3,
1358 ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
1359 ID2P(LANG_VOICE_SPELL)),
1360 OFFON_SETTING(F_TEMPVAR, talk_dir_clip, LANG_VOICE_DIR_TALK, false,
1361 "talk dir clip", NULL),
Steve Bavin6fd10ba2007-06-07 09:24:53 +00001362 CHOICE_SETTING(0, talk_file, LANG_VOICE_FILE, 0,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001363 "talk file", off_number_spell, NULL, 3,
1364 ID2P(LANG_OFF), ID2P(LANG_VOICE_NUMBER),
1365 ID2P(LANG_VOICE_SPELL)),
1366 OFFON_SETTING(F_TEMPVAR, talk_file_clip, LANG_VOICE_FILE_TALK, false,
1367 "talk file clip", NULL),
1368 OFFON_SETTING(F_TEMPVAR, talk_filetype, LANG_VOICE_FILETYPE, false,
1369 "talk filetype", NULL),
1370 OFFON_SETTING(F_TEMPVAR, talk_battery_level, LANG_TALK_BATTERY_LEVEL, false,
Stéphane Doyonda932992007-11-03 05:00:49 +00001371 "Announce Battery Level", NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001372
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001373#ifdef HAVE_RECORDING
William Wilgusa06d9c82018-12-17 22:27:55 -06001374 /* recording */
1375 TABLE_SETTING(F_TIME_SETTING | F_ALLOW_ARBITRARY_VALS | F_RECSETTING,
1376 rec_timesplit,
1377 LANG_SPLIT_TIME, 0, "rec timesplit", off, UNIT_MIN,
1378 formatter_time_unit_0_is_off, getlang_time_unit_0_is_off,NULL,
1379 16, 0,5,10,15,30,60,74,80,120,240,360,480,600,720,1080,1440),
Jonathan Gordon9adf0562007-05-29 04:39:11 +00001380 STRINGCHOICE_SETTING(F_RECSETTING, rec_sizesplit, LANG_SPLIT_SIZE, 0,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001381 "rec sizesplit",
1382 "off,5MB,10MB,15MB,32MB,64MB,75MB,100MB,128MB,"
1383 "256MB,512MB,650MB,700MB,1GB,1.5GB,1.75GB",
1384 NULL, 16, LANG_OFF,
1385 TALK_ID(5, UNIT_MB), TALK_ID(10, UNIT_MB),
1386 TALK_ID(15, UNIT_MB), TALK_ID(32, UNIT_MB),
1387 TALK_ID(64, UNIT_MB), TALK_ID(75, UNIT_MB),
1388 TALK_ID(100, UNIT_MB), TALK_ID(128, UNIT_MB),
1389 TALK_ID(256, UNIT_MB), TALK_ID(512, UNIT_MB),
1390 TALK_ID(650, UNIT_MB), TALK_ID(700, UNIT_MB),
1391 TALK_ID(1024, UNIT_MB), TALK_ID(1536, UNIT_MB),
1392 TALK_ID(1792, UNIT_MB)),
1393 {F_T_INT|F_RECSETTING, &global_settings.rec_channels, LANG_CHANNELS, INT(0),
1394 "rec channels","stereo,mono",UNUSED},
Peter D'Hoye528fe442008-10-08 22:18:16 +00001395#if CONFIG_CODEC == SWCODEC
1396 {F_T_INT|F_RECSETTING, &global_settings.rec_mono_mode,
1397 LANG_RECORDING_MONO_MODE, INT(0), "rec mono mode","L+R,L,R",UNUSED},
1398#endif
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001399 CHOICE_SETTING(F_RECSETTING, rec_split_type, LANG_SPLIT_TYPE, 0,
Peter D'Hoyea3524022008-05-15 22:47:07 +00001400 "rec split type", "Split,Stop,Shutdown", NULL, 3,
1401 ID2P(LANG_START_NEW_FILE), ID2P(LANG_STOP_RECORDING),ID2P(LANG_STOP_RECORDING_AND_SHUTDOWN)),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001402 CHOICE_SETTING(F_RECSETTING, rec_split_method, LANG_SPLIT_MEASURE, 0,
1403 "rec split method", "Time,Filesize", NULL, 2,
Mustapha Senhaji5e1e05f2010-12-24 03:31:40 +00001404 ID2P(LANG_TIME), ID2P(LANG_FILESIZE)),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001405 {F_T_INT|F_RECSETTING, &global_settings.rec_source, LANG_RECORDING_SOURCE,
1406 INT(0), "rec source",
William Wilgusdc87e9e2016-11-22 06:21:31 +01001407 &HAVE_MIC_REC_(",mic")
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001408 HAVE_LINE_REC_(",line")
1409 HAVE_SPDIF_REC_(",spdif")
1410 HAVE_FMRADIO_REC_(",fmradio")[1],
1411 UNUSED},
William Wilgusa06d9c82018-12-17 22:27:55 -06001412 INT_SETTING(F_TIME_SETTING | F_RECSETTING, rec_prerecord_time,
1413 LANG_RECORD_PRERECORD_TIME, 0,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001414 "prerecording time", UNIT_SEC, 0, 30, 1,
William Wilgusa06d9c82018-12-17 22:27:55 -06001415 formatter_time_unit_0_is_off, getlang_time_unit_0_is_off, NULL),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001416
Jonathan Gordon106b68e2008-10-23 00:29:17 +00001417 TEXT_SETTING(F_RECSETTING, rec_directory, "rec path",
1418 REC_BASE_DIR, NULL, NULL),
Jens Arnold47bf6c52007-04-12 22:12:13 +00001419#ifdef HAVE_BACKLIGHT
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001420 CHOICE_SETTING(F_RECSETTING, cliplight, LANG_CLIP_LIGHT, 0,
1421 "cliplight", "off,main,both,remote", NULL,
Jonathan Gordon120016f2007-03-13 11:48:47 +00001422#ifdef HAVE_REMOTE_LCD
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001423 4, ID2P(LANG_OFF), ID2P(LANG_MAIN_UNIT),
1424 ID2P(LANG_REMOTE_MAIN), ID2P(LANG_REMOTE_UNIT)
Jonathan Gordon120016f2007-03-13 11:48:47 +00001425#else
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001426 2, ID2P(LANG_OFF), ID2P(LANG_ON)
Jonathan Gordon120016f2007-03-13 11:48:47 +00001427#endif
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001428 ),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001429#endif
Michael Sevakisbcb8a882007-06-05 07:03:30 +00001430#ifdef DEFAULT_REC_MIC_GAIN
Jonathan Gordon9adf0562007-05-29 04:39:11 +00001431 {F_T_INT|F_RECSETTING,&global_settings.rec_mic_gain,
Nils Wallméniusb3113672007-08-05 19:19:39 +00001432 LANG_GAIN,INT(DEFAULT_REC_MIC_GAIN),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001433 "rec mic gain",NULL,UNUSED},
Michael Sevakisbcb8a882007-06-05 07:03:30 +00001434#endif /* DEFAULT_REC_MIC_GAIN */
1435#ifdef DEFAULT_REC_LEFT_GAIN
Jonathan Gordon9adf0562007-05-29 04:39:11 +00001436 {F_T_INT|F_RECSETTING,&global_settings.rec_left_gain,
Peter D'Hoye496e1f72008-08-06 20:12:44 +00001437 LANG_GAIN_LEFT,INT(DEFAULT_REC_LEFT_GAIN),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001438 "rec left gain",NULL,UNUSED},
Michael Sevakisbcb8a882007-06-05 07:03:30 +00001439#endif /* DEFAULT_REC_LEFT_GAIN */
1440#ifdef DEFAULT_REC_RIGHT_GAIN
Peter D'Hoye496e1f72008-08-06 20:12:44 +00001441 {F_T_INT|F_RECSETTING,&global_settings.rec_right_gain,LANG_GAIN_RIGHT,
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001442 INT(DEFAULT_REC_RIGHT_GAIN),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001443 "rec right gain",NULL,UNUSED},
Michael Sevakisbcb8a882007-06-05 07:03:30 +00001444#endif /* DEFAULT_REC_RIGHT_GAIN */
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001445#if CONFIG_CODEC == MAS3587F
Jonathan Gordon9adf0562007-05-29 04:39:11 +00001446 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency,
Michael Sevakis19b289a2013-07-06 17:14:02 -04001447 LANG_FREQUENCY, INT(0), "rec frequency",
1448 "44,48,32,22,24,16", UNUSED},
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001449 INT_SETTING(F_RECSETTING, rec_quality, LANG_RECORDING_QUALITY, 5,
1450 "rec quality", UNIT_INT, 0, 7, 1, NULL, NULL, NULL),
1451 OFFON_SETTING(F_RECSETTING, rec_editable, LANG_RECORDING_EDITABLE, false,
1452 "editable recordings", NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001453#endif /* CONFIG_CODEC == MAS3587F */
1454#if CONFIG_CODEC == SWCODEC
Jonathan Gordon9adf0562007-05-29 04:39:11 +00001455 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency,
Michael Sevakis19b289a2013-07-06 17:14:02 -04001456 LANG_FREQUENCY,INT(REC_FREQ_DEFAULT),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001457 "rec frequency",REC_FREQ_CFG_VAL_LIST,UNUSED},
Jonathan Gordon9adf0562007-05-29 04:39:11 +00001458 {F_T_INT|F_RECSETTING,&global_settings.rec_format,
1459 LANG_RECORDING_FORMAT,INT(REC_FORMAT_DEFAULT),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001460 "rec format",REC_FORMAT_CFG_VAL_LIST,UNUSED},
1461 /** Encoder settings start - keep these together **/
1462 /* aiff_enc */
1463 /* (no settings yet) */
1464 /* mp3_enc */
Jonathan Gordon9adf0562007-05-29 04:39:11 +00001465 {F_T_INT|F_RECSETTING, &global_settings.mp3_enc_config.bitrate,-1,
1466 INT(MP3_ENC_BITRATE_CFG_DEFAULT),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001467 "mp3_enc bitrate",MP3_ENC_BITRATE_CFG_VALUE_LIST,UNUSED},
1468 /* wav_enc */
1469 /* (no settings yet) */
1470 /* wavpack_enc */
1471 /* (no settings yet) */
1472 /** Encoder settings end **/
1473#endif /* CONFIG_CODEC == SWCODEC */
1474 /* values for the trigger */
Jonathan Gordonff469ab2008-05-28 10:55:39 +00001475 INT_SETTING(F_RECSETTING, rec_start_thres_db, LANG_RECORD_START_THRESHOLD, -35,
Michael Sevakise61e9c62013-04-20 04:06:13 -04001476 "trigger start threshold dB", UNIT_DB, -89, 0, 1, NULL, NULL, NULL),
Jonathan Gordonff469ab2008-05-28 10:55:39 +00001477 INT_SETTING(F_RECSETTING, rec_start_thres_linear, LANG_RECORD_START_THRESHOLD, 5,
1478 "trigger start threshold linear", UNIT_PERCENT, 0, 100, 1, NULL, NULL, NULL),
1479 INT_SETTING(F_RECSETTING, rec_stop_thres_db, LANG_RECORD_STOP_THRESHOLD, -45,
Michael Sevakise61e9c62013-04-20 04:06:13 -04001480 "trigger stop threshold dB", UNIT_DB, -89, 0, 1, NULL, NULL, NULL),
Jonathan Gordonff469ab2008-05-28 10:55:39 +00001481 INT_SETTING(F_RECSETTING, rec_stop_thres_linear, LANG_RECORD_STOP_THRESHOLD, 10,
1482 "trigger stop threshold linear", UNIT_PERCENT, 0, 100, 1, NULL, NULL, NULL),
William Wilgusa06d9c82018-12-17 22:27:55 -06001483 TABLE_SETTING_LIST(F_TIME_SETTING | F_RECSETTING, rec_start_duration,
1484 LANG_MIN_DURATION, 0, "trigger start duration",
1485 off, UNIT_SEC, NULL, NULL, NULL, 13, time_recording_trigger),
1486 TABLE_SETTING_LIST(F_TIME_SETTING | F_RECSETTING, rec_stop_postrec,
1487 LANG_MIN_DURATION, 0, "trigger stop duration",
1488 off, UNIT_SEC, NULL, NULL, NULL, 13, time_recording_trigger),
1489 TABLE_SETTING_LIST(F_TIME_SETTING | F_RECSETTING, rec_stop_gap,
1490 LANG_RECORD_STOP_GAP, 1, "trigger min gap",
1491 off, UNIT_SEC, NULL, NULL, NULL, 13, time_recording_trigger),
Jonathan Gordonff469ab2008-05-28 10:55:39 +00001492 CHOICE_SETTING(F_RECSETTING, rec_trigger_mode, LANG_RECORD_TRIGGER, TRIG_MODE_OFF,
1493 "trigger mode","off,once,repeat", NULL ,3,
1494 ID2P(LANG_OFF), ID2P(LANG_RECORD_TRIG_NOREARM), ID2P(LANG_REPEAT)),
1495 CHOICE_SETTING(F_RECSETTING, rec_trigger_type, LANG_RECORD_TRIGGER_TYPE, TRIG_TYPE_STOP,
Jonathan Gordon83696d92008-08-10 08:09:43 +00001496 "trigger type","stop,pause,nf stp", NULL ,3,
Jonathan Gordonff469ab2008-05-28 10:55:39 +00001497 ID2P(LANG_RECORD_TRIGGER_STOP), ID2P(LANG_PAUSE), ID2P(LANG_RECORD_TRIGGER_NEWFILESTP)),
Peter D'Hoye82f4c602011-06-05 12:36:27 +00001498#endif /* HAVE_RECORDING */
1499
1500#ifdef HAVE_HISTOGRAM
Peter D'Hoyebe90f742010-03-03 22:16:08 +00001501 /* TO DO: additional restictions of following REP items? */
William Wilgusa06d9c82018-12-17 22:27:55 -06001502 INT_SETTING(F_TIME_SETTING | F_RECSETTING, histogram_interval,
1503 LANG_HISTOGRAM_INTERVAL, 0,
1504 "histogram interval", UNIT_SEC, 0,4,1,
1505 NULL, NULL, NULL),
Peter D'Hoye82f4c602011-06-05 12:36:27 +00001506#endif /* HAVE_HISTOGRAM */
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001507
1508#ifdef HAVE_SPDIF_POWER
Jonathan Gordonb8bc45d2007-12-24 22:35:31 +00001509 OFFON_SETTING(F_SOUNDSETTING, spdif_enable, LANG_SPDIF_ENABLE, false,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001510 "spdif enable", spdif_power_enable),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001511#endif
Jonathan Gordonfb628312007-02-12 14:22:35 +00001512 CHOICE_SETTING(0, next_folder, LANG_NEXT_FOLDER, FOLDER_ADVANCE_OFF,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001513 "folder navigation", "off,on,random",NULL ,3,
1514 ID2P(LANG_SET_BOOL_NO), ID2P(LANG_SET_BOOL_YES),
1515 ID2P(LANG_RANDOM)),
Nick Peskettbe108172012-03-19 09:56:38 +00001516 BOOL_SETTING(0, constrain_next_folder, LANG_CONSTRAIN_NEXT_FOLDER, false,
1517 "constrain next folder", off_on,
1518 LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL),
Nils Wallménius071e3ef2009-01-03 13:41:54 +00001519
1520#ifdef HAVE_TAGCACHE
William Wilgusdc87e9e2016-11-22 06:21:31 +01001521#if CONFIG_CODEC == SWCODEC
Michael Hohmuthf0ce1882011-02-08 20:31:22 +00001522 BOOL_SETTING(0, autoresume_enable, LANG_AUTORESUME, false,
Michael Giacomelli66e8fc02011-01-02 02:49:13 +00001523 "autoresume enable", off_on,
Michael Hohmuthf0ce1882011-02-08 20:31:22 +00001524 LANG_SET_BOOL_YES, LANG_SET_BOOL_NO, NULL),
Michael Hohmuth7141ff42011-02-08 20:31:35 +00001525 CHOICE_SETTING(0, autoresume_automatic, LANG_AUTORESUME_AUTOMATIC,
1526 AUTORESUME_NEXTTRACK_NEVER,
1527 "autoresume next track", "never,all,custom",
1528 NULL, 3,
1529 ID2P(LANG_SET_BOOL_NO),
1530 ID2P(LANG_ALWAYS),
1531 ID2P(LANG_AUTORESUME_CUSTOM)),
Michael Hohmutha5303762011-02-11 00:20:03 +00001532 TEXT_SETTING(0, autoresume_paths, "autoresume next track paths",
1533 "/podcast:/podcasts", NULL, NULL),
William Wilgusdc87e9e2016-11-22 06:21:31 +01001534#endif
Marianne Arnold820bfb22011-01-12 16:20:48 +00001535
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001536 OFFON_SETTING(0, runtimedb, LANG_RUNTIMEDB_ACTIVE, false,
1537 "gather runtime data", NULL),
Thomas Martitz63d27622012-07-18 23:36:57 +02001538 TEXT_SETTING(0, tagcache_scan_paths, "database scan paths",
1539 DEFAULT_TAGCACHE_SCAN_PATHS, NULL, NULL),
Nils Wallménius071e3ef2009-01-03 13:41:54 +00001540#endif
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001541
1542#if CONFIG_CODEC == SWCODEC
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001543 /* replay gain */
Michael Sevakis57a20d22012-04-30 16:27:01 -04001544 CHOICE_SETTING(F_SOUNDSETTING, replaygain_settings.type,
1545 LANG_REPLAYGAIN_MODE, REPLAYGAIN_SHUFFLE, "replaygain type",
Alexander Levin8589fcb2009-06-20 21:13:24 +00001546 "track,album,track shuffle,off", NULL, 4, ID2P(LANG_TRACK_GAIN),
1547 ID2P(LANG_ALBUM_GAIN), ID2P(LANG_SHUFFLE_GAIN), ID2P(LANG_OFF)),
Michael Sevakis57a20d22012-04-30 16:27:01 -04001548 OFFON_SETTING(F_SOUNDSETTING, replaygain_settings.noclip,
1549 LANG_REPLAYGAIN_NOCLIP, false, "replaygain noclip", NULL),
1550 INT_SETTING_NOWRAP(F_SOUNDSETTING, replaygain_settings.preamp,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001551 LANG_REPLAYGAIN_PREAMP, 0, "replaygain preamp",
1552 UNIT_DB, -120, 120, 5, db_format, get_dec_talkid, NULL),
1553
1554 CHOICE_SETTING(0, beep, LANG_BEEP, 0, "beep", "off,weak,moderate,strong",
1555 NULL, 4, ID2P(LANG_OFF), ID2P(LANG_WEAK),
1556 ID2P(LANG_MODERATE), ID2P(LANG_STRONG)),
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001557
Michael Giacomelli64699262009-08-11 02:05:38 +00001558#ifdef HAVE_CROSSFADE
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001559 /* crossfade */
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001560 CHOICE_SETTING(F_SOUNDSETTING, crossfade, LANG_CROSSFADE_ENABLE, 0,
1561 "crossfade",
Jeffrey Goode29d27112009-11-12 15:42:37 +00001562 "off,auto track change,man track skip,shuffle,shuffle or man track skip,always",
Jeffrey Goode664dc902009-11-11 00:48:17 +00001563 NULL, 6, ID2P(LANG_OFF), ID2P(LANG_AUTOTRACKSKIP),
1564 ID2P(LANG_MANTRACKSKIP), ID2P(LANG_SHUFFLE),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001565 ID2P(LANG_SHUFFLE_TRACKSKIP), ID2P(LANG_ALWAYS)),
William Wilgusa06d9c82018-12-17 22:27:55 -06001566 INT_SETTING(F_TIME_SETTING | F_SOUNDSETTING, crossfade_fade_in_delay,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001567 LANG_CROSSFADE_FADE_IN_DELAY, 0,
1568 "crossfade fade in delay", UNIT_SEC, 0, 7, 1, NULL, NULL, NULL),
William Wilgusa06d9c82018-12-17 22:27:55 -06001569 INT_SETTING(F_TIME_SETTING | F_SOUNDSETTING, crossfade_fade_out_delay,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001570 LANG_CROSSFADE_FADE_OUT_DELAY, 0,
1571 "crossfade fade out delay", UNIT_SEC, 0, 7, 1, NULL, NULL,NULL),
William Wilgusa06d9c82018-12-17 22:27:55 -06001572 INT_SETTING(F_TIME_SETTING | F_SOUNDSETTING, crossfade_fade_in_duration,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001573 LANG_CROSSFADE_FADE_IN_DURATION, 2,
William Wilgusa06d9c82018-12-17 22:27:55 -06001574 "crossfade fade in duration", UNIT_SEC, 0, 15, 1, NULL, NULL, NULL),
1575 INT_SETTING(F_TIME_SETTING | F_SOUNDSETTING, crossfade_fade_out_duration,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001576 LANG_CROSSFADE_FADE_OUT_DURATION, 2,
William Wilgusa06d9c82018-12-17 22:27:55 -06001577 "crossfade fade out duration", UNIT_SEC, 0, 15, 1, NULL, NULL, NULL),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001578 CHOICE_SETTING(F_SOUNDSETTING, crossfade_fade_out_mixmode,
1579 LANG_CROSSFADE_FADE_OUT_MODE, 0,
1580 "crossfade fade out mode", "crossfade,mix", NULL, 2,
1581 ID2P(LANG_CROSSFADE), ID2P(LANG_MIX)),
Michael Giacomelli47a09012009-08-11 01:09:05 +00001582#endif
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001583
Jonathan Gordon4ca8a432007-01-26 05:45:06 +00001584 /* crossfeed */
Bertrik Sikkenafc96082012-05-01 03:58:27 -04001585 CHOICE_SETTING(F_SOUNDSETTING, crossfeed, LANG_CROSSFEED, 0,"crossfeed",
1586 "off,meier,custom", dsp_set_crossfeed_type, 3,
1587 ID2P(LANG_OFF), ID2P(LANG_CROSSFEED_MEIER),
1588 ID2P(LANG_CROSSFEED_CUSTOM)),
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001589 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_direct_gain,
1590 LANG_CROSSFEED_DIRECT_GAIN, -15,
1591 "crossfeed direct gain", UNIT_DB, -60, 0, 5,
1592 db_format, get_dec_talkid,dsp_set_crossfeed_direct_gain),
1593 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_cross_gain,
1594 LANG_CROSSFEED_CROSS_GAIN, -60,
1595 "crossfeed cross gain", UNIT_DB, -120, -30, 5,
1596 db_format, get_dec_talkid, crossfeed_cross_set),
1597 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_hf_attenuation,
1598 LANG_CROSSFEED_HF_ATTENUATION, -160,
1599 "crossfeed hf attenuation", UNIT_DB, -240, -60, 5,
1600 db_format, get_dec_talkid, crossfeed_cross_set),
1601 INT_SETTING_NOWRAP(F_SOUNDSETTING, crossfeed_hf_cutoff,
1602 LANG_CROSSFEED_HF_CUTOFF, 700,
1603 "crossfeed hf cutoff", UNIT_HERTZ, 500, 2000, 100,
1604 NULL, NULL, crossfeed_cross_set),
Dan Everton5886efa2007-12-07 10:59:07 +00001605
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001606 /* equalizer */
Dan Everton5886efa2007-12-07 10:59:07 +00001607 OFFON_SETTING(F_EQSETTING, eq_enabled, LANG_EQUALIZER_ENABLED, false,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001608 "eq enabled", NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001609
Dan Everton5886efa2007-12-07 10:59:07 +00001610 INT_SETTING_NOWRAP(F_EQSETTING, eq_precut, LANG_EQUALIZER_PRECUT, 0,
Hayden Pearcee4040d92013-03-05 12:15:27 +13001611 "eq precut", UNIT_DB, 0, 240, 1, eq_precut_format,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001612 get_precut_talkid, dsp_set_eq_precut),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001613
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001614 /* 0..32768 Hz */
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001615 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[0].cutoff, LANG_EQUALIZER_BAND_CUTOFF,
Hayden Pearced73c2092013-01-23 07:08:16 +13001616 32, "eq band 0 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001617 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001618 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[1].cutoff, LANG_EQUALIZER_BAND_CENTER,
Hayden Pearced73c2092013-01-23 07:08:16 +13001619 64, "eq band 1 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001620 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001621 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[2].cutoff, LANG_EQUALIZER_BAND_CENTER,
Hayden Pearced73c2092013-01-23 07:08:16 +13001622 125, "eq band 2 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001623 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001624 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[3].cutoff, LANG_EQUALIZER_BAND_CENTER,
Hayden Pearced73c2092013-01-23 07:08:16 +13001625 250, "eq band 3 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001626 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001627 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[4].cutoff, LANG_EQUALIZER_BAND_CENTER,
Hayden Pearced73c2092013-01-23 07:08:16 +13001628 500, "eq band 4 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1629 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001630 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[5].cutoff, LANG_EQUALIZER_BAND_CENTER,
Hayden Pearced73c2092013-01-23 07:08:16 +13001631 1000, "eq band 5 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1632 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001633 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[6].cutoff, LANG_EQUALIZER_BAND_CENTER,
Hayden Pearced73c2092013-01-23 07:08:16 +13001634 2000, "eq band 6 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1635 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001636 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[7].cutoff, LANG_EQUALIZER_BAND_CENTER,
Hayden Pearced73c2092013-01-23 07:08:16 +13001637 4000, "eq band 7 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1638 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001639 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[8].cutoff, LANG_EQUALIZER_BAND_CENTER,
Hayden Pearced73c2092013-01-23 07:08:16 +13001640 8000, "eq band 8 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
1641 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001642 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[9].cutoff, LANG_EQUALIZER_BAND_CUTOFF,
Hayden Pearced73c2092013-01-23 07:08:16 +13001643 16000, "eq band 9 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001644 EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL),
Jonathan Gordonb2e50902007-01-23 13:40:44 +00001645 /* 0..64 (or 0.0 to 6.4) */
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001646 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[0].q, LANG_EQUALIZER_BAND_Q, 7,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001647 "eq band 0 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1648 eq_q_format, get_dec_talkid, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001649 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[1].q, LANG_EQUALIZER_BAND_Q, 10,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001650 "eq band 1 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1651 eq_q_format, get_dec_talkid, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001652 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[2].q, LANG_EQUALIZER_BAND_Q, 10,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001653 "eq band 2 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1654 eq_q_format, get_dec_talkid, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001655 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[3].q, LANG_EQUALIZER_BAND_Q, 10,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001656 "eq band 3 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1657 eq_q_format, get_dec_talkid, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001658 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[4].q, LANG_EQUALIZER_BAND_Q, 10,
Peter D'Hoye5c3d5912008-05-11 23:13:59 +00001659 "eq band 4 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1660 eq_q_format, get_dec_talkid, NULL),
Jonathan Gordon1eb17dc2013-02-05 23:20:17 +11001661 INT_SETTING_NOWRAP(F_DEPRECATED|F_EQSETTING, eq_band_settings[5].q, LANG_EQUALIZER_BAND_Q, 10,
Hayden Pearced73c2092013-01-23 07:08:16 +13001662 "eq band 5 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP,
1663