diff --git a/docs/libs/ges-sections.txt b/docs/libs/ges-sections.txt index c32ff84ed8..74622294a8 100644 --- a/docs/libs/ges-sections.txt +++ b/docs/libs/ges-sections.txt @@ -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 ges_timeline_object_create_track_object ges_timeline_object_fill_track_object diff --git a/ges/ges-timeline-object.c b/ges/ges-timeline-object.c index 5f1773071e..4f00ad6a5f 100644 --- a/ges/ges-timeline-object.c +++ b/ges/ges-timeline-object.c @@ -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; +} diff --git a/ges/ges-timeline-object.h b/ges/ges-timeline-object.h index c1d0ca2efe..a5dbc4cbfa 100644 --- a/ges/ges-timeline-object.h +++ b/ges/ges-timeline-object.h @@ -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 */