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