From 3b1a0d756ddce36cc24c43dab96aa54e9a83950f Mon Sep 17 00:00:00 2001 From: Brandon Lewis Date: Tue, 13 Jul 2010 18:42:46 +0200 Subject: [PATCH] add type argument to ges_timeline_object_find_track_objects() --- ges/ges-timeline-object.c | 13 ++++++++++--- ges/ges-timeline-object.h | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ges/ges-timeline-object.c b/ges/ges-timeline-object.c index 943472fbe3..c275a5a67e 100644 --- a/ges/ges-timeline-object.c +++ b/ges/ges-timeline-object.c @@ -465,9 +465,12 @@ ges_timeline_object_set_priority (GESTimelineObject * object, guint priority) /** * ges_timeline_object_find_track_object: * @object: a #GESTimelineObject - * @track: a #GESTrack + * @track: a #GESTrack or NULL + * @type: a #GType indicating the type of track object you are looking + * for or %G_TYPE_NONE if you do not care about the track type. * - * Finds the #GESTrackObject controlled by @object that is used in @track. + * Finds the #GESTrackObject controlled by @object that is used in @track. You + * may optionally specify a GType to further narrow search criteria. * * Note: The reference count of the returned #GESTrackObject will be increased, * unref when done with it. @@ -477,7 +480,7 @@ ges_timeline_object_set_priority (GESTimelineObject * object, guint priority) GESTrackObject * ges_timeline_object_find_track_object (GESTimelineObject * object, - GESTrack * track) + GESTrack * track, GType type) { GESTrackObject *ret = NULL; @@ -486,6 +489,10 @@ ges_timeline_object_find_track_object (GESTimelineObject * object, for (tmp = object->trackobjects; tmp; tmp = g_list_next (tmp)) if (GES_TRACK_OBJECT (tmp->data)->track == track) { + if ((type != G_TYPE_NONE) && !G_TYPE_CHECK_INSTANCE_TYPE (tmp->data, + type)) + continue; + ret = GES_TRACK_OBJECT (tmp->data); g_object_ref (ret); break; diff --git a/ges/ges-timeline-object.h b/ges/ges-timeline-object.h index 777adf30ff..0f27a9d5a8 100644 --- a/ges/ges-timeline-object.h +++ b/ges/ges-timeline-object.h @@ -210,7 +210,8 @@ ges_timeline_object_fill_track_object (GESTimelineObject * object, GESTrackObject * ges_timeline_object_find_track_object (GESTimelineObject * object, - GESTrack * track); + GESTrack * track, + GType type); gboolean ges_timeline_object_add_track_object (GESTimelineObject *object, GESTrackObject