Class: Clutter::Timeline

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Overview

The Clutter::TimelineClass structure contains only private data

Direct Known Subclasses

Transition

Instance Method Summary collapse

Constructor Details

#initialize(msecs) ⇒ Clutter::Timeline

Creates a new Clutter::Timeline with a duration of msecs.

Parameters:

  • msecs (Integer)

    Duration of the timeline in milliseconds

Instance Method Details

#add_marker(marker_name, progress) ⇒ nil

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:

  • marker_name (String)

    the unique name for this marker

  • progress (Float)

    the normalized value of the position of the martke

Returns:

  • (nil)

#add_marker_at_time(marker_name, msecs) ⇒ nil

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:

  • marker_name (String)

    the unique name for this marker

  • msecs (Integer)

    position of the marker in milliseconds

Returns:

  • (nil)

#advance(msecs) ⇒ nil

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 Clutter::Timeline::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:

  • msecs (Integer)

    Time to advance to

Returns:

  • (nil)

#advance_to_marker(marker_name) ⇒ nil

Advances timeline to the time of the given marker_name.

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

Parameters:

  • marker_name (String)

    the name of the marker

Returns:

  • (nil)

#auto_reverseBoolean

Retrieves the value set by clutter_timeline_set_auto_reverse().

Returns:

  • (Boolean)

    true if the timeline should automatically reverse, and false otherwise

#auto_reverse=(auto_reverse) ⇒ Boolean

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

Parameters:

  • auto_reverse (Boolean)

Returns:

  • (Boolean)

    auto-reverse

  • (Boolean)

    auto-reverse

#auto_reverse?Boolean

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

Returns:

  • (Boolean)

    auto-reverse

#cloneClutter::Timeline

Create a new Clutter::Timeline 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:

  • Clutter::Timeline:duration
  • Clutter::Timeline:loop
  • Clutter::Timeline:delay
  • Clutter::Timeline:direction

Returns:

#current_repeatInteger

Retrieves the current repeat for a timeline.

Repeats start at 0.

Returns:

  • (Integer)

    the current repeat

#delayInteger

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

Returns:

  • (Integer)

    delay

#delay=(delay) ⇒ Integer

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

Parameters:

  • delay (Integer)

Returns:

  • (Integer)

    delay

  • (Integer)

    delay

#deltaInteger

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

Returns:

  • (Integer)

    the amount of time in milliseconds elapsed since the

#directionClutter::TimelineDirection

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

Returns:

#direction=(direction) ⇒ Clutter::TimelineDirection

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

Parameters:

Returns:

#durationInteger

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

Returns:

  • (Integer)

    duration

#duration=(duration) ⇒ Integer

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

Parameters:

  • duration (Integer)

Returns:

  • (Integer)

    duration

  • (Integer)

    duration

#duration_hintInteger

Retrieves the full duration of the timeline, taking into account the current value of the Clutter::Timeline:repeat-count property.

If the Clutter::Timeline: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.

Returns:

  • (Integer)

    the full duration of the Clutter::Timeline

#elapsed_timeInteger

Request the current time position of the timeline.

Returns:

  • (Integer)

    current elapsed time in milliseconds.

#get_cubic_bezier_progress(c_1, c_2) ⇒ Boolean

Retrieves the control points for the cubic bezier progress mode.

Parameters:

  • c_1 (Clutter::Point)

    return location for the first control point of the cubic bezier, or nil

  • c_2 (Clutter::Point)

    return location for the second control point of the cubic bezier, or nil

Returns:

  • (Boolean)

    true if the timeline is using a cubic bezier progress more, and false otherwise

#get_step_progress(n_steps, step_mode) ⇒ Boolean

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

Parameters:

  • n_steps (Integer)

    return location for the number of steps, or nil

  • step_mode (Clutter::StepMode)

    return location for the value change policy, or nil

Returns:

  • (Boolean)

    true if the timeline is using a step progress mode, and false otherwise

#has_marker(marker_name) ⇒ Boolean

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

Parameters:

  • marker_name (String)

    the name of the marker

