GESSimpleLayer

## GESSimpleLayer GESSimpleLayer — High-level GESLayer |

## Synopsis

    #include <ges/ges.h>

                        GESSimpleLayer;
    GESSimpleLayer *    ges_simple_layer_new                (void);
    gboolean            ges_simple_layer_add_object         (GESSimpleLayer *layer,
                                                             GESClip *object,
                                                             gint position);
    gboolean            ges_simple_layer_move_object        (GESSimpleLayer *layer,
                                                             GESClip *clip,
                                                             gint newposition);
    GESClip *           ges_simple_layer_nth                (GESSimpleLayer *layer,
                                                             gint position);
    gint                ges_simple_layer_index              (GESSimpleLayer *layer,
                                                             GESClip *clip);
    gboolean            ges_simple_layer_is_valid           (GESSimpleLayer *layer);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GESLayer
                   +----GESSimpleLayer

## Implemented Interfaces

GESSimpleLayer implements GESExtractable and GESMetaContainer.

## Properties

      "valid"                    gboolean              : Read

## Signals

      "object-moved"                                   : Run First

## Description

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

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

## Details

### GESSimpleLayer

    typedef struct _GESSimpleLayer GESSimpleLayer;

### ges_simple_layer_new ()

    GESSimpleLayer *    ges_simple_layer_new                (void);

Creates a new GESSimpleLayer.

Returns : | The new GESSimpleLayer

### ges_simple_layer_add_object ()

    gboolean            ges_simple_layer_add_object         (GESSimpleLayer *layer,
                                                             GESClip *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 GESSourceClip 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 GESSimpleLayer
`object` : | the GESClip to add
`position` : | the position at which to add the object
Returns : | TRUE if the object was successfuly added, else FALSE.

### ges_simple_layer_move_object ()

    gboolean            ges_simple_layer_move_object        (GESSimpleLayer *layer,
                                                             GESClip *clip,
                                                             gint newposition);

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

`layer` : | a GESSimpleLayer
`clip` : | the GESClip to move
`newposition` : | the new position at which to move the clip
Returns : | TRUE if the clip was successfuly moved, else FALSE.

### ges_simple_layer_nth ()

    GESClip *           ges_simple_layer_nth                (GESSimpleLayer *layer,
                                                             gint position);

Gets the clip at the given position.

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

### ges_simple_layer_index ()

    gint                ges_simple_layer_index              (GESSimpleLayer *layer,
                                                             GESClip *clip);

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

`layer` : | a GESSimpleLayer
`clip` : | a GESClip in the layer
Returns : | The position of the clip starting from 0, or -1 if the clip was not found.

### ges_simple_layer_is_valid ()

    gboolean            ges_simple_layer_is_valid           (GESSimpleLayer *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 GESSimpleLayer
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                      (GESSimpleLayer *layer,
                                                            GESClip        *object,
                                                            gint            old,
                                                            gint            new,
                                                            gpointer        user_data)      : Run First

Will be emitted when an object is moved with ges_simple_layer_move_object.

`layer` : | the GESSimpleLayer
`object` : | the GESClip 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.