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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user