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-03-17 14:52:41 -04:00
|
|
|
* WpSessionItemFeatures:
|
2020-03-12 18:00:01 +02:00
|
|
|
*
|
2021-03-17 14:52:41 -04:00
|
|
|
* Flags to be used as #WpObjectFeatures for #WpSessionItem subclasses.
|
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
|
|
|
|
2020-04-16 17:38:31 +03:00
|
|
|
/**
|
2021-03-17 14:52:41 -04:00
|
|
|
* WP_TYPE_SESSION_ITEM:
|
2020-04-16 17:38:31 +03:00
|
|
|
*
|
2021-03-17 14:52:41 -04:00
|
|
|
* The #WpSessionItem #GType
|
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
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* WpSessionItemClass:
|
2020-04-09 19:24:42 +03:00
|
|
|
* @reset: See wp_session_item_reset()
|
2020-03-12 18:00:01 +02:00
|
|
|
* @configure: See wp_session_item_configure()
|
2021-03-17 14:52:41 -04:00
|
|
|
* @get_associated_proxy: See wp_session_item_get_associated_proxy()
|
|
|
|
|
* @disable_active: disables the active feature of the session item
|
|
|
|
|
* @disable_exported: disables the exported feature of the session item
|
|
|
|
|
* @enable_active: enables the active feature of the session item
|
|
|
|
|
* @enable_exported: enables the exported feature of the session item
|
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
|
|
|
|
2020-04-09 19:24:42 +03:00
|
|
|
void (*reset) (WpSessionItem * self);
|
2021-03-17 14:52:41 -04:00
|
|
|
gboolean (*configure) (WpSessionItem * self, WpProperties * props);
|
2020-03-29 16:03:54 +03:00
|
|
|
gpointer (*get_associated_proxy) (WpSessionItem * self, GType proxy_type);
|
|
|
|
|
|
2021-03-17 14:52:41 -04:00
|
|
|
void (*disable_active) (WpSessionItem * self);
|
|
|
|
|
void (*disable_exported) (WpSessionItem * self);
|
|
|
|
|
void (*enable_active) (WpSessionItem * self, WpTransition * transition);
|
|
|
|
|
void (*enable_exported) (WpSessionItem * self, WpTransition * transition);
|
2020-03-12 18:00:01 +02:00
|
|
|
};
|
|
|
|
|
|
2021-03-25 09:45:43 -04:00
|
|
|
/* Id */
|
|
|
|
|
|
|
|
|
|
WP_API
|
|
|
|
|
guint wp_session_item_get_id (WpSessionItem * self);
|
|
|
|
|
|
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-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
|