Clutter Reference Manual: ClutterTimeline

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

## Functions

ClutterTimeline * | clutter_timeline_new ()
ClutterTimeline * | clutter_timeline_clone ()
void | clutter_timeline_set_duration ()
guint | clutter_timeline_get_duration ()
void | clutter_timeline_set_repeat_count ()
gint | clutter_timeline_get_repeat_count ()
void | clutter_timeline_set_delay ()
guint | clutter_timeline_get_delay ()
void | clutter_timeline_set_direction ()
ClutterTimelineDirection | clutter_timeline_get_direction ()
void | clutter_timeline_set_auto_reverse ()
gboolean | clutter_timeline_get_auto_reverse ()
void | clutter_timeline_set_progress_mode ()
ClutterAnimationMode | clutter_timeline_get_progress_mode ()
void | clutter_timeline_set_cubic_bezier_progress ()
gboolean | clutter_timeline_get_cubic_bezier_progress ()
void | clutter_timeline_set_step_progress ()
gboolean | clutter_timeline_get_step_progress ()
gdouble | (*ClutterTimelineProgressFunc) ()
void | clutter_timeline_set_progress_func ()
gint64 | clutter_timeline_get_duration_hint ()
gint | clutter_timeline_get_current_repeat ()
void | clutter_timeline_set_loop ()
gboolean | clutter_timeline_get_loop ()
void | clutter_timeline_start ()
void | clutter_timeline_pause ()
void | clutter_timeline_stop ()
void | clutter_timeline_rewind ()
void | clutter_timeline_skip ()
void | clutter_timeline_advance ()
guint | clutter_timeline_get_elapsed_time ()
guint | clutter_timeline_get_delta ()
gdouble | clutter_timeline_get_progress ()
gboolean | clutter_timeline_is_playing ()
void | clutter_timeline_add_marker ()
void | clutter_timeline_add_marker_at_time ()
gboolean | clutter_timeline_has_marker ()
gchar ** | clutter_timeline_list_markers ()
void | clutter_timeline_remove_marker ()
void | clutter_timeline_advance_to_marker ()

## Properties

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

## Signals

void | completed | Run Last
void | marker-reached | No Hooks
void | new-frame | Run Last
void | paused | Run Last
void | started | Run Last
void | stopped | Run Last

## Types and Values

| ClutterTimeline
struct | ClutterTimelineClass
enum | ClutterTimelineDirection
enum | ClutterAnimationMode
enum | ClutterStepMode

## Object Hierarchy

        GObject
        ╰── ClutterTimeline
            ╰── ClutterTransition

## Implemented Interfaces

ClutterTimeline implements ClutterScriptable.

## 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 “stopped” signal. The ClutterTimeline guarantees the emission of at least a single “new-frame” signal, as well as the emission of the “completed” signal every time the ClutterTimeline reaches its “duration”.

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 at each repeat. If you want to be notified of the end of the last repeat, use the “stopped” signal.

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 }
      ]
    }

## Functions

### clutter_timeline_new ()

    ClutterTimeline *
    clutter_timeline_new (guint msecs);

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

#### Parameters

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);

`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()`.

The only cloned properties are:

- “duration”

- “loop”

- “delay”

- “direction”

#### Parameters

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.

#### Parameters

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()`.

#### Parameters

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.

#### Parameters

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()`.

#### Parameters

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.

#### Parameters

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()`.

#### Parameters

timeline | a ClutterTimeline |

#### Returns

the delay in milliseconds.

Since 0.4

### 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`.

#### Parameters

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()`.

#### Parameters

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);

#### Parameters

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()`.

#### Parameters

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`.

#### Parameters

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()`.

#### Parameters

timeline | a ClutterTimeline |

#### Returns

a ClutterAnimationMode

Since 1.10

### clutter_timeline_set_cubic_bezier_progress ()

    void
    clutter_timeline_set_cubic_bezier_progress
                                   (ClutterTimeline *timeline,
                                    const ClutterPoint *c_1,
                                    const ClutterPoint *c_2);

Sets the “progress-mode” of `timeline` to `CLUTTER_CUBIC_BEZIER`, and sets the two control points for the cubic bezier.

The cubic bezier curve is between (0, 0) and (1, 1). The X coordinate of the two control points must be in the [ 0, 1 ] range, while the Y coordinate of the two control points can exceed this range.

#### Parameters

timeline | a ClutterTimeline |
c_1 | the first control point for the cubic bezier |
c_2 | the second control point for the cubic bezier |

Since 1.12

### clutter_timeline_get_cubic_bezier_progress ()

    gboolean
    clutter_timeline_get_cubic_bezier_progress
                                   (ClutterTimeline *timeline,
                                    ClutterPoint *c_1,
                                    ClutterPoint *c_2);

