GESTrackElement

## GESTrackElement GESTrackElement — Base Class for objects contained in a GESTrack |

## Synopsis

    #include <ges/ges.h>

                        GESTrackElement;
                        GESTrackElementClass;
    gboolean            ges_track_element_set_active        (GESTrackElement *object,
                                                             gboolean active);
    GESTrack *          ges_track_element_get_track         (GESTrackElement *object);
    GstElement *        ges_track_element_get_gnlobject     (GESTrackElement *object);
    GstElement *        ges_track_element_get_element       (GESTrackElement *object);
    gboolean            ges_track_element_is_active         (GESTrackElement *object);
    gboolean            ges_track_element_lookup_child      (GESTrackElement *object,
                                                             const gchar *prop_name,
                                                             GstElement **element,
                                                             GParamSpec **pspec);
    GParamSpec **       ges_track_element_list_children_properties
                                                            (GESTrackElement *object,
                                                             guint *n_properties);
    gboolean            ges_track_element_set_child_property
                                                            (GESTrackElement *object,
                                                             const gchar *property_name,
                                                             GValue *value);
    void                ges_track_element_set_child_properties
                                                            (GESTrackElement *object,
                                                             const gchar *first_property_name,
                                                             ...);
    void                ges_track_element_set_child_property_valist
                                                            (GESTrackElement *object,
                                                             const gchar *first_property_name,
                                                             va_list var_args);
    void                ges_track_element_set_child_property_by_pspec
                                                            (GESTrackElement *object,
                                                             GParamSpec *pspec,
                                                             GValue *value);
    gboolean            ges_track_element_get_child_property
                                                            (GESTrackElement *object,
                                                             const gchar *property_name,
                                                             GValue *value);
    void                ges_track_element_get_child_properties
                                                            (GESTrackElement *object,
                                                             const gchar *first_property_name,
                                                             ...);
    void                ges_track_element_get_child_property_valist
                                                            (GESTrackElement *object,
                                                             const gchar *first_property_name,
                                                             va_list var_args);
    void                ges_track_element_get_child_property_by_pspec
                                                            (GESTrackElement *object,
                                                             GParamSpec *pspec,
                                                             GValue *value);
    gboolean            ges_track_element_edit              (GESTrackElement *object,
                                                             GList *layers,
                                                             GESEditMode mode,
                                                             GESEdge edge,
                                                             guint64 position);
    gboolean            ges_track_element_set_control_source
                                                            (GESTrackElement *object,
                                                             GstControlSource *source,
                                                             const gchar *property_name,
                                                             const gchar *binding_type);
    GstControlBinding * ges_track_element_get_control_binding
                                                            (GESTrackElement *object,
                                                             const gchar *property_name);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GESTimelineElement
                   +----GESTrackElement
                         +----GESSource
                         +----GESOperation

## Implemented Interfaces

GESTrackElement implements GESExtractable and GESMetaContainer.

## Properties

      "active"                   gboolean              : Read / Write
      "track"                    GESTrack*             : Read
      "track-type"               GESTrackType          : Read / Write / Construct

## Signals

      "deep-notify"                                    : No Hooks

## Description

GESTrackElement is the Base Class for any object that can be contained in a GESTrack.

It contains the basic information as to the location of the object within its container, like the start position, the inpoint, the duration and the priority.

## Details

### GESTrackElement

    typedef struct _GESTrackElement GESTrackElement;

The GESTrackElement base class.

### GESTrackElementClass

    typedef struct {
      /* virtual methods for subclasses */
      const gchar  *gnlobject_factorytype;
      GstElement*  (*create_gnl_object)        (GESTrackElement * object);
      GstElement*  (*create_element)           (GESTrackElement * object);

      void (*active_changed)       (GESTrackElement *object, gboolean active);

      /* virtual methods for subclasses */
      GParamSpec** (*list_children_properties) (GESTrackElement * object,
                  guint *n_properties);
    } GESTrackElementClass;

Subclasses can override the `create_gnl_object` method to override what type of GNonLin object will be created.

const gchar *`gnlobject_factorytype`; | name of the GNonLin GStElementFactory type to use.
`create_gnl_object` () | method to create the GNonLin container object.
`create_element` () | method to return the GstElement to put in the gnlobject.
`active_changed` () | active property of gnlobject has changed
`list_children_properties` () | method to get children properties that user could like to configure. The default implementation will create an object of type `gnlobject_factorytype` and call `create_element`. Since: 0.10.2

### ges_track_element_set_active ()

    gboolean            ges_track_element_set_active        (GESTrackElement *object,
                                                             gboolean active);

Sets the usage of the `object`. If `active` is `TRUE`, the object will be used for playback and rendering, else it will be ignored.

`object` : | a GESTrackElement
`active` : | visibility
Returns : | `TRUE` if the property was toggled, else `FALSE`

### ges_track_element_get_track ()

    GESTrack *          ges_track_element_get_track         (GESTrackElement *object);

