27cdef9531c0c39f42bf553b72ebac4eb2efa9dd
[staging/agl-audio-plugin.git] / loopback.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 paaglloopback
23 #define paaglloopback
24
25 #include <stdint.h>
26
27 #include <pulsecore/pulsecore-config.h> /* required for "core.h" */
28 #include <pulsecore/core.h>             /* required for "PA_LLIST_*" */
29
30 #include "userdata.h"
31
32 typedef struct pa_loopnode pa_loopnode;
33 struct pa_loopnode {
34         PA_LLIST_FIELDS(pa_loopnode);
35         uint32_t   module_index;
36         uint32_t   node_index;
37         uint32_t   sink_input_index;
38         uint32_t   source_output_index;
39 };
40
41 typedef struct pa_loopback {
42     PA_LLIST_HEAD(pa_loopnode, loopnodes);
43 } pa_loopback;
44
45 typedef enum {
46         PA_LOOPNODE_TYPE_UNKNOWN = 0,
47         PA_LOOPNODE_SOURCE,
48         PA_LOOPNODE_SINK,
49 } pa_loopnode_type;
50
51 pa_loopback *pa_loopback_init (void);
52 void pa_loopback_done (struct userdata *, pa_loopback *);
53
54 pa_loopnode *pa_loopnode_create (struct userdata *, pa_loopnode_type,
55                                  uint32_t, uint32_t, uint32_t);
56 void pa_loopnode_destroy (struct userdata *, pa_loopnode *);
57
58 #endif