GESTimeline: New method ges_timeline_get_tracks

This commit is contained in:
Edward Hervey 2010-04-20 11:48:21 +02:00
parent 3c9bb965fc
commit c3741374da
3 changed files with 24 additions and 2 deletions

View 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

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

View 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