ges : add a track-object(removed signal to the track
authorMathieu Duponchelle <seeed@laposte.net>
Thu, 28 Jul 2011 16:49:04 +0000 (18:49 +0200)
committerThibault Saunier <thibault.saunier@collabora.com>
Wed, 11 Jan 2012 14:56:15 +0000 (11:56 -0300)
API: GESTrack::track-object-removed signal

ges/ges-track.c

index 71cc6cb0be982196d78adc323c9a922bb439a2ff..b0951bf105e72e34eafee67d258aa8c0d7be86f7 100644 (file)
@@ -57,6 +57,7 @@ enum
   ARG_DURATION,
   ARG_LAST,
   TRACK_OBJECT_ADDED,
+  TRACK_OBJECT_REMOVED,
   LAST_SIGNAL
 };
 
@@ -214,6 +215,19 @@ ges_track_class_init (GESTrackClass * klass)
       G_SIGNAL_RUN_FIRST, 0, NULL, NULL, ges_marshal_VOID__OBJECT,
       G_TYPE_NONE, 1, GES_TYPE_TRACK_OBJECT);
 
+  /**
+   * GESTrack::track-object-removed
+   * @object: the #GESTrack
+   * @effect: the #GESTrackObject that was removed.
+   *
+   * Will be emitted after a track object was removed from the track.
+   *
+   * Since: 0.10.2
+   */
+  ges_track_signals[TRACK_OBJECT_REMOVED] =
+      g_signal_new ("track-object-removed", G_TYPE_FROM_CLASS (klass),
+      G_SIGNAL_RUN_FIRST, 0, NULL, NULL, ges_marshal_VOID__OBJECT,
+      G_TYPE_NONE, 1, GES_TYPE_TRACK_OBJECT);
 }
 
 static void
@@ -409,6 +423,7 @@ ges_track_add_object (GESTrack * track, GESTrackObject * object)
   track->priv->trackobjects =
       g_list_insert_sorted (track->priv->trackobjects, object,
       (GCompareFunc) objects_start_compare);
+
   g_signal_emit (track, ges_track_signals[TRACK_OBJECT_ADDED], 0,
       GES_TRACK_OBJECT (object));
 
@@ -481,6 +496,9 @@ ges_track_remove_object (GESTrack * track, GESTrackObject * object)
   ges_track_object_set_track (object, NULL);
   priv->trackobjects = g_list_remove (priv->trackobjects, object);
 
+  g_signal_emit (track, ges_track_signals[TRACK_OBJECT_REMOVED], 0,
+      GES_TRACK_OBJECT (object));
+
   g_object_unref (object);
 
   return TRUE;