summaryrefslogtreecommitdiffstats
path: root/node.c
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@iot.bzh>2016-07-04 14:29:04 +0200
committerYannick Gicquel <yannick.gicquel@iot.bzh>2016-10-11 17:09:07 +0200
commitf259ec53101a3754cd2da24a369ea48bb1947e62 (patch)
tree76a42068003af728c71ec1d253eeb869189c9c97 /node.c
parentacb229813f5845e8b38bea56870211319887f3b4 (diff)
Finalize basic configuration logic
Configuration-related structures and values are now applied everywhere. Change-Id: I5c665a649b8c7c52dd18d214cee6c484f491b584 Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Diffstat (limited to 'node.c')
-rw-r--r--node.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/node.c b/node.c
index 212a923..e2c5007 100644
--- a/node.c
+++ b/node.c
@@ -68,6 +68,27 @@ void agl_nodeset_done(struct userdata *u)
}
}
+int agl_nodeset_add_role (struct userdata *u, const char *role, agl_node_type type, agl_nodeset_resdef *resdef)
+{
+ agl_nodeset *ns;
+ agl_nodeset_map *map;
+
+ pa_assert (u);
+ pa_assert_se (ns = u->nodeset);
+
+ map = pa_xnew0 (agl_nodeset_map, 1);
+ map->name = pa_xstrdup (role);
+ map->type = type;
+ map->role = pa_xstrdup (role);
+
+ if (resdef) {
+ map->resdef = pa_xnew (agl_nodeset_resdef, 1);
+ memcpy (map->resdef, resdef, sizeof(agl_nodeset_resdef));
+ }
+
+ return pa_hashmap_put (ns->roles, (void *)map->name, map);
+}
+
agl_node *agl_node_create (struct userdata *u, agl_node *data)
{
agl_nodeset *ns;
@@ -132,6 +153,16 @@ const char *agl_node_type_str (agl_node_type type)
}
}
+const char *agl_node_direction_str (agl_direction direction)
+{
+ switch (direction) {
+ case agl_direction_unknown: return "unknown";
+ case agl_input: return "input";
+ case agl_output: return "output";
+ default: return "< ??? >";
+ }
+}
+
agl_node *agl_node_get_from_data (struct userdata *u, agl_direction type, void *data)
{
pa_sink_input_new_data *sinp_data;