Commit 888667d7 authored by Julian Bouzas's avatar Julian Bouzas
Browse files

modules: remove role and priority properties from si-audio-adapter and si-node

parent d68636f9
......@@ -27,8 +27,6 @@ struct _WpSiAudioAdapter
WpNode *node;
gchar name[96];
gchar media_class[32];
gchar role[32];
guint priority;
guint preferred_n_channels;
gboolean control_port;
gboolean monitor;
......@@ -63,8 +61,6 @@ si_audio_adapter_reset (WpSessionItem * item)
g_clear_object (&self->node);
self->name[0] = '\0';
self->media_class[0] = '\0';
self->role[0] = '\0';
self->priority = 0;
self->control_port = FALSE;
self->monitor = FALSE;
self->direction = WP_DIRECTION_INPUT;
......@@ -115,29 +111,11 @@ si_audio_adapter_configure (WpSessionItem * item, WpProperties *p)
wp_properties_set (si_props, "media.class", self->media_class);
}
str = wp_properties_get (si_props, "role");
if (str) {
strncpy (self->role, str, sizeof (self->role) - 1);
} else {
str = wp_properties_get (node_props, PW_KEY_MEDIA_ROLE);
if (str)
strncpy (self->role, str, sizeof (self->role) - 1);
else
strncpy (self->role, "Unknown", sizeof (self->role) - 1);
wp_properties_set (si_props, "role", self->role);
}
if (strstr (self->media_class, "Source") ||
strstr (self->media_class, "Output"))
self->direction = WP_DIRECTION_OUTPUT;
wp_properties_setf (si_props, "direction", "%u", self->direction);
str = wp_properties_get (si_props, "priority");
if (str && sscanf(str, "%u", &self->priority) != 1)
return FALSE;
if (!str)
wp_properties_setf (si_props, "priority", "%u", self->priority);
str = wp_properties_get (si_props, "preferred.n.channels");
if (str && sscanf(str, "%u", &self->preferred_n_channels) != 1)
return FALSE;
......
......@@ -21,8 +21,6 @@ struct _WpSiNode
WpNode *node;
gchar name[96];
gchar media_class[32];
gchar role[32];
guint priority;
WpDirection direction;
};
......@@ -49,8 +47,6 @@ si_node_reset (WpSessionItem * item)
g_clear_object (&self->node);
self->name[0] = '\0';
self->media_class[0] = '\0';
self->role[0] = '\0';
self->priority = 0;
self->direction = WP_DIRECTION_INPUT;
WP_SESSION_ITEM_CLASS (si_node_parent_class)->reset (item);
......@@ -98,29 +94,11 @@ si_node_configure (WpSessionItem * item, WpProperties *p)
wp_properties_set (si_props, "media.class", self->media_class);
}
str = wp_properties_get (si_props, "role");
if (str) {
strncpy (self->role, str, sizeof (self->role) - 1);
} else {
str = wp_properties_get (node_props, PW_KEY_MEDIA_ROLE);
if (str)
strncpy (self->role, str, sizeof (self->role) - 1);
else
strncpy (self->role, "Unknown", sizeof (self->role) - 1);
wp_properties_set (si_props, "role", self->role);
}
if (strstr (self->media_class, "Source") ||
strstr (self->media_class, "Output"))
self->direction = WP_DIRECTION_OUTPUT;
wp_properties_setf (si_props, "direction", "%u", self->direction);
str = wp_properties_get (si_props, "priority");
if (str && sscanf(str, "%u", &self->priority) != 1)
return FALSE;
if (!str)
wp_properties_setf (si_props, "priority", "%u", self->priority);
self->node = g_object_ref (node);
wp_properties_set (si_props, "si.factory.name", SI_FACTORY_NAME);
......
......@@ -73,7 +73,6 @@ test_si_audio_adapter_configure_activate (TestFixture * f,
{
WpProperties *props = wp_properties_new_empty ();
wp_properties_setf (props, "node", "%p", node);
wp_properties_set (props, "role", "Multimedia");
g_assert_true (wp_session_item_configure (adapter, props));
g_assert_true (wp_session_item_is_configured (adapter));
}
......@@ -89,15 +88,9 @@ test_si_audio_adapter_configure_activate (TestFixture * f,
str = wp_properties_get (props, "media.class");
g_assert_nonnull (str);
g_assert_cmpstr ("Audio/Source", ==, str);
str = wp_properties_get (props, "role");
g_assert_nonnull (str);
g_assert_cmpstr ("Multimedia", ==, str);
str = wp_properties_get (props, "direction");
g_assert_nonnull (str);
g_assert_cmpstr ("1", ==, str);
str = wp_properties_get (props, "priority");
g_assert_nonnull (str);
g_assert_cmpstr ("0", ==, str);
str = wp_properties_get (props, "preferred.n.channels");
g_assert_nonnull (str);
g_assert_cmpstr ("0", ==, str);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment