ges: Add a ges_timeline_append_layer convenience method

API: ges_timeline_append_layer
This commit is contained in:
Thibault Saunier 2011-06-07 12:54:06 -04:00
parent 09e0d1bbe2
commit 8d15025aae
3 changed files with 27 additions and 0 deletions

View file

@ -236,6 +236,7 @@ ges_timeline_new
ges_timeline_new_audio_video
ges_timeline_new_from_uri
ges_timeline_add_layer
ges_timeline_append_layer
ges_timeline_remove_layer
ges_timeline_add_track
ges_timeline_remove_track

View file

@ -696,6 +696,31 @@ layer_object_removed_cb (GESTimelineLayer * layer, GESTimelineObject * object,
GST_DEBUG ("Done");
}
/**
* ges_timeline_append_layer:
* @timeline: a #GESTimeline
* @layer: the #GESTimelineLayer to add
*
* Convenience method to append @layer to @timeline which means that the
* priority of @layer is changed to correspond to the last layer of @timeline.
* The reference to the @layer will be stolen by @timeline.
*
* Returns: TRUE if the layer was properly added, else FALSE.
*/
gboolean
ges_timeline_append_layer (GESTimeline * timeline, GESTimelineLayer * layer)
{
guint32 priority;
GESTimelinePrivate *priv = timeline->priv;
GST_DEBUG ("Appending layer to layer:%p, timeline:%p", timeline, layer);
priority = g_list_length (priv->layers);
ges_timeline_layer_set_priority (layer, priority);
return ges_timeline_add_layer (timeline, layer);
}
/**
* ges_timeline_add_layer:
* @timeline: a #GESTimeline

View file

@ -89,6 +89,7 @@ gboolean ges_timeline_load_from_uri (GESTimeline *timeline, const gchar *uri);
gboolean ges_timeline_save_to_uri (GESTimeline *timeline, const gchar *uri);
gboolean ges_timeline_add_layer (GESTimeline *timeline, GESTimelineLayer *layer);
gboolean ges_timeline_append_layer (GESTimeline * timeline, GESTimelineLayer * layer);
gboolean ges_timeline_remove_layer (GESTimeline *timeline, GESTimelineLayer *layer);
GList* ges_timeline_get_layers (GESTimeline *timeline);