Commit c8417f88 authored by Julian Bouzas's avatar Julian Bouzas
Browse files

endpoint: add get_role API

parent d6ed1747
...@@ -462,6 +462,17 @@ wp_endpoint_get_properties (WpEndpoint * self) ...@@ -462,6 +462,17 @@ wp_endpoint_get_properties (WpEndpoint * self)
return NULL; return NULL;
} }
const char *
wp_endpoint_get_role (WpEndpoint * self)
{
g_return_val_if_fail (WP_IS_ENDPOINT (self), NULL);
if (WP_ENDPOINT_GET_CLASS (self)->get_role)
return WP_ENDPOINT_GET_CLASS (self)->get_role (self);
return NULL;
}
/** /**
* wp_endpoint_register_stream: * wp_endpoint_register_stream:
* @self: the endpoint * @self: the endpoint
......
...@@ -29,6 +29,7 @@ struct _WpEndpointClass ...@@ -29,6 +29,7 @@ struct _WpEndpointClass
GObjectClass parent_class; GObjectClass parent_class;
WpProperties * (*get_properties) (WpEndpoint * self); WpProperties * (*get_properties) (WpEndpoint * self);
const char * (*get_role) (WpEndpoint * self);
GVariant * (*get_control_value) (WpEndpoint * self, guint32 control_id); GVariant * (*get_control_value) (WpEndpoint * self, guint32 control_id);
gboolean (*set_control_value) (WpEndpoint * self, guint32 control_id, gboolean (*set_control_value) (WpEndpoint * self, guint32 control_id,
...@@ -52,6 +53,7 @@ const gchar * wp_endpoint_get_media_class (WpEndpoint * self); ...@@ -52,6 +53,7 @@ const gchar * wp_endpoint_get_media_class (WpEndpoint * self);
guint wp_endpoint_get_direction (WpEndpoint * self); guint wp_endpoint_get_direction (WpEndpoint * self);
guint64 wp_endpoint_get_creation_time (WpEndpoint * self); guint64 wp_endpoint_get_creation_time (WpEndpoint * self);
WpProperties * wp_endpoint_get_properties (WpEndpoint * self); WpProperties * wp_endpoint_get_properties (WpEndpoint * self);
const char * wp_endpoint_get_role (WpEndpoint * self);
void wp_endpoint_register_stream (WpEndpoint * self, GVariant * stream); void wp_endpoint_register_stream (WpEndpoint * self, GVariant * stream);
GVariant * wp_endpoint_get_stream (WpEndpoint * self, guint32 stream_id); GVariant * wp_endpoint_get_stream (WpEndpoint * self, guint32 stream_id);
......
...@@ -100,6 +100,14 @@ endpoint_get_properties (WpEndpoint * ep) ...@@ -100,6 +100,14 @@ endpoint_get_properties (WpEndpoint * ep)
return wp_proxy_node_get_properties (self->proxy_node); return wp_proxy_node_get_properties (self->proxy_node);
} }
static const char *
endpoint_get_role (WpEndpoint *ep)
{
WpPwAudioSoftdspEndpoint *self = WP_PW_AUDIO_SOFTDSP_ENDPOINT (ep);
return self->role;
}
static gboolean static gboolean
endpoint_prepare_link (WpEndpoint * ep, guint32 stream_id, endpoint_prepare_link (WpEndpoint * ep, guint32 stream_id,
WpEndpointLink * link, GVariant ** properties, GError ** error) WpEndpointLink * link, GVariant ** properties, GError ** error)
...@@ -399,6 +407,7 @@ endpoint_class_init (WpPwAudioSoftdspEndpointClass * klass) ...@@ -399,6 +407,7 @@ endpoint_class_init (WpPwAudioSoftdspEndpointClass * klass)
object_class->get_property = endpoint_get_property; object_class->get_property = endpoint_get_property;
endpoint_class->get_properties = endpoint_get_properties; endpoint_class->get_properties = endpoint_get_properties;
endpoint_class->get_role = endpoint_get_role;
endpoint_class->prepare_link = endpoint_prepare_link; endpoint_class->prepare_link = endpoint_prepare_link;
endpoint_class->get_control_value = endpoint_get_control_value; endpoint_class->get_control_value = endpoint_get_control_value;
endpoint_class->set_control_value = endpoint_set_control_value; endpoint_class->set_control_value = endpoint_set_control_value;
......
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