Skip to content
Snippets Groups Projects
Commit a1f47d06 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

session-item: add _get_associated_proxy_id method

To ease the use case where we are only interested in the id
and not the proxy object itself
parent bb78b6bb
No related branches found
No related tags found
No related merge requests found
......@@ -498,6 +498,25 @@ wp_session_item_get_associated_proxy (WpSessionItem * self, GType proxy_type)
return WP_SESSION_ITEM_GET_CLASS (self)->get_associated_proxy (self, proxy_type);
}
/**
* wp_session_item_get_associated_proxy_id:
* @self: the session item
* @proxy_type: a #WpProxy subclass #GType
*
* Returns: the bound id of the associated proxy of the specified @proxy_type,
* or `SPA_ID_INVALID` if there is no association to such a proxy
*/
guint32
wp_session_item_get_associated_proxy_id (WpSessionItem * self, GType proxy_type)
{
g_autoptr (WpProxy) proxy = wp_session_item_get_associated_proxy (self,
proxy_type);
if (!proxy)
return SPA_ID_INVALID;
return wp_proxy_get_bound_id (proxy);
}
/**
* wp_session_item_configure: (virtual configure)
* @self: the session item
......
......@@ -117,6 +117,10 @@ WP_API
gpointer wp_session_item_get_associated_proxy (WpSessionItem * self,
GType proxy_type);
WP_API
guint32 wp_session_item_get_associated_proxy_id (WpSessionItem * self,
GType proxy_type);
/* configuration */
WP_API
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment