timeline: Add a method to get the timeline duration
authorThibault Saunier <thibault.saunier@collabora.com>
Fri, 18 May 2012 00:49:01 +0000 (20:49 -0400)
committerThibault Saunier <thibault.saunier@collabora.com>
Sat, 19 May 2012 17:39:45 +0000 (13:39 -0400)
    + Bind it in python

API: ges_timeline_get_duration

bindings/python/ges.defs
docs/libs/ges-sections.txt
ges/ges-timeline.c
ges/ges-timeline.h

index 3805b3c..4052591 100644 (file)
   (return-type "gboolean")
 )
 
+(define-method get_duration
+  (of-object "GESTimeline")
+  (c-name "ges_timeline_get_duration")
+  (return-type "guint64")
+)
+
 
 
 ;; From ges-timeline-layer.h
index 66f79a1..3b94fc6 100644 (file)
@@ -266,6 +266,7 @@ ges_timeline_is_updating
 ges_timeline_get_tracks
 ges_timeline_get_layers
 ges_timeline_get_track_for_pad
+ges_timeline_get_duration
 <SUBSECTION Standard>
 GESTimelinePrivate
 GESTimelineClass
index dcb09f2..b096e93 100644 (file)
@@ -2397,3 +2397,19 @@ ges_timeline_enable_update (GESTimeline * timeline, gboolean enabled)
 
   return res;
 }
+
+/**
+ * ges_timeline_get_duration
+ * @timeline: a #GESTimeline
+ *
+ * Get the current duration of @timeline
+ *
+ * Returns: The current duration of @timeline
+ */
+GstClockTime
+ges_timeline_get_duration (GESTimeline * timeline)
+{
+  g_return_val_if_fail (GES_IS_TIMELINE (timeline), GST_CLOCK_TIME_NONE);
+
+  return timeline->priv->duration;
+}
index de51bcb..ad1992c 100644 (file)
@@ -102,6 +102,8 @@ GList *ges_timeline_get_tracks (GESTimeline *timeline);
 gboolean ges_timeline_enable_update(GESTimeline * timeline, gboolean enabled);
 gboolean ges_timeline_is_updating (GESTimeline * timeline);
 
+GstClockTime ges_timeline_get_duration (GESTimeline *timeline);
+
 G_END_DECLS
 
 #endif /* _GES_TIMELINE */