## GstTimedValueControlSource

GstTimedValueControlSource — timed value control source base class

## Functions

GSequenceIter * | gst_timed_value_control_source_find_control_point_iter ()
gboolean | gst_timed_value_control_source_set ()
gboolean | gst_timed_value_control_source_set_from_list ()
GList * | gst_timed_value_control_source_get_all ()
gboolean | gst_timed_value_control_source_unset ()
void | gst_timed_value_control_source_unset_all ()
gint | gst_timed_value_control_source_get_count ()
void | gst_timed_value_control_invalidate_cache ()
GstControlPoint * | gst_control_point_copy ()
void | gst_control_point_free ()

## Signals

void | value-added | Run First
void | value-changed | Run First
void | value-removed | Run First

## Types and Values

struct | GstTimedValueControlSource
struct | GstControlPoint

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstControlSource
                    ╰── GstTimedValueControlSource
                        ├── GstInterpolationControlSource
                        ╰── GstTriggerControlSource

## Includes

    #include <gst/controller/controller.h>

## Description

Base class for GstControlSource that use time-stamped values.

When overriding bind, chain up first to give this bind implementation a chance to setup things.

All functions are MT-safe.

## Functions

### gst_timed_value_control_source_find_control_point_iter ()

    GSequenceIter *
    gst_timed_value_control_source_find_control_point_iter
                                   (GstTimedValueControlSource *self,
                                    GstClockTime timestamp);

Find last value before given timestamp in control point list. If all values in the control point list come after the given timestamp or no values exist, `NULL` is returned.

For use in control source implementations.

#### Parameters

self | the control source to search in |
timestamp | the search key |

#### Returns

the found GSequenceIter or `NULL`.

[transfer none]

### gst_timed_value_control_source_set ()

    gboolean
    gst_timed_value_control_source_set (GstTimedValueControlSource *self,
                                        GstClockTime timestamp,
                                        const gdouble value);

Set the value of given controller-handled property at a certain time.

#### Parameters

self | the GstTimedValueControlSource object |
timestamp | the time the control-change is scheduled for |
value | the control-value |

#### Returns

FALSE if the values couldn't be set, TRUE otherwise.

### gst_timed_value_control_source_set_from_list ()

    gboolean
    gst_timed_value_control_source_set_from_list
                                   (GstTimedValueControlSource *self,
                                    const GSList *timedvalues);

Sets multiple timed values at once.

#### Parameters

self | the GstTimedValueControlSource object |
timedvalues | a list with GstTimedValue items. | [transfer none][element-type GstTimedValue]

#### Returns

FALSE if the values couldn't be set, TRUE otherwise.

### gst_timed_value_control_source_get_all ()

    GList *
    gst_timed_value_control_source_get_all
                                   (GstTimedValueControlSource *self);

Returns a read-only copy of the list of GstTimedValue for the given property. Free the list after done with it.

#### Parameters

self | the GstTimedValueControlSource to get the list from |

#### Returns

a copy of the list, or `NULL` if the property isn't handled by the controller.

[transfer container][element-type GstTimedValue]

### gst_timed_value_control_source_unset ()

    gboolean
    gst_timed_value_control_source_unset (GstTimedValueControlSource *self,
                                          GstClockTime timestamp);

Used to remove the value of given controller-handled property at a certain time.

#### Parameters

self | the GstTimedValueControlSource object |
timestamp | the time the control-change should be removed from |

#### Returns

FALSE if the value couldn't be unset (i.e. not found, TRUE otherwise.

### gst_timed_value_control_source_unset_all ()

    void
    gst_timed_value_control_source_unset_all
                                   (GstTimedValueControlSource *self);

Used to remove all time-stamped values of given controller-handled property

#### Parameters

self | the GstTimedValueControlSource object |

### gst_timed_value_control_source_get_count ()

    gint
    gst_timed_value_control_source_get_count
                                   (GstTimedValueControlSource *self);

Get the number of control points that are set.

#### Parameters

self | the GstTimedValueControlSource to get the number of values from |

#### Returns

the number of control points that are set.

### gst_timed_value_control_invalidate_cache ()

    void
    gst_timed_value_control_invalidate_cache
                                   (GstTimedValueControlSource *self);

Reset the controlled value cache.

#### Parameters

self | the GstTimedValueControlSource |

### gst_control_point_copy ()

    GstControlPoint *
    gst_control_point_copy (GstControlPoint *cp);

### gst_control_point_free ()

    void
    gst_control_point_free (GstControlPoint *cp);

Frees all data allocated by a GstControlPoint instance.

#### Parameters

cp | the object to free |

## Types and Values

### struct GstTimedValueControlSource

    struct GstTimedValueControlSource;

The instance structure of GstControlSource.

### struct GstControlPoint

    struct GstControlPoint {
      /* fields from GstTimedValue. DO NOT CHANGE! */
      GstClockTime timestamp;
      gdouble value;
    };

An internal structure for value+time and various temporary values used for interpolation. This "inherits" from GstTimedValue.

#### Members

GstClockTime `timestamp`; | timestamp of the value change |
gdouble `value`; | the new value |

## Signal Details

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

    void
    user_function (GstTimedValueControlSource *self,
                   GstControlPoint            *timed_value,
                   gpointer                    user_data)

Emitted right after the new value has been added to `self`

#### Parameters

self | The GstTimedValueControlSource into which a GstTimedValue has been added |
timed_value | The newly added GstTimedValue |
user_data | user data set when the signal handler was connected. |

Flags: Run First

Since: 1.6

### The `“value-changed”` signal

    void
    user_function (GstTimedValueControlSource *self,
                   GstControlPoint            *timed_value,
                   gpointer                    user_data)

Emitted right after the new value has been set on `timed_signals`

#### Parameters

self | The GstTimedValueControlSource on which a GstTimedValue has changed |
timed_value | The GstTimedValue where the value changed |
user_data | user data set when the signal handler was connected. |

Flags: Run First

Since: 1.6

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

    void
    user_function (GstTimedValueControlSource *self,
                   GstControlPoint            *timed_value,
                   gpointer                    user_data)

Emitted when `timed_value` is removed from `self`

#### Parameters

self | The GstTimedValueControlSource from which a GstTimedValue has been removed |
timed_value | The removed GstTimedValue |
user_data | user data set when the signal handler was connected. |

Flags: Run First

Since: 1.6