## GESLayer GESLayer — Non-overlapping sequence of GESClip |

## Functions

gboolean | ges_layer_add_clip ()
GESClip * | ges_layer_add_asset ()
GESLayer * | ges_layer_new ()
gboolean | ges_layer_remove_clip ()
void | ges_layer_set_priority ()
guint | ges_layer_get_priority ()
GList * | ges_layer_get_clips ()
gboolean | ges_layer_get_auto_transition ()
void | ges_layer_set_auto_transition ()
gboolean | ges_layer_is_empty ()
GstClockTime | ges_layer_get_duration ()

## Properties

gboolean | auto-transition | Read / Write
guint | priority | Read / Write

## Signals

void | clip-added | Run First
void | clip-removed | Run First

## Types and Values

| GESLayer
| GESLayerClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GESLayer

## Implemented Interfaces

GESLayer implements GESExtractable and GESMetaContainer.

## Includes

    #include <ges/ges.h>

## Description

Responsible for the ordering of the various contained Clip(s). A timeline layer has a "priority" property, which is used to manage the priorities of individual Clips. Two layers should not have the same priority within a given timeline.

## Functions

### ges_layer_add_clip ()

    gboolean
    ges_layer_add_clip (GESLayer *layer,
                        GESClip *clip);

Adds the given clip to the layer. Sets the clip's parent, and thus takes ownership of the clip.

An clip can only be added to one layer.

Calling this method will construct and properly set all the media related elements on `clip` . If you need to know when those objects (actually GESTrackElement) are constructed, you should connect to the container::child-added signal which is emited right after those elements are ready to be used.

#### Parameters

layer | a GESLayer |
clip | the GESClip to add. | [transfer floating]

#### Returns

`TRUE` if the clip was properly added to the layer, or `FALSE` if the `layer` refuses to add the clip.

### ges_layer_add_asset ()

    GESClip *
    ges_layer_add_asset (GESLayer *layer,
                         GESAsset *asset,
                         GstClockTime start,
                         GstClockTime inpoint,
                         GstClockTime duration,
                         GESTrackType track_types);

Creates Clip from asset, adds it to layer and returns a reference to it.

#### Parameters

layer | a GESLayer |
asset | The asset to add to |
start | The start value to set on the new GESClip, if `start` == GST_CLOCK_TIME_NONE, it will be set to the current duration of `layer` |
inpoint | The inpoint value to set on the new GESClip |
duration | The duration value to set on the new GESClip |
track_types | The GESTrackType to set on the the new GESClip |

#### Returns

Created GESClip.

[transfer none]

### ges_layer_new ()

    GESLayer *
    ges_layer_new (void);

Creates a new GESLayer.

#### Returns

A new GESLayer.

[transfer floating]

### ges_layer_remove_clip ()

    gboolean
    ges_layer_remove_clip (GESLayer *layer,
                           GESClip *clip);

Removes the given `clip` from the `layer` and unparents it. Unparenting it means the reference owned by `layer` on the `clip` will be removed. If you wish to use the `clip` after this function, make sure you call `gst_object_ref()` before removing it from the `layer` .

#### Parameters

layer | a GESLayer |
clip | the GESClip to remove |

#### Returns

`TRUE` if the clip could be removed, `FALSE` if the layer does not want to remove the clip.

### ges_layer_set_priority ()

    void
    ges_layer_set_priority (GESLayer *layer,
                            guint priority);

`ges_layer_set_priority` has been deprecated since version 1.16.0 and should not be used in newly-written code.

use ges_timeline_move_layer instead. This deprecation means that you will not need to handle layer priorities at all yourself, GES will make sure there is never 'gaps' between layer priorities.

Sets the layer to the given `priority` . See the documentation of the priority property for more information.

#### Parameters

layer | a GESLayer |
priority | the priority to set |

### ges_layer_get_priority ()

    guint
    ges_layer_get_priority (GESLayer *layer);

Get the priority of `layer` within the timeline.

#### Parameters

layer | a GESLayer |

#### Returns

The priority of the `layer` within the timeline.

### ges_layer_get_clips ()

    GList *
    ges_layer_get_clips (GESLayer *layer);

Get the clips this layer contains.

#### Parameters

layer | a GESLayer |

#### Returns

a GList of clips. The user is responsible for unreffing the contained objects and freeing the list.

[transfer full][element-type GESClip]

### ges_layer_get_auto_transition ()

    gboolean
    ges_layer_get_auto_transition (GESLayer *layer);

Gets whether transitions are automatically added when objects overlap or not.

#### Parameters

layer | a GESLayer |

#### Returns

`TRUE` if transitions are automatically added, else `FALSE`.

### ges_layer_set_auto_transition ()

    void
    ges_layer_set_auto_transition (GESLayer *layer,
                                   gboolean auto_transition);

Sets the layer to the given `auto_transition` . See the documentation of the property auto_transition for more information.

#### Parameters

layer | a GESLayer |
auto_transition | whether the auto_transition is active |

### ges_layer_is_empty ()

    gboolean
    ges_layer_is_empty (GESLayer *layer);

Convenience method to check if `layer` is empty (doesn't contain any clip), or not.

#### Parameters

layer | The GESLayer to check |

#### Returns

`TRUE` if `layer` is empty, `FALSE` if it already contains at least one GESClip

### ges_layer_get_duration ()

    GstClockTime
    ges_layer_get_duration (GESLayer *layer);

Lets you retrieve the duration of the layer, which means the end time of the last clip inside it

#### Parameters

layer | The GESLayer to get the duration from |

#### Returns

The duration of a layer

## Types and Values

### GESLayer

    typedef struct {
      GESTimeline *timeline;
    } GESLayer;

#### Members

GESTimeline *`timeline`; | the GESTimeline where this layer is being used. |

### GESLayerClass

    typedef struct {
      /* virtual methods for subclasses */
      GList *(*get_objects) (GESLayer * layer);
    } GESLayerClass;

Subclasses can override the `get_objects` if they can provide a more efficient way of providing the list of contained GESClip(s).

#### Members

`get_objects` () | method to get the objects contained in the layer |

## Property Details

### The `“auto-transition”` property

      “auto-transition”          gboolean

Sets whether transitions are added automagically when clips overlap.

Flags: Read / Write

Default value: FALSE

### The `“priority”` property

      “priority”                 guint

The priority of the layer in the GESTimeline. 0 is the highest priority. Conceptually, a GESTimeline is a stack of GESLayers, and the priority of the layer represents its position in the stack. Two layers should not have the same priority within a given GESTimeline.

Note that the timeline needs to be commited (with ges_timeline_commit) for the change to be taken into account.

`GESLayer:priority` has been deprecated since version 1.16.0 and should not be used in newly-written code.

use ges_timeline_move_layer instead. This deprecation means that you will not need to handle layer priorities at all yourself, GES will make sure there is never 'gaps' between layer priorities.

Flags: Read / Write

Default value: 0

## Signal Details

### The `“clip-added”` signal

    void
    user_function (GESLayer *layer,
                   GESClip  *clip,
                   gpointer  user_data)

Will be emitted after the clip was added to the layer.

#### Parameters

layer | the GESLayer |
clip | the GESClip that was added. |
user_data | user data set when the signal handler was connected. |

Flags: Run First

### The `“clip-removed”` signal

    void
    user_function (GESLayer *layer,
                   GESClip  *clip,
                   gpointer  user_data)

Will be emitted after the clip was removed from the layer.

#### Parameters

layer | the GESLayer |
clip | the GESClip that was removed |
user_data | user data set when the signal handler was connected. |

Flags: Run First