ClutterTimeline

## ClutterTimeline ClutterTimeline — A class for time-based events |

## Synopsis

                        ClutterTimeline;
    struct              ClutterTimelineClass;
    ClutterTimeline *   clutter_timeline_new                (guint msecs);
    ClutterTimeline *   clutter_timeline_clone              (ClutterTimeline *timeline);

    void                clutter_timeline_set_duration       (ClutterTimeline *timeline,
                                                             guint msecs);
    guint               clutter_timeline_get_duration       (ClutterTimeline *timeline);
    void                clutter_timeline_set_repeat_count   (ClutterTimeline *timeline,
                                                             gint count);
    gint                clutter_timeline_get_repeat_count   (ClutterTimeline *timeline);
    void                clutter_timeline_set_delay          (ClutterTimeline *timeline,
                                                             guint msecs);
    guint               clutter_timeline_get_delay          (ClutterTimeline *timeline);
    enum                ClutterTimelineDirection;
    void                clutter_timeline_set_direction      (ClutterTimeline *timeline,
                                                             ClutterTimelineDirection direction);
    ClutterTimelineDirection clutter_timeline_get_direction (ClutterTimeline *timeline);
    void                clutter_timeline_set_auto_reverse   (ClutterTimeline *timeline,
                                                             gboolean reverse);
    gboolean            clutter_timeline_get_auto_reverse   (ClutterTimeline *timeline);
    void                clutter_timeline_set_progress_mode  (ClutterTimeline *timeline,
                                                             ClutterAnimationMode mode);
    ClutterAnimationMode clutter_timeline_get_progress_mode (ClutterTimeline *timeline);
    gdouble             (*ClutterTimelineProgressFunc)      (ClutterTimeline *timeline,
                                                             gdouble elapsed,
                                                             gdouble total,
                                                             gpointer user_data);
    void                clutter_timeline_set_progress_func  (ClutterTimeline *timeline,
                                                             ClutterTimelineProgressFunc func,
                                                             gpointer data,
                                                             GDestroyNotify notify);
    gint64              clutter_timeline_get_duration_hint  (ClutterTimeline *timeline);
    gint                clutter_timeline_get_current_repeat (ClutterTimeline *timeline);
    void                clutter_timeline_set_loop           (ClutterTimeline *timeline,
                                                             gboolean loop);
    gboolean            clutter_timeline_get_loop           (ClutterTimeline *timeline);

    void                clutter_timeline_start              (ClutterTimeline *timeline);
    void                clutter_timeline_pause              (ClutterTimeline *timeline);
    void                clutter_timeline_stop               (ClutterTimeline *timeline);
    void                clutter_timeline_rewind             (ClutterTimeline *timeline);
    void                clutter_timeline_skip               (ClutterTimeline *timeline,
                                                             guint msecs);
    void                clutter_timeline_advance            (ClutterTimeline *timeline,
                                                             guint msecs);
    guint               clutter_timeline_get_elapsed_time   (ClutterTimeline *timeline);
    guint               clutter_timeline_get_delta          (ClutterTimeline *timeline);
    gdouble             clutter_timeline_get_progress       (ClutterTimeline *timeline);
    gboolean            clutter_timeline_is_playing         (ClutterTimeline *timeline);

    void                clutter_timeline_add_marker_at_time (ClutterTimeline *timeline,
                                                             const gchar *marker_name,
                                                             guint msecs);
    gboolean            clutter_timeline_has_marker         (ClutterTimeline *timeline,
                                                             const gchar *marker_name);
    gchar **            clutter_timeline_list_markers       (ClutterTimeline *timeline,
                                                             gint msecs,
                                                             gsize *n_markers);
    void                clutter_timeline_remove_marker      (ClutterTimeline *timeline,
                                                             const gchar *marker_name);
    void                clutter_timeline_advance_to_marker  (ClutterTimeline *timeline,
                                                             const gchar *marker_name);

## Object Hierarchy

      GObject
       +----ClutterTimeline
             +----ClutterTransition

## Implemented Interfaces

ClutterTimeline implements ClutterScriptable.

