1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 Jonathan Gordon
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 ****************************************************************************/
21 #ifndef __SETTINGSLIST_H
22 #define __SETTINGSLIST_H
29 typedef int (*_isfunc_type
)(void);
36 unsigned char *ucharptr
;
39 /* the variable type for the setting */
44 #define F_T_UCHARPTR 5
47 struct sound_setting
{
48 int setting
; /* from the enum in firmware/sound.h */
50 #define F_T_SOUND 0x8 /* this variable uses the set_sound stuff, \
51 | with one of the above types (usually F_T_INT) \
52 These settings get the default from sound_default(setting); */
54 void (*option_callback
)(bool);
58 #define F_BOOL_SETTING (F_T_BOOL|0x10)
61 struct filename_setting
{
66 #define F_FILENAME 0x40
69 void (*option_callback
)(int);
74 void (*formatter
)(char*, size_t, int, const char*);
75 int32_t (*get_talk_id
)(int, int);
77 #define F_INT_SETTING 0x80
79 struct choice_setting
{
80 void (*option_callback
)(int);
83 const unsigned char **desc
;
87 #define F_CHOICE_SETTING 0x100
88 #define F_CHOICETALKS 0x200 /* uses .talks in the above struct for the talks */
89 /* and cfg_vals for the strings to display */
91 struct table_setting
{
92 void (*option_callback
)(int);
93 void (*formatter
)(char*, size_t, int, const char*);
94 int32_t (*get_talk_id
)(int, int);
99 #define F_TABLE_SETTING 0x2000
100 #define F_ALLOW_ARBITRARY_VALS 0x4000
101 /* these use the _isfunc_type type for the function */
102 /* typedef int (*_isfunc_type)(void); */
103 #define F_MIN_ISFUNC 0x100000 /* min(above) is function pointer to above type */
104 #define F_MAX_ISFUNC 0x200000 /* max(above) is function pointer to above type */
105 #define F_DEF_ISFUNC 0x400000 /* default_val is function pointer to above type */
107 #define F_THEMESETTING 0x0800000
108 #define F_RECSETTING 0x1000000
109 #define F_EQSETTING 0x2000000
110 #define F_SOUNDSETTING 0x4000000
112 #define F_NVRAM_BYTES_MASK 0xE0000 /*0-4 bytes can be stored */
113 #define F_NVRAM_MASK_SHIFT 17
114 #define NVRAM_CONFIG_VERSION 4
115 /* Above define should be bumped if
116 - a new NVRAM setting is added between 2 other NVRAM settings
117 - number of bytes for a NVRAM setting is changed
118 - a NVRAM setting is removed
120 #define F_TEMPVAR 0x0400 /* used if the setting should be set using a temp var */
121 #define F_PADTITLE 0x800 /* pad the title with spaces to force it to scroll */
122 #define F_NO_WRAP 0x1000 /* used if the list should not wrap */
124 struct settings_list
{
125 uint32_t flags
; /* ____ _SER TFFF NNN_ _ATW PTVC IFRB STTT */
127 int lang_id
; /* -1 for none */
128 union storage_type default_val
;
129 const char *cfg_name
; /* this settings name in the cfg file */
130 const char *cfg_vals
; /*comma seperated legal values, or NULL */
131 /* used with F_T_UCHARPTR this is the folder prefix */
133 const void *RESERVED
; /* to stop compile errors, will be removed */
134 const struct sound_setting
*sound_setting
; /* use F_T_SOUND for this */
135 const struct bool_setting
*bool_setting
; /* F_BOOL_SETTING */
136 const struct filename_setting
*filename_setting
; /* use F_FILENAME */
137 const struct int_setting
*int_setting
; /* use F_INT_SETTING */
138 const struct choice_setting
*choice_setting
; /* F_CHOICE_SETTING */
139 const struct table_setting
*table_setting
; /* F_TABLE_SETTING */
144 /* not needed for plugins and just causes compile error,
145 possibly fix proberly later */
146 extern const struct settings_list settings
[];
147 extern const int nb_settings
;