]> code.delx.au - pulseaudio/blob - polyp/daemon-conf.h
add simple hardware auto detection module
[pulseaudio] / polyp / daemon-conf.h
1 #ifndef foodaemonconfhfoo
2 #define foodaemonconfhfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of polypaudio.
8
9 polypaudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published
11 by the Free Software Foundation; either version 2 of the License,
12 or (at your option) any later version.
13
14 polypaudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with polypaudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
23 ***/
24
25 #include "log.h"
26
27 /* The actual command to execute */
28 typedef enum pa_daemon_conf_cmd {
29 PA_CMD_DAEMON, /* the default */
30 PA_CMD_HELP,
31 PA_CMD_VERSION,
32 PA_CMD_DUMP_CONF,
33 PA_CMD_DUMP_MODULES,
34 PA_CMD_KILL,
35 PA_CMD_CHECK
36 } pa_daemon_conf_cmd_t;
37
38 /* A structure containing configuration data for the Polypaudio server . */
39 typedef struct pa_daemon_conf {
40 pa_daemon_conf_cmd_t cmd;
41 int daemonize,
42 fail,
43 high_priority,
44 disallow_module_loading,
45 exit_idle_time,
46 module_idle_time,
47 scache_idle_time,
48 auto_log_target,
49 use_pid_file;
50 char *script_commands, *dl_search_path, *default_script_file;
51 pa_log_target_t log_target;
52 pa_log_level_t log_level;
53 int resample_method;
54 char *config_file;
55 } pa_daemon_conf;
56
57 /* Allocate a new structure and fill it with sane defaults */
58 pa_daemon_conf* pa_daemon_conf_new(void);
59 void pa_daemon_conf_free(pa_daemon_conf*c);
60
61 /* Load configuration data from the specified file overwriting the
62 * current settings in *c. If filename is NULL load the default daemon
63 * configuration file */
64 int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename);
65
66 /* Pretty print the current configuration data of the daemon. The
67 * returned string has to be freed manually. The output of this
68 * function may be parsed with pa_daemon_conf_load(). */
69 char *pa_daemon_conf_dump(pa_daemon_conf *c);
70
71 /* Load the configuration data from the process' environment
72 * overwriting the current settings in *c. */
73 int pa_daemon_conf_env(pa_daemon_conf *c);
74
75 /* Set these configuration variables in the structure by passing a string */
76 int pa_daemon_conf_set_log_target(pa_daemon_conf *c, const char *string);
77 int pa_daemon_conf_set_log_level(pa_daemon_conf *c, const char *string);
78 int pa_daemon_conf_set_resample_method(pa_daemon_conf *c, const char *string);
79
80 #endif