Fix silly mistake
[maemo-rb.git] / apps / settings.h
blob36e403be1b567e9a7524927ab09e258ea9bfc7ad
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 <stddef.h>
27 #include "inttypes.h"
28 #include "config.h"
29 #include "audiohw.h" /* for the AUDIOHW_* defines */
30 #include "statusbar.h" /* for the statusbar values */
31 #include "quickscreen.h"
32 #include "button.h"
33 #if CONFIG_CODEC == SWCODEC
34 #include "audio.h"
35 #endif
36 #include "rbpaths.h"
38 struct opt_items {
39 unsigned const char* string;
40 int32_t voice_id;
43 /** Setting values defines **/
44 #define MAX_FILENAME 32
45 #define MAX_PATHNAME 80
48 enum {
49 BOOKMARK_NO = 0,
50 BOOKMARK_YES,
51 BOOKMARK_ASK,
52 BOOKMARK_UNIQUE_ONLY = 2,
53 BOOKMARK_RECENT_ONLY_YES,
54 BOOKMARK_RECENT_ONLY_ASK,
57 enum
59 TRIG_MODE_OFF = 0,
60 TRIG_MODE_NOREARM,
61 TRIG_MODE_REARM
64 enum
66 TRIG_TYPE_STOP = 0,
67 TRIG_TYPE_PAUSE,
68 TRIG_TYPE_NEW_FILE
71 #ifdef HAVE_CROSSFADE
72 enum {
73 CROSSFADE_ENABLE_OFF = 0,
74 CROSSFADE_ENABLE_AUTOSKIP,
75 CROSSFADE_ENABLE_MANSKIP,
76 CROSSFADE_ENABLE_SHUFFLE,
77 CROSSFADE_ENABLE_SHUFFLE_OR_MANSKIP,
78 CROSSFADE_ENABLE_ALWAYS,
80 #endif
82 enum {
83 FOLDER_ADVANCE_OFF = 0,
84 FOLDER_ADVANCE_NEXT,
85 FOLDER_ADVANCE_RANDOM,
88 /* repeat mode options */
89 enum
91 REPEAT_OFF = 0,
92 REPEAT_ALL,
93 REPEAT_ONE,
94 REPEAT_SHUFFLE,
95 #ifdef AB_REPEAT_ENABLE
96 REPEAT_AB,
97 #endif
98 NUM_REPEAT_MODES
102 /* dir filter options */
103 /* Note: Any new filter modes need to be added before NUM_FILTER_MODES.
104 * Any new rockbox browse filter modes (accessible through the menu)
105 * must be added after NUM_FILTER_MODES. */
106 enum { SHOW_ALL, SHOW_SUPPORTED, SHOW_MUSIC, SHOW_PLAYLIST, SHOW_ID3DB,
107 NUM_FILTER_MODES,
108 SHOW_WPS, SHOW_RWPS, SHOW_FMS, SHOW_RFMS, SHOW_SBS, SHOW_RSBS, SHOW_FMR, SHOW_CFG,
109 SHOW_LNG, SHOW_MOD, SHOW_FONT, SHOW_PLUGINS, SHOW_M3U};
111 /* file and dir sort options */
112 enum { SORT_ALPHA, SORT_DATE, SORT_DATE_REVERSED, SORT_TYPE, /* available as settings */
113 SORT_ALPHA_REVERSED, SORT_TYPE_REVERSED }; /* internal use only */
114 enum { SORT_INTERPRET_AS_DIGIT, SORT_INTERPRET_AS_NUMBER };
116 /* recursive dir insert options */
117 enum { RECURSE_OFF, RECURSE_ON, RECURSE_ASK };
119 /* replaygain types */
120 enum { REPLAYGAIN_TRACK = 0, REPLAYGAIN_ALBUM, REPLAYGAIN_SHUFFLE, REPLAYGAIN_OFF };
122 /* show path types */
123 enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL };
125 /* scrollbar visibility/position */
126 enum { SCROLLBAR_OFF = 0, SCROLLBAR_LEFT, SCROLLBAR_RIGHT };
128 /* autoresume settings */
129 enum { AUTORESUME_NEXTTRACK_NEVER = 0, AUTORESUME_NEXTTRACK_ALWAYS,
130 AUTORESUME_NEXTTRACK_CUSTOM};
132 /* Alarm settings */
133 #ifdef HAVE_RTC_ALARM
134 enum { ALARM_START_WPS = 0,
135 #if CONFIG_TUNER
136 ALARM_START_FM,
137 #endif
138 #ifdef HAVE_RECORDING
139 ALARM_START_REC,
140 #endif
141 ALARM_START_COUNT
143 #if CONFIG_TUNER && defined(HAVE_RECORDING)
144 #define ALARM_SETTING_TEXT "wps,fm,rec"
145 #elif CONFIG_TUNER
146 #define ALARM_SETTING_TEXT "wps,fm"
147 #elif defined(HAVE_RECORDING)
148 #define ALARM_SETTING_TEXT "wps,rec"
149 #endif
151 #endif /* HAVE_RTC_ALARM */
153 /* Keyclick stuff */
155 /* Not really a setting but several files should stay synced */
156 #define KEYCLICK_DURATION 2
158 /** virtual pointer stuff.. move to another .h maybe? **/
159 /* These define "virtual pointers", which could either be a literal string,
160 or a mean a string ID if the pointer is in a certain range.
161 This helps to save space for menus and options. */
163 #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */
164 #if defined(CPU_S5L870X)
165 /* the S5L870X has IRAM at 0, so we use 0xffff bytes right after that */
166 #define VIRT_PTR ((unsigned char*)0x40000)
167 #elif CONFIG_CPU==DM320
168 /* the DM320 has IRAM at 0, so we use 0xffff bytes right after that */
169 #define VIRT_PTR ((unsigned char*)0x4000)
170 #else
171 /* a location where we won't store strings, 0 is the fastest */
172 #define VIRT_PTR ((unsigned char*)0)
173 #endif
175 /* form a "virtual pointer" out of a language ID */
176 #define ID2P(id) (VIRT_PTR + id)
178 /* resolve a pointer which could be a virtualized ID or a literal */
179 #define P2STR(p) (char *)((p>=VIRT_PTR && p<VIRT_PTR+VIRT_SIZE) ? str(p-VIRT_PTR) : p)
181 /* get the string ID from a virtual pointer, -1 if not virtual */
182 #define P2ID(p) ((p>=VIRT_PTR && p<VIRT_PTR+VIRT_SIZE) ? p-VIRT_PTR : -1)
184 /* !defined(HAVE_LCD_COLOR) implies HAVE_LCD_CONTRAST with default 40.
185 Explicitly define HAVE_LCD_CONTRAST in config file for newer ports for
186 simplicity. */
190 /** function prototypes **/
192 /* argument bits for settings_load() */
193 #define SETTINGS_RTC (BIT_N(0)) /* only the settings from the RTC nonvolatile RAM */
194 #define SETTINGS_HD (BIT_N(1)) /* only the settings from the disk sector */
195 #define SETTINGS_ALL (SETTINGS_RTC|SETTINGS_HD) /* both */
196 void settings_load(int which);
197 bool settings_load_config(const char* file, bool apply);
199 void status_save(void);
200 int settings_save(void);
201 /* defines for the options paramater */
202 enum {
203 SETTINGS_SAVE_CHANGED = 0,
204 SETTINGS_SAVE_ALL,
205 SETTINGS_SAVE_THEME,
206 SETTINGS_SAVE_SOUND,
207 #ifdef HAVE_RECORDING
208 SETTINGS_SAVE_RECPRESETS,
209 #endif
210 #if CONFIG_CODEC == SWCODEC
211 SETTINGS_SAVE_EQPRESET,
212 #endif
214 bool settings_save_config(int options);
216 struct settings_list;
217 void reset_setting(const struct settings_list *setting, void *var);
218 void settings_reset(void);
219 void sound_settings_apply(void);
221 /* call this after loading a .wps/.rwps pr other skin files, so that the
222 * skin buffer is reset properly
224 void settings_apply_skins(void);
225 void theme_init_buffer(void);
227 void settings_apply(bool read_disk);
228 void settings_apply_pm_range(void);
229 void settings_display(void);
231 enum optiontype { INT, BOOL };
233 const struct settings_list* find_setting(const void* variable, int *id);
234 const struct settings_list* find_setting_by_cfgname(const char* name, int *id);
235 bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len);
236 bool cfg_string_to_int(int setting_id, int* out, const char* str);
237 bool cfg_to_string(int setting_id, char* buf, int buf_len);
238 bool set_bool_options(const char* string, const bool* variable,
239 const char* yes_str, int yes_voice,
240 const char* no_str, int no_voice,
241 void (*function)(bool));
243 bool set_bool(const char* string, const bool* variable);
244 bool set_int(const unsigned char* string, const char* unit, int voice_unit,
245 const int* variable,
246 void (*function)(int), int step, int min, int max,
247 const char* (*formatter)(char*, size_t, int, const char*) );
249 /* use this one if you need to create a lang from the value (i.e with TALK_ID()) */
250 bool set_int_ex(const unsigned char* string, const char* unit, int voice_unit,
251 const int* variable,
252 void (*function)(int), int step, int min, int max,
253 const char* (*formatter)(char*, size_t, int, const char*),
254 int32_t (*get_talk_id)(int, int));
256 void set_file(const char* filename, char* setting, const int maxlen);
258 bool set_option(const char* string, const void* variable, enum optiontype type,
259 const struct opt_items* options, int numoptions, void (*function)(int));
263 /** global_settings and global_status struct definitions **/
265 struct system_status
267 int resume_index; /* index in playlist (-1 for no active resume) */
268 uint32_t resume_offset; /* byte offset in mp3 file */
269 int runtime; /* current runtime since last charge */
270 int topruntime; /* top known runtime */
271 #ifdef HAVE_DIRCACHE
272 int dircache_size; /* directory cache structure last size, 22 bits */
273 #endif
274 #if CONFIG_TUNER
275 int last_frequency; /* Last frequency for resuming, in FREQ_STEP units,
276 relative to MIN_FREQ */
277 #endif
278 signed char last_screen;
279 int viewer_icon_count;
280 int last_volume_change; /* tick the last volume change happened. skins use this */
281 #ifdef HAVE_LCD_BITMAP
282 int font_id[NB_SCREENS]; /* font id of the settings font for each screen */
283 #endif
286 struct user_settings
288 /* audio settings */
290 int volume; /* audio output volume in decibels range depends on the dac */
291 int balance; /* stereo balance: 0-100 0=left 50=bal 100=right */
292 int bass; /* bass boost/cut in decibels */
293 int treble; /* treble boost/cut in decibels */
294 int channel_config; /* Stereo, Mono, Custom, Mono left, Mono right, Karaoke */
295 int stereo_width; /* 0-255% */
297 #if CONFIG_CODEC != SWCODEC
298 int loudness; /* loudness eq: 0-100 0=off 100=max */
299 int avc; /* auto volume correct: 0=off, 1=20ms, 2=2s 3=4s 4=8s */
300 int mdb_strength; /* 0-127dB */
301 int mdb_harmonics; /* 0-100% */
302 int mdb_center; /* 20-300Hz */
303 int mdb_shape; /* 50-300Hz */
304 bool mdb_enable; /* true/false */
305 bool superbass; /* true/false */
306 #endif
308 #ifdef AUDIOHW_HAVE_BASS_CUTOFF
309 int bass_cutoff;
310 #endif
311 #ifdef AUDIOHW_HAVE_TREBLE_CUTOFF
312 int treble_cutoff;
313 #endif
315 #if CONFIG_CODEC == SWCODEC
316 #ifdef HAVE_CROSSFADE
317 /* Crossfade */
318 int crossfade; /* Enable crossfade (0=off, 1=shuffle, 2=trackskip,
319 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
327 /* Replaygain */
328 bool replaygain_noclip; /* scale to prevent clips */
329 int replaygain_type; /* 0=track gain, 1=album gain, 2=track gain if
330 shuffle is on, album gain otherwise, 4=off */
331 int replaygain_preamp; /* scale replaygained tracks by this */
333 /* Crossfeed */
334 bool crossfeed; /* enable crossfeed */
335 unsigned int crossfeed_direct_gain; /* dB x 10 */
336 unsigned int crossfeed_cross_gain; /* dB x 10 */
337 unsigned int crossfeed_hf_attenuation; /* dB x 10 */
338 unsigned int crossfeed_hf_cutoff; /* Frequency in Hz */
340 /* EQ */
341 bool eq_enabled; /* Enable equalizer */
342 unsigned int eq_precut; /* dB */
344 /* Order is important here, must be cutoff, q, then gain for each band.
345 See dsp_set_eq_coefs in dsp.c for why. */
347 /* Band 0 settings */
348 int eq_band0_cutoff; /* Hz */
349 int eq_band0_q;
350 int eq_band0_gain; /* +/- dB */
352 /* Band 1 settings */
353 int eq_band1_cutoff; /* Hz */
354 int eq_band1_q;
355 int eq_band1_gain; /* +/- dB */
357 /* Band 2 settings */
358 int eq_band2_cutoff; /* Hz */
359 int eq_band2_q;
360 int eq_band2_gain; /* +/- dB */
362 /* Band 3 settings */
363 int eq_band3_cutoff; /* Hz */
364 int eq_band3_q;
365 int eq_band3_gain; /* +/- dB */
367 /* Band 4 settings */
368 int eq_band4_cutoff; /* Hz */
369 int eq_band4_q;
370 int eq_band4_gain; /* +/- dB */
372 /* Misc. swcodec */
373 int beep; /* system beep volume when changing tracks etc. */
374 int keyclick; /* keyclick volume */
375 int keyclick_repeats; /* keyclick on repeats */
376 bool dithering_enabled;
377 #ifdef HAVE_PITCHSCREEN
378 bool timestretch_enabled;
379 #endif
380 #endif /* CONFIG_CODEC == SWCODEC */
382 #ifdef HAVE_RECORDING
383 #if CONFIG_CODEC == SWCODEC
384 int rec_format; /* record format index */
385 int rec_mono_mode; /* how to create mono: L, R, L+R */
387 /* Encoder Settings Start - keep these together */
388 struct mp3_enc_config mp3_enc_config;
389 #if 0 /* These currently contain no members but their places in line
390 should be held */
391 struct aiff_enc_config aiff_enc_config;
392 struct wav_enc_config wav_enc_config;
393 struct wavpack_enc_config wavpack_enc_config;
394 #endif
395 /* Encoder Settings End */
397 #else
398 int rec_quality; /* 0-7 */
399 #endif /* CONFIG_CODEC == SWCODEC */
400 int rec_source; /* 0=mic, 1=line, 2=S/PDIF, 2 or 3=FM Radio */
401 int rec_frequency; /* 0 = 44.1kHz (depends on target)
402 1 = 48kHz
403 2 = 32kHz
404 3 = 22.05kHz
405 4 = 24kHz
406 5 = 16kHz */
407 int rec_channels; /* 0=Stereo, 1=Mono */
409 int rec_mic_gain; /* depends on target */
410 int rec_left_gain; /* depends on target */
411 int rec_right_gain; /* depends on target */
412 bool peak_meter_clipcounter; /* clipping count indicator */
413 bool rec_editable; /* true means that the bit reservoir is off */
415 /* note: timesplit setting is not saved */
416 int rec_timesplit; /* 0 = off,
417 1 = 00:05, 2 = 00:10, 3 = 00:15, 4 = 00:30
418 5 = 01:00, 6 = 02:00, 7 = 04:00, 8 = 06:00
419 9 = 08:00, 10= 10:00, 11= 12:00, 12= 18:00,
420 13= 24:00 */
421 int rec_sizesplit; /* 0 = off,
422 1 = 5MB, 2 = 10MB, 3 = 15MB, 4 = 32MB
423 5 = 64MB, 6 = 75MB, 7 = 100MB, 8 = 128MB
424 9 = 256MB, 10= 512MB, 11= 650MB, 12= 700MB,
425 13= 1GB, 14 = 1.5GB 15 = 1.75MB*/
426 int rec_split_type; /* split/stop */
427 int rec_split_method; /* time/filesize */
429 int rec_prerecord_time; /* In seconds, 0-30, 0 means OFF */
430 char rec_directory[MAX_PATHNAME+1];
431 int cliplight; /* 0 = off
432 1 = main lcd
433 2 = main and remote lcd
434 3 = remote lcd */
436 int rec_start_thres_db;
437 int rec_start_thres_linear;
438 int rec_start_duration; /* index of trig_durations */
439 int rec_stop_thres_db;
440 int rec_stop_thres_linear;
441 int rec_stop_postrec;
442 int rec_stop_gap; /* index of trig_durations */
443 int rec_trigger_mode; /* see TRIG_MODE_XXX constants */
444 int rec_trigger_type; /* what to do when trigger released */
445 #ifdef HAVE_HISTOGRAM
446 int histogram_interval; /* recording peakmeter histogram */
447 #endif
449 #ifdef HAVE_AGC
450 int rec_agc_preset_mic; /* AGC mic preset modes:
451 0 = Off
452 1 = Safety (clip)
453 2 = Live (slow)
454 3 = DJ-Set (slow)
455 4 = Medium
456 5 = Voice (fast) */
457 int rec_agc_preset_line; /* AGC line-in preset modes:
458 0 = Off
459 1 = Safety (clip)
460 2 = Live (slow)
461 3 = DJ-Set (slow)
462 4 = Medium
463 5 = Voice (fast) */
464 int rec_agc_maxgain_mic; /* AGC maximum mic gain */
465 int rec_agc_maxgain_line; /* AGC maximum line-in gain */
466 int rec_agc_cliptime; /* 0.2, 0.4, 0.6, 0.8, 1s */
467 #endif
468 #endif /* HAVE_RECORDING */
470 #if CONFIG_TUNER
471 int fm_region;
472 bool fm_force_mono; /* Forces Mono mode if true */
473 unsigned char fmr_file[MAX_FILENAME+1]; /* last fmr preset */
474 unsigned char fms_file[MAX_FILENAME+1]; /* last fms */
475 #ifdef HAVE_REMOTE_LCD
476 unsigned char rfms_file[MAX_FILENAME+1]; /* last remote-fms */
477 #endif
478 #endif /* CONFIG_TUNER */
480 /* misc options */
481 #ifndef HAVE_WHEEL_ACCELERATION
482 int list_accel_start_delay; /* ms before we start increaseing step size */
483 int list_accel_wait; /* ms between increases */
484 #endif
486 #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
487 int touchpad_sensitivity;
488 #endif
490 int pause_rewind; /* time in s to rewind when pausing */
491 #ifdef HAVE_HEADPHONE_DETECTION
492 int unplug_mode; /* pause on headphone unplug */
493 bool unplug_autoresume; /* disable auto-resume if no phones */
494 #endif
496 #ifdef HAVE_QUICKSCREEN
497 int qs_items[QUICKSCREEN_ITEM_COUNT];
498 #endif
500 #if CONFIG_RTC
501 int timeformat; /* time format: 0=24 hour clock, 1=12 hour clock */
502 #endif
504 #ifdef HAVE_DISK_STORAGE
505 int disk_spindown; /* time until disk spindown, in seconds (0=off) */
506 int buffer_margin; /* audio buffer watermark margin, in seconds */
507 #endif
509 int dirfilter; /* 0=display all, 1=only supported, 2=only music,
510 3=dirs+playlists, 4=ID3 database */
511 int show_filename_ext; /* show filename extensions in file browser?
512 0 = no, 1 = yes, 2 = only unknown 0 */
513 int default_codepage; /* set default codepage for tag conversion */
514 bool hold_lr_for_scroll_in_list; /* hold L/R scrolls the list left/right */
515 bool play_selected; /* Plays selected file even in shuffle mode */
516 bool party_mode; /* party mode - unstoppable music */
517 bool audioscrobbler; /* Audioscrobbler logging */
518 bool cuesheet;
519 bool car_adapter_mode; /* 0=off 1=on */
520 int start_in_screen;
521 #if defined(HAVE_RTC_ALARM) && \
522 (defined(HAVE_RECORDING) || CONFIG_TUNER)
523 int alarm_wake_up_screen;
524 #endif
525 int ff_rewind_min_step; /* FF/Rewind minimum step size */
526 int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */
528 int peak_meter_release; /* units per read out */
529 int peak_meter_hold; /* hold time for peak meter in 1/100 s */
530 int peak_meter_clip_hold; /* hold time for clips */
531 bool peak_meter_dbfs; /* show linear or dbfs values */
532 int peak_meter_min; /* range minimum */
533 int peak_meter_max; /* range maximum */
535 unsigned char wps_file[MAX_FILENAME+1]; /* last wps */
536 #ifdef HAVE_LCD_BITMAP
537 unsigned char sbs_file[MAX_FILENAME+1]; /* last statusbar skin */
538 #endif
539 #ifdef HAVE_REMOTE_LCD
540 unsigned char rwps_file[MAX_FILENAME+1]; /* last remote-wps */
541 unsigned char rsbs_file[MAX_FILENAME+1]; /* last remote statusbar skin */
542 #endif
543 unsigned char lang_file[MAX_FILENAME+1]; /* last language */
544 unsigned char playlist_catalog_dir[MAX_PATHNAME+1];
545 int skip_length; /* skip length */
546 int max_files_in_dir; /* Max entries in directory (file browser) */
547 int max_files_in_playlist; /* Max entries in playlist */
548 int volume_type; /* how volume is displayed: 0=graphic, 1=percent */
549 int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
550 bool show_icons; /* 0=hide 1=show */
551 int statusbar; /* STATUSBAR_* enum values */
552 #ifdef HAVE_REMOTE_LCD
553 int remote_statusbar;
554 #endif
556 #if CONFIG_KEYPAD == RECORDER_PAD
557 bool buttonbar; /* 0=hide, 1=show */
558 #endif
560 #ifdef HAVE_LCD_BITMAP
561 int scrollbar; /* SCROLLBAR_* enum values */
562 int scrollbar_width;
563 #endif
565 /* goto current song when exiting WPS */
566 bool browse_current; /* 1=goto current song,
567 0=goto previous location */
568 bool scroll_paginated; /* 0=dont 1=do */
569 int scroll_speed; /* long texts scrolling speed: 1-30 */
570 int bidir_limit; /* bidir scroll length limit */
571 int scroll_delay; /* delay (in 1/10s) before starting scroll */
572 int scroll_step; /* pixels to advance per update */
574 /* auto bookmark settings */
575 int autoloadbookmark; /* auto load option: 0=off, 1=ask, 2=on */
576 int autocreatebookmark; /* auto create option: 0=off, 1=ask, 2=on */
577 bool autoupdatebookmark;/* auto update option */
578 int usemrb; /* use MRB list: 0=No, 1=Yes, 2=One per playlist */
580 #ifdef HAVE_DIRCACHE
581 bool dircache; /* enable directory cache */
582 #endif
583 #ifdef HAVE_TAGCACHE
584 #ifdef HAVE_TC_RAMCACHE
585 bool tagcache_ram; /* load tagcache to ram? */
586 #endif
587 bool tagcache_autoupdate; /* automatically keep tagcache in sync? */
588 bool autoresume_enable; /* enable auto-resume feature? */
589 int autoresume_automatic; /* resume next track? 0=never, 1=always,
590 2=custom */
591 unsigned char autoresume_paths[MAX_PATHNAME+1]; /* colon-separated list */
592 bool runtimedb; /* runtime database active? */
593 #endif /* HAVE_TAGCACHE */
595 #if LCD_DEPTH > 1
596 unsigned char backdrop_file[MAX_PATHNAME+1]; /* backdrop bitmap file */
597 #endif
599 #ifdef HAVE_LCD_COLOR
600 int bg_color; /* background color native format */
601 int fg_color; /* foreground color native format */
602 int lss_color; /* background color for the selector or start color for the gradient */
603 int lse_color; /* end color for the selector gradient */
604 int lst_color; /* color of the text for the selector */
605 unsigned char colors_file[MAX_FILENAME+1];
606 #endif
608 /* playlist/playback settings */
609 int repeat_mode; /* 0=off 1=repeat all 2=repeat one 3=shuffle 4=ab */
610 int next_folder; /* move to next folder */
611 int recursive_dir_insert; /* should directories be inserted recursively */
612 bool fade_on_stop; /* fade on pause/unpause/stop */
613 bool playlist_shuffle;
614 bool warnon_erase_dynplaylist; /* warn when erasing dynamic playlist */
616 /* playlist viewer settings */
617 bool playlist_viewer_icons; /* display icons on viewer */
618 bool playlist_viewer_indices; /* display playlist indices on viewer */
619 int playlist_viewer_track_display; /* how to display tracks in viewer */
621 /* voice UI settings */
622 bool talk_menu; /* enable voice UI */
623 int talk_dir; /* voiced directories mode: 0=off 1=number 2=spell */
624 bool talk_dir_clip; /* use directory .talk clips */
625 int talk_file; /* voice file mode: 0=off, 1=number, 2=spell */
626 bool talk_file_clip; /* use file .talk clips */
627 bool talk_filetype; /* say file type */
628 bool talk_battery_level;
630 /* file browser sorting */
631 bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */
632 int sort_dir; /* 0=alpha, 1=date (old first), 2=date (new first) */
633 int sort_file; /* 0=alpha, 1=date, 2=date (new first), 3=type */
634 int interpret_numbers; /* true=strnatcmp, false=strcmp */
636 /* power settings */
637 int poweroff; /* idle power off timer */
638 #ifdef BATTERY_CAPACITY_DEFAULT
639 int battery_capacity; /* in mAh */
640 #endif
642 #if BATTERY_TYPES_COUNT > 1
643 int battery_type; /* for units which can take multiple types (Ondio). */
644 #endif
645 #ifdef HAVE_SPDIF_POWER
646 bool spdif_enable; /* S/PDIF power on/off */
647 #endif
648 #ifdef HAVE_USB_CHARGING_ENABLE
649 int usb_charging;
650 #endif
652 /* device settings */
653 #ifdef HAVE_LCD_CONTRAST
654 int contrast; /* lcd contrast */
655 #endif
657 #ifdef HAVE_LCD_BITMAP
658 #ifdef HAVE_LCD_INVERT
659 bool invert; /* invert display */
660 #endif
661 #ifdef HAVE_LCD_FLIP
662 bool flip_display; /* turn display (and button layout) by 180 degrees */
663 #endif
664 int cursor_style; /* style of the selection cursor */
665 int screen_scroll_step;
666 int show_path_in_browser; /* 0=off, 1=current directory, 2=full path */
667 bool offset_out_of_view;
668 unsigned char icon_file[MAX_FILENAME+1];
669 unsigned char viewers_icon_file[MAX_FILENAME+1];
670 unsigned char font_file[MAX_FILENAME+1]; /* last font */
671 #ifdef HAVE_REMOTE_LCD
672 unsigned char remote_font_file[MAX_FILENAME+1]; /* last font */
673 #endif
674 unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */
675 #endif /* HAVE_LCD_BITMAP */
676 int backlight_timeout; /* backlight off timeout: 0-18 0=never,
677 1=always,
678 then according to timeout_values[] */
679 bool caption_backlight; /* turn on backlight at end and start of track */
680 bool bl_filter_first_keypress; /* filter first keypress when dark? */
681 #if CONFIG_CHARGING
682 int backlight_timeout_plugged;
683 #endif
684 #ifdef HAVE_BACKLIGHT
685 #ifdef HAS_BUTTON_HOLD
686 int backlight_on_button_hold; /* what to do with backlight when hold
687 switch is on */
688 #endif
689 #ifdef HAVE_LCD_SLEEP_SETTING
690 int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight
691 has turned off */
692 #endif
693 #endif
694 #if defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
695 int backlight_fade_in; /* backlight fade in timing: 0..3 */
696 int backlight_fade_out; /* backlight fade in timing: 0..7 */
697 #elif defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING)
698 bool backlight_fade_in;
699 bool backlight_fade_out;
700 #endif
701 #ifdef HAVE_BACKLIGHT_BRIGHTNESS
702 int brightness;
703 #endif
705 #ifdef HAVE_REMOTE_LCD
706 /* remote lcd */
707 int remote_contrast; /* lcd contrast: 0-63 0=low 63=high */
708 int remote_backlight_timeout; /* backlight off timeout: 0-18 0=never,
709 1=always, then according to timeout_values[] */
710 int remote_backlight_timeout_plugged;
711 int remote_scroll_speed; /* long texts scrolling speed: 1-30 */
712 int remote_scroll_delay; /* delay (in 1/10s) before starting scroll */
713 int remote_scroll_step; /* pixels to advance per update */
714 int remote_bidir_limit; /* bidir scroll length limit */
715 bool remote_invert; /* invert display */
716 bool remote_flip_display; /* turn display (and button layout) by 180 degrees */
717 bool remote_caption_backlight; /* turn on backlight at end and start of track */
718 bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */
719 unsigned char remote_icon_file[MAX_FILENAME+1];
720 unsigned char remote_viewers_icon_file[MAX_FILENAME+1];
721 #ifdef HAS_REMOTE_BUTTON_HOLD
722 int remote_backlight_on_button_hold; /* what to do with remote backlight when hold
723 switch is on */
724 #endif
725 #ifdef HAVE_REMOTE_LCD_TICKING
726 bool remote_reduce_ticking; /* 0=normal operation,
727 1=EMI reduce on with cost more CPU. */
728 #endif
729 #endif /* HAVE_REMOTE_LCD */
731 #if CONFIG_CODEC == MAS3507D
732 bool line_in; /* false=off, true=active */
733 #endif
735 #ifdef HAVE_BUTTON_LIGHT
736 int buttonlight_timeout;
737 #endif
738 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
739 int buttonlight_brightness;
740 #endif
742 #ifdef IPOD_ACCESSORY_PROTOCOL
743 int serial_bitrate; /* 0=auto 1=9600 2=19200 3=38400 4=57600 */
744 #endif
745 #ifdef HAVE_ACCESSORY_SUPPLY
746 bool accessory_supply; /* 0=off 1=on, accessory power supply for iPod */
747 #endif
748 #ifdef HAVE_LINEOUT_POWEROFF
749 bool lineout_active;
750 #endif
752 #ifdef HAVE_SPEAKER
753 bool speaker_enabled;
754 #endif
755 bool prevent_skip;
757 #ifdef HAVE_TOUCHSCREEN
758 int touch_mode;
759 struct touchscreen_parameter ts_calibration_data;
760 #endif
762 #ifdef HAVE_PITCHSCREEN
763 /* pitch screen settings */
764 bool pitch_mode_semitone;
765 #if CONFIG_CODEC == SWCODEC
766 bool pitch_mode_timestretch;
767 #endif
768 #endif
769 /* If values are just added to the end, no need to bump plugin API
770 version. */
771 /* new stuff to be added at the end */
773 #ifdef USB_ENABLE_HID
774 bool usb_hid;
775 int usb_keypad_mode;
776 #endif
778 #if defined(USB_ENABLE_STORAGE) && defined(HAVE_MULTIDRIVE)
779 bool usb_skip_first_drive;
780 #endif
782 #ifdef HAVE_LCD_BITMAP
783 unsigned char ui_vp_config[64]; /* viewport string for the lists */
784 #ifdef HAVE_REMOTE_LCD
785 unsigned char remote_ui_vp_config[64]; /* viewport string for the remote lists */
786 #endif
787 #endif
789 #if CONFIG_CODEC == SWCODEC
790 int compressor_threshold;
791 int compressor_makeup_gain;
792 int compressor_ratio;
793 int compressor_knee;
794 int compressor_release_time;
795 #endif
797 #ifdef HAVE_MORSE_INPUT
798 bool morse_input; /* text input method setting */
799 #endif
801 #ifdef HAVE_HOTKEY
802 /* hotkey assignments - acceptable values are in
803 hotkey_action enum in onplay.h */
804 int hotkey_wps;
805 int hotkey_tree;
806 #endif
808 #if CONFIG_CODEC == SWCODEC
809 /* When resuming playback (after a stop), rewind this number of seconds */
810 int resume_rewind;
811 #endif
813 #ifdef AUDIOHW_HAVE_DEPTH_3D
814 int depth_3d;
815 #endif
817 #ifdef AUDIOHW_HAVE_EQ
818 /** Hardware EQ tone controls **/
819 struct hw_eq_band
821 /* Maintain the order of members or sound_menu has to be changed */
822 int gain;
823 #ifdef AUDIOHW_HAVE_EQ_FREQUENCY
824 int frequency;
825 #endif
826 #ifdef AUDIOHW_HAVE_EQ_WIDTH
827 int width;
828 #endif
829 } hw_eq_bands[AUDIOHW_EQ_BAND_NUM];
830 #endif /* AUDIOHW_HAVE_EQ */
831 char start_directory[MAX_PATHNAME+1];
834 /** global variables **/
835 extern long lasttime;
836 /* global settings */
837 extern struct user_settings global_settings;
838 /* global status */
839 extern struct system_status global_status;
841 #endif /* __SETTINGS_H__ */