1 #ifndef foomirrouterfoo
2 #define foomirrouterfoo
9 typedef pa_bool_t (*mir_rtgroup_accept_t)(struct userdata *, mir_rtgroup *,
11 typedef int (*mir_rtgroup_compare_t)(struct userdata *u,
12 mir_node *, mir_node *);
16 int maplen; /**< length of the class- and priormap */
17 mir_rtgroup **classmap; /**< to map device node types to rtgroups */
18 int *priormap; /**< stream node priorities */
19 mir_dlist nodlist; /**< priorized list of the input stream nodes */
20 mir_dlist connlist; /**< listhead of the connections */
25 mir_dlist link; /**< rtgroup chain */
26 mir_dlist nodchain; /**< node chain */
27 mir_node *node; /**< pointer to the owning node */
28 bool blocked; /**< weather this routing entry is active */
33 char *name; /**< name of the rtgroup */
34 mir_dlist entries; /**< listhead of ordered rtentries */
35 mir_rtgroup_accept_t accept; /**< wheter to accept a node or not */
36 mir_rtgroup_compare_t compare; /**< comparision function for ordering */
39 struct mir_connection {
40 mir_dlist link; /**< list of connections */
41 pa_bool_t blocked; /**< true if this conflicts with another route */
42 uint16_t amid; /**< audio manager connection id */
43 uint32_t from; /**< source node index */
44 uint32_t to; /**< destination node index */
45 uint32_t stream; /**< index of the sink-input to be routed */
49 pa_router *pa_router_init(struct userdata *);
50 void pa_router_done(struct userdata *);
52 pa_bool_t mir_router_create_rtgroup(struct userdata *, const char *,
54 mir_rtgroup_compare_t);
55 void mir_router_destroy_rtgroup(struct userdata *, const char *);
56 pa_bool_t mir_router_assign_class_to_rtgroup(struct userdata *, mir_node_type,
59 void mir_router_register_node(struct userdata *, mir_node *);
60 void mir_router_unregister_node(struct userdata *, mir_node *);
62 mir_node *mir_router_make_prerouting(struct userdata *, mir_node *);
63 void mir_router_make_routing(struct userdata *);
65 mir_connection *mir_router_add_explicit_route(struct userdata *, uint16_t,
66 mir_node *, mir_node *);
67 void mir_router_remove_explicit_route(struct userdata *, mir_connection *);
70 int mir_router_print_rtgroups(struct userdata *, char *, int);
72 pa_bool_t mir_router_default_accept(struct userdata *, mir_rtgroup *,
74 pa_bool_t mir_router_phone_accept(struct userdata *, mir_rtgroup *,
77 int mir_router_default_compare(struct userdata *, mir_node *, mir_node *);
78 int mir_router_phone_compare(struct userdata *, mir_node *, mir_node *);
81 #endif /* foomirrouterfoo */
87 * indent-tabs-mode: nil