Retrieves the control points for the cubic bezier progress mode.

#### Parameters

timeline | a ClutterTimeline |
c_1 | return location for the first control point of the cubic bezier, or `NULL`. | [out caller-allocates]
c_2 | return location for the second control point of the cubic bezier, or `NULL`. | [out caller-allocates]

#### Returns

`TRUE` if the `timeline` is using a cubic bezier progress more, and `FALSE` otherwise

Since 1.12

### clutter_timeline_set_step_progress ()

    void
    clutter_timeline_set_step_progress (ClutterTimeline *timeline,
                                        gint n_steps,
                                        ClutterStepMode step_mode);

Sets the “progress-mode” of the `timeline` to `CLUTTER_STEPS` and provides the parameters of the step function.

#### Parameters

timeline | a ClutterTimeline |
n_steps | the number of steps |
step_mode | whether the change should happen at the start or at the end of the step |

Since 1.12

### clutter_timeline_get_step_progress ()

    gboolean
    clutter_timeline_get_step_progress (ClutterTimeline *timeline,
                                        gint *n_steps,
                                        ClutterStepMode *step_mode);

Retrieves the parameters of the step progress mode used by `timeline` .

#### Parameters

timeline | a ClutterTimeline |
n_steps | return location for the number of steps, or `NULL`. | [out]
step_mode | return location for the value change policy, or `NULL`. | [out]

#### Returns

`TRUE` if the `timeline` is using a step progress mode, and `FALSE` otherwise

Since 1.12

### ClutterTimelineProgressFunc ()

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

A function for defining a custom progress.

#### Parameters

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`.

#### Parameters

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.

#### Parameters

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.

#### Parameters

timeline | a ClutterTimeline |

#### Returns

the current repeat

Since 1.10

### clutter_timeline_set_loop ()

    void
    clutter_timeline_set_loop (ClutterTimeline *timeline,
                               gboolean loop);

`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`.

#### Parameters

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

### clutter_timeline_get_loop ()

    gboolean
    clutter_timeline_get_loop (ClutterTimeline *timeline);

`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

#### Parameters

timeline | a ClutterTimeline |

#### Returns

`TRUE` if the timeline is looping

### clutter_timeline_start ()

    void
    clutter_timeline_start (ClutterTimeline *timeline);

Starts the ClutterTimeline playing.

#### Parameters

timeline | A ClutterTimeline |

### clutter_timeline_pause ()

    void
    clutter_timeline_pause (ClutterTimeline *timeline);

Pauses the ClutterTimeline on current frame

#### Parameters

timeline | A ClutterTimeline |

### clutter_timeline_stop ()

    void
    clutter_timeline_stop (ClutterTimeline *timeline);

Stops the ClutterTimeline and moves to frame 0

#### Parameters

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`.

#### Parameters

timeline | A ClutterTimeline |

### clutter_timeline_skip ()

    void
    clutter_timeline_skip (ClutterTimeline *timeline,
                           guint msecs);

Advance timeline by the requested time in milliseconds

#### Parameters

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.

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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()`.

#### Parameters

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.

#### Parameters

timeline | A ClutterTimeline |

#### Returns

`TRUE` if timeline is currently playing

### clutter_timeline_add_marker ()

    void
    clutter_timeline_add_marker (ClutterTimeline *timeline,
                                 const gchar *marker_name,
                                 gdouble progress);

Adds a named marker that will be hit when the timeline has reached the specified `progress` .

Markers are unique string identifiers for a given position on the timeline. Once `timeline` reaches the given `progress` of its duration, if will emit a ::marker-reached signal for each marker attached to that particular point.

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

See also: `clutter_timeline_add_marker_at_time()`

#### Parameters

timeline | a ClutterTimeline |
marker_name | the unique name for this marker |
progress | the normalized value of the position of the martke |

Since 1.14

### 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 position on the timeline. Once `timeline` reaches the given `msecs` , it will emit a ::marker-reached signal for each marker attached to that position.

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

See also: `clutter_timeline_add_marker()`

#### Parameters

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.

#### Parameters

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.

