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
;
96 extern const char * const aaa_mode_names
[];
97 extern const char * const view_names
[NR_VIEWS
+ 1];
99 extern int colors
[NR_COLORS
];
101 /* format string for track window (tree view) */
102 extern char *track_win_format
;
103 extern char *track_win_alt_format
;
105 /* format string for shuffle, sorted and play queue views */
106 extern char *list_win_format
;
107 extern char *list_win_alt_format
;
109 /* format string for currently playing track */
110 extern char *current_format
;
111 extern char *current_alt_format
;
113 /* format string for window title */
114 extern char *window_title_format
;
115 extern char *window_title_alt_format
;
117 extern char *id3_default_charset
;
119 /* build option list */
120 void options_add(void);
122 /* load options from the config file */
123 void options_load(void);
125 int source_file(const char *filename
);
128 void options_exit(void);
130 void option_add(const char *name
, unsigned int id
, opt_get_cb get
,
131 opt_set_cb set
, opt_toggle_cb toggle
);
132 struct cmus_opt
*option_find(const char *name
);
133 void option_set(const char *name
, const char *value
);
134 int parse_enum(const char *buf
, int minval
, int maxval
, const char * const names
[], int *val
);