Change the way the MAX_FILETYPES define works. It now allocates enough filetype icons...
[Rockbox.git] / apps / settings.h
blob276a8b3f87ab0245ed65598ee5eacd5f930484c9
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by wavey@wavey.org
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef __SETTINGS_H__
21 #define __SETTINGS_H__
23 #include <stdbool.h>
24 #include "inttypes.h"
25 #include "config.h"
26 #include "file.h"
27 #include "dircache.h"
28 #include "timefuncs.h"
29 #include "tagcache.h"
30 #ifndef __PCTOOL__
31 #include "button.h"
32 #endif
34 #if CONFIG_CODEC == SWCODEC
35 #include "audio.h"
36 #endif
38 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
39 #include "backlight.h" /* for [MIN|MAX]_BRIGHTNESS_SETTING */
40 #endif
42 /** Setting values defines **/
44 /* name of directory where configuration, fonts and other data
45 * files are stored */
46 #ifdef __PCTOOL__
47 #define ROCKBOX_DIR "."
48 #define ROCKBOX_DIR_LEN 1
49 #else
50 #define ROCKBOX_DIR "/.rockbox"
51 #define ROCKBOX_DIR_LEN 9
52 #endif
54 #define FONT_DIR ROCKBOX_DIR "/fonts"
55 #define LANG_DIR ROCKBOX_DIR "/langs"
56 #define WPS_DIR ROCKBOX_DIR "/wps"
57 #define THEME_DIR ROCKBOX_DIR "/themes"
58 #define ICON_DIR ROCKBOX_DIR "/icons"
60 #define PLUGIN_DIR ROCKBOX_DIR "/rocks"
61 #define PLUGIN_GAMES_DIR PLUGIN_DIR "/games"
62 #define PLUGIN_APPS_DIR PLUGIN_DIR "/apps"
63 #define PLUGIN_DEMOS_DIR PLUGIN_DIR "/demos"
64 #define VIEWERS_DIR PLUGIN_DIR "/viewers"
66 #define BACKDROP_DIR ROCKBOX_DIR "/backdrops"
67 #define REC_BASE_DIR "/"
68 #define EQS_DIR ROCKBOX_DIR "/eqs"
69 #define CODECS_DIR ROCKBOX_DIR "/codecs"
70 #define RECPRESETS_DIR ROCKBOX_DIR "/recpresets"
71 #define FMPRESET_PATH ROCKBOX_DIR "/fmpresets"
73 #define VIEWERS_CONFIG ROCKBOX_DIR "/viewers.config"
74 #define CONFIGFILE ROCKBOX_DIR "/config.cfg"
75 #define FIXEDSETTINGSFILE ROCKBOX_DIR "/fixed.cfg"
77 #define MAX_FILENAME 32
80 #define BOOKMARK_NO 0
81 #define BOOKMARK_YES 1
82 #define BOOKMARK_ASK 2
83 #define BOOKMARK_UNIQUE_ONLY 2
84 #define BOOKMARK_RECENT_ONLY_YES 3
85 #define BOOKMARK_RECENT_ONLY_ASK 4
86 #define FF_REWIND_1000 0
87 #define FF_REWIND_2000 1
88 #define FF_REWIND_3000 2
89 #define FF_REWIND_4000 3
90 #define FF_REWIND_5000 4
91 #define FF_REWIND_6000 5
92 #define FF_REWIND_8000 6
93 #define FF_REWIND_10000 7
94 #define FF_REWIND_15000 8
95 #define FF_REWIND_20000 9
96 #define FF_REWIND_25000 10
97 #define FF_REWIND_30000 11
98 #define FF_REWIND_45000 12
99 #define FF_REWIND_60000 13
101 #define TRIG_MODE_OFF 0
102 #define TRIG_MODE_NOREARM 1
103 #define TRIG_MODE_REARM 2
105 #define TRIG_DURATION_COUNT 13
106 extern const char * const trig_durations[TRIG_DURATION_COUNT];
108 #define CROSSFADE_ENABLE_SHUFFLE 1
109 #define CROSSFADE_ENABLE_TRACKSKIP 2
110 #define CROSSFADE_ENABLE_SHUFFLE_AND_TRACKSKIP 3
111 #define CROSSFADE_ENABLE_ALWAYS 4
113 #define FOLDER_ADVANCE_OFF 0
114 #define FOLDER_ADVANCE_NEXT 1
115 #define FOLDER_ADVANCE_RANDOM 2
117 /* system defines */
118 #ifndef TARGET_TREE
120 #ifndef HAVE_LCD_COLOR
121 #define DEFAULT_CONTRAST_SETTING 40
122 #endif
124 #if defined HAVE_LCD_CHARCELLS
125 #define MIN_CONTRAST_SETTING 5
126 #define MAX_CONTRAST_SETTING 31
127 #else
128 #define MIN_CONTRAST_SETTING 5
129 #define MAX_CONTRAST_SETTING 63
130 #endif
132 /* As it was */
133 #ifdef HAVE_REMOTE_LCD
134 #ifndef DEFAULT_REMOTE_CONTRAST_SETTING
135 /* May be defined in config file if driver code needs the value */
136 #define DEFAULT_REMOTE_CONTRAST_SETTING 42
137 #endif
138 #define MIN_REMOTE_CONTRAST_SETTING MIN_CONTRAST_SETTING
139 #define MAX_REMOTE_CONTRAST_SETTING MAX_CONTRAST_SETTING
140 #endif
142 #endif /* !TARGET_TREE */
144 #if !defined(HAVE_LCD_COLOR)
145 #define HAVE_LCD_CONTRAST
146 #endif
148 #if CONFIG_CODEC == SWCODEC
149 #define MAX_FILETYPES 128
150 #else
151 #define MAX_FILETYPES 48
152 #endif
155 /* repeat mode options */
156 enum
158 REPEAT_OFF,
159 REPEAT_ALL,
160 REPEAT_ONE,
161 REPEAT_SHUFFLE,
162 #ifdef AB_REPEAT_ENABLE
163 REPEAT_AB,
164 #endif
165 NUM_REPEAT_MODES
168 /* dir filter options */
169 /* Note: Any new filter modes need to be added before NUM_FILTER_MODES.
170 * Any new rockbox browse filter modes (accessible through the menu)
171 * must be added after NUM_FILTER_MODES. */
172 enum { SHOW_ALL, SHOW_SUPPORTED, SHOW_MUSIC, SHOW_PLAYLIST, SHOW_ID3DB,
173 NUM_FILTER_MODES,
174 SHOW_WPS, SHOW_RWPS, SHOW_FMR, SHOW_CFG, SHOW_LNG, SHOW_MOD, SHOW_FONT, SHOW_PLUGINS};
176 /* recursive dir insert options */
177 enum { RECURSE_OFF, RECURSE_ON, RECURSE_ASK };
179 /* replaygain types */
180 enum { REPLAYGAIN_TRACK = 0, REPLAYGAIN_ALBUM, REPLAYGAIN_SHUFFLE };
182 /* show path types */
183 enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL };
185 /* Alarm settings */
186 #ifdef HAVE_RTC_ALARM
187 enum { ALARM_START_WPS = 0,
188 #if CONFIG_TUNER
189 ALARM_START_FM,
190 #endif
191 #ifdef HAVE_RECORDING
192 ALARM_START_REC,
193 #endif
194 ALARM_START_COUNT
196 #if CONFIG_TUNER && defined(HAVE_RECORDING)
197 #define ALARM_SETTING_TEXT "wps,fm,rec"
198 #elif CONFIG_TUNER
199 #define ALARM_SETTING_TEXT "wps,fm"
200 #elif defined(HAVE_RECORDING)
201 #define ALARM_SETTING_TEXT "wps,rec"
202 #endif
204 #endif /* HAVE_RTC_ALARM */
205 /** virtual pointer stuff.. move to another .h maybe? **/
206 /* These define "virtual pointers", which could either be a literal string,
207 or a mean a string ID if the pointer is in a certain range.
208 This helps to save space for menus and options. */
210 #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */
211 #ifdef SIMULATOR
212 /* a space which is defined in stubs.c */
213 extern unsigned char vp_dummy[VIRT_SIZE];
214 #define VIRT_PTR vp_dummy
215 #else
216 /* a location where we won't store strings, 0 is the fastest */
217 #define VIRT_PTR ((unsigned char*)0)
218 #endif
220 /* form a "virtual pointer" out of a language ID */
221 #define ID2P(id) (VIRT_PTR + id)
223 /* resolve a pointer which could be a virtualized ID or a literal */
224 #define P2STR(p) (char *)((p>=VIRT_PTR && p<=VIRT_PTR+VIRT_SIZE) ? str(p-VIRT_PTR) : p)
226 /* get the string ID from a virtual pointer, -1 if not virtual */
227 #define P2ID(p) ((p>=VIRT_PTR && p<=VIRT_PTR+VIRT_SIZE) ? p-VIRT_PTR : -1)
229 /* !defined(HAVE_LCD_COLOR) implies HAVE_LCD_CONTRAST with default 40.
230 Explicitly define HAVE_LCD_CONTRAST in config file for newer ports for
231 simplicity. */
235 /** function prototypes **/
237 /* argument bits for settings_load() */
238 #define SETTINGS_RTC 1 /* only the settings from the RTC nonvolatile RAM */
239 #define SETTINGS_HD 2 /* only the settings from the disk sector */
240 #define SETTINGS_ALL 3 /* both */
241 void settings_load(int which);
242 bool settings_load_config(const char* file, bool apply);
244 void status_save( void );
245 int settings_save(void);
246 /* defines for the options paramater */
247 enum {
248 SETTINGS_SAVE_CHANGED = 0,
249 SETTINGS_SAVE_ALL,
250 SETTINGS_SAVE_THEME,
251 #ifdef HAVE_RECORDING
252 SETTINGS_SAVE_RECPRESETS,
253 #endif
255 bool settings_save_config(int options);
257 void settings_reset(void);
258 void sound_settings_apply(void);
259 void settings_apply(void);
260 void settings_apply_pm_range(void);
261 void settings_display(void);
263 enum optiontype { INT, BOOL };
265 struct opt_items {
266 unsigned const char* string;
267 long voice_id;
269 const struct settings_list* find_setting(void* variable, int *id);
270 bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len);
271 void talk_setting(void *global_settings_variable);
272 bool set_sound(const unsigned char * string,
273 int* variable, int setting);
274 bool set_bool_options(const char* string, bool* variable,
275 const char* yes_str, int yes_voice,
276 const char* no_str, int no_voice,
277 void (*function)(bool));
279 bool set_bool(const char* string, bool* variable );
280 bool set_option(const char* string, void* variable, enum optiontype type,
281 const struct opt_items* options, int numoptions, void (*function)(int));
282 bool set_int(const unsigned char* string, const char* unit, int voice_unit,
283 int* variable,
284 void (*function)(int), int step, int min, int max,
285 void (*formatter)(char*, int, int, const char*) );
286 /* use this one if you need to create a lang from the value (i.e with TALK_ID()) */
287 bool set_int_ex(const unsigned char* string, const char* unit, int voice_unit,
288 int* variable,
289 void (*function)(int), int step, int min, int max,
290 void (*formatter)(char*, int, int, const char*),
291 long (*get_talk_id)(int));
293 /* the following are either not in setting.c or shouldnt be */
294 bool set_time_screen(const char* string, struct tm *tm);
295 int read_line(int fd, char* buffer, int buffer_size);
296 void set_file(char* filename, char* setting, int maxlen);
299 /** global_settings and global_status struct definitions **/
301 struct system_status
303 int resume_index; /* index in playlist (-1 for no active resume) */
304 int resume_first_index; /* index of first track in playlist */
305 uint32_t resume_offset; /* byte offset in mp3 file */
306 int resume_seed; /* shuffle seed (-1=no resume shuffle 0=sorted
307 >0=shuffled) */
308 int runtime; /* current runtime since last charge */
309 int topruntime; /* top known runtime */
310 #ifdef HAVE_DIRCACHE
311 int dircache_size; /* directory cache structure last size, 22 bits */
312 #endif
313 #if CONFIG_TUNER
314 int last_frequency; /* Last frequency for resuming, in FREQ_STEP units,
315 relative to MIN_FREQ */
316 #endif
317 char last_screen;
318 int filetype_count;
319 int viewer_icon_count;
322 struct user_settings
324 /* audio settings */
326 int volume; /* audio output volume: 0-100 0=off 100=max */
327 int balance; /* stereo balance: 0-100 0=left 50=bal 100=right */
328 int bass; /* bass eq: 0-100 0=off 100=max */
329 int treble; /* treble eq: 0-100 0=low 100=high */
330 int loudness; /* loudness eq: 0-100 0=off 100=max */
331 int avc; /* auto volume correct: 0=off, 1=20ms, 2=2s 3=4s 4=8s */
332 int channel_config; /* Stereo, Mono, Custom, Mono left, Mono right, Karaoke */
333 int stereo_width; /* 0-255% */
334 int mdb_strength; /* 0-127dB */
335 int mdb_harmonics; /* 0-100% */
336 int mdb_center; /* 20-300Hz */
337 int mdb_shape; /* 50-300Hz */
338 bool mdb_enable; /* true/false */
339 bool superbass; /* true/false */
341 #if CONFIG_CODEC == SWCODEC
342 int crossfade; /* Enable crossfade (0=off,1=shuffle,2=trackskip,3=shuff&trackskip,4=always) */
343 int crossfade_fade_in_delay; /* Fade in delay (0-15s) */
344 int crossfade_fade_out_delay; /* Fade out delay (0-15s) */
345 int crossfade_fade_in_duration; /* Fade in duration (0-15s) */
346 int crossfade_fade_out_duration; /* Fade out duration (0-15s) */
347 int crossfade_fade_out_mixmode; /* Fade out mode (0=crossfade,1=mix) */
348 #endif
349 #ifdef HAVE_RECORDING
350 #if CONFIG_CODEC == SWCODEC
351 int rec_format; /* record format index */
352 #else
353 int rec_quality; /* 0-7 */
354 #endif /* CONFIG_CODEC == SWCODEC */
355 int rec_source; /* 0=mic, 1=line, 2=S/PDIF, 2 or 3=FM Radio */
356 int rec_frequency; /* 0 = 44.1kHz (depends on target)
357 1 = 48kHz
358 2 = 32kHz
359 3 = 22.05kHz
360 4 = 24kHz
361 5 = 16kHz */
362 int rec_channels; /* 0=Stereo, 1=Mono */
363 int rec_mic_gain; /* depends on target */
364 int rec_left_gain; /* depends on target */
365 int rec_right_gain; /* depands on target */
366 bool rec_editable; /* true means that the bit reservoir is off */
368 /* note: timesplit setting is not saved */
369 int rec_timesplit; /* 0 = off,
370 1 = 00:05, 2 = 00:10, 3 = 00:15, 4 = 00:30
371 5 = 01:00, 6 = 02:00, 7 = 04:00, 8 = 06:00
372 9 = 08:00, 10= 10:00, 11= 12:00, 12= 18:00,
373 13= 24:00 */
374 int rec_sizesplit; /* 0 = off,
375 1 = 5MB, 2 = 10MB, 3 = 15MB, 4 = 32MB
376 5 = 64MB, 6 = 75MB, 7 = 100MB, 8 = 128MB
377 9 = 256MB, 10= 512MB, 11= 650MB, 12= 700MB,
378 13= 1GB, 14 = 1.5GB 15 = 1.75MB*/
379 int rec_split_type; /* split/stop */
380 int rec_split_method; /* time/filesize */
382 int rec_prerecord_time; /* In seconds, 0-30, 0 means OFF */
383 char rec_directory[MAX_FILENAME+1];
384 int cliplight; /* 0 = off
385 1 = main lcd
386 2 = main and remote lcd
387 3 = remote lcd */
389 int rec_start_thres; /* negative: db, positive: % range -87 .. 100 */
390 int rec_start_duration; /* index of trig_durations */
391 int rec_stop_thres; /* negative: db, positive: % */
392 int rec_stop_postrec; /* negative: db, positive: % range -87 .. 100 */
393 int rec_stop_gap; /* index of trig_durations */
394 int rec_trigger_mode; /* see TRIG_MODE_XXX constants */
395 int rec_trigger_type; /* what to do when trigger released */
397 #ifdef HAVE_AGC
398 int rec_agc_preset_mic; /* AGC mic preset modes:
399 0 = Off
400 1 = Safety (clip)
401 2 = Live (slow)
402 3 = DJ-Set (slow)
403 4 = Medium
404 5 = Voice (fast) */
405 int rec_agc_preset_line; /* AGC line-in preset modes:
406 0 = Off
407 1 = Safety (clip)
408 2 = Live (slow)
409 3 = DJ-Set (slow)
410 4 = Medium
411 5 = Voice (fast) */
412 int rec_agc_maxgain_mic; /* AGC maximum mic gain */
413 int rec_agc_maxgain_line; /* AGC maximum line-in gain */
414 int rec_agc_cliptime; /* 0.2, 0.4, 0.6, 0.8, 1s */
415 #endif
416 #endif /* HAVE_RECORDING */
417 /* device settings */
419 #ifdef HAVE_LCD_CONTRAST
420 int contrast; /* lcd contrast */
421 #endif
422 bool invert; /* invert display */
423 bool invert_cursor; /* invert the current file in dir browser and menu
424 instead of using the default cursor */
425 bool flip_display; /* turn display (and button layout) by 180 degrees */
426 int poweroff; /* power off timer */
427 int backlight_timeout; /* backlight off timeout: 0-18 0=never,
428 1=always,
429 then according to timeout_values[] */
430 int backlight_timeout_plugged;
431 #ifdef HAVE_BACKLIGHT_PWM_FADING
432 int backlight_fade_in; /* backlight fade in timing: 0..3 */
433 int backlight_fade_out; /* backlight fade in timing: 0..7 */
434 #endif
435 int battery_capacity; /* in mAh */
436 int battery_type; /* for units which can take multiple types (Ondio). */
438 #ifdef HAVE_SPDIF_POWER
439 bool spdif_enable; /* S/PDIF power on/off */
440 #endif
442 #if CONFIG_TUNER
443 unsigned char fmr_file[MAX_FILENAME+1]; /* last fmr preset */
444 #endif
445 unsigned char font_file[MAX_FILENAME+1]; /* last font */
446 unsigned char wps_file[MAX_FILENAME+1]; /* last wps */
447 unsigned char lang_file[MAX_FILENAME+1]; /* last language */
449 /* misc options */
451 int repeat_mode; /* 0=off 1=repeat all 2=repeat one 3=shuffle 4=ab */
452 int dirfilter; /* 0=display all, 1=only supported, 2=only music,
453 3=dirs+playlists, 4=ID3 database */
454 bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */
455 int volume_type; /* how volume is displayed: 0=graphic, 1=percent */
456 int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
457 int timeformat; /* time format: 0=24 hour clock, 1=12 hour clock */
458 bool playlist_shuffle;
459 bool play_selected; /* Plays selected file even in shuffle mode */
460 int ff_rewind_min_step; /* FF/Rewind minimum step size */
461 int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */
463 #ifndef HAVE_FLASH_STORAGE
464 int disk_spindown; /* time until disk spindown, in seconds (0=off) */
465 int buffer_margin; /* MP3 buffer watermark margin, in seconds */
466 #endif
468 int peak_meter_release; /* units per read out */
469 int peak_meter_hold; /* hold time for peak meter in 1/100 s */
470 int peak_meter_clip_hold; /* hold time for clips */
471 bool peak_meter_dbfs; /* show linear or dbfs values */
472 int peak_meter_min; /* range minimum */
473 int peak_meter_max; /* range maximum */
474 bool car_adapter_mode; /* 0=off 1=on */
476 /* show status bar */
477 bool statusbar; /* 0=hide, 1=show */
479 /* show button bar */
480 bool buttonbar; /* 0=hide, 1=show */
482 /* show scroll bar */
483 bool scrollbar; /* 0=hide, 1=show */
485 /* goto current song when exiting WPS */
486 bool browse_current; /* 1=goto current song,
487 0=goto previous location */
490 int scroll_speed; /* long texts scrolling speed: 1-30 */
491 int bidir_limit; /* bidir scroll length limit */
492 int scroll_delay; /* delay (in 1/10s) before starting scroll */
493 int scroll_step; /* pixels to advance per update */
494 #ifdef HAVE_REMOTE_LCD
495 int remote_scroll_speed; /* long texts scrolling speed: 1-30 */
496 int remote_scroll_delay; /* delay (in 1/10s) before starting scroll */
497 int remote_scroll_step; /* pixels to advance per update */
498 int remote_bidir_limit; /* bidir scroll length limit */
499 #endif
501 #ifdef HAVE_LCD_BITMAP
502 bool offset_out_of_view;
503 int screen_scroll_step;
504 #endif
506 /* auto bookmark settings */
507 int autoloadbookmark; /* auto load option: 0=off, 1=ask, 2=on */
508 int autocreatebookmark; /* auto create option: 0=off, 1=ask, 2=on */
509 int usemrb; /* use MRB list: 0=No, 1=Yes*/
510 #ifdef HAVE_LCD_CHARCELLS
511 int jump_scroll; /* Fast jump when scrolling */
512 int jump_scroll_delay; /* Delay between jump scroll screens */
513 #endif
514 bool fade_on_stop; /* fade on pause/unpause/stop */
515 bool caption_backlight; /* turn on backlight at end and start of track */
517 #if CONFIG_TUNER
518 int fm_freq_step; /* Frequency step for manual tuning, in kHz */
519 bool fm_force_mono; /* Forces Mono mode if true */
520 bool fm_full_range; /* Enables full 10MHz-160MHz range if true, else
521 only 88MHz-108MHz */
522 #endif
524 int max_files_in_dir; /* Max entries in directory (file browser) */
525 int max_files_in_playlist; /* Max entries in playlist */
526 bool show_icons; /* 0=hide 1=show */
527 int recursive_dir_insert; /* should directories be inserted recursively */
529 bool line_in; /* false=off, true=active */
531 bool id3_v1_first; /* true = ID3V1 has prio over ID3V2 tag */
533 /* playlist viewer settings */
534 bool playlist_viewer_icons; /* display icons on viewer */
535 bool playlist_viewer_indices; /* display playlist indices on viewer */
536 int playlist_viewer_track_display; /* how to display tracks in viewer */
538 /* voice UI settings */
539 bool talk_menu; /* enable voice UI */
540 int talk_dir; /* voiced directories mode: 0=off 1=number 2=spell */
541 bool talk_dir_clip; /* use directory .talk clips */
542 int talk_file; /* voice file mode: 0=off, 1=number, 2=spell */
543 bool talk_file_clip; /* use file .talk clips */
545 /* file browser sorting */
546 int sort_file; /* 0=alpha, 1=date, 2=date (new first), 3=type */
547 int sort_dir; /* 0=alpha, 1=date (old first), 2=date (new first) */
549 #ifdef HAVE_REMOTE_LCD
550 /* remote lcd */
551 int remote_contrast; /* lcd contrast: 0-63 0=low 63=high */
552 bool remote_invert; /* invert display */
553 bool remote_flip_display; /* turn display (and button layout) by 180 degrees */
554 int remote_backlight_timeout; /* backlight off timeout: 0-18 0=never,
555 1=always,
556 then according to timeout_values[] */
557 int remote_backlight_timeout_plugged;
558 bool remote_caption_backlight; /* turn on backlight at end and start of track */
559 #ifdef HAS_REMOTE_BUTTON_HOLD
560 int remote_backlight_on_button_hold; /* what to do with remote backlight when hold
561 switch is on */
562 #endif
563 #ifdef HAVE_REMOTE_LCD_TICKING
564 bool remote_reduce_ticking; /* 0=normal operation,
565 1=EMI reduce on with cost more CPU. */
566 #endif
567 #endif /* HAVE_REMOTE_LCD */
569 int next_folder; /* move to next folder */
570 bool runtimedb; /* runtime database active? */
572 #if CONFIG_CODEC == SWCODEC
573 bool replaygain; /* enable replaygain */
574 bool replaygain_noclip; /* scale to prevent clips */
575 int replaygain_type; /* 0=track gain, 1=album gain, 2=track gain if
576 shuffle is on, album gain otherwise */
577 int replaygain_preamp; /* scale replaygained tracks by this */
578 int beep; /* system beep volume when changing tracks etc. */
580 /* Crossfeed settings */
581 bool crossfeed; /* enable crossfeed */
582 unsigned int crossfeed_direct_gain; /* - dB x 10 */
583 unsigned int crossfeed_cross_gain; /* - dB x 10 */
584 unsigned int crossfeed_hf_attenuation; /* - dB x 10 */
585 unsigned int crossfeed_hf_cutoff; /* Frequency in Hz */
586 #endif
587 #ifdef HAVE_DIRCACHE
588 bool dircache; /* enable directory cache */
589 #endif
590 #ifdef HAVE_TAGCACHE
591 #ifdef HAVE_TC_RAMCACHE
592 bool tagcache_ram; /* load tagcache to ram? */
593 #endif
594 bool tagcache_autoupdate; /* automatically keep tagcache in sync? */
595 #endif
596 int default_codepage; /* set default codepage for tag conversion */
597 #ifdef HAVE_REMOTE_LCD
598 unsigned char rwps_file[MAX_FILENAME+1]; /* last remote-wps */
599 #endif
600 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
601 int brightness; /* iriver h300: backlight PWM value: 2..15
602 (0 and 1 are black) */
603 #endif
605 #if CONFIG_CODEC == SWCODEC
606 bool eq_enabled; /* Enable equalizer */
607 unsigned int eq_precut; /* dB */
609 /* Order is important here, must be cutoff, q, then gain for each band.
610 See dsp_eq_update_data in dsp.c for why. */
612 /* Band 0 settings */
613 int eq_band0_cutoff; /* Hz */
614 int eq_band0_q;
615 int eq_band0_gain; /* +/- dB */
617 /* Band 1 settings */
618 int eq_band1_cutoff; /* Hz */
619 int eq_band1_q;
620 int eq_band1_gain; /* +/- dB */
622 /* Band 2 settings */
623 int eq_band2_cutoff; /* Hz */
624 int eq_band2_q;
625 int eq_band2_gain; /* +/- dB */
627 /* Band 3 settings */
628 int eq_band3_cutoff; /* Hz */
629 int eq_band3_q;
630 int eq_band3_gain; /* +/- dB */
632 /* Band 4 settings */
633 int eq_band4_cutoff; /* Hz */
634 int eq_band4_q;
635 int eq_band4_gain; /* +/- dB */
637 bool dithering_enabled;
638 #endif
640 #if LCD_DEPTH > 1
641 unsigned char backdrop_file[MAX_FILENAME+1]; /* backdrop bitmap file */
642 #endif
644 bool warnon_erase_dynplaylist; /* warn when erasing dynamic playlist */
645 bool scroll_paginated; /* 0=dont 1=do */
646 #ifdef HAVE_LCD_COLOR
647 int bg_color; /* background color native format */
648 int fg_color; /* foreground color native format */
649 #endif
650 bool party_mode; /* party mode - unstoppable music */
652 #ifdef HAVE_BACKLIGHT
653 bool bl_filter_first_keypress; /* filter first keypress when dark? */
654 #ifdef HAVE_REMOTE_LCD
655 bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */
656 #endif
657 #ifdef HAS_BUTTON_HOLD
658 int backlight_on_button_hold; /* what to do with backlight when hold
659 switch is on */
660 #endif
661 #ifdef HAVE_LCD_SLEEP
662 int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight
663 has turned off */
664 #endif
665 #endif /* HAVE_BACKLIGHT */
667 #ifdef HAVE_LCD_BITMAP
668 unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */
669 #endif
671 #ifdef HAVE_USB_POWER
672 #if CONFIG_CHARGING
673 bool usb_charging;
674 #endif
675 #endif
677 #ifdef HAVE_WM8758
678 bool eq_hw_enabled; /* Enable hardware equalizer */
680 int eq_hw_band0_cutoff;
681 int eq_hw_band0_gain;
683 int eq_hw_band1_center;
684 int eq_hw_band1_bandwidth;
685 int eq_hw_band1_gain;
687 int eq_hw_band2_center;
688 int eq_hw_band2_bandwidth;
689 int eq_hw_band2_gain;
691 int eq_hw_band3_center;
692 int eq_hw_band3_bandwidth;
693 int eq_hw_band3_gain;
695 int eq_hw_band4_cutoff;
696 int eq_hw_band4_gain;
697 #endif
698 bool hold_lr_for_scroll_in_list; /* hold L/R scrolls the list left/right */
699 int show_path_in_browser; /* 0=off, 1=current directory, 2=full path */
701 #ifdef HAVE_HEADPHONE_DETECTION
702 int unplug_mode; /* pause on headphone unplug */
703 int unplug_rw; /* time in s to rewind when pausing */
704 bool unplug_autoresume; /* disable auto-resume if no phones */
705 #endif
706 #if CONFIG_TUNER
707 int fm_region;
708 #endif
709 bool audioscrobbler; /* Audioscrobbler logging */
711 /* If values are just added to the end, no need to bump plugin API
712 version. */
713 /* new stuff to be added at the end */
715 #if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
716 /* Encoder Settings Start - keep these together */
717 struct mp3_enc_config mp3_enc_config;
718 #if 0 /* These currently contain no members but their places in line
719 should be held */
720 struct aiff_enc_config aiff_enc_config;
721 struct wav_enc_config wav_enc_config;
722 struct wavpack_enc_config wavpack_enc_config;
723 #endif
724 /* Encoder Settings End */
725 #endif /* CONFIG_CODEC == SWCODEC */
726 bool cuesheet;
727 int start_in_screen;
728 #if defined(HAVE_RTC_ALARM) && \
729 (defined(HAVE_RECORDING) || CONFIG_TUNER)
730 int alarm_wake_up_screen;
731 #endif
732 /* customizable icons */
733 #ifdef HAVE_LCD_BITMAP
734 unsigned char icon_file[MAX_FILENAME+1];
735 unsigned char viewers_icon_file[MAX_FILENAME+1];
736 #endif
737 #ifdef HAVE_REMOTE_LCD
738 unsigned char remote_icon_file[MAX_FILENAME+1];
739 unsigned char remote_viewers_icon_file[MAX_FILENAME+1];
740 #endif
741 #ifdef HAVE_LCD_COLOR
742 unsigned char colors_file[MAX_FILENAME+1];
743 #endif
744 #ifdef HAVE_BUTTON_LIGHT
745 int button_light_timeout;
746 #endif
747 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
748 int buttonlight_brightness;
749 #endif
750 #ifndef HAVE_SCROLLWHEEL
751 int list_accel_start_delay; /* ms before we start increaseing step size */
752 int list_accel_wait; /* ms between increases */
753 #endif
756 /** global variables **/
757 extern long lasttime;
758 /* global settings */
759 extern struct user_settings global_settings;
760 /* global status */
761 extern struct system_status global_status;
763 #endif /* __SETTINGS_H__ */