## Properties

      "auto-reverse"             gboolean              : Read / Write
      "delay"                    guint                 : Read / Write
      "direction"                ClutterTimelineDirection  : Read / Write
      "duration"                 guint                 : Read / Write
      "loop"                     gboolean              : Read / Write
      "progress-mode"            ClutterAnimationMode  : Read / Write
      "repeat-count"             gint                  : Read / Write

## Signals

      "completed"                                      : Run Last
      "marker-reached"                                 : No Hooks
      "new-frame"                                      : Run Last
      "paused"                                         : Run Last
      "started"                                        : Run Last

## Description

ClutterTimeline is a base class for managing time-based event that cause Clutter to redraw a stage, such as animations.

Each ClutterTimeline instance has a duration: once a timeline has been started, using `clutter_timeline_start()`, it will emit a signal that can be used to update the state of the actors.

It is important to note that ClutterTimeline is not a generic API for calling closures after an interval; each Timeline is tied into the master clock used to drive the frame cycle. If you need to schedule a closure after an interval, see `clutter_threads_add_timeout()` instead.

Users of ClutterTimeline should connect to the "new-frame" signal, which is emitted each time a timeline is advanced during the maste clock iteration. The "new-frame" signal provides the time elapsed since the beginning of the timeline, in milliseconds. A normalized progress value can be obtained by calling `clutter_timeline_get_progress()`. By using `clutter_timeline_get_delta()` it is possible to obtain the wallclock time elapsed since the last emission of the "new-frame" signal.

Initial state can be set up by using the "started" signal, while final state can be set up by using the "completed" signal. The ClutterTimeline guarantees the emission of at least a single "new-frame" signal, as well as the emission of the "completed" signal.

It is possible to connect to specific points in the timeline progress by adding markers using `clutter_timeline_add_marker_at_time()` and connecting to the "marker-reached" signal.

Timelines can be made to loop once they reach the end of their duration, by using `clutter_timeline_set_repeat_count()`; a looping timeline will still emit the "completed" signal once it reaches the end of its duration.

Timelines have a "direction": the default direction is `CLUTTER_TIMELINE_FORWARD`, and goes from 0 to the duration; it is possible to change the direction to `CLUTTER_TIMELINE_BACKWARD`, and have the timeline go from the duration to 0. The direction can be automatically reversed when reaching completion by using the "auto-reverse" property.

Timelines are used in the Clutter animation framework by classes like ClutterAnimation, ClutterAnimator, and ClutterState.

### Defining Timelines in ClutterScript

A ClutterTimeline can be described in ClutterScript like any other object. Additionally, it is possible to define markers directly inside the JSON definition by using the markers JSON object member, such as:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    {
      "type" : "ClutterTimeline",
      "duration" : 1000,
      "markers" : [
        { "name" : "quarter", "time" : 250 },
        { "name" : "half-time", "time" : 500 },
        { "name" : "three-quarters", "time" : 750 }
      ]
    }

## Details

### ClutterTimeline

    typedef struct _ClutterTimeline ClutterTimeline;

The ClutterTimeline structure contains only private data and should be accessed using the provided API

Since 0.2

### struct ClutterTimelineClass

    struct ClutterTimelineClass {
      void (*started)        (ClutterTimeline *timeline);
      void (*completed)      (ClutterTimeline *timeline);
      void (*paused)         (ClutterTimeline *timeline);

      void (*new_frame)      (ClutterTimeline *timeline,
    		          gint             msecs);

      void (*marker_reached) (ClutterTimeline *timeline,
                              const gchar     *marker_name,
                              gint             msecs);
    };

The ClutterTimelineClass structure contains only private data

`started` () | handler for the "started" signal
`completed` () | handler for the "completed" signal
`paused` () | handler for the "paused" signal
`new_frame` () | handler for the "new-frame" signal
`marker_reached` () | handler for the "marker-reached" signal

Since 0.2

### clutter_timeline_new ()

    ClutterTimeline *   clutter_timeline_new                (guint msecs);

Creates a new ClutterTimeline with a duration of `msecs`.

`msecs` : | Duration of the timeline in milliseconds
Returns : | the newly created ClutterTimeline instance. Use `g_object_unref()` when done using it

