introducing maximum volume limit for streams
[profile/ivi/pulseaudio-module-murphy-ivi.git] / murphy / userdata.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 foomurphyuserdatafoo
21 #define foomurphyuserdatafoo
22
23 #include <stdbool.h>
24 #include <pulsecore/core.h>
25 #include <pulsecore/client.h>
26 #include <pulsecore/protocol-native.h>
27
28 #include <murphy/domain-control/client.h>
29
30 #include "multiplex.h"
31 #include "loopback.h"
32
33 #define DIM(a) (sizeof(a)/sizeof((a)[0]))
34
35 #define PA_PROP_ZONES                  "zones"
36 #define PA_PROP_ZONE_NAME              "zone.name"
37 #define PA_PROP_ROUTING_CLASS_NAME     "routing.class.name"
38 #define PA_PROP_ROUTING_CLASS_ID       "routing.class.id"
39 #define PA_PROP_ROUTING_METHOD         "routing.method"
40 #define PA_PROP_ROUTING_TABLE          "routing.table"
41 #define PA_PROP_NODE_INDEX             "node.index"
42 #define PA_PROP_NODE_TYPE              "node.type"
43 #define PA_PROP_NODE_ROLE              "node.role"
44 #define PA_PROP_RESOURCE_SET_ID        "resource.set.id"
45 #define PA_PROP_RESOURCE_SET_APPID     "resource.set.appid"
46 #define PA_PROP_RESOURCE_PRIORITY      "resource.set.priority"
47 #define PA_PROP_RESOURCE_SET_FLAGS     "resource.set.flags"
48 #define PA_PROP_RESOURCE_AUDIO_FLAGS   "resource.audio.flags"
49
50 #define PA_ZONE_NAME_DEFAULT           "driver"
51
52 #define PA_ROUTING_DEFAULT             "default"
53 #define PA_ROUTING_EXPLICIT            "explicit"
54
55 #define PA_RESOURCE_SET_ID_PID         "pid"
56
57 #define MIR_VOLUME_MAX_ATTENUATION      -120 /* dB */
58
59 typedef enum   pa_value_type            pa_value_type;
60 typedef struct pa_value                 pa_value;
61 typedef struct pa_null_sink             pa_null_sink;
62 typedef struct pa_tracker               pa_tracker;
63 typedef struct pa_audiomgr              pa_audiomgr;
64 typedef struct pa_routerif              pa_routerif;
65 typedef struct pa_discover              pa_discover;
66 typedef struct pa_router                pa_router;
67 typedef struct pa_constrain             pa_constrain;
68 typedef struct pa_fader                 pa_fader;
69 typedef struct pa_scripting             pa_scripting;
70 typedef struct pa_mir_volume            pa_mir_volume;
71 typedef struct pa_mir_config            pa_mir_config;
72 typedef struct pa_zoneset               pa_zoneset;
73 typedef struct pa_nodeset               pa_nodeset;
74 typedef struct pa_nodeset_resdef        pa_nodeset_resdef;
75 typedef struct pa_nodeset_map           pa_nodeset_map;
76 typedef struct pa_node_card             pa_node_card;
77 typedef struct pa_card_hooks            pa_card_hooks;
78 typedef struct pa_port_hooks            pa_port_hooks;
79 typedef struct pa_sink_hooks            pa_sink_hooks;
80 typedef struct pa_source_hooks          pa_source_hooks;
81 typedef struct pa_sink_input_hooks      pa_sink_input_hooks;
82 typedef struct pa_source_output_hooks   pa_source_output_hooks;
83 typedef struct pa_extapi                pa_extapi;
84 typedef struct pa_murphyif              pa_murphyif;
85
86 typedef enum   mir_direction            mir_direction;
87 typedef enum   mir_implement            mir_implement;
88 typedef enum   mir_location             mir_location;
89 typedef enum   mir_node_type            mir_node_type;
90 typedef enum   mir_privacy              mir_privacy; 
91 typedef struct mir_node                 mir_node;
92 typedef struct mir_zone                 mir_zone;
93 typedef struct mir_rtgroup              mir_rtgroup;
94 typedef struct mir_rtentry              mir_rtentry;
95 typedef struct mir_connection           mir_connection;
96 typedef struct mir_constr_link          mir_constr_link;
97 typedef struct mir_constr_def           mir_constr_def;
98 typedef struct mir_vlim                 mir_vlim;
99 typedef struct mir_volume_suppress_arg  mir_volume_suppress_arg;
100
101 typedef struct scripting_import         scripting_import;
102 typedef struct scripting_node           scripting_node;
103 typedef struct scripting_zone           scripting_zone;
104 typedef struct scripting_resource       scripting_resource;
105 typedef struct scripting_rtgroup        scripting_rtgroup;
106 typedef struct scripting_apclass        scripting_apclass;
107 typedef struct scripting_vollim         scripting_vollim;
108
109 typedef enum   am_method                am_method;
110 typedef struct am_domainreg_data        am_domainreg_data;
111 typedef struct am_nodereg_data          am_nodereg_data;
112 typedef struct am_nodeunreg_data        am_nodeunreg_data;
113 typedef struct am_ack_data              am_ack_data;
114 typedef struct am_connect_data          am_connect_data;
115
116
117 typedef struct {
118     char *profile;    /**< During profile change it contains the new profile
119                            name. Otherwise it is NULL. When sink tracking
120                            hooks called the card's active_profile still
121                            points to the old profile */
122     uint32_t sink;
123     uint32_t source;
124 } pa_mir_state;
125
126 enum pa_value_type {
127     pa_value_unknown = 0,
128     pa_value_string,
129     pa_value_integer,
130     pa_value_unsignd,
131     pa_value_floating,
132 };
133
134 struct pa_value {
135     /* positive values are enumerations of pa_value_type
136      * negative values represent array dimensions,
137      * eg. -2 menas an array with two element
138      */
139     int             type;
140     union {
141         const char *string;
142         int32_t     integer;
143         uint32_t    unsignd;
144         double      floating;
145         pa_value  **array;
146     };
147 };
148
149
150 struct userdata {
151     pa_core       *core;
152     pa_module     *module;
153     pa_null_sink  *nullsink;
154     pa_zoneset    *zoneset;
155     pa_nodeset    *nodeset;
156     pa_audiomgr   *audiomgr;
157     pa_routerif   *routerif;
158     pa_discover   *discover;
159     pa_tracker    *tracker;
160     pa_router     *router;
161     pa_constrain  *constrain;
162     pa_multiplex  *multiplex;
163     pa_loopback   *loopback;
164     pa_fader      *fader;
165     pa_scripting  *scripting;
166     pa_mir_volume *volume;
167     pa_mir_config *config;
168     pa_mir_state   state;
169     pa_extapi     *extapi;
170     pa_native_protocol *protocol;
171     pa_murphyif   *murphyif;
172 };
173
174 #endif
175
176 /*
177  * Local Variables:
178  * c-basic-offset: 4
179  * indent-tabs-mode: nil
180  * End:
181  *
182  */