GESSimpleTimelineLayer: add _nth() method
authorBrandon Lewis <brandon@collabora.co.uk>
Wed, 15 Dec 2010 15:51:23 +0000 (15:51 +0000)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Wed, 15 Dec 2010 17:01:33 +0000 (18:01 +0100)
docs/libs/ges-sections.txt
ges/ges-simple-timeline-layer.c
ges/ges-simple-timeline-layer.h

index 3394e07..0fcc350 100644 (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
index 9be317a..62bf97d 100644 (file)
@@ -348,6 +348,31 @@ ges_simple_timeline_layer_add_object (GESSimpleTimelineLayer * layer,
 }
 
 /**
+ * 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
  * @object: the #GESTimelineObject to move
index 2725616..165e0b7 100644 (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 */