2019-12-09 16:35:15 +02:00
|
|
|
/* WirePlumber
|
|
|
|
|
*
|
|
|
|
|
* Copyright © 2019 Collabora Ltd.
|
|
|
|
|
* @author George Kiagiadakis <george.kiagiadakis@collabora.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __WIREPLUMBER_ENDPOINT_H__
|
|
|
|
|
#define __WIREPLUMBER_ENDPOINT_H__
|
|
|
|
|
|
|
|
|
|
#include "proxy.h"
|
|
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* WpDirection:
|
|
|
|
|
* @WP_DIRECTION_INPUT: a sink, consuming input
|
|
|
|
|
* @WP_DIRECTION_OUTPUT: a source, producing output
|
|
|
|
|
*
|
|
|
|
|
* The different directions the endpoint can have
|
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
|
|
|
|
WP_DIRECTION_INPUT,
|
|
|
|
|
WP_DIRECTION_OUTPUT,
|
|
|
|
|
} WpDirection;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
WP_ENDPOINT_CONTROL_VOLUME = 0x10003 /* SPA_PROP_volume */,
|
|
|
|
|
WP_ENDPOINT_CONTROL_MUTE = 0x10004 /* SPA_PROP_mute */,
|
|
|
|
|
WP_ENDPOINT_CONTROL_CHANNEL_VOLUMES = 0x10008 /* SPA_PROP_channelVolumes */,
|
|
|
|
|
} WpEndpointControl;
|
|
|
|
|
|
2020-02-12 11:28:07 +02:00
|
|
|
typedef enum { /*< flags >*/
|
|
|
|
|
WP_ENDPOINT_FEATURE_CONTROLS = WP_PROXY_FEATURE_LAST,
|
|
|
|
|
} WpEndpointFeatures;
|
|
|
|
|
|
|
|
|
|
/* WpEndpoint */
|
|
|
|
|
|
|
|
|
|
#define WP_TYPE_ENDPOINT (wp_endpoint_get_type ())
|
|
|
|
|
WP_API
|
|
|
|
|
G_DECLARE_DERIVABLE_TYPE (WpEndpoint, wp_endpoint, WP, ENDPOINT, WpProxy)
|
|
|
|
|
|
|
|
|
|
struct _WpEndpointClass
|
2019-12-09 16:35:15 +02:00
|
|
|
{
|
2020-02-12 11:28:07 +02:00
|
|
|
WpProxyClass parent_class;
|
2019-12-09 16:35:15 +02:00
|
|
|
|
|
|
|
|
const gchar * (*get_name) (WpEndpoint * self);
|
|
|
|
|
const gchar * (*get_media_class) (WpEndpoint * self);
|
|
|
|
|
WpDirection (*get_direction) (WpEndpoint * self);
|
|
|
|
|
|
|
|
|
|
const struct spa_pod * (*get_control) (WpEndpoint * self, guint32 control_id);
|
|
|
|
|
gboolean (*set_control) (WpEndpoint * self, guint32 control_id,
|
|
|
|
|
const struct spa_pod * value);
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-16 18:50:07 +02:00
|
|
|
WP_API
|
2019-12-09 16:35:15 +02:00
|
|
|
const gchar * wp_endpoint_get_name (WpEndpoint * self);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2019-12-09 16:35:15 +02:00
|
|
|
const gchar * wp_endpoint_get_media_class (WpEndpoint * self);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2019-12-09 16:35:15 +02:00
|
|
|
WpDirection wp_endpoint_get_direction (WpEndpoint * self);
|
|
|
|
|
|
2020-01-16 18:50:07 +02:00
|
|
|
WP_API
|
2019-12-09 16:35:15 +02:00
|
|
|
const struct spa_pod * wp_endpoint_get_control (WpEndpoint * self,
|
|
|
|
|
guint32 control_id);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2019-12-09 16:35:15 +02:00
|
|
|
gboolean wp_endpoint_get_control_boolean (WpEndpoint * self, guint32 control_id,
|
|
|
|
|
gboolean * value);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2019-12-09 16:35:15 +02:00
|
|
|
gboolean wp_endpoint_get_control_int (WpEndpoint * self, guint32 control_id,
|
|
|
|
|
gint * value);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2019-12-09 16:35:15 +02:00
|
|
|
gboolean wp_endpoint_get_control_float (WpEndpoint * self, guint32 control_id,
|
|
|
|
|
gfloat * value);
|
|
|
|
|
|
2020-01-16 18:50:07 +02:00
|
|
|
WP_API
|
2019-12-09 16:35:15 +02:00
|
|
|
gboolean wp_endpoint_set_control (WpEndpoint * self, guint32 control_id,
|
|
|
|
|
const struct spa_pod * value);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2019-12-09 16:35:15 +02:00
|
|
|
gboolean wp_endpoint_set_control_boolean (WpEndpoint * self, guint32 control_id,
|
|
|
|
|
gboolean value);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2019-12-09 16:35:15 +02:00
|
|
|
gboolean wp_endpoint_set_control_int (WpEndpoint * self, guint32 control_id,
|
|
|
|
|
gint value);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2019-12-09 16:35:15 +02:00
|
|
|
gboolean wp_endpoint_set_control_float (WpEndpoint * self, guint32 control_id,
|
|
|
|
|
gfloat value);
|
|
|
|
|
|
2020-02-12 11:28:07 +02:00
|
|
|
/* WpImplEndpoint */
|
2019-12-09 16:35:15 +02:00
|
|
|
|
2020-02-12 11:28:07 +02:00
|
|
|
#define WP_TYPE_IMPL_ENDPOINT (wp_impl_endpoint_get_type ())
|
2020-01-16 18:50:07 +02:00
|
|
|
WP_API
|
2020-02-12 11:28:07 +02:00
|
|
|
G_DECLARE_DERIVABLE_TYPE (WpImplEndpoint, wp_impl_endpoint,
|
|
|
|
|
WP, IMPL_ENDPOINT, WpEndpoint)
|
2019-12-09 16:35:15 +02:00
|
|
|
|
2020-02-12 11:28:07 +02:00
|
|
|
struct _WpImplEndpointClass
|
2019-12-09 16:35:15 +02:00
|
|
|
{
|
2020-02-12 11:28:07 +02:00
|
|
|
WpEndpointClass parent_class;
|
2019-12-09 16:35:15 +02:00
|
|
|
};
|
|
|
|
|
|
2020-01-16 18:50:07 +02:00
|
|
|
WP_API
|
2020-02-12 11:28:07 +02:00
|
|
|
WpImplEndpoint * wp_impl_endpoint_new (WpCore * core);
|
2019-12-09 16:35:15 +02:00
|
|
|
|
2020-01-16 18:50:07 +02:00
|
|
|
WP_API
|
2020-02-12 11:28:07 +02:00
|
|
|
void wp_impl_endpoint_set_property (WpImplEndpoint * self,
|
2019-12-09 16:35:15 +02:00
|
|
|
const gchar * key, const gchar * value);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2020-02-12 11:28:07 +02:00
|
|
|
void wp_impl_endpoint_update_properties (WpImplEndpoint * self,
|
2019-12-09 16:35:15 +02:00
|
|
|
WpProperties * updates);
|
|
|
|
|
|
2020-01-16 18:50:07 +02:00
|
|
|
WP_API
|
2020-02-12 11:28:07 +02:00
|
|
|
void wp_impl_endpoint_set_name (WpImplEndpoint * self,
|
2019-12-09 18:31:43 +02:00
|
|
|
const gchar * name);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2020-02-12 11:28:07 +02:00
|
|
|
void wp_impl_endpoint_set_media_class (WpImplEndpoint * self,
|
2019-12-09 18:31:43 +02:00
|
|
|
const gchar * media_class);
|
2020-01-16 18:50:07 +02:00
|
|
|
|
|
|
|
|
WP_API
|
2020-02-12 11:28:07 +02:00
|
|
|
void wp_impl_endpoint_set_direction (WpImplEndpoint * self,
|
2019-12-09 18:31:43 +02:00
|
|
|
WpDirection dir);
|
|
|
|
|
|
2020-01-16 18:50:07 +02:00
|
|
|
WP_API
|
2020-02-12 11:28:07 +02:00
|
|
|
void wp_impl_endpoint_register_control (WpImplEndpoint * self,
|
2019-12-09 16:35:15 +02:00
|
|
|
WpEndpointControl control);
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
#endif
|