Returns:

  • (Boolean)

    true if the marker was found

#is_playingBoolean

Queries state of a Clutter::Timeline.

Returns:

  • (Boolean)

    true if timeline is currently playing

#list_markers(msecs, n_markers) ⇒ Array<String>

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

Parameters:

  • msecs (Integer)

    the time to check, or -1

  • n_markers (Integer)

    the number of markers returned

Returns:

  • (Array<String>)

    a newly allocated, nil terminated string array containing the names of the markers. Use g_strfreev() when done.

#loopBoolean

Gets whether timeline is looping

Returns:

  • (Boolean)

    true if the timeline is looping

#loop=(loop) ⇒ Boolean

Whether the timeline should automatically rewind and restart.

As a side effect, setting this property to true will set the Clutter::Timeline:repeat-count property to -1, while setting this property to false will set the Clutter::Timeline:repeat-count property to 0.

Parameters:

  • loop (Boolean)

Returns:

  • (Boolean)

    loop

  • (Boolean)

    loop

#loop?Boolean

Whether the timeline should automatically rewind and restart.

As a side effect, setting this property to true will set the Clutter::Timeline:repeat-count property to -1, while setting this property to false will set the Clutter::Timeline:repeat-count property to 0.

Returns:

  • (Boolean)

    loop

#pausenil

Pauses the Clutter::Timeline on current frame

Returns:

  • (nil)

#progressFloat

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

Returns:

  • (Float)

    the normalized current position in the timeline.

#progress_modeClutter::AnimationMode

Controls the way a Clutter::Timeline computes the normalized progress.

Returns:

#progress_mode=(progress_mode) ⇒ Clutter::AnimationMode

Controls the way a Clutter::Timeline computes the normalized progress.

Parameters:

Returns:

#remove_marker(marker_name) ⇒ nil

Removes marker_name, if found, from timeline.

Parameters:

  • marker_name (String)

    the name of the marker to remove

Returns:

  • (nil)

#repeat_countInteger

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.

Returns:

  • (Integer)

    repeat-count

#repeat_count=(repeat_count) ⇒ Integer

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.

Parameters:

  • repeat_count (Integer)

Returns:

  • (Integer)

    repeat-count

  • (Integer)

    repeat-count

#rewindnil

Rewinds Clutter::Timeline to the first frame if its direction is %CLUTTER_TIMELINE_FORWARD and the last frame if it is %CLUTTER_TIMELINE_BACKWARD.

Returns:

  • (nil)

#set_cubic_bezier_progress(c_1, c_2) ⇒ nil

Sets the Clutter::Timeline: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:

  • c_1 (Clutter::Point)

    the first control point for the cubic bezier

  • c_2 (Clutter::Point)

    the second control point for the cubic bezier

Returns:

  • (nil)

#set_progress_func(func, data, notify) ⇒ nil

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 nil, the Clutter::Timeline:progress-mode property will be set to %CLUTTER_CUSTOM_MODE.

If func is nil, any previously set progress function will be unset, and the Clutter::Timeline:progress-mode property will be set to %CLUTTER_LINEAR.

Parameters:

  • func (Clutter::TimelineProgressFunc)

    a progress function, or nil

  • data (GObject)

    data to pass to func

  • notify (GLib::DestroyNotify)

    a function to be called when the progress function is removed or the timeline is disposed

Returns:

  • (nil)

#set_step_progress(n_steps, step_mode) ⇒ nil

Sets the Clutter::Timeline:progress-mode of the timeline to %CLUTTER_STEPS and provides the parameters of the step function.

Parameters:

  • n_steps (Integer)

    the number of steps

  • step_mode (Clutter::StepMode)

    whether the change should happen at the start or at the end of the step

Returns:

  • (nil)

#skip(msecs) ⇒ nil

Advance timeline by the requested time in milliseconds

Parameters:

  • msecs (Integer)

    Amount of time to skip

Returns:

  • (nil)

#startnil

Starts the Clutter::Timeline playing.

Returns:

  • (nil)

#stopnil

Stops the Clutter::Timeline and moves to frame 0

Returns:

  • (nil)