Since 0.6

### clutter_timeline_clone ()

    ClutterTimeline *   clutter_timeline_clone              (ClutterTimeline *timeline);

### Warning

`clutter_timeline_clone` has been deprecated since version 1.10 and should not be used in newly-written code. Use `clutter_timeline_new()` or `g_object_new()` instead

Create a new ClutterTimeline instance which has property values matching that of supplied timeline. The cloned timeline will not be started and will not be positioned to the current position of the original `timeline`: you will have to start it with `clutter_timeline_start()`.

### Note

The only cloned properties are:

- "duration"
- "loop"
- "delay"
- "direction"

`timeline` : | ClutterTimeline to duplicate.
Returns : | a new ClutterTimeline, cloned from `timeline`. [transfer full]

Since 0.4

### clutter_timeline_set_duration ()

    void                clutter_timeline_set_duration       (ClutterTimeline *timeline,
                                                             guint msecs);

Sets the duration of the timeline, in milliseconds. The speed of the timeline depends on the ClutterTimeline:fps setting.

`timeline` : | a ClutterTimeline
`msecs` : | duration of the timeline in milliseconds

Since 0.6

### clutter_timeline_get_duration ()

    guint               clutter_timeline_get_duration       (ClutterTimeline *timeline);

Retrieves the duration of a ClutterTimeline in milliseconds. See `clutter_timeline_set_duration()`.

`timeline` : | a ClutterTimeline
Returns : | the duration of the timeline, in milliseconds.

Since 0.6

### clutter_timeline_set_repeat_count ()

    void                clutter_timeline_set_repeat_count   (ClutterTimeline *timeline,
                                                             gint count);

Sets the number of times the `timeline` should repeat.

If `count` is 0, the timeline never repeats.

If `count` is -1, the timeline will always repeat until it's stopped.

`timeline` : | a ClutterTimeline
`count` : | the number of times the timeline should repeat

Since 1.10

### clutter_timeline_get_repeat_count ()

    gint                clutter_timeline_get_repeat_count   (ClutterTimeline *timeline);

Retrieves the number set using `clutter_timeline_set_repeat_count()`.

`timeline` : | a ClutterTimeline
Returns : | the number of repeats

Since 1.10

### clutter_timeline_set_delay ()

    void                clutter_timeline_set_delay          (ClutterTimeline *timeline,
                                                             guint msecs);

Sets the delay, in milliseconds, before `timeline` should start.

`timeline` : | a ClutterTimeline
`msecs` : | delay in milliseconds

Since 0.4

### clutter_timeline_get_delay ()

    guint               clutter_timeline_get_delay          (ClutterTimeline *timeline);

Retrieves the delay set using `clutter_timeline_set_delay()`.

`timeline` : | a ClutterTimeline
Returns : | the delay in milliseconds.

Since 0.4

### enum ClutterTimelineDirection

    typedef enum {
      CLUTTER_TIMELINE_FORWARD,
      CLUTTER_TIMELINE_BACKWARD
    } ClutterTimelineDirection;

The direction of a ClutterTimeline

`CLUTTER_TIMELINE_FORWARD` | forward direction for a timeline
`CLUTTER_TIMELINE_BACKWARD` | backward direction for a timeline

Since 0.6

### clutter_timeline_set_direction ()

    void                clutter_timeline_set_direction      (ClutterTimeline *timeline,
                                                             ClutterTimelineDirection direction);

Sets the direction of `timeline`, either `CLUTTER_TIMELINE_FORWARD` or `CLUTTER_TIMELINE_BACKWARD`.

`timeline` : | a ClutterTimeline
`direction` : | the direction of the timeline

Since 0.6

### clutter_timeline_get_direction ()

    ClutterTimelineDirection clutter_timeline_get_direction (ClutterTimeline *timeline);

Retrieves the direction of the timeline set with `clutter_timeline_set_direction()`.

`timeline` : | a ClutterTimeline
Returns : | the direction of the timeline

Since 0.6

### clutter_timeline_set_auto_reverse ()

    void                clutter_timeline_set_auto_reverse   (ClutterTimeline *timeline,
                                                             gboolean reverse);

