gstobject: add FIXME and docs for the disabled notify on parent
[platform/upstream/gstreamer.git] / gst / gstcontrolbinding.h
1 /* GStreamer
2  *
3  * Copyright (C) 2011 Stefan Sauer <ensonic@users.sf.net>
4  *
5  * gstcontrolbinding.h: Attachment for control sources
6  *
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.
11  *
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.
16  *
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., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22
23 #ifndef __GST_CONTROL_BINDING_H__
24 #define __GST_CONTROL_BINDING_H__
25
26 #include <gst/gstconfig.h>
27
28 #include <glib-object.h>
29
30 #include <gst/gstcontrolsource.h>
31
32 G_BEGIN_DECLS
33
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))
46
47 typedef struct _GstControlBinding GstControlBinding;
48 typedef struct _GstControlBindingClass GstControlBindingClass;
49
50 /* FIXME(2.0): remove, this is unused */
51 typedef void (* GstControlBindingConvert) (GstControlBinding *binding, gdouble src_value, GValue *dest_value);
52
53 /**
54  * GstControlBinding:
55  * @name: name of the property of this binding
56  * @pspec: #GParamSpec for this property
57  *
58  * The instance structure of #GstControlBinding.
59  */
60 struct _GstControlBinding {
61   GstObject parent;
62   
63   /*< public >*/
64   gchar *name;
65   GParamSpec *pspec;
66
67   /*< private >*/
68   GstObject *object;            /* GstObject owning the property
69                                  * (== parent when bound) */
70   gboolean disabled;
71
72   gpointer _gst_reserved[GST_PADDING];
73 };
74
75 /**
76  * GstControlBindingClass:
77  * @parent_class: Parent class
78  *
79  * The class structure of #GstControlBinding.
80  */
81
82 struct _GstControlBindingClass
83 {
84   GstObjectClass parent_class;
85
86   /* virtual methods */
87   gboolean (* sync_values) (GstControlBinding *binding, GstObject *object, GstClockTime timestamp, GstClockTime last_sync);
88   GValue * (* get_value) (GstControlBinding *binding, GstClockTime timestamp);
89   gboolean (* get_value_array) (GstControlBinding *binding, GstClockTime timestamp,GstClockTime interval, guint n_values, gpointer values);
90   gboolean (* get_g_value_array) (GstControlBinding *binding, GstClockTime timestamp,GstClockTime interval, guint n_values, GValue *values);
91
92   /*< private >*/
93   gpointer _gst_reserved[GST_PADDING];
94 };
95
96 #define GST_CONTROL_BINDING_PSPEC(cb) (((GstControlBinding *) cb)->pspec)
97
98 GType gst_control_binding_get_type (void);
99
100 /* Functions */
101
102 gboolean            gst_control_binding_sync_values        (GstControlBinding * binding, GstObject *object,
103                                                             GstClockTime timestamp, GstClockTime last_sync);
104 GValue *            gst_control_binding_get_value          (GstControlBinding *binding,
105                                                             GstClockTime timestamp);
106 gboolean            gst_control_binding_get_value_array    (GstControlBinding *binding, GstClockTime timestamp,
107                                                             GstClockTime interval, guint n_values, gpointer values);
108 gboolean            gst_control_binding_get_g_value_array  (GstControlBinding *binding, GstClockTime timestamp,
109                                                             GstClockTime interval, guint n_values, GValue *values);
110
111 void                gst_control_binding_set_disabled       (GstControlBinding * binding, gboolean disabled);
112 gboolean            gst_control_binding_is_disabled        (GstControlBinding * binding);
113 G_END_DECLS
114
115 #endif /* __GST_CONTROL_BINDING_H__ */