Implement routing groups and volume ramp up/down
[staging/agl-audio-plugin.git] / utils.h
1 /*
2  * module-agl-audio -- PulseAudio module for providing audio routing support
3  * (forked from "module-murphy-ivi" - https://github.com/otcshare )
4  * Copyright (c) 2012, Intel Corporation.
5  * Copyright (c) 2016, IoT.bzh
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms and conditions of the GNU Lesser General Public License,
9  * version 2.1, as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin St - Fifth Floor, Boston,
19  * MA 02110-1301 USA.
20  *
21  */
22 #ifndef paaglutils
23 #define paaglutils
24
25 #include <pulsecore/core.h>
26
27 #include "userdata.h"
28
29 struct agl_null_sink;
30
31 struct agl_null_sink *agl_utils_create_null_sink (struct userdata *, const char *);
32 void agl_utils_destroy_null_sink (struct userdata *, struct agl_null_sink *);
33 pa_sink *agl_utils_get_null_sink (struct userdata *, struct agl_null_sink *);
34 pa_source *agl_utils_get_null_source (struct userdata *, struct agl_null_sink *);
35 void agl_utils_volume_ramp (struct userdata *, struct agl_null_sink *, bool);
36
37  /* general helper functions */ 
38 const char *agl_utils_get_card_name (pa_card *);
39 const char *agl_utils_get_card_bus (pa_card *);
40 const char *agl_utils_get_sink_name (pa_sink *);
41 const char *agl_utils_get_source_name (pa_source *);
42 const char *agl_utils_get_sink_input_name (pa_sink_input *);
43 const char *agl_utils_get_source_output_name (pa_source_output *);
44 pa_sink *agl_utils_get_primary_alsa_sink (struct userdata *);
45 pa_sink *agl_utils_get_alsa_sink (struct userdata *, const char *);
46 void agl_utils_init_stamp (void);
47 uint32_t agl_utils_new_stamp (void);
48 uint32_t agl_utils_get_stamp (void);
49
50  /* AM-oriented helper functions */
51 char *agl_utils_get_zone (pa_proplist *, pa_proplist *);
52 bool agl_utils_set_stream_routing_properties (pa_proplist *, int, void *);
53 bool agl_utils_unset_stream_routing_properties (pa_proplist *);
54
55 #endif