Sets whether `timeline` should reverse the direction after the emission of the "completed" signal.

Setting the "auto-reverse" property to `TRUE` is the equivalent of connecting a callback to the "completed" signal and changing the direction of the timeline from that callback; for instance, this code:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    static void
    reverse_timeline (ClutterTimeline *timeline)
    {
      ClutterTimelineDirection dir = clutter_timeline_get_direction (timeline);

      if (dir == CLUTTER_TIMELINE_FORWARD)
        dir = CLUTTER_TIMELINE_BACKWARD;
      else
        dir = CLUTTER_TIMELINE_FORWARD;

      clutter_timeline_set_direction (timeline, dir);
    }
    ...
      timeline = clutter_timeline_new (1000);
      clutter_timeline_set_repeat_count (timeline, -1);
      g_signal_connect (timeline, "completed",
                        G_CALLBACK (reverse_timeline),
                        NULL);

can be effectively replaced by:

    1
    2
    3
    timeline = clutter_timeline_new (1000);
    clutter_timeline_set_repeat_count (timeline, -1);
    clutter_timeline_set_auto_reverse (timeline);

`timeline` : | a ClutterTimeline
`reverse` : | `TRUE` if the `timeline` should reverse the direction

Since 1.6

### clutter_timeline_get_auto_reverse ()

    gboolean            clutter_timeline_get_auto_reverse   (ClutterTimeline *timeline);

Retrieves the value set by `clutter_timeline_set_auto_reverse()`.

`timeline` : | a ClutterTimeline
Returns : | `TRUE` if the timeline should automatically reverse, and `FALSE` otherwise

Since 1.6

### clutter_timeline_set_progress_mode ()

    void                clutter_timeline_set_progress_mode  (ClutterTimeline *timeline,
                                                             ClutterAnimationMode mode);

Sets the progress function using a value from the ClutterAnimationMode enumeration. The `mode` cannot be `CLUTTER_CUSTOM_MODE` or bigger than `CLUTTER_ANIMATION_LAST`.

`timeline` : | a ClutterTimeline
`mode` : | the progress mode, as a ClutterAnimationMode

Since 1.10

### clutter_timeline_get_progress_mode ()

    ClutterAnimationMode clutter_timeline_get_progress_mode (ClutterTimeline *timeline);

Retrieves the progress mode set using `clutter_timeline_set_progress_mode()` or `clutter_timeline_set_progress_func()`.

`timeline` : | a ClutterTimeline
Returns : | a ClutterAnimationMode

Since 1.10

### ClutterTimelineProgressFunc ()

    gdouble             (*ClutterTimelineProgressFunc)      (ClutterTimeline *timeline,
                                                             gdouble elapsed,
                                                             gdouble total,
                                                             gpointer user_data);

A function for defining a custom progress.

`timeline` : | a ClutterTimeline
`elapsed` : | the elapsed time, in milliseconds
`total` : | the total duration of the timeline, in milliseconds,
`user_data` : | data passed to the function
Returns : | the progress, as a floating point value between -1.0 and 2.0.

Since 1.10

### clutter_timeline_set_progress_func ()

    void                clutter_timeline_set_progress_func  (ClutterTimeline *timeline,
                                                             ClutterTimelineProgressFunc func,
                                                             gpointer data,
                                                             GDestroyNotify notify);

Sets a custom progress function for `timeline`. The progress function will be called by `clutter_timeline_get_progress()` and will be used to compute the progress value based on the elapsed time and the total duration of the timeline.

If `func` is not `NULL`, the "progress-mode" property will be set to `CLUTTER_CUSTOM_MODE`.

If `func` is `NULL`, any previously set progress function will be unset, and the "progress-mode" property will be set to `CLUTTER_LINEAR`.

`timeline` : | a ClutterTimeline
`func` : | a progress function, or `NULL`. [scope notified][allow-none]
`data` : | data to pass to `func`. [closure]
`notify` : | a function to be called when the progress function is removed or the timeline is disposed

Since 1.10

