remove zombie combine module if stream setup failed
[profile/ivi/pulseaudio-module-murphy-ivi.git] / murphy / discover.h
1 /*
2  * module-murphy-ivi -- PulseAudio module for providing audio routing support
3  * Copyright (c) 2012, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU Lesser General Public License,
7  * version 2.1, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.
12  * See the GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St - Fifth Floor, Boston,
17  * MA 02110-1301 USA.
18  *
19  */
20 #ifndef foodiscoverfoo
21 #define foodiscoverfoo
22
23 #include <sys/types.h>
24 #include <regex.h>
25
26 #include "userdata.h"
27
28
29 #define PA_BIT(a)      (1UL << (a))
30
31 #if 0
32 enum pa_bus_type {
33     pa_bus_unknown = 0,
34     pa_bus_pci,
35     pa_bus_usb,
36     pa_bus_bluetooth,
37 };
38
39 enum pa_form_factor {
40     pa_form_factor_unknown,
41     pa_internal,
42     pa_speaker,
43     pa_handset,
44     pa_tv,
45     pa_webcam,
46     pa_microphone,
47     pa_headset,
48     pa_headphone,
49     pa_hands_free,
50     pa_car,
51     pa_hifi,
52     pa_computer,
53     pa_portable
54 };
55 #endif
56
57 struct pa_discover {
58     /*
59      * cirteria for filtering sinks and sources
60      */
61     unsigned        chmin;    /**< minimum of max channels */
62     unsigned        chmax;    /**< maximum of max channels */
63     pa_bool_t       selected; /**< for alsa cards: whether to consider the
64                                    selected profile alone.
65                                    for bluetooth cards: no effect */
66     struct {
67         pa_hashmap *byname;
68         pa_hashmap *byptr;
69     }               nodes;
70 };
71
72
73 struct pa_discover *pa_discover_init(struct userdata *);
74 void  pa_discover_done(struct userdata *);
75
76 void pa_discover_domain_up(struct userdata *);
77 void pa_discover_domain_down(struct userdata *);
78
79 void pa_discover_add_card(struct userdata *, pa_card *);
80 void pa_discover_remove_card(struct userdata *, pa_card *);
81 void pa_discover_profile_changed(struct userdata *, pa_card *);
82
83 void pa_discover_port_available_changed(struct userdata *, pa_device_port *);
84
85 void pa_discover_add_sink(struct userdata *, pa_sink *, pa_bool_t);
86 void pa_discover_remove_sink(struct userdata *, pa_sink *);
87
88 void pa_discover_add_source(struct userdata *, pa_source *);
89 void pa_discover_remove_source(struct userdata *, pa_source *);
90
91 void pa_discover_register_sink_input(struct userdata *, pa_sink_input *);
92 pa_bool_t pa_discover_preroute_sink_input(struct userdata *,
93                                           pa_sink_input_new_data *);
94 void pa_discover_add_sink_input(struct userdata *, pa_sink_input *);
95 void pa_discover_remove_sink_input(struct userdata *, pa_sink_input *);
96
97 void pa_discover_register_source_output(struct userdata *, pa_source_output *);
98 pa_bool_t pa_discover_preroute_source_output(struct userdata *,
99                                              pa_source_output_new_data *);
100 void pa_discover_add_source_output(struct userdata *, pa_source_output *);
101 void pa_discover_remove_source_output(struct userdata *, pa_source_output *);
102
103
104 mir_node *pa_discover_find_node_by_key(struct userdata *, const char *);
105 mir_node *pa_discover_find_node_by_ptr(struct userdata *, void *);
106
107 void pa_discover_add_node_to_ptr_hash(struct userdata *, void *, mir_node *);
108 mir_node *pa_discover_remove_node_from_ptr_hash(struct userdata *, void *);
109
110 #endif
111
112
113 /*
114  * Local Variables:
115  * c-basic-offset: 4
116  * indent-tabs-mode: nil
117  * End:
118  *
119  */