## GESSimpleTimelineLayer

GESSimpleTimelineLayer — High-level GESTimelineLayer

## Synopsis

    #include <ges/ges.h>

                        GESSimpleTimelineLayer;
    GESSimpleTimelineLayer *  ges_simple_timeline_layer_new (void);
    gboolean            ges_simple_timeline_layer_add_object
                                                            (GESSimpleTimelineLayer *layer,
                                                             GESTimelineObject *object,
                                                             gint position);
    gboolean            ges_simple_timeline_layer_move_object
                                                            (GESSimpleTimelineLayer *layer,
                                                             GESTimelineObject *object,
                                                             gint newposition);
    GESTimelineObject * ges_simple_timeline_layer_nth       (GESSimpleTimelineLayer *layer,
                                                             gint position);
    gint                ges_simple_timeline_layer_index     (GESSimpleTimelineLayer *layer,
                                                             GESTimelineObject *object);
    gboolean            ges_simple_timeline_layer_is_valid  (GESSimpleTimelineLayer *layer);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GESTimelineLayer
                   +----GESSimpleTimelineLayer

## Properties

      "valid"                    gboolean              : Read

## Signals

      "object-moved"                                   : Run First

## Description

GESSimpleTimelineLayer allows using GESTimelineObject(s) with a list-like API. Clients can add any type of GESTimelineObject to a GESSimpleTimelineLayer, and the layer will automatically compute the appropriate start times.

Users should be aware that GESTimelineTransition objects are considered to have a negative duration for the purposes of positioning GESTimelineSource objects (i.e., adding a GESTimelineTransition creates an overlap between the two adjacent sources.

## Details

### GESSimpleTimelineLayer

    typedef struct _GESSimpleTimelineLayer GESSimpleTimelineLayer;

### ges_simple_timeline_layer_new ()

    GESSimpleTimelineLayer *  ges_simple_timeline_layer_new (void);

Creates a new GESSimpleTimelineLayer.

Returns : | The new GESSimpleTimelineLayer

### ges_simple_timeline_layer_add_object ()

    gboolean            ges_simple_timeline_layer_add_object
                                                            (GESSimpleTimelineLayer *layer,
                                                             GESTimelineObject *object,
                                                             gint position);

Adds the object at the given position in the layer. The position is where the object will be inserted. To put the object before all objects, use position 0. To put after all objects, use position -1.

When adding transitions, it is important that the adjacent objects (objects at position, and position + 1) be (1) A derivative of GESTimelineSource or other non-transition, and (2) have a duration at least as long as the duration of the transition.

The layer will steal a reference to the provided object.

`layer` : | a GESSimpleTimelineLayer
`object` : | the GESTimelineObject to add
`position` : | the position at which to add the object
Returns : | TRUE if the object was successfuly added, else FALSE.

### ges_simple_timeline_layer_move_object ()

    gboolean            ges_simple_timeline_layer_move_object
                                                            (GESSimpleTimelineLayer *layer,
                                                             GESTimelineObject *object,
                                                             gint newposition);

Moves the object to the given position in the layer. To put the object before all other objects, use position 0. To put the objects after all objects, use position -1.

`layer` : | a GESSimpleTimelineLayer
`object` : | the GESTimelineObject to move
`newposition` : | the new position at which to move the object
Returns : | TRUE if the object was successfuly moved, else FALSE.

### ges_simple_timeline_layer_nth ()

    GESTimelineObject * ges_simple_timeline_layer_nth       (GESSimpleTimelineLayer *layer,
                                                             gint position);

Gets the timeline object at the given position.

`layer` : | a GESSimpleTimelineLayer
`position` : | The position in position to get, starting from 0.
Returns : | The GESTimelineObject at the given position or NULL if the position is off the end of the layer. [transfer none]

### ges_simple_timeline_layer_index ()

    gint                ges_simple_timeline_layer_index     (GESSimpleTimelineLayer *layer,
                                                             GESTimelineObject *object);

Gets the position of the given object within the given layer.

`layer` : | a GESSimpleTimelineLayer
`object` : | a GESTimelineObject in the layer
Returns : | The position of the object starting from 0, or -1 if the object was not found.

### ges_simple_timeline_layer_is_valid ()

    gboolean            ges_simple_timeline_layer_is_valid  (GESSimpleTimelineLayer *layer);

Checks whether the arrangement of objects in the layer would cause errors or unexpected output during playback. Do not set the containing pipeline state to PLAYING when this property is FALSE.

`layer` : | a GESSimpleTimelineLayer
Returns : | TRUE if current arrangement of the layer is valid else FALSE.

## Property Details

### The `"valid"` property

      "valid"                    gboolean              : Read

FALSE when the arrangement of objects in the layer would cause errors or unexpected output during playback. Do not set the containing pipeline state to PLAYING when this property is FALSE.

Default value: FALSE

## Signal Details

### The `"object-moved"` signal

    void                user_function                      (GESSimpleTimelineLayer *layer,
                                                            GESTimelineObject      *object,
                                                            gint                    old,
                                                            gint                    new,
                                                            gpointer                user_data)      : Run First

Will be emitted when an object is moved with ges_simple_timeline_layer_move_object.

`layer` : | the GESSimpleTimelineLayer
`object` : | the GESTimelineObject that was added
`old` : | the previous position of the object
`new` : | the new position of the object
`user_data` : | user data set when the signal handler was connected.