2020-03-12 18:00:01 +02:00
|
|
|
/* WirePlumber
|
|
|
|
|
*
|
|
|
|
|
* Copyright © 2020 Collabora Ltd.
|
|
|
|
|
* @author George Kiagiadakis <george.kiagiadakis@collabora.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __WIREPLUMBER_SESSION_ITEM_H__
|
|
|
|
|
#define __WIREPLUMBER_SESSION_ITEM_H__
|
|
|
|
|
|
2021-03-17 14:52:41 -04:00
|
|
|
#include "object.h"
|
|
|
|
|
#include "proxy.h"
|
2020-03-12 18:00:01 +02:00
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
2021-05-13 17:54:58 +03:00
|
|
|
/*!
|
2021-05-21 18:40:43 +03:00
|
|
|
* \brief Flags to be used as WpObjectFeatures for WpSessionItem subclasses.
|
|
|
|
|
* \ingroup wpsessionitem
|
2020-03-12 18:00:01 +02:00
|
|
|
*/
|
2021-03-17 14:52:41 -04:00
|
|
|
typedef enum { /*< flags >*/
|
|
|
|
|
/* main features */
|
|
|
|
|
WP_SESSION_ITEM_FEATURE_ACTIVE = (1 << 0),
|
|
|
|
|
WP_SESSION_ITEM_FEATURE_EXPORTED = (1 << 1),
|
2020-03-12 18:00:01 +02:00
|
|
|
|
2021-03-17 14:52:41 -04:00
|
|
|
WP_SESSION_ITEM_FEATURE_CUSTOM_START = (1 << 16), /*< skip >*/
|
|
|
|
|
} WpSessionItemFeatures;
|
2020-03-12 18:00:01 +02:00
|
|
|
|
2021-05-13 17:54:58 +03:00
|
|
|
/*!
|
2021-05-21 18:40:43 +03:00
|
|
|
* \brief The WpSessionItem GType
|
|
|
|
|
* \ingroup wpsessionitem
|
2020-03-12 18:00:01 +02:00
|
|
|
*/
|
2021-03-17 14:52:41 -04:00
|
|
|
#define WP_TYPE_SESSION_ITEM (wp_session_item_get_type ())
|
|
|
|
|
WP_API
|
|
|
|
|
G_DECLARE_DERIVABLE_TYPE (WpSessionItem, wp_session_item,
|
|
|
|
|
WP, SESSION_ITEM, WpObject)
|
2020-03-12 18:00:01 +02:00
|
|
|
|
|
|
|
|
struct _WpSessionItemClass
|
|
|
|
|
{
|
2021-03-17 14:52:41 -04:00
|
|
|
WpObjectClass parent_class;
|
2020-03-12 18:00:01 +02:00
|
|
|
|
2021-05-21 18:40:43 +03:00
|
|
|
/*! See wp_session_item_reset() */
|
2020-04-09 19:24:42 +03:00
|
|
|
void (*reset) (WpSessionItem * self);
|
2021-05-21 18:40:43 +03:00
|
|
|
/*! See wp_session_item_configure() */
|
2021-03-17 14:52:41 -04:00
|
|
|
gboolean (*configure) (WpSessionItem * self, WpProperties * props);
|
2021-05-21 18:40:43 +03:00
|
|
|
/*! See wp_session_item_get_associated_proxy() */
|
2020-03-29 16:03:54 +03:00
|
|
|
gpointer (*get_associated_proxy) (WpSessionItem * self, GType proxy_type);
|
|
|
|
|
|
2021-05-21 18:40:43 +03:00
|
|
|
/*! disables the active feature of the session item */
|
2021-03-17 14:52:41 -04:00
|
|
|
void (*disable_active) (WpSessionItem * self);
|
2021-05-21 18:40:43 +03:00
|
|
|
/*! disables the exported feature of the session item */
|
2021-03-17 14:52:41 -04:00
|
|
|
void (*disable_exported) (WpSessionItem * self);
|
2021-05-21 18:40:43 +03:00
|
|
|
/*! enables the active feature of the session item */
|
2021-03-17 14:52:41 -04:00
|
|
|
void (*enable_active) (WpSessionItem * self, WpTransition * transition);
|
2021-05-21 18:40:43 +03:00
|
|
|
/*! enables the exported feature of the session item */
|
2021-03-17 14:52:41 -04:00
|
|
|
void (*enable_exported) (WpSessionItem * self, WpTransition * transition);
|
2021-06-08 17:38:14 +03:00
|
|
|
|
|
|
|
|
/*< private >*/
|
|
|
|
|
WP_PADDING(5)
|
2020-03-12 18:00:01 +02:00
|
|
|
};
|
|
|
|
|
|
2021-03-17 14:52:41 -04:00
|
|
|
/* configuration */
|
2020-03-12 18:00:01 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2021-03-17 14:52:41 -04:00
|
|
|
void wp_session_item_reset (WpSessionItem * self);
|
2020-03-12 18:00:01 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2021-03-17 14:52:41 -04:00
|
|
|
gboolean wp_session_item_configure (WpSessionItem * self, WpProperties * props);
|
2020-03-12 18:00:01 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2021-03-17 14:52:41 -04:00
|
|
|
gboolean wp_session_item_is_configured (WpSessionItem * self);
|
2020-03-12 18:00:01 +02:00
|
|
|
|
2020-03-29 16:03:54 +03:00
|
|
|
/* associated proxies */
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
gpointer wp_session_item_get_associated_proxy (WpSessionItem * self,
|
|
|
|
|
GType proxy_type);
|
|
|
|
|
|
2020-03-31 19:26:05 +03:00
|
|
|
WP_API
|
|
|
|
|
guint32 wp_session_item_get_associated_proxy_id (WpSessionItem * self,
|
|
|
|
|
GType proxy_type);
|
|
|
|
|
|
2021-03-18 13:17:27 -04:00
|
|
|
/* registry */
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
void wp_session_item_register (WpSessionItem * self);
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
void wp_session_item_remove (WpSessionItem * self);
|
|
|
|
|
|
2021-03-17 14:52:41 -04:00
|
|
|
/* properties */
|
2020-03-12 18:00:01 +02:00
|
|
|
|
2021-01-20 09:55:07 -05:00
|
|
|
WP_API
|
2021-03-17 14:52:41 -04:00
|
|
|
WpProperties * wp_session_item_get_properties (WpSessionItem * self);
|
2021-01-20 09:55:07 -05:00
|
|
|
|
2021-05-11 15:34:38 -04:00
|
|
|
WP_API
|
|
|
|
|
const gchar * wp_session_item_get_property (WpSessionItem * self,
|
|
|
|
|
const gchar *key);
|
|
|
|
|
|
2021-03-17 14:52:41 -04:00
|
|
|
/* for subclasses only */
|
2020-03-20 14:45:17 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2021-03-17 14:52:41 -04:00
|
|
|
void wp_session_item_set_properties (WpSessionItem * self, WpProperties *props);
|
2020-03-20 14:45:17 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2021-03-17 14:52:41 -04:00
|
|
|
void wp_session_item_handle_proxy_destroyed (WpProxy * proxy,
|
|
|
|
|
WpSessionItem * item);
|
2020-03-20 14:45:17 +02:00
|
|
|
|
2020-03-12 18:00:01 +02:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
#endif
|