Get the GESTrack to which this object belongs.

`object` : | a GESTrackElement
Returns : | The GESTrack to which this object belongs. Can be `NULL` if it is not in any track. [transfer none]

### ges_track_element_get_gnlobject ()

    GstElement *        ges_track_element_get_gnlobject     (GESTrackElement *object);

Get the GNonLin object this object is controlling.

`object` : | a GESTrackElement
Returns : | the GNonLin object this object is controlling. [transfer none]

### ges_track_element_get_element ()

    GstElement *        ges_track_element_get_element       (GESTrackElement *object);

Get the GstElement this track element is controlling within GNonLin.

`object` : | a GESTrackElement
Returns : | the GstElement this track element is controlling within GNonLin. [transfer none]

### ges_track_element_is_active ()

    gboolean            ges_track_element_is_active         (GESTrackElement *object);

Lets you know if `object` will be used for playback and rendering, or not.

`object` : | a GESTrackElement
Returns : | `TRUE` if `object` is active, `FALSE` otherwize

Since 0.10.2

### ges_track_element_lookup_child ()

    gboolean            ges_track_element_lookup_child      (GESTrackElement *object,
                                                             const gchar *prop_name,
                                                             GstElement **element,
                                                             GParamSpec **pspec);

Looks up which `element` and `pspec` would be effected by the given `name`. If various contained elements have this property name you will get the first one, unless you specify the class name in `name`.

`object` : | object to lookup the property in
`prop_name` : | name of the property to look up. You can specify the name of the class as such: "ClassName::property-name", to guarantee that you get the proper GParamSpec in case various GstElement-s contain the same property name. If you don't do so, you will get the first element found, having this property and the and the corresponding GParamSpec.
`element` : | pointer to a GstElement that takes the real object to set property on. [out][allow-none][transfer full]
`pspec` : | pointer to take the GParamSpec describing the property. [out][allow-none][transfer full]
Returns : | TRUE if `element` and `pspec` could be found. FALSE otherwise. In that case the values for `pspec` and `element` are not modified. Unref `element` after usage.

Since 0.10.2

### ges_track_element_list_children_properties ()

    GParamSpec **       ges_track_element_list_children_properties
                                                            (GESTrackElement *object,
                                                             guint *n_properties);

Gets an array of GParamSpec* for all configurable properties of the children of `object`.

`object` : | The GESTrackElement to get the list of children properties from
`n_properties` : | return location for the length of the returned array. [out]
Returns : | an array of GParamSpec* which should be freed after use or `NULL` if something went wrong. [transfer full][array length=n_properties]

Since 0.10.2

### ges_track_element_set_child_property ()

    gboolean            ges_track_element_set_child_property
                                                            (GESTrackElement *object,
                                                             const gchar *property_name,
                                                             GValue *value);

Sets a property of a GstElement contained in `object`.

Note that ges_track_element_set_child_property is really intended for language bindings, ges_track_element_set_child_properties is much more convenient for C programming.

`object` : | The origin GESTrackElement
`property_name` : | The name of the property
`value` : | the value
Returns : | `TRUE` if the property was set, `FALSE` otherwize

### ges_track_element_set_child_properties ()

    void                ges_track_element_set_child_properties
                                                            (GESTrackElement *object,
                                                             const gchar *first_property_name,
                                                             ...);

Sets a property of a child of `object`. If there are various child elements that have the same property name, you can distinguish them using the following syntax: 'ClasseName::property_name' as property name. If you don't, the corresponding property of the first element found will be set.

`object` : | The GESTrackElement parent object
`first_property_name` : | The name of the first property to set
`...` : | value for the first property, followed optionally by more name/return location pairs, followed by NULL

Since 0.10.2

### ges_track_element_set_child_property_valist ()

    void                ges_track_element_set_child_property_valist
                                                            (GESTrackElement *object,
                                                             const gchar *first_property_name,
                                                             va_list var_args);

Sets a property of a child of `object`. If there are various child elements that have the same property name, you can distinguish them using the following syntax: 'ClasseName::property_name' as property name. If you don't, the corresponding property of the first element found will be set.

`object` : | The GESTrackElement parent object
`first_property_name` : | The name of the first property to set
`var_args` : | value for the first property, followed optionally by more name/return location pairs, followed by NULL

Since 0.10.2

### ges_track_element_set_child_property_by_pspec ()

    void                ges_track_element_set_child_property_by_pspec
                                                            (GESTrackElement *object,
                                                             GParamSpec *pspec,
                                                             GValue *value);

Sets a property of a child of `object`.

`object` : | a GESTrackElement
`pspec` : | The GParamSpec that specifies the property you want to set
`value` : | the value

Since 0.10.2

### ges_track_element_get_child_property ()

    gboolean            ges_track_element_get_child_property
                                                            (GESTrackElement *object,
                                                             const gchar *property_name,
                                                             GValue *value);

