## GESTimelineLayer

GESTimelineLayer — Non-overlaping sequence of GESTimelineObject

## Synopsis

    #include <ges/ges.h>

                        GESTimelineLayer;
                        GESTimelineLayerClass;
    gboolean            ges_timeline_layer_add_object       (GESTimelineLayer *layer,
                                                             GESTimelineObject *object);
    GESTimelineLayer *  ges_timeline_layer_new              (void);
    gboolean            ges_timeline_layer_remove_object    (GESTimelineLayer *layer,
                                                             GESTimelineObject *object);
    void                ges_timeline_layer_set_priority     (GESTimelineLayer *layer,
                                                             guint priority);
    guint               ges_timeline_layer_get_priority     (GESTimelineLayer *layer);
    GList *             ges_timeline_layer_get_objects      (GESTimelineLayer *layer);

## Object Hierarchy

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

## Properties

      "priority"                 guint                 : Read / Write

## Signals

      "object-added"                                   : Run First
      "object-removed"                                 : Run First

## Description

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

## Details

### GESTimelineLayer

    typedef struct {
      GESTimeline *timeline;
    } GESTimelineLayer;

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

### GESTimelineLayerClass

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

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

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

### ges_timeline_layer_add_object ()

    gboolean            ges_timeline_layer_add_object       (GESTimelineLayer *layer,
                                                             GESTimelineObject *object);

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

An object can only be added to one layer.

`layer` : | a GESTimelineLayer
`object` : | the GESTimelineObject to add. [transfer full]
Returns : | TRUE if the object was properly added to the layer, or FALSE if the `layer` refuses to add the object.

### ges_timeline_layer_new ()

    GESTimelineLayer *  ges_timeline_layer_new              (void);

Creates a new GESTimelineLayer.

Returns : | A new GESTimelineLayer

### ges_timeline_layer_remove_object ()

    gboolean            ges_timeline_layer_remove_object    (GESTimelineLayer *layer,
                                                             GESTimelineObject *object);

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

`layer` : | a GESTimelineLayer
`object` : | the GESTimelineObject to remove
Returns : | TRUE if the object could be removed, FALSE if the layer does not want to remove the object.

### ges_timeline_layer_set_priority ()

    void                ges_timeline_layer_set_priority     (GESTimelineLayer *layer,
                                                             guint priority);

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

`layer` : | a GESTimelineLayer
`priority` : | the priority to set

### ges_timeline_layer_get_priority ()

    guint               ges_timeline_layer_get_priority     (GESTimelineLayer *layer);

Get the priority of `layer` within the timeline.

`layer` : | a GESTimelineLayer
Returns : | The priority of the `layer` within the timeline.

### ges_timeline_layer_get_objects ()

    GList *             ges_timeline_layer_get_objects      (GESTimelineLayer *layer);

Get the timeline objects this layer contains.

`layer` : | a GESTimelineLayer
Returns : | a GList of timeline objects. The user is responsible for unreffing the contained objects and freeing the list. [transfer full][element-type GESTimelineObject]

## Property Details

### The `"priority"` property

      "priority"                 guint                 : Read / Write

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

Default value: 0

## Signal Details

### The `"object-added"` signal

    void                user_function                      (GESTimelineLayer  *layer,
                                                            GESTimelineObject *object,
                                                            gpointer           user_data)      : Run First

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

`layer` : | the GESTimelineLayer
`object` : | the GESTimelineObject that was added.
`user_data` : | user data set when the signal handler was connected.

### The `"object-removed"` signal

    void                user_function                      (GESTimelineLayer  *layer,
                                                            GESTimelineObject *object,
                                                            gpointer           user_data)      : Run First

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

`layer` : | the GESTimelineLayer
`object` : | the GESTimelineObject that was removed
`user_data` : | user data set when the signal handler was connected.