X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=node.c;fp=node.c;h=c46f84262605ab5d09bb9e9729d5c00ecdd83af3;hb=2de141b9a3145a4a8edf2e310adfa8d425637e53;hp=c85d51222d7de82ae9ddbe4f1692011dfe3092d1;hpb=cc70e0ae30920ca835bf011f8040afb6fea43f45;p=staging%2Fagl-audio-plugin.git diff --git a/node.c b/node.c index c85d512..c46f842 100644 --- a/node.c +++ b/node.c @@ -23,6 +23,8 @@ #include "router.h" #include +#include +#include agl_nodeset *agl_nodeset_init (struct userdata *u) { @@ -146,6 +148,39 @@ void agl_node_destroy (struct userdata *u, agl_node *node) pa_xfree (node); } + +agl_node_type agl_node_type_from_str (const char *str) +{ + agl_node_type type; + + pa_assert (str); + + if (pa_streq (str, "agl_radio")) + type = agl_radio; + else if (pa_streq (str, "agl_music")) + type = agl_player; + else if (pa_streq (str, "agl_navigator")) + type = agl_navigator; + else if (pa_streq (str, "agl_game")) + type = agl_game; + else if (pa_streq (str, "agl_browser")) + type = agl_browser; + else if (pa_streq (str, "agl_camera")) + type = agl_camera; + else if (pa_streq (str, "agl_phone")) + type = agl_phone; + else if (pa_streq (str, "agl_alert")) + type = agl_alert; + else if (pa_streq (str, "agl_event")) + type = agl_event; + else if (pa_streq (str, "agl_system")) + type = agl_system; + else + type = agl_node_type_unknown; + + return type; +} + const char *agl_node_type_str (agl_node_type type) { switch (type) {