In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling `g_value_unset()`.

Gets a property of a GstElement contained in `object`.

Note that ges_track_element_get_child_property is really intended for language bindings, ges_track_element_get_child_properties is much more convenient for C programming.

`object` : | The origin GESTrackElement
`property_name` : | The name of the property
`value` : | return location for the property value, it will be initialized if it is initialized with 0. [out]
Returns : | `TRUE` if the property was found, `FALSE` otherwize

### ges_track_element_get_child_properties ()

    void                ges_track_element_get_child_properties
                                                            (GESTrackElement *object,
                                                             const gchar *first_property_name,
                                                             ...);

Gets properties of a child of `object`.

`object` : | The origin GESTrackElement
`first_property_name` : | The name of the first property to get
`...` : | return location for the first property, followed optionally by more name/return location pairs, followed by NULL

Since 0.10.2

### ges_track_element_get_child_property_valist ()

    void                ges_track_element_get_child_property_valist
                                                            (GESTrackElement *object,
                                                             const gchar *first_property_name,
                                                             va_list var_args);

Gets a property of a child of `object`. If there are various child elements that have the same property name, you can distinguish them using the following syntax: 'ClasseName::property_name' as property name. If you don't, the corresponding property of the first element found will be set.

`object` : | The GESTrackElement parent object
`first_property_name` : | The name of the first property to get
`var_args` : | value for the first property, followed optionally by more name/return location pairs, followed by NULL

Since 0.10.2

### ges_track_element_get_child_property_by_pspec ()

    void                ges_track_element_get_child_property_by_pspec
                                                            (GESTrackElement *object,
                                                             GParamSpec *pspec,
                                                             GValue *value);

Gets a property of a child of `object`.

`object` : | a GESTrackElement
`pspec` : | The GParamSpec that specifies the property you want to get
`value` : | return location for the value. [out]

Since 0.10.2

### ges_track_element_edit ()

    gboolean            ges_track_element_edit              (GESTrackElement *object,
                                                             GList *layers,
                                                             GESEditMode mode,
                                                             GESEdge edge,
                                                             guint64 position);

Edit `object` in the different exisiting GESEditMode modes. In the case of slide, and roll, you need to specify a GESEdge

`object` : | the GESTrackElement to edit
`layers` : | The layers you want the edit to happen in, `NULL` means that the edition is done in all the GESLayers contained in the current timeline. FIXME: This is not implemented yet. [element-type GESLayer]
`mode` : | The GESEditMode in which the editition will happen.
`edge` : | The GESEdge the edit should happen on.
`position` : | The position at which to edit `object` (in nanosecond)
Returns : | `TRUE` if the object as been edited properly, `FALSE` if an error occured

Since 0.10.XX

### ges_track_element_set_control_source ()

    gboolean            ges_track_element_set_control_source
                                                            (GESTrackElement *object,
                                                             GstControlSource *source,
                                                             const gchar *property_name,
                                                             const gchar *binding_type);

Creates a GstControlBinding and adds it to the GstElement concerned by the property. Use the same syntax as ges_track_element_lookup_child for the property name.

`object` : | the GESTrackElement on which to set a control binding
`source` : | the GstControlSource to set on the binding. [element-type GstControlSource]
`property_name` : | The name of the property to control.
`binding_type` : | The type of binding to create. Only "direct" is available for now.
Returns : | `TRUE` if the binding could be created and added, `FALSE` if an error occured

Since 1.0.XX

### ges_track_element_get_control_binding ()

    GstControlBinding * ges_track_element_get_control_binding
                                                            (GESTrackElement *object,
                                                             const gchar *property_name);

Looks up the various controlled properties for that GESTrackElement, and returns the GstControlBinding which controls `property_name`.

`object` : | the GESTrackElement in which to lookup the bindings.
`property_name` : | The property_name to which the binding is associated.
Returns : | the GstControlBinding associated with `property_name`, or `NULL` if that property is not controlled. [transfer none]

Since 1.0.XX

## Property Details

### The `"active"` property

      "active"                   gboolean              : Read / Write

Whether the object should be taken into account in the GESTrack output. If FALSE, then its contents will not be used in the resulting track.

Default value: TRUE

### The `"track"` property

      "track"                    GESTrack*             : Read

The track the object is in.

### The `"track-type"` property

      "track-type"               GESTrackType          : Read / Write / Construct

The track type of the object.

Default value: GES_TRACK_TYPE_UNKNOWN

## Signal Details

### The `"deep-notify"` signal

    void                user_function                      (GESTrackElement *track_element,
                                                            GstElement      *prop_object,
                                                            GParamSpec      *prop,
                                                            gpointer         user_data)          : No Hooks

The deep notify signal is used to be notified of property changes of all the childs of `track_element`

`track_element` : | a GESTrackElement
`prop_object` : | the object that originated the signal
`prop` : | the property that changed
`user_data` : | user data set when the signal handler was connected.

Since 0.10.2