1 #ifndef fooautoloadhfoo
2 #define fooautoloadhfoo
7 This file is part of polypaudio.
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.
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.
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
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. */
32 /* An autoload entry, or "ghost" sink/source */
33 typedef struct pa_autoload_entry {
37 pa_namereg_type_t type; /* Type of the autoload entry */
38 int in_action; /* Currently loaded */
39 char *module, *argument;
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
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);
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);
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);
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);