mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-09 08:55:33 +00:00
TimelineLayer: Implement _remove_object()
This commit is contained in:
parent
1bd2ebc068
commit
b10743ef9a
2 changed files with 27 additions and 0 deletions
|
@ -156,3 +156,29 @@ ges_timeline_layer_add_object (GESTimelineLayer * layer,
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
ges_timeline_layer_remove_object (GESTimelineLayer * layer,
|
||||
GESTimelineObject * object)
|
||||
{
|
||||
GST_DEBUG ("layer:%p, object:%p", layer, object);
|
||||
|
||||
if (G_UNLIKELY (object->layer != layer)) {
|
||||
GST_WARNING ("TimelineObject doesn't belong to this layer");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* emit 'object-removed' */
|
||||
g_signal_emit (layer, ges_timeline_layer_signals[OBJECT_REMOVED], 0, object);
|
||||
|
||||
/* inform the object it's no longer in a layer */
|
||||
ges_timeline_object_set_layer (object, NULL);
|
||||
|
||||
/* Remove it from our list of controlled objects */
|
||||
layer->objects_start = g_slist_remove (layer->objects_start, object);
|
||||
|
||||
/* Remove our reference to the object */
|
||||
g_object_unref (object);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ GESTimelineLayer* ges_timeline_layer_new (void);
|
|||
|
||||
void ges_timeline_layer_set_timeline (GESTimelineLayer * layer, GESTimeline * timeline);
|
||||
gboolean ges_timeline_layer_add_object (GESTimelineLayer * layer, GESTimelineObject * object);
|
||||
gboolean ges_timeline_layer_remove_object (GESTimelineLayer * layer, GESTimelineObject * object);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
Loading…
Reference in a new issue