### clutter_timeline_get_duration_hint ()

    gint64              clutter_timeline_get_duration_hint  (ClutterTimeline *timeline);

Retrieves the full duration of the `timeline`, taking into account the current value of the "repeat-count" property.

If the "repeat-count" property is set to -1, this function will return `G_MAXINT64`.

The returned value is to be considered a hint, and it's only valid as long as the `timeline` hasn't been changed.

`timeline` : | a ClutterTimeline
Returns : | the full duration of the ClutterTimeline

Since 1.10

### clutter_timeline_get_current_repeat ()

    gint                clutter_timeline_get_current_repeat (ClutterTimeline *timeline);

Retrieves the current repeat for a timeline.

Repeats start at 0.

`timeline` : | a ClutterTimeline
Returns : | the current repeat

Since 1.10

### clutter_timeline_set_loop ()

    void                clutter_timeline_set_loop           (ClutterTimeline *timeline,
                                                             gboolean loop);

### Warning

`clutter_timeline_set_loop` has been deprecated since version 1.10 and should not be used in newly-written code. Use `clutter_timeline_set_repeat_count()` instead.

Sets whether `timeline` should loop.

This function is equivalent to calling `clutter_timeline_set_repeat_count()` with -1 if `loop` is `TRUE`, and with 0 if `loop` is `FALSE`.

`timeline` : | a ClutterTimeline
`loop` : | `TRUE` for enable looping

### clutter_timeline_get_loop ()

    gboolean            clutter_timeline_get_loop           (ClutterTimeline *timeline);

### Warning

`clutter_timeline_get_loop` has been deprecated since version 1.10 and should not be used in newly-written code. Use `clutter_timeline_get_repeat_count()` instead.

Gets whether `timeline` is looping

`timeline` : | a ClutterTimeline
Returns : | `TRUE` if the timeline is looping

### clutter_timeline_start ()

    void                clutter_timeline_start              (ClutterTimeline *timeline);

Starts the ClutterTimeline playing.

`timeline` : | A ClutterTimeline

### clutter_timeline_pause ()

    void                clutter_timeline_pause              (ClutterTimeline *timeline);

Pauses the ClutterTimeline on current frame

`timeline` : | A ClutterTimeline

### clutter_timeline_stop ()

    void                clutter_timeline_stop               (ClutterTimeline *timeline);

Stops the ClutterTimeline and moves to frame 0

`timeline` : | A ClutterTimeline

### clutter_timeline_rewind ()

    void                clutter_timeline_rewind             (ClutterTimeline *timeline);

Rewinds ClutterTimeline to the first frame if its direction is `CLUTTER_TIMELINE_FORWARD` and the last frame if it is `CLUTTER_TIMELINE_BACKWARD`.

`timeline` : | A ClutterTimeline

### clutter_timeline_skip ()

    void                clutter_timeline_skip               (ClutterTimeline *timeline,
                                                             guint msecs);

Advance timeline by the requested time in milliseconds

`timeline` : | A ClutterTimeline
`msecs` : | Amount of time to skip

### clutter_timeline_advance ()

    void                clutter_timeline_advance            (ClutterTimeline *timeline,
                                                             guint msecs);

Advance timeline to the requested point. The point is given as a time in milliseconds since the timeline started.

### Note

The `timeline` will not emit the "new-frame" signal for the given time. The first ::new-frame signal after the call to `clutter_timeline_advance()` will be emit the skipped markers.

`timeline` : | A ClutterTimeline
`msecs` : | Time to advance to

### clutter_timeline_get_elapsed_time ()

    guint               clutter_timeline_get_elapsed_time   (ClutterTimeline *timeline);

Request the current time position of the timeline.

`timeline` : | A ClutterTimeline
Returns : | current elapsed time in milliseconds.

### clutter_timeline_get_delta ()

    guint               clutter_timeline_get_delta          (ClutterTimeline *timeline);

Retrieves the amount of time elapsed since the last ClutterTimeline::new-frame signal.

This function is only useful inside handlers for the ::new-frame signal, and its behaviour is undefined if the timeline is not playing.

`timeline` : | a ClutterTimeline
Returns : | the amount of time in milliseconds elapsed since the last frame

