2 * module-murphy-ivi -- PulseAudio module for providing audio routing support
3 * Copyright (c) 2012, Intel Corporation.
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.
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.
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,
23 #include <sys/types.h>
27 #include "multiplex.h"
31 #define AM_ID_INVALID 65535
34 mir_direction_unknown,
40 mir_implementation_unknown = 0,
46 mir_location_unknown = 0,
52 mir_node_type_unknown = 0,
54 /* application classes */
55 mir_application_class_begin,
56 mir_radio = mir_application_class_begin,
62 mir_phone, /**< telephony voice */
63 mir_alert, /**< ringtone, alarm */
64 mir_event, /**< notifications */
65 mir_system, /**< always audible system notifications, events */
66 mir_application_class_end,
69 mir_device_class_begin = 128,
70 mir_null = mir_device_class_begin,
90 mir_user_defined_start = 256
94 mir_privacy_unknown = 0,
99 struct pa_nodeset_resdef {
107 struct pa_nodeset_map {
111 pa_nodeset_resdef *resdef;
114 struct pa_node_card {
121 * @brief routing endpoint
123 * @details node is a routing endpoint in the GenIVI audio model.
124 * In pulseaudio terminology a routing endpoint is one of
126 * @li node is a pulseaudio sink or source. Such node is a
127 * combination of pulseudio card/profile + sink/port
128 * @li node is a pulseaudio stream. Such node in pulseaudio
129 * is either a sink_input or a source_output
132 uint32_t index; /**< index into nodeset->idxset */
133 char *key; /**< hash key for discover lookups */
134 mir_direction direction; /**< mir_input | mir_output */
135 mir_implement implement; /**< mir_device | mir_stream */
136 uint32_t channels; /**< number of channels (eg. 1=mono, 2=stereo) */
137 mir_location location; /**< mir_internal | mir_external */
138 mir_privacy privacy; /**< mir_public | mir_private */
139 mir_node_type type; /**< mir_speakers | mir_headset | ... */
140 char *zone; /**< zone where the node belong */
141 bool visible; /**< internal or can appear on UI */
142 bool available; /**< eg. is the headset connected? */
143 bool ignore; /**< do not consider it while routing */
144 bool localrset; /**< locally generated resource set */
145 char *amname; /**< audiomanager name */
146 char *amdescr; /**< UI description */
147 uint16_t amid; /**< handle to audiomanager, if any */
148 char *paname; /**< sink|source|sink_input|source_output name */
149 uint32_t paidx; /**< sink|source|sink_input|source_output index*/
150 pa_node_card pacard; /**< pulse card related data, if any */
151 char *paport; /**< sink or source port if applies */
152 pa_muxnode *mux; /**< for multiplexable input streams only */
153 pa_loopnode *loop; /**< for looped back sources only */
154 mir_dlist rtentries; /**< in device nodes: listhead of nodchain */
155 mir_dlist rtprilist; /**< in stream nodes: priority link (head is in
157 mir_dlist constrains;/**< listhead of constrains */
158 mir_vlim vlim; /**< volume limit */
159 char *rsetid; /**< resource set id, if any */
161 scripting_node *scripting;/** scripting data, if any */
165 pa_nodeset *pa_nodeset_init(struct userdata *);
166 void pa_nodeset_done(struct userdata *);
168 int pa_nodeset_add_class(struct userdata *u, mir_node_type , const char *);
169 void pa_nodeset_delete_class(struct userdata *, mir_node_type);
170 const char *pa_nodeset_get_class(struct userdata *, mir_node_type);
172 int pa_nodeset_add_role(struct userdata *, const char *, mir_node_type,
173 pa_nodeset_resdef *);
174 void pa_nodeset_delete_role(struct userdata *, const char *);
175 pa_nodeset_map *pa_nodeset_get_map_by_role(struct userdata *, const char *);
177 int pa_nodeset_add_binary(struct userdata *, const char *, mir_node_type,
178 const char *, pa_nodeset_resdef *);
179 void pa_nodeset_delete_binary(struct userdata *, const char *);
180 pa_nodeset_map *pa_nodeset_get_map_by_binary(struct userdata *, const char *);
182 int pa_nodeset_print_maps(struct userdata *, char *, int);
184 mir_node *pa_nodeset_iterate_nodes(struct userdata *, uint32_t *);
187 mir_node *mir_node_create(struct userdata *, mir_node *);
188 void mir_node_destroy(struct userdata *, mir_node *);
190 mir_node *mir_node_find_by_index(struct userdata *, uint32_t);
193 int mir_node_print(mir_node *, char *, int);
195 const char *mir_direction_str(mir_direction);
196 const char *mir_implement_str(mir_implement);
197 const char *mir_location_str(mir_location);
198 const char *mir_node_type_str(mir_node_type);
199 const char *mir_privacy_str(mir_privacy);
207 * indent-tabs-mode: nil