layer: Add a method to check if a layer is empty or not

API: ges_timeline_layer_is_empty
This commit is contained in:
Thibault Saunier 2012-01-20 14:36:36 -03:00
parent 4c26b89e3c
commit 4a881a43d9
4 changed files with 27 additions and 0 deletions

View file

@ -956,6 +956,12 @@
(return-type "GList*") (return-type "GList*")
) )
(define-method is_empty
(of-object "GESTimelineLayer")
(c-name "ges_timeline_layer_is_empty")
(return-type "gboolean")
)
;; From ges-timeline-object.h ;; From ges-timeline-object.h

View file

@ -285,6 +285,7 @@ ges_timeline_layer_get_objects
ges_timeline_layer_get_timeline ges_timeline_layer_get_timeline
ges_timeline_layer_get_auto_transition ges_timeline_layer_get_auto_transition
ges_timeline_layer_set_auto_transition ges_timeline_layer_set_auto_transition
ges_timeline_layer_is_empty
<SUBSECTION Standard> <SUBSECTION Standard>
GESTimelineLayerPrivate GESTimelineLayerPrivate
ges_timeline_layer_set_timeline ges_timeline_layer_set_timeline

View file

@ -994,3 +994,21 @@ ges_timeline_layer_get_objects (GESTimelineLayer * layer)
ret = g_list_reverse (ret); ret = g_list_reverse (ret);
return ret; return ret;
} }
/**
* ges_timeline_layer_is_empty:
* @layer: The #GESTimelineLayer to check
*
* Convenience method to check if @layer is empty (doesn't contain any object),
* or not.
*
* Returns: %TRUE if @layer is empty, %FALSE if it already contains at least
* one #GESTimelineObject
*/
gboolean
ges_timeline_layer_is_empty (GESTimelineLayer * layer)
{
g_return_val_if_fail (GES_IS_TIMELINE_LAYER (layer), FALSE);
return (layer->priv->objects_start == NULL);
}

View file

@ -108,6 +108,8 @@ gboolean ges_timeline_layer_remove_object (GESTimelineLayer * layer,
void ges_timeline_layer_set_priority (GESTimelineLayer * layer, void ges_timeline_layer_set_priority (GESTimelineLayer * layer,
guint priority); guint priority);
gboolean ges_timeline_layer_is_empty (GESTimelineLayer * layer);
guint ges_timeline_layer_get_priority (GESTimelineLayer * layer); guint ges_timeline_layer_get_priority (GESTimelineLayer * layer);
gboolean ges_timeline_layer_get_auto_transition (GESTimelineLayer * layer); gboolean ges_timeline_layer_get_auto_transition (GESTimelineLayer * layer);