timeline: Add a method to get the timeline duration

+ Bind it in python

API: ges_timeline_get_duration
This commit is contained in:
Thibault Saunier 2012-05-17 20:49:01 -04:00
parent 9ee94b3d40
commit ce8afba367
4 changed files with 25 additions and 0 deletions

View file

@ -911,6 +911,12 @@
(return-type "gboolean")
)
(define-method get_duration
(of-object "GESTimeline")
(c-name "ges_timeline_get_duration")
(return-type "guint64")
)
;; From ges-timeline-layer.h

View 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

View 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;
}

View 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 */