3 * Copyright (C) 2011 Stefan Sauer <ensonic@users.sf.net>
5 * gstcontrolbinding.h: Attachment for control sources
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #ifndef __GST_CONTROL_BINDING_H__
24 #define __GST_CONTROL_BINDING_H__
26 #include <gst/gstconfig.h>
28 #include <glib-object.h>
30 #include <gst/gstcontrolsource.h>
34 #define GST_TYPE_CONTROL_BINDING \
35 (gst_control_binding_get_type())
36 #define GST_CONTROL_BINDING(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CONTROL_BINDING,GstControlBinding))
38 #define GST_CONTROL_BINDING_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CONTROL_BINDING,GstControlBindingClass))
40 #define GST_IS_CONTROL_BINDING(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CONTROL_BINDING))
42 #define GST_IS_CONTROL_BINDING_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CONTROL_BINDING))
44 #define GST_CONTROL_BINDING_GET_CLASS(obj) \
45 (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTOL_SOURCE, GstControlBindingClass))
47 typedef struct _GstControlBinding GstControlBinding;
48 typedef struct _GstControlBindingClass GstControlBindingClass;
51 * GstControlBindingConvert:
52 * @self: the #GstControlBinding instance
53 * @src_value: the value returned by the cotnrol source
54 * @dest_value: the target GValue
56 * Function to map a control-value to the target GValue.
58 typedef void (* GstControlBindingConvert) (GstControlBinding *self, gdouble src_value, GValue *dest_value);
62 * @name: name of the property of this binding
64 * The instance structure of #GstControlBinding.
66 struct _GstControlBinding {
70 gchar *name; /* name of the property */
71 GParamSpec *pspec; /* GParamSpec for this property */
74 GstObject *object; /* GstObject owning the property
75 * (== parent when bound) */
78 gpointer _gst_reserved[GST_PADDING];
82 * GstControlBindingClass:
83 * @parent_class: Parent class
84 * @convert: Class method to convert control-values
86 * The class structure of #GstControlBinding.
89 struct _GstControlBindingClass
91 GstObjectClass parent_class;
94 gboolean (* sync_values) (GstControlBinding *self, GstObject *object, GstClockTime timestamp, GstClockTime last_sync);
95 GValue * (* get_value) (GstControlBinding *self, GstClockTime timestamp);
96 gboolean (* get_value_array) (GstControlBinding *self, GstClockTime timestamp,GstClockTime interval, guint n_values, GValue *values);
99 gpointer _gst_reserved[GST_PADDING];
102 #define GST_CONTROL_BINDING_PSPEC(cb) (((GstControlBinding *) cb)->pspec)
104 GType gst_control_binding_get_type (void);
108 gboolean gst_control_binding_sync_values (GstControlBinding * self, GstObject *object,
109 GstClockTime timestamp, GstClockTime last_sync);
110 GValue * gst_control_binding_get_value (GstControlBinding *binding,
111 GstClockTime timestamp);
112 gboolean gst_control_binding_get_value_array (GstControlBinding *binding, GstClockTime timestamp,
113 GstClockTime interval, guint n_values, GValue *values);
115 void gst_control_binding_set_disabled (GstControlBinding * self, gboolean disabled);
116 gboolean gst_control_binding_is_disabled (GstControlBinding * self);
119 #endif /* __GST_CONTROL_BINDING_H__ */