## GstControlBinding

GstControlBinding — attachment for control source sources

## Synopsis

    #include <gst/gst.h>

    struct              GstControlBinding;
    struct              GstControlBindingClass;
    void                (*GstControlBindingConvert)         (GstControlBinding *binding,
                                                             gdouble src_value,
                                                             GValue *dest_value);
    gboolean            gst_control_binding_sync_values     (GstControlBinding *binding,
                                                             GstObject *object,
                                                             GstClockTime timestamp,
                                                             GstClockTime last_sync);
    GValue *            gst_control_binding_get_value       (GstControlBinding *binding,
                                                             GstClockTime timestamp);
    gboolean            gst_control_binding_get_value_array (GstControlBinding *binding,
                                                             GstClockTime timestamp,
                                                             GstClockTime interval,
                                                             guint n_values,
                                                             gpointer values);
    gboolean            gst_control_binding_get_g_value_array
                                                            (GstControlBinding *binding,
                                                             GstClockTime timestamp,
                                                             GstClockTime interval,
                                                             guint n_values,
                                                             GValue *values);
    void                gst_control_binding_set_disabled    (GstControlBinding *binding,
                                                             gboolean disabled);
    gboolean            gst_control_binding_is_disabled     (GstControlBinding *binding);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GstObject
                   +----GstControlBinding

## Properties

      "name"                     gchar*                : Read / Write / Construct Only
      "object"                   GstObject*            : Read / Write / Construct Only

## Description

A value mapping object that attaches control sources to gobject properties.

## Details

### struct GstControlBinding

    struct GstControlBinding {
      gchar *name;
      GParamSpec *pspec;
    };

The instance structure of GstControlBinding.

gchar *`name`; | name of the property of this binding
GParamSpec *`pspec`; | GParamSpec for this property

### struct GstControlBindingClass

    struct GstControlBindingClass {
      GstObjectClass parent_class;

      /* virtual methods */
      gboolean (* sync_values) (GstControlBinding *binding, GstObject *object, GstClockTime timestamp, GstClockTime last_sync);
      GValue * (* get_value) (GstControlBinding *binding, GstClockTime timestamp);
      gboolean (* get_value_array) (GstControlBinding *binding, GstClockTime timestamp,GstClockTime interval, guint n_values, gpointer values);
      gboolean (* get_g_value_array) (GstControlBinding *binding, GstClockTime timestamp,GstClockTime interval, guint n_values, GValue *values);
    };

The class structure of GstControlBinding.

GstObjectClass `parent_class`; | Parent class
`sync_values` () |
`get_value` () |
`get_value_array` () |
`get_g_value_array` () |

### GstControlBindingConvert ()

    void                (*GstControlBindingConvert)         (GstControlBinding *binding,
                                                             gdouble src_value,
                                                             GValue *dest_value);

Function to map a control-value to the target GValue.

`binding` : | the GstControlBinding instance
`src_value` : | the value returned by the cotnrol source
`dest_value` : | the target GValue

### gst_control_binding_sync_values ()

    gboolean            gst_control_binding_sync_values     (GstControlBinding *binding,
                                                             GstObject *object,
                                                             GstClockTime timestamp,
                                                             GstClockTime last_sync);

Sets the property of the `object`, according to the GstControlSources that handle them and for the given timestamp.

If this function fails, it is most likely the application developers fault. Most probably the control sources are not setup correctly.

`binding` : | the control binding
`object` : | the object that has controlled properties
`timestamp` : | the time that should be processed
`last_sync` : | the last time this was called
Returns : | `TRUE` if the controller value could be applied to the object property, `FALSE` otherwise

### gst_control_binding_get_value ()

    GValue *            gst_control_binding_get_value       (GstControlBinding *binding,
                                                             GstClockTime timestamp);

Gets the value for the given controlled property at the requested time.

`binding` : | the control binding
`timestamp` : | the time the control-change should be read from
Returns : | the GValue of the property at the given time, or `NULL` if the property isn't controlled.

### gst_control_binding_get_value_array ()

    gboolean            gst_control_binding_get_value_array (GstControlBinding *binding,
                                                             GstClockTime timestamp,
                                                             GstClockTime interval,
                                                             guint n_values,
                                                             gpointer values);

Gets a number of values for the given controlled property starting at the requested time. The array `values` need to hold enough space for `n_values` of the same type as the objects property's type.

This function is useful if one wants to e.g. draw a graph of the control curve or apply a control curve sample by sample.

The values are unboxed and ready to be used. The similar function `gst_control_binding_get_g_value_array()` returns the array as GValues and is better suites for bindings.

`binding` : | the control binding
`timestamp` : | the time that should be processed
`interval` : | the time spacing between subsequent values
`n_values` : | the number of values
`values` : | array to put control-values in
Returns : | `TRUE` if the given array could be filled, `FALSE` otherwise

### gst_control_binding_get_g_value_array ()

    gboolean            gst_control_binding_get_g_value_array
                                                            (GstControlBinding *binding,
                                                             GstClockTime timestamp,
                                                             GstClockTime interval,
                                                             guint n_values,
                                                             GValue *values);

Gets a number of GValues for the given controlled property starting at the requested time. The array `values` need to hold enough space for `n_values` of GValue.

This function is useful if one wants to e.g. draw a graph of the control curve or apply a control curve sample by sample.

`binding` : | the control binding
`timestamp` : | the time that should be processed
`interval` : | the time spacing between subsequent values
`n_values` : | the number of values
`values` : | array to put control-values in
Returns : | `TRUE` if the given array could be filled, `FALSE` otherwise

### gst_control_binding_set_disabled ()

    void                gst_control_binding_set_disabled    (GstControlBinding *binding,
                                                             gboolean disabled);

This function is used to disable a control binding for some time, i.e. `gst_object_sync_values()` will do nothing.

`binding` : | the control binding
`disabled` : | boolean that specifies whether to disable the controller or not.

### gst_control_binding_is_disabled ()

    gboolean            gst_control_binding_is_disabled     (GstControlBinding *binding);

Check if the control binding is disabled.

`binding` : | the control binding
Returns : | `TRUE` if the binding is inactive

## Property Details

### The `"name"` property

      "name"                     gchar*                : Read / Write / Construct Only

The name of the property.

Default value: NULL

### The `"object"` property

      "object"                   GstObject*            : Read / Write / Construct Only

The object of the property.