2 * Copyright 2005 Timo Hirvonen
10 #define OPTION_MAX_SIZE 256
12 typedef void (*opt_get_cb
)(unsigned int id
, char *buf
);
13 typedef void (*opt_set_cb
)(unsigned int id
, const char *buf
);
14 typedef void (*opt_toggle_cb
)(unsigned int id
);
17 struct list_head node
;
21 /* If there are many similar options you should write generic get(),
22 * set() and optionally toggle() and set id to index of option array or
25 * Useful for colors, format strings and plugin options.
32 /* NULL if not toggle-able */
36 extern struct list_head option_head
;
37 extern int nr_options
;
69 COLOR_WIN_INACTIVE_CUR_SEL_BG
,
71 COLOR_WIN_INACTIVE_CUR_SEL_FG
,
72 COLOR_WIN_INACTIVE_SEL_BG
,
73 COLOR_WIN_INACTIVE_SEL_FG
,
82 #define BRIGHT (1 << 3)
84 extern char *output_plugin
;
85 extern char *status_display_program
;
86 extern char *server_password
;
87 extern int auto_reshuffle
;
88 extern int confirm_run
;
89 extern int show_hidden
;
90 extern int show_remaining_time
;
91 extern int set_term_title
;
92 extern int play_library
;
95 extern int pretty_artist_name
;
96 extern int fuzzy_artist_sort
;
98 extern const char * const aaa_mode_names
[];
99 extern const char * const view_names
[NR_VIEWS
+ 1];
101 extern int colors
[NR_COLORS
];
103 /* format string for track window (tree view) */
104 extern char *track_win_format
;
105 extern char *track_win_alt_format
;
107 /* format string for shuffle, sorted and play queue views */
108 extern char *list_win_format
;
109 extern char *list_win_alt_format
;
111 /* format string for currently playing track */
112 extern char *current_format
;
113 extern char *current_alt_format
;
115 /* format string for window title */
116 extern char *window_title_format
;
117 extern char *window_title_alt_format
;
119 extern char *id3_default_charset
;
121 /* build option list */
122 void options_add(void);
124 /* load options from the config file */
125 void options_load(void);
127 int source_file(const char *filename
);
130 void options_exit(void);
132 void option_add(const char *name
, unsigned int id
, opt_get_cb get
,
133 opt_set_cb set
, opt_toggle_cb toggle
);
134 struct cmus_opt
*option_find(const char *name
);
135 void option_set(const char *name
, const char *value
);
136 int parse_enum(const char *buf
, int minval
, int maxval
, const char * const names
[], int *val
);