GESTimeline: New method ges_timeline_get_tracks
authorEdward Hervey <edward.hervey@collabora.co.uk>
Tue, 20 Apr 2010 09:48:21 +0000 (11:48 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Tue, 20 Apr 2010 11:47:03 +0000 (13:47 +0200)
docs/libs/ges-sections.txt
ges/ges-timeline.c
ges/ges-timeline.h

index dfb83b2..6339b0b 100644 (file)
@@ -104,6 +104,7 @@ ges_timeline_remove_track
 ges_timeline_get_track_for_pad
 ges_timeline_load_from_uri
 ges_timeline_save
+ges_timeline_get_tracks
 <SUBSECTION Standard>
 ges_timeline_get_type
 GES_IS_TIMELINE
index f299006..c4de7d4 100644 (file)
@@ -553,3 +553,24 @@ ges_timeline_get_track_for_pad (GESTimeline * timeline, GstPad * pad)
 
   return NULL;
 }
+
+/**
+ * ges_timeline_get_tracks:
+ * @timeline: a #GESTimeline
+ *
+ * Returns the list of #GESTrack used by the Timeline.
+ *
+ * Returns: A list of #GESTrack. The caller should unref each track
+ * once he is done with them. */
+GList *
+ges_timeline_get_tracks (GESTimeline * timeline)
+{
+  GList *tmp, *res = NULL;
+
+  for (tmp = timeline->tracks; tmp; tmp = g_list_next (tmp)) {
+    TrackPrivate *priv = (TrackPrivate *) tmp->data;
+    res = g_list_append (res, g_object_ref (priv->track));
+  }
+
+  return res;
+}
index 1173ba2..aed30b9 100644 (file)
@@ -53,8 +53,7 @@ struct _GESTimeline {
 
   /*< private >*/
   GList *layers; /* A list of GESTimelineLayer sorted by priority */
-  /*< public >*/
-  GList *tracks;
+  GList *tracks; /* A list of private track data */
 };
 
 struct _GESTimelineClass {
@@ -82,6 +81,7 @@ gboolean ges_timeline_add_track (GESTimeline *timeline, GESTrack *track);
 gboolean ges_timeline_remove_track (GESTimeline *timeline, GESTrack *track);
 
 GESTrack * ges_timeline_get_track_for_pad (GESTimeline *timeline, GstPad *pad);
+GList *ges_timeline_get_tracks (GESTimeline *timeline);
 
 G_END_DECLS