Since 0.6

### clutter_timeline_get_progress ()

    gdouble             clutter_timeline_get_progress       (ClutterTimeline *timeline);

The position of the timeline in a normalized [-1, 2] interval.

The return value of this function is determined by the progress mode set using `clutter_timeline_set_progress_mode()`, or by the progress function set using `clutter_timeline_set_progress_func()`.

`timeline` : | a ClutterTimeline
Returns : | the normalized current position in the timeline.

Since 0.6

### clutter_timeline_is_playing ()

    gboolean            clutter_timeline_is_playing         (ClutterTimeline *timeline);

Queries state of a ClutterTimeline.

`timeline` : | A ClutterTimeline
Returns : | `TRUE` if timeline is currently playing

### clutter_timeline_add_marker_at_time ()

    void                clutter_timeline_add_marker_at_time (ClutterTimeline *timeline,
                                                             const gchar *marker_name,
                                                             guint msecs);

Adds a named marker that will be hit when the timeline has been running for `msecs` milliseconds. Markers are unique string identifiers for a given time. Once `timeline` reaches `msecs`, it will emit a ::marker-reached signal for each marker attached to that time.

A marker can be removed with `clutter_timeline_remove_marker()`. The timeline can be advanced to a marker using `clutter_timeline_advance_to_marker()`.

`timeline` : | a ClutterTimeline
`marker_name` : | the unique name for this marker
`msecs` : | position of the marker in milliseconds

Since 0.8

### clutter_timeline_has_marker ()

    gboolean            clutter_timeline_has_marker         (ClutterTimeline *timeline,
                                                             const gchar *marker_name);

Checks whether `timeline` has a marker set with the given name.

`timeline` : | a ClutterTimeline
`marker_name` : | the name of the marker
Returns : | `TRUE` if the marker was found

Since 0.8

### clutter_timeline_list_markers ()

    gchar **            clutter_timeline_list_markers       (ClutterTimeline *timeline,
                                                             gint msecs,
                                                             gsize *n_markers);

Retrieves the list of markers at time `msecs`. If `msecs` is a negative integer, all the markers attached to `timeline` will be returned.

`timeline` : | a ClutterTimeline
`msecs` : | the time to check, or -1
`n_markers` : | the number of markers returned
Returns : | a newly allocated, `NULL` terminated string array containing the names of the markers. Use `g_strfreev()` when done. [transfer full][array zero-terminated=1 length=n_markers]

Since 0.8

### clutter_timeline_remove_marker ()

    void                clutter_timeline_remove_marker      (ClutterTimeline *timeline,
                                                             const gchar *marker_name);

Removes `marker_name`, if found, from `timeline`.

`timeline` : | a ClutterTimeline
`marker_name` : | the name of the marker to remove

Since 0.8

### clutter_timeline_advance_to_marker ()

    void                clutter_timeline_advance_to_marker  (ClutterTimeline *timeline,
                                                             const gchar *marker_name);

Advances `timeline` to the time of the given `marker_name`.

### Note

Like `clutter_timeline_advance()`, this function will not emit the "new-frame" for the time where `marker_name` is set, nor it will emit "marker-reached" for `marker_name`.

`timeline` : | a ClutterTimeline
`marker_name` : | the name of the marker

Since 0.8

## Property Details

### The `"auto-reverse"` property

      "auto-reverse"             gboolean              : Read / Write

If the direction of the timeline should be automatically reversed when reaching the end.

Default value: FALSE

Since 1.6

### The `"delay"` property

      "delay"                    guint                 : Read / Write

A delay, in milliseconds, that should be observed by the timeline before actually starting.

Default value: 0

Since 0.4

### The `"direction"` property

      "direction"                ClutterTimelineDirection  : Read / Write

The direction of the timeline, either `CLUTTER_TIMELINE_FORWARD` or `CLUTTER_TIMELINE_BACKWARD`.

Default value: CLUTTER_TIMELINE_FORWARD

Since 0.6

### The `"duration"` property

      "duration"                 guint                 : Read / Write

Duration of the timeline in milliseconds, depending on the ClutterTimeline:fps value.

