3 * Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
4 * 2011 Stefan Sauer <ensonic@users.sf.net>
6 * gsttimedvaluecontrolsource.h: Base class for timeed value based control
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
25 #ifndef __GST_TIMED_VALUE_CONTROL_SOURCE_H__
26 #define __GST_TIMED_VALUE_CONTROL_SOURCE_H__
28 #include <glib-object.h>
31 #include <gst/gstcontrolsource.h>
35 #define GST_TYPE_TIMED_VALUE_CONTROL_SOURCE \
36 (gst_timed_value_control_source_get_type ())
37 #define GST_TIMED_VALUE_CONTROL_SOURCE(obj) \
38 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TIMED_VALUE_CONTROL_SOURCE, GstTimedValueControlSource))
39 #define GST_TIMED_VALUE_CONTROL_SOURCE_CLASS(vtable) \
40 (G_TYPE_CHECK_CLASS_CAST ((vtable), GST_TYPE_TIMED_VALUE_CONTROL_SOURCE, GstTimedValueControlSourceClass))
41 #define GST_IS_TIMED_VALUE_CONTROL_SOURCE(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TIMED_VALUE_CONTROL_SOURCE))
43 #define GST_IS_TIMED_VALUE_CONTROL_SOURCE_CLASS(vtable) \
44 (G_TYPE_CHECK_CLASS_TYPE ((vtable), GST_TYPE_TIMED_VALUE_CONTROL_SOURCE))
45 #define GST_TIMED_VALUE_CONTROL_SOURCE_GET_CLASS(inst) \
46 (G_TYPE_INSTANCE_GET_CLASS ((inst), GST_TYPE_TIMED_VALUE_CONTROL_SOURCE, GstTimedValueControlSourceClass))
48 typedef struct _GstTimedValueControlSource GstTimedValueControlSource;
49 typedef struct _GstTimedValueControlSourceClass GstTimedValueControlSourceClass;
50 typedef struct _GstTimedValueControlSourcePrivate GstTimedValueControlSourcePrivate;
55 * a internal structure for value+time and various temporary
56 * values used for interpolation. This "inherits" from
59 typedef struct _GstControlPoint
61 /* fields from GstTimedValue. DO NOT CHANGE! */
62 GstClockTime timestamp; /* timestamp of the value change */
63 gdouble value; /* the new value */
67 /* Caches for the interpolators */
68 // FIXME: we should not have this here already ...
79 * GstTimedValueControlSource:
81 * The instance structure of #GstControlSource.
83 struct _GstTimedValueControlSource {
84 GstControlSource parent;
89 GSequence *values; /* List of GstControlPoint */
90 gint nvalues; /* Number of control points */
93 GstTimedValueControlSourcePrivate *priv;
94 gpointer _gst_reserved[GST_PADDING];
97 struct _GstTimedValueControlSourceClass {
98 GstControlSourceClass parent_class;
101 gpointer _gst_reserved[GST_PADDING];
104 #define GST_TIMED_VALUE_CONTROL_SOURCE_LOCK(o) \
105 g_mutex_lock(((GstTimedValueControlSource *)o)->lock)
106 #define GST_TIMED_VALUE_CONTROL_SOURCE_UNLOCK(o) \
107 g_mutex_unlock(((GstTimedValueControlSource *)o)->lock)
109 GType gst_timed_value_control_source_get_type (void);
113 GSequenceIter * gst_timed_value_control_source_find_control_point_iter (
114 GstTimedValueControlSource * self,
115 GstClockTime timestamp);
117 gboolean gst_timed_value_control_source_set (GstTimedValueControlSource * self,
118 GstClockTime timestamp,
119 const gdouble value);
120 gboolean gst_timed_value_control_source_set_from_list (GstTimedValueControlSource * self,
121 const GSList * timedvalues);
122 gboolean gst_timed_value_control_source_unset (GstTimedValueControlSource * self,
123 GstClockTime timestamp);
124 void gst_timed_value_control_source_unset_all (GstTimedValueControlSource *self);
125 GList * gst_timed_value_control_source_get_all (GstTimedValueControlSource * self);
126 gint gst_timed_value_control_source_get_count (GstTimedValueControlSource * self);
127 void gst_timed_value_control_invalidate_cache (GstTimedValueControlSource * self);
131 #endif /* __GST_TIMED_VALUE_CONTROL_SOURCE_H__ */