switch: explicit route support
[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 agl_loopnode agl_loopnode;
33 struct agl_loopnode {
34         PA_LLIST_FIELDS(agl_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 agl_loopback {
42     PA_LLIST_HEAD(agl_loopnode, loopnodes);
43 } agl_loopback;
44
45 typedef enum {
46         AGL_LOOPNODE_TYPE_UNKNOWN = 0,
47         AGL_LOOPNODE_SOURCE,
48         AGL_LOOPNODE_SINK,
49 } agl_loopnode_type;
50
51 agl_loopback *agl_loopback_init (void);
52 void agl_loopback_done (struct userdata *, agl_loopback *);
53
54 agl_loopnode *agl_loopnode_create (struct userdata *, agl_loopnode_type,
55                                    uint32_t, uint32_t, uint32_t);
56 void agl_loopnode_destroy (struct userdata *, agl_loopnode *);
57
58 #endif