Default value: 1000

Since 0.6

### The `"loop"` property

      "loop"                     gboolean              : Read / Write

### Warning

`ClutterTimeline:loop` has been deprecated since version 1.10 and should not be used in newly-written code. Use the "repeat-count" property instead.

Whether the timeline should automatically rewind and restart.

As a side effect, setting this property to `TRUE` will set the "repeat-count" property to -1, while setting this property to `FALSE` will set the "repeat-count" property to 0.

Default value: FALSE

### The `"progress-mode"` property

      "progress-mode"            ClutterAnimationMode  : Read / Write

Controls the way a ClutterTimeline computes the normalized progress.

Default value: CLUTTER_LINEAR

Since 1.10

### The `"repeat-count"` property

      "repeat-count"             gint                  : Read / Write

Defines how many times the timeline should repeat.

If the repeat count is 0, the timeline does not repeat.

If the repeat count is set to -1, the timeline will repeat until it is stopped.

Allowed values: >= G_MAXULONG

Default value: 0

Since 1.10

## Signal Details

### The `"completed"` signal

    void                user_function                      (ClutterTimeline *timeline,
                                                            gpointer         user_data)      : Run Last

The "completed" signal is emitted when the timeline's elapsed time reaches the value of the "duration" property.

This signal will be emitted even if the ClutterTimeline is set to be repeating.

`timeline` : | the ClutterTimeline which received the signal
`user_data` : | user data set when the signal handler was connected.

### The `"marker-reached"` signal

    void                user_function                      (ClutterTimeline *timeline,
                                                            gchar           *marker_name,
                                                            gint             msecs,
                                                            gpointer         user_data)        : No Hooks

The ::marker-reached signal is emitted each time a timeline reaches a marker set with `clutter_timeline_add_marker_at_time()`. This signal is detailed with the name of the marker as well, so it is possible to connect a callback to the ::marker-reached signal for a specific marker with:

    1
    2
    3
    4
    5
    6
    7
    8
    clutter_timeline_add_marker_at_time (timeline, "foo", 500);
    clutter_timeline_add_marker_at_time (timeline, "bar", 750);
    g_signal_connect (timeline, "marker-reached",
                      G_CALLBACK (each_marker_reached), NULL);
    g_signal_connect (timeline, "marker-reached::foo",
                      G_CALLBACK (foo_marker_reached), NULL);
    g_signal_connect (timeline, "marker-reached::bar",
                      G_CALLBACK (bar_marker_reached), NULL);

In the example, the first callback will be invoked for both the "foo" and "bar" marker, while the second and third callbacks will be invoked for the "foo" or "bar" markers, respectively.

`timeline` : | the ClutterTimeline which received the signal
`marker_name` : | the name of the marker reached
`msecs` : | the elapsed time
`user_data` : | user data set when the signal handler was connected.

Since 0.8

### The `"new-frame"` signal

    void                user_function                      (ClutterTimeline *timeline,
                                                            gint             msecs,
                                                            gpointer         user_data)      : Run Last

The ::new-frame signal is emitted for each timeline running timeline before a new frame is drawn to give animations a chance to update the scene.

`timeline` : | the timeline which received the signal
`msecs` : | the elapsed time between 0 and duration
`user_data` : | user data set when the signal handler was connected.

### The `"paused"` signal

    void                user_function                      (ClutterTimeline *timeline,
                                                            gpointer         user_data)      : Run Last

The ::paused signal is emitted when `clutter_timeline_pause()` is invoked.

`timeline` : | the ClutterTimeline which received the signal
`user_data` : | user data set when the signal handler was connected.

### The `"started"` signal

    void                user_function                      (ClutterTimeline *timeline,
                                                            gpointer         user_data)      : Run Last

The ::started signal is emitted when the timeline starts its run. This might be as soon as `clutter_timeline_start()` is invoked or after the delay set in the ClutterTimeline:delay property has expired.

`timeline` : | the ClutterTimeline which received the signal
`user_data` : | user data set when the signal handler was connected.

## See Also

ClutterAnimation, ClutterAnimator, ClutterState