* Boston, MA 02111-1307, USA.
*/
-#include "ges-internal.h"
#include "ges-timeline-object.h"
#include "ges.h"
+#include "ges-internal.h"
/**
* GESTimelineObject
GST_DEBUG
("Got a TrackObject : %p , setting the timeline object as its creator");
ges_track_object_set_timeline_object (res, object);
+
+ GST_DEBUG ("Adding TrackObject to the list of controlled track objects");
+ object->trackobjects = g_list_append (object->trackobjects, res);
}
GST_DEBUG ("Returning res:%p", res);
return res;
}
+gboolean
+ges_timeline_object_release_track_object (GESTimelineObject * object,
+ GESTrackObject * trobj)
+{
+ GST_DEBUG ("object:%p, trackobject:%p", object, trobj);
+
+ if (!(g_list_find (object->trackobjects, trobj))) {
+ GST_WARNING ("TrackObject isn't controlled by this object");
+ return FALSE;
+ }
+
+ /* FIXME : Do we need to tell the subclasses ? If so, add a new virtual-method */
+
+ object->trackobjects = g_list_remove (object->trackobjects, trobj);
+
+ ges_track_object_set_timeline_object (trobj, NULL);
+
+ return TRUE;
+}
+
void
ges_timeline_object_set_layer (GESTimelineObject * object,
GESTimelineLayer * layer)
return res;
}
+
+gboolean
+ges_timeline_object_fill_track_object_func (GESTimelineObject * object,
+ GESTrackObject * trackobj, GstElement * gnlobj)
+{
+ GST_WARNING ("No 'fill_track_object' implementation !");
+
+ return FALSE;
+}
#define GES_TIMELINE_OBJECT_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TIMELINE_OBJECT, GESTimelineObjectClass))
+typedef gboolean (*FillTrackObjectFunc) (GESTimelineObject * object,
+ GESTrackObject * trobject,
+ GstElement * gnlobj);
+
struct _GESTimelineObject {
GObject parent;
GESTimelineLayer * layer; /* The layer where this object is being used */
+ GList *trackobjects; /* A list of TrackObject controlled by this TimelineObject */
+
/* start, inpoint, duration and fullduration are in nanoseconds */
guint64 start; /* position (in time) of the object in the layer */
guint64 inpoint; /* in-point */
GESTrackObject* (*create_track_object) (GESTimelineObject * object,
GESTrack * track);
- gboolean (*fill_track_object) (GESTimelineObject * object,
- GESTrackObject * trobject,
- GstElement * gnlobj);
+ /* FIXME : might need a release_track_object */
+ FillTrackObjectFunc fill_track_object;
};
GType ges_timeline_object_get_type (void);
ges_timeline_object_create_track_object (GESTimelineObject * object,
GESTrack * track);
+gboolean
+ges_timeline_object_release_track_object (GESTimelineObject * object,
+ GESTrackObject * trackobject);
+
gboolean
ges_timeline_object_fill_track_object (GESTimelineObject * object,
GESTrackObject * trackobj,