]> code.delx.au - pulseaudio/blob - src/pulsecore/autoload.h
big s/polyp/pulse/g
[pulseaudio] / src / pulsecore / autoload.h
1 #ifndef fooautoloadhfoo
2 #define fooautoloadhfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of PulseAudio.
8
9 PulseAudio 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 PulseAudio 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 PulseAudio; 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 <pulsecore/namereg.h>
26
27 /* Using the autoloading facility, modules by be loaded on-demand and
28 * synchronously. The user may register a "ghost sink" or "ghost
29 * source". Whenever this sink/source is requested but not available a
30 * specified module is loaded. */
31
32 /* An autoload entry, or "ghost" sink/source */
33 typedef struct pa_autoload_entry {
34 pa_core *core;
35 uint32_t index;
36 char *name;
37 pa_namereg_type_t type; /* Type of the autoload entry */
38 int in_action; /* Currently loaded */
39 char *module, *argument;
40 } pa_autoload_entry;
41
42 /* Add a new autoload entry of the given time, with the speicified
43 * sink/source name, module name and argument. Return the entry's
44 * index in *index */
45 int pa_autoload_add(pa_core *c, const char*name, pa_namereg_type_t type, const char*module, const char *argument, uint32_t *idx);
46
47 /* Free all autoload entries */
48 void pa_autoload_free(pa_core *c);
49 int pa_autoload_remove_by_name(pa_core *c, const char*name, pa_namereg_type_t type);
50 int pa_autoload_remove_by_index(pa_core *c, uint32_t idx);
51
52 /* Request an autoload entry by its name, effectively causing a module to be loaded */
53 void pa_autoload_request(pa_core *c, const char *name, pa_namereg_type_t type);
54
55 const pa_autoload_entry* pa_autoload_get_by_name(pa_core *c, const char*name, pa_namereg_type_t type);
56 const pa_autoload_entry* pa_autoload_get_by_index(pa_core *c, uint32_t idx);
57
58 #endif