]> code.delx.au - pulseaudio/blob - src/daemon/daemon-conf.h
Add option --dump-resample-methods to list available resampler implementations
[pulseaudio] / src / daemon / daemon-conf.h
1 #ifndef foodaemonconfhfoo
2 #define foodaemonconfhfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of PulseAudio.
8
9 Copyright 2004-2006 Lennart Poettering
10 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
11
12 PulseAudio is free software; you can redistribute it and/or modify
13 it under the terms of the GNU Lesser General Public License as published
14 by the Free Software Foundation; either version 2 of the License,
15 or (at your option) any later version.
16
17 PulseAudio is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
21
22 You should have received a copy of the GNU Lesser General Public License
23 along with PulseAudio; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 USA.
26 ***/
27
28 #include <pulsecore/log.h>
29 #include <pulse/sample.h>
30
31 #ifdef HAVE_SYS_RESOURCE_H
32 #include <sys/resource.h>
33 #endif
34
35 /* The actual command to execute */
36 typedef enum pa_daemon_conf_cmd {
37 PA_CMD_DAEMON, /* the default */
38 PA_CMD_HELP,
39 PA_CMD_VERSION,
40 PA_CMD_DUMP_CONF,
41 PA_CMD_DUMP_MODULES,
42 PA_CMD_KILL,
43 PA_CMD_CHECK,
44 PA_CMD_DUMP_RESAMPLE_METHODS
45 } pa_daemon_conf_cmd_t;
46
47 #ifdef HAVE_SYS_RESOURCE_H
48 typedef struct pa_rlimit {
49 rlim_t value;
50 int is_set;
51 } pa_rlimit;
52 #endif
53
54 /* A structure containing configuration data for the PulseAudio server . */
55 typedef struct pa_daemon_conf {
56 pa_daemon_conf_cmd_t cmd;
57 int daemonize,
58 fail,
59 high_priority,
60 disallow_module_loading,
61 exit_idle_time,
62 module_idle_time,
63 scache_idle_time,
64 auto_log_target,
65 use_pid_file,
66 system_instance,
67 no_cpu_limit,
68 disable_shm;
69 char *script_commands, *dl_search_path, *default_script_file;
70 pa_log_target_t log_target;
71 pa_log_level_t log_level;
72 int resample_method;
73 char *config_file;
74
75 #ifdef HAVE_SYS_RESOURCE_H
76 pa_rlimit rlimit_as, rlimit_core, rlimit_data, rlimit_fsize, rlimit_nofile, rlimit_stack;
77 #ifdef RLIMIT_NPROC
78 pa_rlimit rlimit_nproc;
79 #endif
80 #ifdef RLIMIT_MEMLOCK
81 pa_rlimit rlimit_memlock;
82 #endif
83 #endif
84
85 unsigned default_n_fragments, default_fragment_size_msec;
86 pa_sample_spec default_sample_spec;
87 } pa_daemon_conf;
88
89 /* Allocate a new structure and fill it with sane defaults */
90 pa_daemon_conf* pa_daemon_conf_new(void);
91 void pa_daemon_conf_free(pa_daemon_conf*c);
92
93 /* Load configuration data from the specified file overwriting the
94 * current settings in *c. If filename is NULL load the default daemon
95 * configuration file */
96 int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename);
97
98 /* Pretty print the current configuration data of the daemon. The
99 * returned string has to be freed manually. The output of this
100 * function may be parsed with pa_daemon_conf_load(). */
101 char *pa_daemon_conf_dump(pa_daemon_conf *c);
102
103 /* Load the configuration data from the process' environment
104 * overwriting the current settings in *c. */
105 int pa_daemon_conf_env(pa_daemon_conf *c);
106
107 /* Set these configuration variables in the structure by passing a string */
108 int pa_daemon_conf_set_log_target(pa_daemon_conf *c, const char *string);
109 int pa_daemon_conf_set_log_level(pa_daemon_conf *c, const char *string);
110 int pa_daemon_conf_set_resample_method(pa_daemon_conf *c, const char *string);
111
112 #endif