default: esd is obsolete, hence don't load it anymore by default
[pulseaudio-mirror.git] / src / pulsecore / card.h
blob2d691b679e99c7461eb46bfd9b5d5c8444e52d3b
1 #ifndef foopulsecardhfoo
2 #define foopulsecardhfoo
4 /***
5 This file is part of PulseAudio.
7 Copyright 2009 Lennart Poettering
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.1 of the License,
12 or (at your option) any later version.
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.
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 ***/
25 typedef struct pa_card pa_card;
27 #include <pulse/proplist.h>
28 #include <pulsecore/core.h>
29 #include <pulsecore/module.h>
30 #include <pulsecore/idxset.h>
32 typedef struct pa_card_profile {
33 char *name;
34 char *description;
36 unsigned priority;
38 /* We probably want to have different properties later on here */
39 unsigned n_sinks;
40 unsigned n_sources;
42 unsigned max_sink_channels;
43 unsigned max_source_channels;
45 /* .. followed by some implementation specific data */
46 } pa_card_profile;
48 #define PA_CARD_PROFILE_DATA(d) ((void*) ((uint8_t*) d + PA_ALIGN(sizeof(pa_card_profile))))
50 struct pa_card {
51 uint32_t index;
52 pa_core *core;
54 char *name;
56 pa_proplist *proplist;
57 pa_module *module;
58 char *driver;
60 pa_idxset *sinks;
61 pa_idxset *sources;
63 pa_hashmap *profiles;
64 pa_card_profile *active_profile;
66 pa_bool_t save_profile:1;
68 void *userdata;
70 int (*set_profile)(pa_card *c, pa_card_profile *profile);
73 typedef struct pa_card_new_data {
74 char *name;
75 pa_proplist *proplist;
77 const char *driver;
78 pa_module *module;
80 pa_hashmap *profiles;
81 char *active_profile;
83 pa_bool_t namereg_fail:1;
85 pa_bool_t save_profile:1;
86 } pa_card_new_data;
88 pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra);
89 void pa_card_profile_free(pa_card_profile *c);
91 pa_card_new_data *pa_card_new_data_init(pa_card_new_data *data);
92 void pa_card_new_data_set_name(pa_card_new_data *data, const char *name);
93 void pa_card_new_data_set_profile(pa_card_new_data *data, const char *profile);
94 void pa_card_new_data_done(pa_card_new_data *data);
96 pa_card *pa_card_new(pa_core *c, pa_card_new_data *data);
97 void pa_card_free(pa_card *c);
99 int pa_card_set_profile(pa_card *c, const char *name, pa_bool_t save);
101 int pa_card_suspend(pa_card *c, pa_bool_t suspend, pa_suspend_cause_t cause);
103 #endif