summaryrefslogtreecommitdiffstats
path: root/classify.c
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@iot.bzh>2016-07-06 10:16:36 +0200
committerYannick Gicquel <yannick.gicquel@iot.bzh>2016-10-11 17:09:07 +0200
commit2478974dfde05063cbf0233e3d3c434ca2f46c7c (patch)
tree86395f3b4c2c35261e051c237d7ae17f9ca3994a /classify.c
parentf259ec53101a3754cd2da24a369ea48bb1947e62 (diff)
Map labels to classes, map routing groups to audio adapters
Change-Id: I563aa146eba8de594900c02b44f19f526a5cdc0e Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Diffstat (limited to 'classify.c')
-rw-r--r--classify.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/classify.c b/classify.c
index c049fad..4d10ce0 100644
--- a/classify.c
+++ b/classify.c
@@ -23,19 +23,28 @@
#include <pulsecore/core-util.h> /* required for "pa_streq" */
#include "classify.h"
+#include "node.h"
agl_node_type agl_classify_guess_stream_node_type (struct userdata *u, pa_proplist *pl)
{
+ agl_nodeset *ns;
+ agl_nodeset_map *map;
agl_node_type type;
const char *role;
pa_assert (u);
pa_assert (pl);
+ pa_assert_se (ns = u->nodeset);
role = pa_proplist_gets (pl, PA_PROP_MEDIA_ROLE);
if (!role)
type = agl_node_type_unknown;
+
+ /* ask the configuration, see defaults in "config.c" */
+ else if (map = pa_hashmap_get (ns->roles, role))
+ type = map->type;
+ /* configuration did not match, here are some sensible defaults */
else if (pa_streq (role, "radio"))
type = agl_radio;
else if (pa_streq (role, "music"))