Remove .a files before running ar, to avoid problems with renamed files remaining...
[kugel-rb.git] / apps / settings.h
blob84480593087729255735165290e37e98f30f3469
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Stuart Martin
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef __SETTINGS_H__
23 #define __SETTINGS_H__
25 #include <stdbool.h>
26 #include "inttypes.h"
27 #include "config.h"
28 #include "file.h"
29 #include "dircache.h"
30 #include "timefuncs.h"
31 #include "tagcache.h"
32 #ifndef __PCTOOL__
33 #include "button.h"
34 #endif
36 #if CONFIG_CODEC == SWCODEC
37 #include "audio.h"
38 #endif
40 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
41 #include "backlight.h" /* for [MIN|MAX]_BRIGHTNESS_SETTING */
42 #endif
44 struct opt_items {
45 unsigned const char* string;
46 int32_t voice_id;
49 /** Setting values defines **/
51 /* name of directory where configuration, fonts and other data
52 * files are stored */
53 #ifdef __PCTOOL__
54 #undef ROCKBOX_DIR
55 #undef ROCKBOX_DIR_LEN
56 #undef WPS_DIR
57 #define ROCKBOX_DIR "."
58 #define ROCKBOX_DIR_LEN 1
59 #else
60 #define ROCKBOX_DIR "/.rockbox"
61 #define ROCKBOX_DIR_LEN 9
62 #endif
64 #define FONT_DIR ROCKBOX_DIR "/fonts"
65 #define LANG_DIR ROCKBOX_DIR "/langs"
66 #define WPS_DIR ROCKBOX_DIR "/wps"
67 #define THEME_DIR ROCKBOX_DIR "/themes"
68 #define ICON_DIR ROCKBOX_DIR "/icons"
70 #define PLUGIN_DIR ROCKBOX_DIR "/rocks"
71 #define PLUGIN_GAMES_DIR PLUGIN_DIR "/games"
72 #define PLUGIN_APPS_DIR PLUGIN_DIR "/apps"
73 #define PLUGIN_DEMOS_DIR PLUGIN_DIR "/demos"
74 #define VIEWERS_DIR PLUGIN_DIR "/viewers"
76 #define BACKDROP_DIR ROCKBOX_DIR "/backdrops"
77 #define REC_BASE_DIR "/"
78 #define EQS_DIR ROCKBOX_DIR "/eqs"
79 #define CODECS_DIR ROCKBOX_DIR "/codecs"
80 #define RECPRESETS_DIR ROCKBOX_DIR "/recpresets"
81 #define FMPRESET_PATH ROCKBOX_DIR "/fmpresets"
82 #define PLAYLIST_CATALOG_DEFAULT_DIR "/Playlists"
84 #define VIEWERS_CONFIG ROCKBOX_DIR "/viewers.config"
85 #define CONFIGFILE ROCKBOX_DIR "/config.cfg"
86 #define FIXEDSETTINGSFILE ROCKBOX_DIR "/fixed.cfg"
88 #define MAX_FILENAME 32
91 #define BOOKMARK_NO 0
92 #define BOOKMARK_YES 1
93 #define BOOKMARK_ASK 2
94 #define BOOKMARK_UNIQUE_ONLY 2
95 #define BOOKMARK_RECENT_ONLY_YES 3
96 #define BOOKMARK_RECENT_ONLY_ASK 4
98 enum
100 TRIG_MODE_OFF = 0,
101 TRIG_MODE_NOREARM,
102 TRIG_MODE_REARM
105 enum
107 TRIG_TYPE_STOP = 0,
108 TRIG_TYPE_PAUSE,
109 TRIG_TYPE_NEW_FILE
112 #define CROSSFADE_ENABLE_SHUFFLE 1
113 #define CROSSFADE_ENABLE_TRACKSKIP 2
114 #define CROSSFADE_ENABLE_SHUFFLE_AND_TRACKSKIP 3
115 #define CROSSFADE_ENABLE_ALWAYS 4
117 #define FOLDER_ADVANCE_OFF 0
118 #define FOLDER_ADVANCE_NEXT 1
119 #define FOLDER_ADVANCE_RANDOM 2
121 /* repeat mode options */
122 enum
124 REPEAT_OFF,
125 REPEAT_ALL,
126 REPEAT_ONE,
127 REPEAT_SHUFFLE,
128 #ifdef AB_REPEAT_ENABLE
129 REPEAT_AB,
130 #endif
131 NUM_REPEAT_MODES
134 /* dir filter options */
135 /* Note: Any new filter modes need to be added before NUM_FILTER_MODES.
136 * Any new rockbox browse filter modes (accessible through the menu)
137 * must be added after NUM_FILTER_MODES. */
138 enum { SHOW_ALL, SHOW_SUPPORTED, SHOW_MUSIC, SHOW_PLAYLIST, SHOW_ID3DB,
139 NUM_FILTER_MODES,
140 SHOW_WPS, SHOW_RWPS, SHOW_FMR, SHOW_CFG, SHOW_LNG, SHOW_MOD, SHOW_FONT, SHOW_PLUGINS};
142 /* file and dir sort options */
143 enum { SORT_ALPHA, SORT_DATE, SORT_DATE_REVERSED, SORT_TYPE, /* available as settings */
144 SORT_ALPHA_REVERSED, SORT_TYPE_REVERSED }; /* internal use only */
146 /* recursive dir insert options */
147 enum { RECURSE_OFF, RECURSE_ON, RECURSE_ASK };
149 /* replaygain types */
150 enum { REPLAYGAIN_TRACK = 0, REPLAYGAIN_ALBUM, REPLAYGAIN_SHUFFLE };
152 /* show path types */
153 enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL };
155 /* Alarm settings */
156 #ifdef HAVE_RTC_ALARM
157 enum { ALARM_START_WPS = 0,
158 #if CONFIG_TUNER
159 ALARM_START_FM,
160 #endif
161 #ifdef HAVE_RECORDING
162 ALARM_START_REC,
163 #endif
164 ALARM_START_COUNT
166 #if CONFIG_TUNER && defined(HAVE_RECORDING)
167 #define ALARM_SETTING_TEXT "wps,fm,rec"
168 #elif CONFIG_TUNER
169 #define ALARM_SETTING_TEXT "wps,fm"
170 #elif defined(HAVE_RECORDING)
171 #define ALARM_SETTING_TEXT "wps,rec"
172 #endif
174 #endif /* HAVE_RTC_ALARM */
175 /** virtual pointer stuff.. move to another .h maybe? **/
176 /* These define "virtual pointers", which could either be a literal string,
177 or a mean a string ID if the pointer is in a certain range.
178 This helps to save space for menus and options. */
180 #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */
181 #ifdef SIMULATOR
182 /* a space which is defined in stubs.c */
183 extern unsigned char vp_dummy[VIRT_SIZE];
184 #define VIRT_PTR vp_dummy
185 #elif CONFIG_CPU==DM320
186 /* the DM320 has IRAM at 0, so we use 0xffff bytes right after that */
187 #define VIRT_PTR ((unsigned char*)0x4000)
188 #else
189 /* a location where we won't store strings, 0 is the fastest */
190 #define VIRT_PTR ((unsigned char*)0)
191 #endif
193 /* form a "virtual pointer" out of a language ID */
194 #define ID2P(id) (VIRT_PTR + id)
196 /* resolve a pointer which could be a virtualized ID or a literal */
197 #define P2STR(p) (char *)((p>=VIRT_PTR && p<VIRT_PTR+VIRT_SIZE) ? str(p-VIRT_PTR) : p)
199 /* get the string ID from a virtual pointer, -1 if not virtual */
200 #define P2ID(p) ((p>=VIRT_PTR && p<VIRT_PTR+VIRT_SIZE) ? p-VIRT_PTR : -1)
202 /* !defined(HAVE_LCD_COLOR) implies HAVE_LCD_CONTRAST with default 40.
203 Explicitly define HAVE_LCD_CONTRAST in config file for newer ports for
204 simplicity. */
208 /** function prototypes **/
210 /* argument bits for settings_load() */
211 #define SETTINGS_RTC 1 /* only the settings from the RTC nonvolatile RAM */
212 #define SETTINGS_HD 2 /* only the settings from the disk sector */
213 #define SETTINGS_ALL 3 /* both */
214 void settings_load(int which);
215 bool settings_load_config(const char* file, bool apply);
217 void status_save(void);
218 int settings_save(void);
219 /* defines for the options paramater */
220 enum {
221 SETTINGS_SAVE_CHANGED = 0,
222 SETTINGS_SAVE_ALL,
223 SETTINGS_SAVE_THEME,
224 SETTINGS_SAVE_SOUND,
225 #ifdef HAVE_RECORDING
226 SETTINGS_SAVE_RECPRESETS,
227 #endif
228 #if CONFIG_CODEC == SWCODEC
229 SETTINGS_SAVE_EQPRESET,
230 #endif
232 bool settings_save_config(int options);
234 struct settings_list;
235 void reset_setting(const struct settings_list *setting, void *var);
236 void settings_reset(void);
237 void sound_settings_apply(void);
238 void settings_apply(bool read_disk);
239 void settings_apply_pm_range(void);
240 void settings_display(void);
242 enum optiontype { INT, BOOL };
244 const struct settings_list* find_setting(const void* variable, int *id);
245 bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len);
246 bool set_bool_options(const char* string, const bool* variable,
247 const char* yes_str, int yes_voice,
248 const char* no_str, int no_voice,
249 void (*function)(bool));
251 bool set_bool(const char* string, const bool* variable);
252 bool set_int(const unsigned char* string, const char* unit, int voice_unit,
253 const int* variable,
254 void (*function)(int), int step, int min, int max,
255 void (*formatter)(char*, size_t, int, const char*) );
257 /* use this one if you need to create a lang from the value (i.e with TALK_ID()) */
258 bool set_int_ex(const unsigned char* string, const char* unit, int voice_unit,
259 const int* variable,
260 void (*function)(int), int step, int min, int max,
261 void (*formatter)(char*, size_t, int, const char*),
262 int32_t (*get_talk_id)(int, int));
264 void set_file(const char* filename, char* setting, int maxlen);
266 bool set_option(const char* string, const void* variable, enum optiontype type,
267 const struct opt_items* options, int numoptions, void (*function)(int));
271 /** global_settings and global_status struct definitions **/
273 struct system_status
275 int resume_index; /* index in playlist (-1 for no active resume) */
276 uint32_t resume_offset; /* byte offset in mp3 file */
277 int runtime; /* current runtime since last charge */
278 int topruntime; /* top known runtime */
279 #ifdef HAVE_DIRCACHE
280 int dircache_size; /* directory cache structure last size, 22 bits */
281 #endif
282 #if CONFIG_TUNER
283 int last_frequency; /* Last frequency for resuming, in FREQ_STEP units,
284 relative to MIN_FREQ */
285 int statusbar_forced; /* fix the bug where the statusbar would stay shown
286 if powered off inside the fm screen...
287 for some reason the screen doesnt use global_settings.statusbar
288 obviously a better fix is to fix the screen... so remove this
289 when that happens */
290 #endif
291 signed char last_screen;
292 int viewer_icon_count;
295 struct user_settings
297 /* audio settings */
299 int volume; /* audio output volume in decibels range depends on the dac */
300 int balance; /* stereo balance: 0-100 0=left 50=bal 100=right */
301 int bass; /* bass boost/cut in decibels */
302 int treble; /* treble boost/cut in decibels */
303 int channel_config; /* Stereo, Mono, Custom, Mono left, Mono right, Karaoke */
304 int stereo_width; /* 0-255% */
306 #if CONFIG_CODEC != SWCODEC
307 int loudness; /* loudness eq: 0-100 0=off 100=max */
308 int avc; /* auto volume correct: 0=off, 1=20ms, 2=2s 3=4s 4=8s */
309 int mdb_strength; /* 0-127dB */
310 int mdb_harmonics; /* 0-100% */
311 int mdb_center; /* 20-300Hz */
312 int mdb_shape; /* 50-300Hz */
313 bool mdb_enable; /* true/false */
314 bool superbass; /* true/false */
315 #endif
317 #ifdef HAVE_WM8758
318 int bass_cutoff;
319 int treble_cutoff;
320 #endif
322 #if CONFIG_CODEC == SWCODEC
323 int crossfade; /* Enable crossfade (0=off,1=shuffle,2=trackskip,3=shuff&trackskip,4=always) */
324 int crossfade_fade_in_delay; /* Fade in delay (0-15s) */
325 int crossfade_fade_out_delay; /* Fade out delay (0-15s) */
326 int crossfade_fade_in_duration; /* Fade in duration (0-15s) */
327 int crossfade_fade_out_duration; /* Fade out duration (0-15s) */
328 int crossfade_fade_out_mixmode; /* Fade out mode (0=crossfade,1=mix) */
329 #endif
330 #ifdef HAVE_RECORDING
331 #if CONFIG_CODEC == SWCODEC
332 int rec_format; /* record format index */
333 #else
334 int rec_quality; /* 0-7 */
335 #endif /* CONFIG_CODEC == SWCODEC */
336 int rec_source; /* 0=mic, 1=line, 2=S/PDIF, 2 or 3=FM Radio */
337 int rec_frequency; /* 0 = 44.1kHz (depends on target)
338 1 = 48kHz
339 2 = 32kHz
340 3 = 22.05kHz
341 4 = 24kHz
342 5 = 16kHz */
343 int rec_channels; /* 0=Stereo, 1=Mono */
344 #if CONFIG_CODEC == SWCODEC
345 int rec_mono_mode; /* how to create mono: L, R, L+R */
346 #endif
347 int rec_mic_gain; /* depends on target */
348 int rec_left_gain; /* depends on target */
349 int rec_right_gain; /* depands on target */
350 bool rec_editable; /* true means that the bit reservoir is off */
352 /* note: timesplit setting is not saved */
353 int rec_timesplit; /* 0 = off,
354 1 = 00:05, 2 = 00:10, 3 = 00:15, 4 = 00:30
355 5 = 01:00, 6 = 02:00, 7 = 04:00, 8 = 06:00
356 9 = 08:00, 10= 10:00, 11= 12:00, 12= 18:00,
357 13= 24:00 */
358 int rec_sizesplit; /* 0 = off,
359 1 = 5MB, 2 = 10MB, 3 = 15MB, 4 = 32MB
360 5 = 64MB, 6 = 75MB, 7 = 100MB, 8 = 128MB
361 9 = 256MB, 10= 512MB, 11= 650MB, 12= 700MB,
362 13= 1GB, 14 = 1.5GB 15 = 1.75MB*/
363 int rec_split_type; /* split/stop */
364 int rec_split_method; /* time/filesize */
366 int rec_prerecord_time; /* In seconds, 0-30, 0 means OFF */
367 char rec_directory[MAX_FILENAME+1];
368 int cliplight; /* 0 = off
369 1 = main lcd
370 2 = main and remote lcd
371 3 = remote lcd */
373 int rec_start_thres_db;
374 int rec_start_thres_linear;
375 int rec_start_duration; /* index of trig_durations */
376 int rec_stop_thres_db;
377 int rec_stop_thres_linear;
378 int rec_stop_postrec;
379 int rec_stop_gap; /* index of trig_durations */
380 int rec_trigger_mode; /* see TRIG_MODE_XXX constants */
381 int rec_trigger_type; /* what to do when trigger released */
383 #ifdef HAVE_AGC
384 int rec_agc_preset_mic; /* AGC mic preset modes:
385 0 = Off
386 1 = Safety (clip)
387 2 = Live (slow)
388 3 = DJ-Set (slow)
389 4 = Medium
390 5 = Voice (fast) */
391 int rec_agc_preset_line; /* AGC line-in preset modes:
392 0 = Off
393 1 = Safety (clip)
394 2 = Live (slow)
395 3 = DJ-Set (slow)
396 4 = Medium
397 5 = Voice (fast) */
398 int rec_agc_maxgain_mic; /* AGC maximum mic gain */
399 int rec_agc_maxgain_line; /* AGC maximum line-in gain */
400 int rec_agc_cliptime; /* 0.2, 0.4, 0.6, 0.8, 1s */
401 #endif
402 #endif /* HAVE_RECORDING */
403 /* device settings */
405 #ifdef HAVE_LCD_CONTRAST
406 int contrast; /* lcd contrast */
407 #endif
408 bool invert; /* invert display */
409 int cursor_style; /* style of the selection cursor */
410 bool flip_display; /* turn display (and button layout) by 180 degrees */
411 int poweroff; /* power off timer */
412 int backlight_timeout; /* backlight off timeout: 0-18 0=never,
413 1=always,
414 then according to timeout_values[] */
415 #if CONFIG_CHARGING
416 int backlight_timeout_plugged;
417 #endif
419 #ifdef HAVE_BACKLIGHT_PWM_FADING
420 int backlight_fade_in; /* backlight fade in timing: 0..3 */
421 int backlight_fade_out; /* backlight fade in timing: 0..7 */
422 #endif
423 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
424 int brightness;
425 #endif
426 int battery_capacity; /* in mAh */
427 #if BATTERY_TYPES_COUNT > 1
428 int battery_type; /* for units which can take multiple types (Ondio). */
429 #endif
430 #ifdef HAVE_SPDIF_POWER
431 bool spdif_enable; /* S/PDIF power on/off */
432 #endif
434 #if CONFIG_TUNER
435 unsigned char fmr_file[MAX_FILENAME+1]; /* last fmr preset */
436 #endif
437 #ifdef HAVE_LCD_BITMAP
438 unsigned char font_file[MAX_FILENAME+1]; /* last font */
439 #endif
440 unsigned char wps_file[MAX_FILENAME+1]; /* last wps */
441 unsigned char lang_file[MAX_FILENAME+1]; /* last language */
443 /* misc options */
445 int repeat_mode; /* 0=off 1=repeat all 2=repeat one 3=shuffle 4=ab */
446 int dirfilter; /* 0=display all, 1=only supported, 2=only music,
447 3=dirs+playlists, 4=ID3 database */
448 bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */
449 int show_filename_ext; /* show filename extensions in file browser?
450 0 = no, 1 = yes, 2 = only unknown 0 */
451 int volume_type; /* how volume is displayed: 0=graphic, 1=percent */
452 int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
453 int timeformat; /* time format: 0=24 hour clock, 1=12 hour clock */
454 bool playlist_shuffle;
455 bool play_selected; /* Plays selected file even in shuffle mode */
456 int ff_rewind_min_step; /* FF/Rewind minimum step size */
457 int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */
459 #ifdef HAVE_DISK_STORAGE
460 int disk_spindown; /* time until disk spindown, in seconds (0=off) */
461 int buffer_margin; /* MP3 buffer watermark margin, in seconds */
462 #endif
464 int peak_meter_release; /* units per read out */
465 int peak_meter_hold; /* hold time for peak meter in 1/100 s */
466 int peak_meter_clip_hold; /* hold time for clips */
467 bool peak_meter_dbfs; /* show linear or dbfs values */
468 int peak_meter_min; /* range minimum */
469 int peak_meter_max; /* range maximum */
470 #ifdef HAVE_RECORDING
471 bool peak_meter_clipcounter; /* clipping count indicator */
472 #endif
473 bool car_adapter_mode; /* 0=off 1=on */
474 #ifdef HAVE_ACCESSORY_SUPPLY
475 bool accessory_supply; /* 0=off 1=on, accessory power supply for iPod */
476 #endif
478 /* show status bar */
479 bool statusbar; /* 0=hide, 1=show */
481 #if CONFIG_KEYPAD == RECORDER_PAD
482 /* show button bar */
483 bool buttonbar; /* 0=hide, 1=show */
484 #endif
486 /* show scroll bar */
487 bool scrollbar; /* 0=hide, 1=show */
489 /* goto current song when exiting WPS */
490 bool browse_current; /* 1=goto current song,
491 0=goto previous location */
494 int scroll_speed; /* long texts scrolling speed: 1-30 */
495 int bidir_limit; /* bidir scroll length limit */
496 int scroll_delay; /* delay (in 1/10s) before starting scroll */
497 int scroll_step; /* pixels to advance per update */
498 #ifdef HAVE_REMOTE_LCD
499 int remote_scroll_speed; /* long texts scrolling speed: 1-30 */
500 int remote_scroll_delay; /* delay (in 1/10s) before starting scroll */
501 int remote_scroll_step; /* pixels to advance per update */
502 int remote_bidir_limit; /* bidir scroll length limit */
503 #endif
505 #ifdef HAVE_LCD_BITMAP
506 bool offset_out_of_view;
507 int screen_scroll_step;
508 #endif
510 /* auto bookmark settings */
511 int autoloadbookmark; /* auto load option: 0=off, 1=ask, 2=on */
512 int autocreatebookmark; /* auto create option: 0=off, 1=ask, 2=on */
513 int usemrb; /* use MRB list: 0=No, 1=Yes*/
514 #ifdef HAVE_LCD_CHARCELLS
515 int jump_scroll; /* Fast jump when scrolling */
516 int jump_scroll_delay; /* Delay between jump scroll screens */
517 #endif
518 bool fade_on_stop; /* fade on pause/unpause/stop */
519 bool caption_backlight; /* turn on backlight at end and start of track */
521 #if CONFIG_TUNER
522 int fm_freq_step; /* Frequency step for manual tuning, in kHz */
523 bool fm_force_mono; /* Forces Mono mode if true */
524 bool fm_full_range; /* Enables full 10MHz-160MHz range if true, else
525 only 88MHz-108MHz */
526 #endif
528 int max_files_in_dir; /* Max entries in directory (file browser) */
529 int max_files_in_playlist; /* Max entries in playlist */
530 bool show_icons; /* 0=hide 1=show */
531 int recursive_dir_insert; /* should directories be inserted recursively */
533 #if CONFIG_CODEC == MAS3507D
534 bool line_in; /* false=off, true=active */
535 #endif
537 /* playlist viewer settings */
538 bool playlist_viewer_icons; /* display icons on viewer */
539 bool playlist_viewer_indices; /* display playlist indices on viewer */
540 int playlist_viewer_track_display; /* how to display tracks in viewer */
542 /* voice UI settings */
543 bool talk_menu; /* enable voice UI */
544 int talk_dir; /* voiced directories mode: 0=off 1=number 2=spell */
545 bool talk_dir_clip; /* use directory .talk clips */
546 int talk_file; /* voice file mode: 0=off, 1=number, 2=spell */
547 bool talk_file_clip; /* use file .talk clips */
548 bool talk_filetype; /* say file type */
549 bool talk_battery_level;
551 /* file browser sorting */
552 int sort_file; /* 0=alpha, 1=date, 2=date (new first), 3=type */
553 int sort_dir; /* 0=alpha, 1=date (old first), 2=date (new first) */
555 #ifdef HAVE_REMOTE_LCD
556 /* remote lcd */
557 int remote_contrast; /* lcd contrast: 0-63 0=low 63=high */
558 bool remote_invert; /* invert display */
559 bool remote_flip_display; /* turn display (and button layout) by 180 degrees */
560 int remote_backlight_timeout; /* backlight off timeout: 0-18 0=never,
561 1=always,
562 then according to timeout_values[] */
563 int remote_backlight_timeout_plugged;
564 bool remote_caption_backlight; /* turn on backlight at end and start of track */
565 #ifdef HAS_REMOTE_BUTTON_HOLD
566 int remote_backlight_on_button_hold; /* what to do with remote backlight when hold
567 switch is on */
568 #endif
569 #ifdef HAVE_REMOTE_LCD_TICKING
570 bool remote_reduce_ticking; /* 0=normal operation,
571 1=EMI reduce on with cost more CPU. */
572 #endif
573 #endif /* HAVE_REMOTE_LCD */
575 int next_folder; /* move to next folder */
576 bool runtimedb; /* runtime database active? */
578 #if CONFIG_CODEC == SWCODEC
579 bool replaygain; /* enable replaygain */
580 bool replaygain_noclip; /* scale to prevent clips */
581 int replaygain_type; /* 0=track gain, 1=album gain, 2=track gain if
582 shuffle is on, album gain otherwise */
583 int replaygain_preamp; /* scale replaygained tracks by this */
584 int beep; /* system beep volume when changing tracks etc. */
586 /* Crossfeed settings */
587 bool crossfeed; /* enable crossfeed */
588 unsigned int crossfeed_direct_gain; /* dB x 10 */
589 unsigned int crossfeed_cross_gain; /* dB x 10 */
590 unsigned int crossfeed_hf_attenuation; /* dB x 10 */
591 unsigned int crossfeed_hf_cutoff; /* Frequency in Hz */
592 #endif
593 #ifdef HAVE_DIRCACHE
594 bool dircache; /* enable directory cache */
595 #endif
596 #ifdef HAVE_TAGCACHE
597 #ifdef HAVE_TC_RAMCACHE
598 bool tagcache_ram; /* load tagcache to ram? */
599 #endif
600 bool tagcache_autoupdate; /* automatically keep tagcache in sync? */
601 #endif
602 int default_codepage; /* set default codepage for tag conversion */
603 #ifdef HAVE_REMOTE_LCD
604 unsigned char rwps_file[MAX_FILENAME+1]; /* last remote-wps */
605 #endif
607 #if CONFIG_CODEC == SWCODEC
608 bool eq_enabled; /* Enable equalizer */
609 unsigned int eq_precut; /* dB */
611 /* Order is important here, must be cutoff, q, then gain for each band.
612 See dsp_eq_update_data in dsp.c for why. */
614 /* Band 0 settings */
615 int eq_band0_cutoff; /* Hz */
616 int eq_band0_q;
617 int eq_band0_gain; /* +/- dB */
619 /* Band 1 settings */
620 int eq_band1_cutoff; /* Hz */
621 int eq_band1_q;
622 int eq_band1_gain; /* +/- dB */
624 /* Band 2 settings */
625 int eq_band2_cutoff; /* Hz */
626 int eq_band2_q;
627 int eq_band2_gain; /* +/- dB */
629 /* Band 3 settings */
630 int eq_band3_cutoff; /* Hz */
631 int eq_band3_q;
632 int eq_band3_gain; /* +/- dB */
634 /* Band 4 settings */
635 int eq_band4_cutoff; /* Hz */
636 int eq_band4_q;
637 int eq_band4_gain; /* +/- dB */
639 bool dithering_enabled;
640 #endif
643 #if LCD_DEPTH > 1
644 unsigned char backdrop_file[MAX_FILENAME+1]; /* backdrop bitmap file */
645 #endif
647 bool warnon_erase_dynplaylist; /* warn when erasing dynamic playlist */
648 bool scroll_paginated; /* 0=dont 1=do */
649 #ifdef HAVE_LCD_COLOR
650 int bg_color; /* background color native format */
651 int fg_color; /* foreground color native format */
652 int lss_color; /* background color for the selector or start color for the gradient */
653 int lse_color; /* end color for the selector gradient */
654 int lst_color; /* color of the text for the selector */
655 #endif
656 bool party_mode; /* party mode - unstoppable music */
658 #ifdef HAVE_BACKLIGHT
659 bool bl_filter_first_keypress; /* filter first keypress when dark? */
660 #ifdef HAVE_REMOTE_LCD
661 bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */
662 #endif
663 #ifdef HAS_BUTTON_HOLD
664 int backlight_on_button_hold; /* what to do with backlight when hold
665 switch is on */
666 #endif
667 #ifdef HAVE_LCD_SLEEP_SETTING
668 int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight
669 has turned off */
670 #endif
671 #endif /* HAVE_BACKLIGHT */
673 #ifdef HAVE_LCD_BITMAP
674 unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */
675 #endif
677 #ifdef HAVE_USB_POWER
678 #if CONFIG_CHARGING
679 bool usb_charging;
680 #endif
681 #endif
683 bool hold_lr_for_scroll_in_list; /* hold L/R scrolls the list left/right */
684 #ifdef HAVE_LCD_BITMAP
685 int show_path_in_browser; /* 0=off, 1=current directory, 2=full path */
686 #endif
688 #ifdef HAVE_HEADPHONE_DETECTION
689 int unplug_mode; /* pause on headphone unplug */
690 int unplug_rw; /* time in s to rewind when pausing */
691 bool unplug_autoresume; /* disable auto-resume if no phones */
692 #endif
693 #if CONFIG_TUNER
694 int fm_region;
695 #endif
696 bool audioscrobbler; /* Audioscrobbler logging */
698 /* If values are just added to the end, no need to bump plugin API
699 version. */
700 /* new stuff to be added at the end */
702 #if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
703 /* Encoder Settings Start - keep these together */
704 struct mp3_enc_config mp3_enc_config;
705 #if 0 /* These currently contain no members but their places in line
706 should be held */
707 struct aiff_enc_config aiff_enc_config;
708 struct wav_enc_config wav_enc_config;
709 struct wavpack_enc_config wavpack_enc_config;
710 #endif
711 /* Encoder Settings End */
712 #endif /* CONFIG_CODEC == SWCODEC */
713 bool cuesheet;
714 int start_in_screen;
715 #if defined(HAVE_RTC_ALARM) && \
716 (defined(HAVE_RECORDING) || CONFIG_TUNER)
717 int alarm_wake_up_screen;
718 #endif
719 /* customizable icons */
720 #ifdef HAVE_LCD_BITMAP
721 unsigned char icon_file[MAX_FILENAME+1];
722 unsigned char viewers_icon_file[MAX_FILENAME+1];
723 #endif
724 #ifdef HAVE_REMOTE_LCD
725 unsigned char remote_icon_file[MAX_FILENAME+1];
726 unsigned char remote_viewers_icon_file[MAX_FILENAME+1];
727 #endif
728 #ifdef HAVE_LCD_COLOR
729 unsigned char colors_file[MAX_FILENAME+1];
730 #endif
731 #ifdef HAVE_BUTTON_LIGHT
732 int buttonlight_timeout;
733 #endif
734 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
735 int buttonlight_brightness;
736 #endif
737 #ifndef HAVE_SCROLLWHEEL
738 int list_accel_start_delay; /* ms before we start increaseing step size */
739 int list_accel_wait; /* ms between increases */
740 #endif
741 #ifdef HAVE_USBSTACK
742 int usb_stack_mode; /* device or host */
743 unsigned char usb_stack_device_driver[32]; /* usb device driver to load */
744 #endif
745 #if CONFIG_CODEC == SWCODEC
746 int keyclick; /* keyclick volume */
747 int keyclick_repeats; /* keyclick on repeats */
748 #endif
749 unsigned char playlist_catalog_dir[MAX_FILENAME+1];
750 int skip_length; /* skip length */
751 #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
752 int touchpad_sensitivity;
753 #endif
754 #ifdef HAVE_QUICKSCREEN
755 /* these are split because settings_list cant handle arrays */
756 int qs_item_left;
757 int qs_item_right;
758 int qs_item_bottom;
759 #endif
762 /** global variables **/
763 extern long lasttime;
764 /* global settings */
765 extern struct user_settings global_settings;
766 /* global status */
767 extern struct system_status global_status;
769 #endif /* __SETTINGS_H__ */