Change i2c config on e200. Seems to speed things up somewhat.
[kugel-rb.git] / apps / settings.h
blob5e9da84bae453fb044d33ef73572e8c0fe51567c
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"
59 #define PLUGIN_DIR ROCKBOX_DIR "/rocks"
60 #define VIEWERS_DIR ROCKBOX_DIR "/viewers"
61 #define BACKDROP_DIR ROCKBOX_DIR "/backdrops"
62 #define REC_BASE_DIR "/recordings"
63 #define EQS_DIR ROCKBOX_DIR "/eqs"
64 #define CODECS_DIR ROCKBOX_DIR"/codecs"
65 #define FMPRESET_PATH ROCKBOX_DIR "/fmpresets"
67 #define VIEWERS_CONFIG ROCKBOX_DIR "/viewers.config"
68 #define CONFIGFILE ROCKBOX_DIR "/config.cfg"
69 #define FIXEDSETTINGSFILE ROCKBOX_DIR "/fixed.cfg"
71 #define MAX_FILENAME 32
74 #define BOOKMARK_NO 0
75 #define BOOKMARK_YES 1
76 #define BOOKMARK_ASK 2
77 #define BOOKMARK_UNIQUE_ONLY 2
78 #define BOOKMARK_RECENT_ONLY_YES 3
79 #define BOOKMARK_RECENT_ONLY_ASK 4
80 #define FF_REWIND_1000 0
81 #define FF_REWIND_2000 1
82 #define FF_REWIND_3000 2
83 #define FF_REWIND_4000 3
84 #define FF_REWIND_5000 4
85 #define FF_REWIND_6000 5
86 #define FF_REWIND_8000 6
87 #define FF_REWIND_10000 7
88 #define FF_REWIND_15000 8
89 #define FF_REWIND_20000 9
90 #define FF_REWIND_25000 10
91 #define FF_REWIND_30000 11
92 #define FF_REWIND_45000 12
93 #define FF_REWIND_60000 13
95 #define TRIG_MODE_OFF 0
96 #define TRIG_MODE_NOREARM 1
97 #define TRIG_MODE_REARM 2
99 #define TRIG_DURATION_COUNT 13
100 extern const char * const trig_durations[TRIG_DURATION_COUNT];
102 #define CROSSFADE_ENABLE_SHUFFLE 1
103 #define CROSSFADE_ENABLE_TRACKSKIP 2
104 #define CROSSFADE_ENABLE_SHUFFLE_AND_TRACKSKIP 3
105 #define CROSSFADE_ENABLE_ALWAYS 4
107 #define FOLDER_ADVANCE_OFF 0
108 #define FOLDER_ADVANCE_NEXT 1
109 #define FOLDER_ADVANCE_RANDOM 2
111 /* system defines */
112 #ifndef TARGET_TREE
114 #ifndef HAVE_LCD_COLOR
115 #define DEFAULT_CONTRAST_SETTING 40
116 #endif
118 #if defined HAVE_LCD_CHARCELLS
119 #define MIN_CONTRAST_SETTING 5
120 #define MAX_CONTRAST_SETTING 31
121 #else
122 #define MIN_CONTRAST_SETTING 5
123 #define MAX_CONTRAST_SETTING 63
124 #endif
126 /* As it was */
127 #ifdef HAVE_REMOTE_LCD
128 #ifndef DEFAULT_REMOTE_CONTRAST_SETTING
129 /* May be defined in config file if driver code needs the value */
130 #define DEFAULT_REMOTE_CONTRAST_SETTING 42
131 #endif
132 #define MIN_REMOTE_CONTRAST_SETTING MIN_CONTRAST_SETTING
133 #define MAX_REMOTE_CONTRAST_SETTING MAX_CONTRAST_SETTING
134 #endif
136 #endif /* !TARGET_TREE */
138 #if !defined(HAVE_LCD_COLOR)
139 #define HAVE_LCD_CONTRAST
140 #endif
142 /* repeat mode options */
143 enum
145 REPEAT_OFF,
146 REPEAT_ALL,
147 REPEAT_ONE,
148 REPEAT_SHUFFLE,
149 #ifdef AB_REPEAT_ENABLE
150 REPEAT_AB,
151 #endif
152 NUM_REPEAT_MODES
155 /* dir filter options */
156 /* Note: Any new filter modes need to be added before NUM_FILTER_MODES.
157 * Any new rockbox browse filter modes (accessible through the menu)
158 * must be added after NUM_FILTER_MODES. */
159 enum { SHOW_ALL, SHOW_SUPPORTED, SHOW_MUSIC, SHOW_PLAYLIST, SHOW_ID3DB,
160 NUM_FILTER_MODES,
161 SHOW_WPS, SHOW_RWPS, SHOW_FMR, SHOW_CFG, SHOW_LNG, SHOW_MOD, SHOW_FONT, SHOW_PLUGINS};
163 /* recursive dir insert options */
164 enum { RECURSE_OFF, RECURSE_ON, RECURSE_ASK };
166 /* replaygain types */
167 enum { REPLAYGAIN_TRACK = 0, REPLAYGAIN_ALBUM, REPLAYGAIN_SHUFFLE };
169 /* show path types */
170 enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL };
172 /* Alarm settings */
173 #ifdef HAVE_RTC_ALARM
174 enum { ALARM_START_WPS = 0,
175 #if CONFIG_TUNER
176 ALARM_START_FM,
177 #endif
178 #ifdef HAVE_RECORDING
179 ALARM_START_REC,
180 #endif
181 ALARM_START_COUNT
183 #if CONFIG_TUNER && defined(HAVE_RECORDING)
184 #define ALARM_SETTING_TEXT "wps,fm,rec"
185 #elif CONFIG_TUNER
186 #define ALARM_SETTING_TEXT "wps,fm"
187 #elif defined(HAVE_RECORDING)
188 #define ALARM_SETTING_TEXT "wps,rec"
189 #endif
191 #endif /* HAVE_RTC_ALARM */
192 /** virtual pointer stuff.. move to another .h maybe? **/
193 /* These define "virtual pointers", which could either be a literal string,
194 or a mean a string ID if the pointer is in a certain range.
195 This helps to save space for menus and options. */
197 #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */
198 #ifdef SIMULATOR
199 /* a space which is defined in stubs.c */
200 extern unsigned char vp_dummy[VIRT_SIZE];
201 #define VIRT_PTR vp_dummy
202 #else
203 /* a location where we won't store strings, 0 is the fastest */
204 #define VIRT_PTR ((unsigned char*)0)
205 #endif
207 /* form a "virtual pointer" out of a language ID */
208 #define ID2P(id) (VIRT_PTR + id)
210 /* resolve a pointer which could be a virtualized ID or a literal */
211 #define P2STR(p) (char *)((p>=VIRT_PTR && p<=VIRT_PTR+VIRT_SIZE) ? str(p-VIRT_PTR) : p)
213 /* get the string ID from a virtual pointer, -1 if not virtual */
214 #define P2ID(p) ((p>=VIRT_PTR && p<=VIRT_PTR+VIRT_SIZE) ? p-VIRT_PTR : -1)
216 /* !defined(HAVE_LCD_COLOR) implies HAVE_LCD_CONTRAST with default 40.
217 Explicitly define HAVE_LCD_CONTRAST in config file for newer ports for
218 simplicity. */
222 /** function prototypes **/
224 /* argument bits for settings_load() */
225 #define SETTINGS_RTC 1 /* only the settings from the RTC nonvolatile RAM */
226 #define SETTINGS_HD 2 /* only the settings from the disk sector */
227 #define SETTINGS_ALL 3 /* both */
228 void settings_load(int which);
229 bool settings_load_config(const char* file, bool apply);
231 void status_save( void );
232 int settings_save(void);
233 /* defines for the options paramater */
234 #define SETTINGS_SAVE_CHANGED 0
235 #define SETTINGS_SAVE_ALL 1
236 #define SETTINGS_SAVE_THEME 2
237 bool settings_save_config(int options);
239 void settings_reset(void);
240 void sound_settings_apply(void);
241 void settings_apply(void);
242 void settings_apply_pm_range(void);
243 void settings_display(void);
245 enum optiontype { INT, BOOL };
247 struct opt_items {
248 unsigned const char* string;
249 long voice_id;
251 const struct settings_list* find_setting(void* variable, int *id);
252 bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len);
253 void talk_setting(void *global_settings_variable);
254 bool set_sound(const unsigned char * string,
255 int* variable, int setting);
256 bool set_bool_options(const char* string, bool* variable,
257 const char* yes_str, int yes_voice,
258 const char* no_str, int no_voice,
259 void (*function)(bool));
261 bool set_bool(const char* string, bool* variable );
262 bool set_option(const char* string, void* variable, enum optiontype type,
263 const struct opt_items* options, int numoptions, void (*function)(int));
264 bool set_int(const unsigned char* string, const char* unit, int voice_unit,
265 int* variable,
266 void (*function)(int), int step, int min, int max,
267 void (*formatter)(char*, int, int, const char*) );
268 /* use this one if you need to create a lang from the value (i.e with TALK_ID()) */
269 bool set_int_ex(const unsigned char* string, const char* unit, int voice_unit,
270 int* variable,
271 void (*function)(int), int step, int min, int max,
272 void (*formatter)(char*, int, int, const char*),
273 long (*get_talk_id)(int));
275 /* the following are either not in setting.c or shouldnt be */
276 bool set_time_screen(const char* string, struct tm *tm);
277 int read_line(int fd, char* buffer, int buffer_size);
278 void set_file(char* filename, char* setting, int maxlen);
279 unsigned int rec_timesplit_seconds(void);
280 unsigned long rec_sizesplit_bytes(void);
281 void settings_apply_trigger(void);
284 /** global_settings and global_status struct definitions **/
286 struct system_status
288 int resume_index; /* index in playlist (-1 for no active resume) */
289 int resume_first_index; /* index of first track in playlist */
290 uint32_t resume_offset; /* byte offset in mp3 file */
291 int resume_seed; /* shuffle seed (-1=no resume shuffle 0=sorted
292 >0=shuffled) */
293 int runtime; /* current runtime since last charge */
294 int topruntime; /* top known runtime */
295 #ifdef HAVE_DIRCACHE
296 int dircache_size; /* directory cache structure last size, 22 bits */
297 #endif
298 #if CONFIG_TUNER
299 int last_frequency; /* Last frequency for resuming, in FREQ_STEP units,
300 relative to MIN_FREQ */
301 #endif
302 char last_screen;
303 int viewer_icon_count;
306 struct user_settings
308 /* audio settings */
310 int volume; /* audio output volume: 0-100 0=off 100=max */
311 int balance; /* stereo balance: 0-100 0=left 50=bal 100=right */
312 int bass; /* bass eq: 0-100 0=off 100=max */
313 int treble; /* treble eq: 0-100 0=low 100=high */
314 int loudness; /* loudness eq: 0-100 0=off 100=max */
315 int avc; /* auto volume correct: 0=off, 1=20ms, 2=2s 3=4s 4=8s */
316 int channel_config; /* Stereo, Mono, Custom, Mono left, Mono right, Karaoke */
317 int stereo_width; /* 0-255% */
318 int mdb_strength; /* 0-127dB */
319 int mdb_harmonics; /* 0-100% */
320 int mdb_center; /* 20-300Hz */
321 int mdb_shape; /* 50-300Hz */
322 bool mdb_enable; /* true/false */
323 bool superbass; /* true/false */
325 #if CONFIG_CODEC == SWCODEC
326 int crossfade; /* Enable crossfade (0=off,1=shuffle,2=trackskip,3=shuff&trackskip,4=always) */
327 int crossfade_fade_in_delay; /* Fade in delay (0-15s) */
328 int crossfade_fade_out_delay; /* Fade out delay (0-15s) */
329 int crossfade_fade_in_duration; /* Fade in duration (0-15s) */
330 int crossfade_fade_out_duration; /* Fade out duration (0-15s) */
331 int crossfade_fade_out_mixmode; /* Fade out mode (0=crossfade,1=mix) */
332 #endif
334 #if CONFIG_CODEC == SWCODEC
335 int rec_format; /* record format index */
336 #else
337 int rec_quality; /* 0-7 */
338 #endif /* CONFIG_CODEC == SWCODEC */
339 int rec_source; /* 0=mic, 1=line, 2=S/PDIF, 2 or 3=FM Radio */
340 int rec_frequency; /* 0 = 44.1kHz (depends on target)
341 1 = 48kHz
342 2 = 32kHz
343 3 = 22.05kHz
344 4 = 24kHz
345 5 = 16kHz */
346 int rec_channels; /* 0=Stereo, 1=Mono */
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 int rec_directory; /* 0=base dir, 1=current dir */
368 int cliplight; /* 0 = off
369 1 = main lcd
370 2 = main and remote lcd
371 3 = remote lcd */
373 int rec_start_thres; /* negative: db, positive: % range -87 .. 100 */
374 int rec_start_duration; /* index of trig_durations */
375 int rec_stop_thres; /* negative: db, positive: % */
376 int rec_stop_postrec; /* negative: db, positive: % range -87 .. 100 */
377 int rec_stop_gap; /* index of trig_durations */
378 int rec_trigger_mode; /* see TRIG_MODE_XXX constants */
379 int rec_trigger_type; /* what to do when trigger released */
381 #ifdef HAVE_AGC
382 int rec_agc_preset_mic; /* AGC mic preset modes:
383 0 = Off
384 1 = Safety (clip)
385 2 = Live (slow)
386 3 = DJ-Set (slow)
387 4 = Medium
388 5 = Voice (fast) */
389 int rec_agc_preset_line; /* AGC line-in preset modes:
390 0 = Off
391 1 = Safety (clip)
392 2 = Live (slow)
393 3 = DJ-Set (slow)
394 4 = Medium
395 5 = Voice (fast) */
396 int rec_agc_maxgain_mic; /* AGC maximum mic gain */
397 int rec_agc_maxgain_line; /* AGC maximum line-in gain */
398 int rec_agc_cliptime; /* 0.2, 0.4, 0.6, 0.8, 1s */
399 #endif
401 /* device settings */
403 #ifdef HAVE_LCD_CONTRAST
404 int contrast; /* lcd contrast */
405 #endif
406 bool invert; /* invert display */
407 bool invert_cursor; /* invert the current file in dir browser and menu
408 instead of using the default cursor */
409 bool flip_display; /* turn display (and button layout) by 180 degrees */
410 int poweroff; /* power off timer */
411 int backlight_timeout; /* backlight off timeout: 0-18 0=never,
412 1=always,
413 then according to timeout_values[] */
414 int backlight_timeout_plugged;
415 #ifdef HAVE_BACKLIGHT_PWM_FADING
416 int backlight_fade_in; /* backlight fade in timing: 0..3 */
417 int backlight_fade_out; /* backlight fade in timing: 0..7 */
418 #endif
419 int battery_capacity; /* in mAh */
420 int battery_type; /* for units which can take multiple types (Ondio). */
422 #ifdef HAVE_SPDIF_POWER
423 bool spdif_enable; /* S/PDIF power on/off */
424 #endif
426 #if CONFIG_TUNER
427 unsigned char fmr_file[MAX_FILENAME+1]; /* last fmr preset */
428 #endif
429 unsigned char font_file[MAX_FILENAME+1]; /* last font */
430 unsigned char wps_file[MAX_FILENAME+1]; /* last wps */
431 unsigned char lang_file[MAX_FILENAME+1]; /* last language */
433 /* misc options */
435 int repeat_mode; /* 0=off 1=repeat all 2=repeat one 3=shuffle 4=ab */
436 int dirfilter; /* 0=display all, 1=only supported, 2=only music,
437 3=dirs+playlists, 4=ID3 database */
438 bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */
439 int volume_type; /* how volume is displayed: 0=graphic, 1=percent */
440 int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
441 int timeformat; /* time format: 0=24 hour clock, 1=12 hour clock */
442 bool playlist_shuffle;
443 bool play_selected; /* Plays selected file even in shuffle mode */
444 int ff_rewind_min_step; /* FF/Rewind minimum step size */
445 int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */
446 int disk_spindown; /* time until disk spindown, in seconds (0=off) */
447 int buffer_margin; /* MP3 buffer watermark margin, in seconds */
449 int peak_meter_release; /* units per read out */
450 int peak_meter_hold; /* hold time for peak meter in 1/100 s */
451 int peak_meter_clip_hold; /* hold time for clips */
452 bool peak_meter_dbfs; /* show linear or dbfs values */
453 int peak_meter_min; /* range minimum */
454 int peak_meter_max; /* range maximum */
455 bool car_adapter_mode; /* 0=off 1=on */
457 /* show status bar */
458 bool statusbar; /* 0=hide, 1=show */
460 /* show button bar */
461 bool buttonbar; /* 0=hide, 1=show */
463 /* show scroll bar */
464 bool scrollbar; /* 0=hide, 1=show */
466 /* goto current song when exiting WPS */
467 bool browse_current; /* 1=goto current song,
468 0=goto previous location */
471 int scroll_speed; /* long texts scrolling speed: 1-30 */
472 int bidir_limit; /* bidir scroll length limit */
473 int scroll_delay; /* delay (in 1/10s) before starting scroll */
474 int scroll_step; /* pixels to advance per update */
475 #ifdef HAVE_REMOTE_LCD
476 int remote_scroll_speed; /* long texts scrolling speed: 1-30 */
477 int remote_scroll_delay; /* delay (in 1/10s) before starting scroll */
478 int remote_scroll_step; /* pixels to advance per update */
479 int remote_bidir_limit; /* bidir scroll length limit */
480 #endif
482 #ifdef HAVE_LCD_BITMAP
483 bool offset_out_of_view;
484 int screen_scroll_step;
485 #endif
487 /* auto bookmark settings */
488 int autoloadbookmark; /* auto load option: 0=off, 1=ask, 2=on */
489 int autocreatebookmark; /* auto create option: 0=off, 1=ask, 2=on */
490 int usemrb; /* use MRB list: 0=No, 1=Yes*/
491 #ifdef HAVE_LCD_CHARCELLS
492 int jump_scroll; /* Fast jump when scrolling */
493 int jump_scroll_delay; /* Delay between jump scroll screens */
494 #endif
495 bool fade_on_stop; /* fade on pause/unpause/stop */
496 bool caption_backlight; /* turn on backlight at end and start of track */
498 #if CONFIG_TUNER
499 int fm_freq_step; /* Frequency step for manual tuning, in kHz */
500 bool fm_force_mono; /* Forces Mono mode if true */
501 bool fm_full_range; /* Enables full 10MHz-160MHz range if true, else
502 only 88MHz-108MHz */
503 #endif
505 int max_files_in_dir; /* Max entries in directory (file browser) */
506 int max_files_in_playlist; /* Max entries in playlist */
507 bool show_icons; /* 0=hide 1=show */
508 int recursive_dir_insert; /* should directories be inserted recursively */
510 bool line_in; /* false=off, true=active */
512 bool id3_v1_first; /* true = ID3V1 has prio over ID3V2 tag */
514 /* playlist viewer settings */
515 bool playlist_viewer_icons; /* display icons on viewer */
516 bool playlist_viewer_indices; /* display playlist indices on viewer */
517 int playlist_viewer_track_display; /* how to display tracks in viewer */
519 /* voice UI settings */
520 bool talk_menu; /* enable voice UI */
521 int talk_dir; /* talkbox mode: 0=off 1=number 2=clip@enter 3=clip@hover */
522 int talk_file; /* voice filename mode: 0=off, 1=number, other t.b.d. */
524 /* file browser sorting */
525 int sort_file; /* 0=alpha, 1=date, 2=date (new first), 3=type */
526 int sort_dir; /* 0=alpha, 1=date (old first), 2=date (new first) */
528 #ifdef HAVE_REMOTE_LCD
529 /* remote lcd */
530 int remote_contrast; /* lcd contrast: 0-63 0=low 63=high */
531 bool remote_invert; /* invert display */
532 bool remote_flip_display; /* turn display (and button layout) by 180 degrees */
533 int remote_backlight_timeout; /* backlight off timeout: 0-18 0=never,
534 1=always,
535 then according to timeout_values[] */
536 int remote_backlight_timeout_plugged;
537 bool remote_caption_backlight; /* turn on backlight at end and start of track */
538 #ifdef HAS_REMOTE_BUTTON_HOLD
539 int remote_backlight_on_button_hold; /* what to do with remote backlight when hold
540 switch is on */
541 #endif
542 #ifdef HAVE_REMOTE_LCD_TICKING
543 bool remote_reduce_ticking; /* 0=normal operation,
544 1=EMI reduce on with cost more CPU. */
545 #endif
546 #endif /* HAVE_REMOTE_LCD */
548 int next_folder; /* move to next folder */
549 bool runtimedb; /* runtime database active? */
551 #if CONFIG_CODEC == SWCODEC
552 bool replaygain; /* enable replaygain */
553 bool replaygain_noclip; /* scale to prevent clips */
554 int replaygain_type; /* 0=track gain, 1=album gain, 2=track gain if
555 shuffle is on, album gain otherwise */
556 int replaygain_preamp; /* scale replaygained tracks by this */
557 int beep; /* system beep volume when changing tracks etc. */
559 /* Crossfeed settings */
560 bool crossfeed; /* enable crossfeed */
561 unsigned int crossfeed_direct_gain; /* - dB x 10 */
562 unsigned int crossfeed_cross_gain; /* - dB x 10 */
563 unsigned int crossfeed_hf_attenuation; /* - dB x 10 */
564 unsigned int crossfeed_hf_cutoff; /* Frequency in Hz */
565 #endif
566 #ifdef HAVE_DIRCACHE
567 bool dircache; /* enable directory cache */
568 #endif
569 #ifdef HAVE_TAGCACHE
570 #ifdef HAVE_TC_RAMCACHE
571 bool tagcache_ram; /* load tagcache to ram? */
572 #endif
573 bool tagcache_autoupdate; /* automatically keep tagcache in sync? */
574 #endif
575 int default_codepage; /* set default codepage for tag conversion */
576 #ifdef HAVE_REMOTE_LCD
577 unsigned char rwps_file[MAX_FILENAME+1]; /* last remote-wps */
578 #endif
579 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
580 int brightness; /* iriver h300: backlight PWM value: 2..15
581 (0 and 1 are black) */
582 #endif
584 #if CONFIG_CODEC == SWCODEC
585 bool eq_enabled; /* Enable equalizer */
586 unsigned int eq_precut; /* dB */
588 /* Order is important here, must be cutoff, q, then gain for each band.
589 See dsp_eq_update_data in dsp.c for why. */
591 /* Band 0 settings */
592 int eq_band0_cutoff; /* Hz */
593 int eq_band0_q;
594 int eq_band0_gain; /* +/- dB */
596 /* Band 1 settings */
597 int eq_band1_cutoff; /* Hz */
598 int eq_band1_q;
599 int eq_band1_gain; /* +/- dB */
601 /* Band 2 settings */
602 int eq_band2_cutoff; /* Hz */
603 int eq_band2_q;
604 int eq_band2_gain; /* +/- dB */
606 /* Band 3 settings */
607 int eq_band3_cutoff; /* Hz */
608 int eq_band3_q;
609 int eq_band3_gain; /* +/- dB */
611 /* Band 4 settings */
612 int eq_band4_cutoff; /* Hz */
613 int eq_band4_q;
614 int eq_band4_gain; /* +/- dB */
616 bool dithering_enabled;
617 #endif
619 #if LCD_DEPTH > 1
620 unsigned char backdrop_file[MAX_FILENAME+1]; /* backdrop bitmap file */
621 #endif
623 bool warnon_erase_dynplaylist; /* warn when erasing dynamic playlist */
624 bool scroll_paginated; /* 0=dont 1=do */
625 #ifdef HAVE_LCD_COLOR
626 int bg_color; /* background color native format */
627 int fg_color; /* foreground color native format */
628 #endif
629 bool party_mode; /* party mode - unstoppable music */
631 #ifdef HAVE_BACKLIGHT
632 bool bl_filter_first_keypress; /* filter first keypress when dark? */
633 #ifdef HAVE_REMOTE_LCD
634 bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */
635 #endif
636 #ifdef HAS_BUTTON_HOLD
637 int backlight_on_button_hold; /* what to do with backlight when hold
638 switch is on */
639 #endif
640 #ifdef HAVE_LCD_SLEEP
641 int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight
642 has turned off */
643 #endif
644 #endif /* HAVE_BACKLIGHT */
646 #ifdef HAVE_LCD_BITMAP
647 unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */
648 #endif
650 #ifdef HAVE_USB_POWER
651 #if CONFIG_CHARGING
652 bool usb_charging;
653 #endif
654 #endif
656 #ifdef HAVE_WM8758
657 bool eq_hw_enabled; /* Enable hardware equalizer */
659 int eq_hw_band0_cutoff;
660 int eq_hw_band0_gain;
662 int eq_hw_band1_center;
663 int eq_hw_band1_bandwidth;
664 int eq_hw_band1_gain;
666 int eq_hw_band2_center;
667 int eq_hw_band2_bandwidth;
668 int eq_hw_band2_gain;
670 int eq_hw_band3_center;
671 int eq_hw_band3_bandwidth;
672 int eq_hw_band3_gain;
674 int eq_hw_band4_cutoff;
675 int eq_hw_band4_gain;
676 #endif
677 bool hold_lr_for_scroll_in_list; /* hold L/R scrolls the list left/right */
678 int show_path_in_browser; /* 0=off, 1=current directory, 2=full path */
680 #ifdef HAVE_HEADPHONE_DETECTION
681 int unplug_mode; /* pause on headphone unplug */
682 int unplug_rw; /* time in s to rewind when pausing */
683 bool unplug_autoresume; /* disable auto-resume if no phones */
684 #endif
685 #if CONFIG_TUNER
686 int fm_region;
687 #endif
688 bool audioscrobbler; /* Audioscrobbler logging */
690 /* If values are just added to the end, no need to bump plugin API
691 version. */
692 /* new stuff to be added at the end */
694 #if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
695 /* Encoder Settings Start - keep these together */
696 struct mp3_enc_config mp3_enc_config;
697 #if 0 /* These currently contain no members but their places in line
698 should be held */
699 struct aiff_enc_config aiff_enc_config;
700 struct wav_enc_config wav_enc_config;
701 struct wavpack_enc_config wavpack_enc_config;
702 #endif
703 /* Encoder Settings End */
704 #endif /* CONFIG_CODEC == SWCODEC */
705 bool cuesheet;
706 int start_in_screen;
707 #if defined(HAVE_RTC_ALARM) && \
708 (defined(HAVE_RECORDING) || CONFIG_TUNER)
709 int alarm_wake_up_screen;
710 #endif
711 /* customizable icons */
712 #ifdef HAVE_LCD_BITMAP
713 unsigned char icon_file[MAX_FILENAME+1];
714 unsigned char viewers_icon_file[MAX_FILENAME+1];
715 #endif
716 #ifdef HAVE_REMOTE_LCD
717 unsigned char remote_icon_file[MAX_FILENAME+1];
718 unsigned char remote_viewers_icon_file[MAX_FILENAME+1];
719 #endif
720 #ifdef HAVE_BUTTON_LIGHT
721 int button_light_timeout;
722 #endif
723 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
724 int buttonlight_brightness;
725 #endif
728 /** global variables **/
729 extern long lasttime;
730 /* Recording base directory */
731 extern const char rec_base_directory[];
732 /* global settings */
733 extern struct user_settings global_settings;
734 /* global status */
735 extern struct system_status global_status;
737 #endif /* __SETTINGS_H__ */