GESTimelineObject: new API : _find_track_object
authorEdward Hervey <bilboed@bilboed.com>
Fri, 12 Mar 2010 16:17:30 +0000 (17:17 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Sat, 13 Mar 2010 14:53:58 +0000 (15:53 +0100)
This allows getting the TrackObject for a corresponding TimelineObject
and Track combination

docs/libs/ges-sections.txt
ges/ges-timeline-object.c
ges/ges-timeline-object.h

index c32ff84ed86cab15e9f335c7d65427460917d249..74622294a8fc630241b06491442a0ad0647f733d 100644 (file)
@@ -148,6 +148,7 @@ GES_TIMELINE_OBJECT_START
 ges_timeline_object_set_inpoint
 ges_timeline_object_set_start
 ges_timeline_object_set_duration
+ges_timeline_object_find_track_object
 <SUBSECTION Standard>
 ges_timeline_object_create_track_object
 ges_timeline_object_fill_track_object
index 5f1773071e4909819d617765a7afc67c14b91af4..4f00ad6a5fe9e5cb83584b72c48101a331f9d961 100644 (file)
@@ -359,3 +359,36 @@ ges_timeline_object_set_priority (GESTimelineObject * object, guint priority)
   object->priority = priority;
 
 }
+
+/**
+ * ges_timeline_object_find_track_object:
+ * @object: a #GESTimelineObject
+ * @track: a #GESTrack
+ *
+ * Finds the #GESTrackObject controlled by @object that is used in @track.
+ *
+ * Note: The reference count of the returned #GESTrackObject will be increased,
+ * unref when done with it.
+ *
+ * Returns: The #GESTrackObject used by @track, else #NULL.
+ */
+
+GESTrackObject *
+ges_timeline_object_find_track_object (GESTimelineObject * object,
+    GESTrack * track)
+{
+  GESTrackObject *ret = NULL;
+
+  if (G_LIKELY (object->trackobjects)) {
+    GList *tmp;
+
+    for (tmp = object->trackobjects; tmp; tmp = g_list_next (tmp))
+      if (GES_TRACK_OBJECT (tmp->data)->track == track) {
+        ret = GES_TRACK_OBJECT (tmp->data);
+        g_object_ref (ret);
+        break;
+      }
+  }
+
+  return ret;
+}
index c1d0ca2efef659be7112d54bd9a70eab41796136..a5dbc4cbfa027453fecdbca15aa927739d3869eb 100644 (file)
@@ -161,6 +161,10 @@ ges_timeline_object_fill_track_object (GESTimelineObject * object,
                                       GESTrackObject * trackobj,
                                       GstElement * gnlobj);
 
+GESTrackObject *
+ges_timeline_object_find_track_object (GESTimelineObject * object,
+                                      GESTrack * track);
+
 G_END_DECLS
 
 #endif /* _GES_TIMELINE_OBJECT */