volume control: second part
[profile/ivi/pulseaudio-module-murphy-ivi.git] / murphy / discover.h
1 #ifndef foodiscoverfoo
2 #define foodiscoverfoo
3
4 #include <sys/types.h>
5 #include <regex.h>
6
7 #include "userdata.h"
8
9
10 #define PA_BIT(a)      (1UL << (a))
11
12 #if 0
13 enum pa_bus_type {
14     pa_bus_unknown = 0,
15     pa_bus_pci,
16     pa_bus_usb,
17     pa_bus_bluetooth,
18 };
19
20 enum pa_form_factor {
21     pa_form_factor_unknown,
22     pa_internal,
23     pa_speaker,
24     pa_handset,
25     pa_tv,
26     pa_webcam,
27     pa_microphone,
28     pa_headset,
29     pa_headphone,
30     pa_hands_free,
31     pa_car,
32     pa_hifi,
33     pa_computer,
34     pa_portable
35 };
36 #endif
37
38 struct pa_discover {
39     /*
40      * cirteria for filtering sinks and sources
41      */
42     unsigned        chmin;    /**< minimum of max channels */
43     unsigned        chmax;    /**< maximum of max channels */
44     pa_bool_t       selected; /**< for alsa cards: whether to consider the
45                                    selected profile alone.
46                                    for bluetooth cards: no effect */
47     struct {
48         pa_hashmap *byname;
49         pa_hashmap *byptr;
50     }               nodes;
51 };
52
53
54 struct pa_discover *pa_discover_init(struct userdata *);
55 void  pa_discover_done(struct userdata *);
56
57 void pa_discover_domain_up(struct userdata *);
58 void pa_discover_domain_down(struct userdata *);
59
60 void pa_discover_add_card(struct userdata *, pa_card *);
61 void pa_discover_remove_card(struct userdata *, pa_card *);
62 void pa_discover_profile_changed(struct userdata *, pa_card *);
63
64 void pa_discover_add_sink(struct userdata *, pa_sink *, pa_bool_t);
65 void pa_discover_remove_sink(struct userdata *, pa_sink *);
66
67 void pa_discover_add_source(struct userdata *, pa_source *);
68 void pa_discover_remove_source(struct userdata *, pa_source *);
69
70 void pa_discover_register_sink_input(struct userdata *, pa_sink_input *);
71 void pa_discover_preroute_sink_input(struct userdata *,
72                                      pa_sink_input_new_data *);
73 void pa_discover_add_sink_input(struct userdata *, pa_sink_input *);
74 void pa_discover_remove_sink_input(struct userdata *, pa_sink_input *);
75
76
77 mir_node *pa_discover_find_node_by_key(struct userdata *, const char *);
78 mir_node *pa_discover_find_node_by_ptr(struct userdata *, void *);
79
80 #endif
81
82
83 /*
84  * Local Variables:
85  * c-basic-offset: 4
86  * indent-tabs-mode: nil
87  * End:
88  *
89  */