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
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.
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.
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,
22 #include <pulsecore/pulsecore-config.h> /* required for headers below */
23 #include <pulsecore/core-util.h> /* required for "pa_streq" */
28 agl_node_type agl_classify_guess_stream_node_type (struct userdata *u, pa_proplist *pl)
37 pa_assert_se (ns = u->nodeset);
39 role = pa_proplist_gets (pl, PA_PROP_MEDIA_ROLE);
42 type = agl_node_type_unknown;
44 /* ask the configuration, see defaults in "config.c" */
45 else if (map = pa_hashmap_get (ns->roles, role))
47 /* configuration did not match, here are some sensible defaults */
48 else if (pa_streq (role, "radio"))
50 else if (pa_streq (role, "music"))
52 else if (pa_streq (role, "navi"))
54 else if (pa_streq (role, "game"))
56 else if (pa_streq (role, "browser"))
58 else if (pa_streq (role, "camera"))
60 else if (pa_streq (role, "phone"))
62 else if (pa_streq (role, "alert"))
64 else if (pa_streq (role, "event"))
66 else if (pa_streq (role, "system"))