Files
wireplumber/lib/wp/proxy-interfaces.h
George Kiagiadakis bd65517b7d pw-object-mixin: refactor, implement param caching and features for impl objects
Now the WpPipewireObject interface is directly implemented by the mixin
and there is another interface that users of the mixin must implement
in order for the mixin to work proprely.

A lot of manual stuff that proxy classes had to do before are now
in the mixin. Also most of the data that would normally reside in Private
structures is now in the mixin data structure (stored as qdata on the object).
This is achieving the best amount of code reuse so far.

For impl objects (WpImpl*) there are also default implementations of the
standard pipewire object methods and the INFO & PARAM_* features are
more coherently enabled during the whole lifetime of these objects.
2020-11-25 22:44:29 +02:00

89 lines
2.3 KiB
C

/* WirePlumber
*
* Copyright © 2020 Collabora Ltd.
* @author George Kiagiadakis <george.kiagiadakis@collabora.com>
*
* SPDX-License-Identifier: MIT
*/
#ifndef __WIREPLUMBER_PROXY_INTERFACES_H__
#define __WIREPLUMBER_PROXY_INTERFACES_H__
#include "proxy.h"
#include "properties.h"
#include "spa-pod.h"
G_BEGIN_DECLS
/**
* WP_TYPE_PIPEWIRE_OBJECT:
*
* The #WpPipewireObject #GType
*/
#define WP_TYPE_PIPEWIRE_OBJECT (wp_pipewire_object_get_type ())
WP_API
G_DECLARE_INTERFACE (WpPipewireObject, wp_pipewire_object,
WP, PIPEWIRE_OBJECT, WpProxy)
struct _WpPipewireObjectInterface
{
GTypeInterface parent_iface;
gconstpointer (*get_native_info) (WpPipewireObject * self);
WpProperties * (*get_properties) (WpPipewireObject * self);
GVariant * (*get_param_info) (WpPipewireObject * self);
void (*enum_params) (WpPipewireObject * self, const gchar * id,
WpSpaPod * filter, GCancellable * cancellable,
GAsyncReadyCallback callback, gpointer user_data);
WpIterator * (*enum_params_finish) (WpPipewireObject * self,
GAsyncResult * res, GError ** error);
WpIterator * (*enum_params_sync) (WpPipewireObject * self,
const gchar * id, WpSpaPod * filter);
gboolean (*set_param) (WpPipewireObject * self, const gchar * id,
guint32 flags, WpSpaPod * param);
};
WP_API
gconstpointer wp_pipewire_object_get_native_info (WpPipewireObject * self);
WP_API
WpProperties * wp_pipewire_object_get_properties (WpPipewireObject * self);
WP_API
WpIterator * wp_pipewire_object_iterate_properties (WpPipewireObject * self);
WP_API
const gchar * wp_pipewire_object_get_property (WpPipewireObject * self,
const gchar * key);
WP_API
GVariant * wp_pipewire_object_get_param_info (WpPipewireObject * self);
WP_API
void wp_pipewire_object_enum_params (WpPipewireObject * self, const gchar * id,
WpSpaPod *filter, GCancellable * cancellable,
GAsyncReadyCallback callback, gpointer user_data);
WP_API
WpIterator * wp_pipewire_object_enum_params_finish (WpPipewireObject * self,
GAsyncResult * res, GError ** error);
WP_API
WpIterator * wp_pipewire_object_enum_params_sync (WpPipewireObject * self,
const gchar * id, WpSpaPod * filter);
WP_API
gboolean wp_pipewire_object_set_param (WpPipewireObject * self,
const gchar * id, guint32 flags, WpSpaPod * param);
G_END_DECLS
#endif