GESSimpleTimelineLayer: add _nth() method

This commit is contained in:
Brandon Lewis 2010-12-15 15:51:23 +00:00 committed by Edward Hervey
parent 0486623e30
commit 7bb28f0a6a
3 changed files with 30 additions and 0 deletions

View file

@ -445,6 +445,7 @@ GESSimpleTimelineLayer
ges_simple_timeline_layer_new
ges_simple_timeline_layer_add_object
ges_simple_timeline_layer_move_object
ges_simple_timeline_layer_nth
ges_simple_timeline_layer_is_valid
<SUBSECTION Standard>
GESSimpleTimelineLayerClass

View file

@ -347,6 +347,31 @@ ges_simple_timeline_layer_add_object (GESSimpleTimelineLayer * layer,
return TRUE;
}
/**
* ges_simple_timeline_layer_nth:
* @layer: a #GESSimpleTimelineLayer
* @position: The position in position to get, starting from 0.
*
* Gets the timeline object at the given position.
*
* Returns: The #GESTimelineObject at the given position or NULL if
* the position is off the end of the layer.
*/
GESTimelineObject *
ges_simple_timeline_layer_nth (GESSimpleTimelineLayer * layer, gint position)
{
GList *list;
GESSimpleTimelineLayerPrivate *priv = layer->priv;
list = g_list_nth (priv->objects, position);
if (list)
return GES_TIMELINE_OBJECT (list->data);
return NULL;
}
/**
* ges_simple_timeline_layer_move_object:
* @layer: a #GESSimpleTimelineLayer

View file

@ -87,6 +87,10 @@ ges_simple_timeline_layer_move_object (GESSimpleTimelineLayer *layer,
gboolean
ges_simple_timeline_layer_is_valid (GESSimpleTimelineLayer *layer);
GESTimelineObject *
ges_simple_timeline_layer_nth (GESSimpleTimelineLayer *layer,
gint position);
G_END_DECLS
#endif /* _GES_SIMPLE_TIMELINE_LAYER */