#### Parameters

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` .

#### Parameters

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` .

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` .

#### Parameters

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

Since 0.8

## Types and Values

### 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);
      void (*stopped)        (ClutterTimeline *timeline,
                              gboolean         is_finished);
    };

The ClutterTimelineClass structure contains only private data

#### Members

`started` () | class handler for the “started” signal |
`completed` () | class handler for the “completed” signal |
`paused` () | class handler for the “paused” signal |
`new_frame` () | class handler for the “new-frame” signal |
`marker_reached` () | class handler for the “marker-reached” signal |
`stopped` () | class handler for the “stopped” signal |

Since 0.2

### enum ClutterTimelineDirection

The direction of a ClutterTimeline

#### Members

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

Since 0.6

### enum ClutterAnimationMode

The animation modes used by ClutterAlpha and ClutterAnimation. This enumeration can be expanded in later versions of Clutter.

<figure id="easing-modes"> <title>Easing modes provided by Clutter</title> <graphic fileref="easing-modes.png" format="PNG"/> </figure>

Every global alpha function registered using `clutter_alpha_register_func()` or `clutter_alpha_register_closure()` will have a logical id greater than `CLUTTER_ANIMATION_LAST`.

#### Members

CLUTTER_CUSTOM_MODE | custom progress function |
CLUTTER_LINEAR | linear tweening |
CLUTTER_EASE_IN_QUAD | quadratic tweening |
CLUTTER_EASE_OUT_QUAD | quadratic tweening, inverse of `CLUTTER_EASE_IN_QUAD` |
CLUTTER_EASE_IN_OUT_QUAD | quadratic tweening, combininig `CLUTTER_EASE_IN_QUAD` and `CLUTTER_EASE_OUT_QUAD` |
CLUTTER_EASE_IN_CUBIC | cubic tweening |
CLUTTER_EASE_OUT_CUBIC | cubic tweening, invers of `CLUTTER_EASE_IN_CUBIC` |
CLUTTER_EASE_IN_OUT_CUBIC | cubic tweening, combining `CLUTTER_EASE_IN_CUBIC` and `CLUTTER_EASE_OUT_CUBIC` |
CLUTTER_EASE_IN_QUART | quartic tweening |
CLUTTER_EASE_OUT_QUART | quartic tweening, inverse of `CLUTTER_EASE_IN_QUART` |
CLUTTER_EASE_IN_OUT_QUART | quartic tweening, combining `CLUTTER_EASE_IN_QUART` and `CLUTTER_EASE_OUT_QUART` |
CLUTTER_EASE_IN_QUINT | quintic tweening |
CLUTTER_EASE_OUT_QUINT | quintic tweening, inverse of `CLUTTER_EASE_IN_QUINT` |
CLUTTER_EASE_IN_OUT_QUINT | fifth power tweening, combining `CLUTTER_EASE_IN_QUINT` and `CLUTTER_EASE_OUT_QUINT` |
CLUTTER_EASE_IN_SINE | sinusoidal tweening |
CLUTTER_EASE_OUT_SINE | sinusoidal tweening, inverse of `CLUTTER_EASE_IN_SINE` |
CLUTTER_EASE_IN_OUT_SINE | sine wave tweening, combining `CLUTTER_EASE_IN_SINE` and `CLUTTER_EASE_OUT_SINE` |
CLUTTER_EASE_IN_EXPO | exponential tweening |
CLUTTER_EASE_OUT_EXPO | exponential tweening, inverse of `CLUTTER_EASE_IN_EXPO` |
CLUTTER_EASE_IN_OUT_EXPO | exponential tweening, combining `CLUTTER_EASE_IN_EXPO` and `CLUTTER_EASE_OUT_EXPO` |
CLUTTER_EASE_IN_CIRC | circular tweening |
CLUTTER_EASE_OUT_CIRC | circular tweening, inverse of `CLUTTER_EASE_IN_CIRC` |
CLUTTER_EASE_IN_OUT_CIRC | circular tweening, combining `CLUTTER_EASE_IN_CIRC` and `CLUTTER_EASE_OUT_CIRC` |
CLUTTER_EASE_IN_ELASTIC | elastic tweening, with offshoot on start |
CLUTTER_EASE_OUT_ELASTIC | elastic tweening, with offshoot on end |
CLUTTER_EASE_IN_OUT_ELASTIC | elastic tweening with offshoot on both ends |
CLUTTER_EASE_IN_BACK | overshooting cubic tweening, with backtracking on start |
CLUTTER_EASE_OUT_BACK | overshooting cubic tweening, with backtracking on end |
CLUTTER_EASE_IN_OUT_BACK | overshooting cubic tweening, with backtracking on both ends |
CLUTTER_EASE_IN_BOUNCE | exponentially decaying parabolic (bounce) tweening, with bounce on start |
CLUTTER_EASE_OUT_BOUNCE | exponentially decaying parabolic (bounce) tweening, with bounce on end |
CLUTTER_EASE_IN_OUT_BOUNCE | exponentially decaying parabolic (bounce) tweening, with bounce on both ends |
CLUTTER_STEPS | parametrized step function; see `clutter_timeline_set_step_progress()` for further details. (Since 1.12) |
CLUTTER_STEP_START | equivalent to `CLUTTER_STEPS` with a number of steps equal to 1, and a step mode of `CLUTTER_STEP_MODE_START`. (Since 1.12) |
CLUTTER_STEP_END | equivalent to `CLUTTER_STEPS` with a number of steps equal to 1, and a step mode of `CLUTTER_STEP_MODE_END`. (Since 1.12) |
CLUTTER_CUBIC_BEZIER | cubic bezier between (0, 0) and (1, 1) with two control points; see `clutter_timeline_set_cubic_bezier_progress()`. (Since 1.12) |
CLUTTER_EASE | equivalent to `CLUTTER_CUBIC_BEZIER` with control points in (0.25, 0.1) and (0.25, 1.0). (Since 1.12) |
CLUTTER_EASE_IN | equivalent to `CLUTTER_CUBIC_BEZIER` with control points in (0.42, 0) and (1.0, 1.0). (Since 1.12) |
CLUTTER_EASE_OUT | equivalent to `CLUTTER_CUBIC_BEZIER` with control points in (0, 0) and (0.58, 1.0). (Since 1.12) |
CLUTTER_EASE_IN_OUT | equivalent to `CLUTTER_CUBIC_BEZIER` with control points in (0.42, 0) and (0.58, 1.0). (Since 1.12) |
CLUTTER_ANIMATION_LAST | last animation mode, used as a guard for registered global alpha functions |

Since 1.0

### enum ClutterStepMode

Change the value transition of a step function.

See `clutter_timeline_set_step_progress()`.

#### Members

CLUTTER_STEP_MODE_START | The change in the value of a `CLUTTER_STEP` progress mode should occur at the start of the transition |
CLUTTER_STEP_MODE_END | The change in the value of a `CLUTTER_STEP` progress mode should occur at the end of the transition |

Since 1.12

## Property Details

### The `“auto-reverse”` property

      “auto-reverse”             gboolean

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

Flags: Read / Write

Default value: FALSE

Since 1.6

### The `“delay”` property

      “delay”                    guint

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

Flags: Read / Write

Default value: 0

Since 0.4

### The `“direction”` property

      “direction”                ClutterTimelineDirection

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

Flags: Read / Write

Default value: CLUTTER_TIMELINE_FORWARD

Since 0.6

### The `“duration”` property

      “duration”                 guint

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

Flags: Read / Write

Default value: 1000

Since 0.6

### The `“loop”` property

      “loop”                     gboolean

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.

`ClutterTimeline:loop` has been deprecated since version 1.10 and should not be used in newly-written code.

Use the “repeat-count” property instead.

Flags: Read / Write

Default value: FALSE

### The `“progress-mode”` property

      “progress-mode”            ClutterAnimationMode

Controls the way a ClutterTimeline computes the normalized progress.

Flags: Read / Write

Default value: CLUTTER_LINEAR

Since 1.10

### The `“repeat-count”` property

      “repeat-count”             gint

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.

Flags: Read / Write

Allowed values: >= -1

Default value: 0

Since 1.10

## Signal Details

### The `“completed”` signal

    void
    user_function (ClutterTimeline *timeline,
                   gpointer         user_data)

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.

If you want to get notification on whether the ClutterTimeline has been stopped or has finished its run, including its eventual repeats, you should use the “stopped” signal instead.

#### Parameters

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

Flags: Run Last

### The `“marker-reached”` signal

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

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:

<informalexample><programlisting> 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); </programlisting></informalexample>

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.

#### Parameters

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. |

Flags: No Hooks

Since 0.8

### The `“new-frame”` signal

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

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.

#### Parameters

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. |

Flags: Run Last

### The `“paused”` signal

    void
    user_function (ClutterTimeline *timeline,
                   gpointer         user_data)

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

#### Parameters

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

Flags: Run Last

### The `“started”` signal

    void
    user_function (ClutterTimeline *timeline,
                   gpointer         user_data)

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.

#### Parameters

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

Flags: Run Last

### The `“stopped”` signal

    void
    user_function (ClutterTimeline *timeline,
                   gboolean         is_finished,
                   gpointer         user_data)

The “stopped” signal is emitted when the timeline has been stopped, either because `clutter_timeline_stop()` has been called, or because it has been exhausted.

This is different from the “completed” signal, which gets emitted after every repeat finishes.

If the ClutterTimeline has is marked as infinitely repeating, this signal will never be emitted.

#### Parameters

timeline | the ClutterTimeline that emitted the signal |
is_finished | `TRUE` if the signal was emitted at the end of the timeline. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since 1.12

## See Also

ClutterAnimation, ClutterAnimator, ClutterState