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