add type argument to ges_timeline_object_find_track_objects()
authorBrandon Lewis <brandon@collabora.co.uk>
Tue, 13 Jul 2010 16:42:46 +0000 (18:42 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Wed, 1 Sep 2010 14:56:03 +0000 (16:56 +0200)
ges/ges-timeline-object.c
ges/ges-timeline-object.h

index 943472fbe3cde09bfbdb713c552725af49caad8e..c275a5a67ec61ebc239aaa198d0bdf1cf41946fd 100644 (file)
@@ -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;
index 777adf30ff544d8071c8d528014bfe548c550a7e..0f27a9d5a8f7063cf1ae1fd2e7f1eb1fdda46fa0 100644 (file)
@@ -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