| 1 |
/* WirePlumber |
| 2 |
* |
| 3 |
* Copyright © 2020 Collabora Ltd. |
| 4 |
* @author George Kiagiadakis <[email protected]> |
| 5 |
* |
| 6 |
* SPDX-License-Identifier: MIT |
| 7 |
*/ |
| 8 |
|
| 9 |
#ifndef __WIREPLUMBER_SESSION_ITEM_H__ |
| 10 |
#define __WIREPLUMBER_SESSION_ITEM_H__ |
| 11 |
|
| 12 |
#include "object.h" |
| 13 |
#include "proxy.h" |
| 14 |
#include "properties.h" |
| 15 |
|
| 16 |
G_BEGIN_DECLS |
| 17 |
|
| 18 |
/*! |
| 19 |
* \brief Flags to be used as WpObjectFeatures for WpSessionItem subclasses. |
| 20 |
* \ingroup wpsessionitem |
| 21 |
*/ |
| 22 |
typedef enum { /*< flags >*/ |
| 23 |
/* main features */ |
| 24 |
WP_SESSION_ITEM_FEATURE_ACTIVE = (1 << 0), |
| 25 |
WP_SESSION_ITEM_FEATURE_EXPORTED = (1 << 1), |
| 26 |
|
| 27 |
WP_SESSION_ITEM_FEATURE_CUSTOM_START = (1 << 16), /*< skip >*/ |
| 28 |
} WpSessionItemFeatures; |
| 29 |
|
| 30 |
/*! |
| 31 |
* \brief The WpSessionItem GType |
| 32 |
* \ingroup wpsessionitem |
| 33 |
*/ |
| 34 |
#define WP_TYPE_SESSION_ITEM (wp_session_item_get_type ()) |
| 35 |
WP_API |
| 36 |
G_DECLARE_DERIVABLE_TYPE (WpSessionItem, wp_session_item, |
| 37 |
WP, SESSION_ITEM, WpObject) |
| 38 |
|
| 39 |
struct _WpSessionItemClass |
| 40 |
{ |
| 41 |
WpObjectClass parent_class; |
| 42 |
|
| 43 |
/*! See wp_session_item_reset() */ |
| 44 |
void (*reset) (WpSessionItem * self); |
| 45 |
/*! See wp_session_item_configure() */ |
| 46 |
gboolean (*configure) (WpSessionItem * self, WpProperties * props); |
| 47 |
/*! See wp_session_item_get_associated_proxy() */ |
| 48 |
gpointer (*get_associated_proxy) (WpSessionItem * self, GType proxy_type); |
| 49 |
|
| 50 |
/*! disables the active feature of the session item */ |
| 51 |
void (*disable_active) (WpSessionItem * self); |
| 52 |
/*! disables the exported feature of the session item */ |
| 53 |
void (*disable_exported) (WpSessionItem * self); |
| 54 |
/*! enables the active feature of the session item */ |
| 55 |
void (*enable_active) (WpSessionItem * self, WpTransition * transition); |
| 56 |
/*! enables the exported feature of the session item */ |
| 57 |
void (*enable_exported) (WpSessionItem * self, WpTransition * transition); |
| 58 |
|
| 59 |
/*< private >*/ |
| 60 |
WP_PADDING(5) |
| 61 |
}; |
| 62 |
|
| 63 |
/* configuration */ |
| 64 |
|
| 65 |
WP_API |
| 66 |
void wp_session_item_reset (WpSessionItem * self); |
| 67 |
|
| 68 |
WP_API |
| 69 |
gboolean wp_session_item_configure (WpSessionItem * self, WpProperties * props); |
| 70 |
|
| 71 |
WP_API |
| 72 |
gboolean wp_session_item_is_configured (WpSessionItem * self); |
| 73 |
|
| 74 |
/* associated proxies */ |
| 75 |
|
| 76 |
WP_API |
| 77 |
gpointer wp_session_item_get_associated_proxy (WpSessionItem * self, |
| 78 |
GType proxy_type); |
| 79 |
|
| 80 |
WP_API |
| 81 |
guint32 wp_session_item_get_associated_proxy_id (WpSessionItem * self, |
| 82 |
GType proxy_type); |
| 83 |
|
| 84 |
/* registry */ |
| 85 |
|
| 86 |
WP_API |
| 87 |
void wp_session_item_register (WpSessionItem * self); |
| 88 |
|
| 89 |
WP_API |
| 90 |
void wp_session_item_remove (WpSessionItem * self); |
| 91 |
|
| 92 |
/* properties */ |
| 93 |
|
| 94 |
WP_API |
| 95 |
WpProperties * wp_session_item_get_properties (WpSessionItem * self); |
| 96 |
|
| 97 |
WP_API |
| 98 |
const gchar * wp_session_item_get_property (WpSessionItem * self, |
| 99 |
const gchar *key); |
| 100 |
|
| 101 |
/* for subclasses only */ |
| 102 |
|
| 103 |
WP_API |
| 104 |
void wp_session_item_set_properties (WpSessionItem * self, WpProperties *props); |
| 105 |
|
| 106 |
WP_API |
| 107 |
void wp_session_item_handle_proxy_destroyed (WpProxy * proxy, |
| 108 |
WpSessionItem * item); |
| 109 |
|
| 110 |
G_END_DECLS |
| 111 |
|
| 112 |
#endif |