cluttermm: Clutter::Timeline Class Reference

Inheritance diagram for Clutter::Timeline:
Collaboration diagram for Clutter::Timeline:

Public Member Functions

virtual ~Timeline ()
 
ClutterTimeline* gobj ()
 Provides access to the underlying C GObject. More...

 
const ClutterTimeline* gobj () const
 Provides access to the underlying C GObject. More...

 
ClutterTimeline* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...

 
Glib::RefPtr< Timelineclone () const
 Create a new Clutter::Timeline instance which has property values matching that of supplied timeline. More...

 
void set_duration (guint msecs)
 Sets the duration of the timeline, in milliseconds. More...

 
guint get_duration () const
 Retrieves the duration of a Clutter::Timeline in milliseconds. More...

 
void start ()
 Starts the Clutter::Timeline playing. More...

 
void pause ()
 Pauses the Clutter::Timeline on current frame. More...

 
void stop ()
 Stops the Clutter::Timeline and moves to frame 0. More...

 
void set_auto_reverse (bool reverse=true)
 Sets whether timeline should reverse the direction after the emission of the Clutter::Timeline::signal_completed() signal. More...

 
bool get_auto_reverse () const
 Retrieves the value set by set_auto_reverse(). More...

 
void set_repeat_count (int count)
 Sets the number of times the timeline should repeat. More...

 
int get_repeat_count () const
 Retrieves the number set using set_repeat_count(). More...

 
void rewind ()
 Rewinds Clutter::Timeline to the first frame if its direction is Clutter::TIMELINE_FORWARD and the last frame if it is Clutter::TIMELINE_BACKWARD. More...

 
void set_loop (bool loop=true)
 Sets whether timeline should loop. More...

 
bool get_loop () const
 Gets whether timeline is looping. More...

 
void skip (guint n_frames)
 Advance timeline by the requested time in milliseconds. More...

 
void advance (guint frame_num)
 Advance timeline to the requested point. More...

 
guint get_delta () const
 Retrieves the amount of time elapsed since the last ClutterTimeline::new-frame signal. More...

 
bool is_playing () const
 Queries state of a Clutter::Timeline. More...

 
void set_delay (guint msecs)
 Sets the delay, in milliseconds, before timeline should start. More...

 
guint get_delay () const
 Retrieves the delay set using set_delay(). More...

 
guint get_elapsed_time () const
 Request the current time position of the timeline. More...

 
double get_progress () const
 The position of the timeline in a normalized [-1, 2] interval. More...

 
void set_direction (TimelineDirection direction)
 Sets the direction of timeline, either Clutter::TIMELINE_FORWARD or Clutter::TIMELINE_BACKWARD. More...

 
TimelineDirection get_direction () const
 Retrieves the direction of the timeline set with set_direction(). More...

 
std::vector< Glib::ustringlist_markers (int frame_num) const
 Retrieves the list of markers at time msecs. More...

 
void add_marker_at_time (const Glib::ustring& marker_name, guint msecs)
 Adds a named marker that will be hit when the timeline has been running for msecs milliseconds. More...

 
bool has_marker (const Glib::ustring& marker_name)
 Checks whether timeline has a marker set with the given name. More...

 
void remove_marker (const Glib::ustring& marker_name)
 Removes marker_name, if found, from timeline. More...

 
void advance_to_marker (const Glib::ustring& marker_name)
 Advances timeline to the time of the given marker_name. More...

 
void set_progress_mode (AnimationMode mode)
 Sets the progress function using a value from the Clutter::AnimationMode enumeration. More...

 
AnimationMode get_progress_mode () const
 Retrieves the progress mode set using set_progress_mode() or set_progress_func(). More...

 
Glib::PropertyProxy< guint > property_delay ()
 Delay before start. More...

 
Glib::PropertyProxy_ReadOnly

< guint > 
property_delay () const
 Delay before start. More...

 
Glib::PropertyProxy

< TimelineDirection
property_direction ()
 Direction of the timeline. More...

 
Glib::PropertyProxy_ReadOnly

< TimelineDirection
property_direction () const
 Direction of the timeline. More...

 
Glib::PropertyProxy< guint > property_duration ()
 Duration of the timeline in milliseconds. More...

 
Glib::PropertyProxy_ReadOnly

< guint > 
property_duration () const
 Duration of the timeline in milliseconds. More...

 
Glib::PropertyProxy< bool > property_loop ()
 Should the timeline automatically restart. More...

 
Glib::PropertyProxy_ReadOnly

< bool > 
property_loop () const
 Should the timeline automatically restart. More...

 
Glib::PropertyProxy< bool > property_auto_reverse ()
 Whether the direction should be reversed when reaching the end. More...

 
Glib::PropertyProxy_ReadOnly

< bool > 
property_auto_reverse () const
 Whether the direction should be reversed when reaching the end. More...

 
Glib::PropertyProxy< int > property_repeat_count ()
 How many times the timeline should repeat. More...

 
Glib::PropertyProxy_ReadOnly< int > property_repeat_count () const
 How many times the timeline should repeat. More...

 
Glib::PropertyProxy

< AnimationMode
property_progress_mode ()
 How the timeline should compute the progress. More...

 
Glib::PropertyProxy_ReadOnly

< AnimationMode
property_progress_mode () const
 How the timeline should compute the progress. More...

 
Glib::SignalProxy0< void > signal_completed ()
 
Glib::SignalProxy1< void, int > signal_new_frame ()
 
Glib::SignalProxy0< void > signal_paused ()
 
Glib::SignalProxy0< void > signal_started ()
 
Glib::SignalProxy2< void,

const Glib::ustring&, int > 
signal_marker_reached ()
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...

 
static Glib::RefPtr< Timelinecreate (guint msecs)
 

Protected Member Functions

 Timeline (guint msecs)
 Creates a new Clutter::Timeline with a duration of msecs. More...

 
virtual void on_completed ()
 This is a default handler for the signal signal_completed(). More...

 
virtual void on_new_frame (int fram_num)
 This is a default handler for the signal signal_new_frame(). More...

 
virtual void on_paused ()
 This is a default handler for the signal signal_paused(). More...

 
virtual void on_started ()
 This is a default handler for the signal signal_started(). More...

 
virtual void on_marker_reached (const Glib::ustring& marker_name, int frame_num)
 This is a default handler for the signal signal_marker_reached(). More...

 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Clutter::Timelinewrap (ClutterTimeline* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...

 

Constructor & Destructor Documentation

virtual Clutter::Timeline::~Timeline ( )
virtual
Clutter::Timeline::Timeline ( guint  msecs)
explicitprotected

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

Since cluttermm 0.6:
Parameters
msecsDuration of the timeline in milliseconds.
Returns
The newly created Clutter::Timeline instance. Use Glib::object_unref() when done using it.

Member Function Documentation

void Clutter::Timeline::add_marker_at_time ( const Glib::ustring 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 signal_marker_reached() signal for each marker attached to that position.

A marker can be removed with remove_marker(). The timeline can be advanced to a marker using advance_to_marker().

See also: add_marker()

Since cluttermm 0.8:
Parameters
marker_nameThe unique name for this marker.
msecsPosition of the marker in milliseconds.
void Clutter::Timeline::advance ( guint  frame_num)

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 Clutter::Timeline::signal_new_frame() signal for the given time. The first signal_new_frame() signal after the call to advance() will be emit the skipped markers. </note>

Parameters
msecsTime to advance to.
void Clutter::Timeline::advance_to_marker ( const Glib::ustring marker_name)

Advances timeline to the time of the given marker_name.

<note>Like advance(), this function will not emit the Clutter::Timeline::signal_new_frame() for the time where marker_name is set, nor it will emit Clutter::Timeline::signal_marker_reached() for marker_name.</note>

Since cluttermm 0.8:
Parameters
marker_nameThe name of the marker.
Glib::RefPtr<Timeline> Clutter::Timeline::clone ( ) const

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

<note>The only cloned properties are:

Since cluttermm 0.4:

Deprecated: 1.10: Use new() or Glib::object_new() instead

Deprecated:
Use create() instead.
Returns
A new Clutter::Timeline, cloned from timeline.
static Glib::RefPtr<Timeline> Clutter::Timeline::create ( guint  msecs)
static
bool Clutter::Timeline::get_auto_reverse ( ) const

Retrieves the value set by set_auto_reverse().

Since cluttermm 1.6:
Returns
true if the timeline should automatically reverse, and false otherwise.
guint Clutter::Timeline::get_delay ( ) const

Retrieves the delay set using set_delay().

Since cluttermm 0.4:
Returns
The delay in milliseconds.
guint Clutter::Timeline::get_delta ( ) const

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

This function is only useful inside handlers for the signal_new_frame() signal, and its behaviour is undefined if the timeline is not playing.

Since cluttermm 0.6:
Returns
The amount of time in milliseconds elapsed since the last frame.
TimelineDirection Clutter::Timeline::get_direction ( ) const

Retrieves the direction of the timeline set with set_direction().

Since cluttermm 0.6:
Returns
The direction of the timeline.
guint Clutter::Timeline::get_duration ( ) const

Retrieves the duration of a Clutter::Timeline in milliseconds.

See set_duration().

Since cluttermm 0.6:
Returns
The duration of the timeline, in milliseconds.
guint Clutter::Timeline::get_elapsed_time ( ) const

Request the current time position of the timeline.

Returns
Current elapsed time in milliseconds.
bool Clutter::Timeline::get_loop ( ) const

Gets whether timeline is looping.

Deprecated: 1.10: Use get_repeat_count() instead.

Deprecated:
Use get_repeat_count() instead.
Returns
true if the timeline is looping.
double Clutter::Timeline::get_progress ( ) const

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 set_progress_mode(), or by the progress function set using set_progress_func().

Since cluttermm 0.6:
Returns
The normalized current position in the timeline.
AnimationMode Clutter::Timeline::get_progress_mode ( ) const

Retrieves the progress mode set using set_progress_mode() or set_progress_func().

Since cluttermm 1.10:
Returns
A Clutter::AnimationMode.
int Clutter::Timeline::get_repeat_count ( ) const

Retrieves the number set using set_repeat_count().

Since cluttermm 1.10:
Returns
The number of repeats.
static GType Clutter::Timeline::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

ClutterTimeline* Clutter::Timeline::gobj ( )
inline

Provides access to the underlying C GObject.

const ClutterTimeline* Clutter::Timeline::gobj ( ) const
inline

Provides access to the underlying C GObject.

ClutterTimeline* Clutter::Timeline::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

bool Clutter::Timeline::has_marker ( const Glib::ustring marker_name)

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

Since cluttermm 0.8:
Parameters
marker_nameThe name of the marker.
Returns
true if the marker was found.
bool Clutter::Timeline::is_playing ( ) const

Queries state of a Clutter::Timeline.

Returns
true if timeline is currently playing.
std::vector<Glib::ustring> Clutter::Timeline::list_markers ( int  frame_num) const

Retrieves the list of markers at time msecs.

If msecs is a negative integer, all the markers attached to timeline will be returned.

Since cluttermm 0.8:
Parameters
msecsThe time to check, or -1.
n_markersThe number of markers returned.
Returns
A newly allocated, 0 terminated string array containing the names of the markers. Use Glib::strfreev() when done.
virtual void Clutter::Timeline::on_completed ( )
protectedvirtual

This is a default handler for the signal signal_completed().

virtual void Clutter::Timeline::on_marker_reached ( const Glib::ustring marker_name,
int  frame_num 
)
protectedvirtual

This is a default handler for the signal signal_marker_reached().

virtual void Clutter::Timeline::on_new_frame ( int  fram_num)
protectedvirtual

This is a default handler for the signal signal_new_frame().

virtual void Clutter::Timeline::on_paused ( )
protectedvirtual

This is a default handler for the signal signal_paused().

virtual void Clutter::Timeline::on_started ( )
protectedvirtual

This is a default handler for the signal signal_started().

void Clutter::Timeline::pause ( )

Pauses the Clutter::Timeline on current frame.

Glib::PropertyProxy< bool > Clutter::Timeline::property_auto_reverse ( )

Whether the direction should be reversed when reaching the end.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Clutter::Timeline::property_auto_reverse ( ) const

Whether the direction should be reversed when reaching the end.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< guint > Clutter::Timeline::property_delay ( )

Delay before start.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< guint > Clutter::Timeline::property_delay ( ) const

Delay before start.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< TimelineDirection > Clutter::Timeline::property_direction ( )

Direction of the timeline.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< TimelineDirection > Clutter::Timeline::property_direction ( ) const

Direction of the timeline.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< guint > Clutter::Timeline::property_duration ( )

Duration of the timeline in milliseconds.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< guint > Clutter::Timeline::property_duration ( ) const

Duration of the timeline in milliseconds.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< bool > Clutter::Timeline::property_loop ( )

Should the timeline automatically restart.

Deprecated:
Use the “repeat-count” property instead.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Clutter::Timeline::property_loop ( ) const

Should the timeline automatically restart.

Deprecated:
Use the “repeat-count” property instead.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< AnimationMode > Clutter::Timeline::property_progress_mode ( )

How the timeline should compute the progress.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< AnimationMode > Clutter::Timeline::property_progress_mode ( ) const

How the timeline should compute the progress.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< int > Clutter::Timeline::property_repeat_count ( )

How many times the timeline should repeat.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< int > Clutter::Timeline::property_repeat_count ( ) const

How many times the timeline should repeat.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
void Clutter::Timeline::remove_marker ( const Glib::ustring marker_name)

Removes marker_name, if found, from timeline.

Since cluttermm 0.8:
Parameters
marker_nameThe name of the marker to remove.
void Clutter::Timeline::rewind ( )

Rewinds Clutter::Timeline to the first frame if its direction is Clutter::TIMELINE_FORWARD and the last frame if it is Clutter::TIMELINE_BACKWARD.

void Clutter::Timeline::set_auto_reverse ( bool  reverse = true)

Sets whether timeline should reverse the direction after the emission of the Clutter::Timeline::signal_completed() signal.

Setting the Clutter::Timeline::property_auto_reverse() property to true is the equivalent of connecting a callback to the Clutter::Timeline::signal_completed() signal and changing the direction of the timeline from that callback; for instance, this code:

[C example ellipted]

can be effectively replaced by:

[C example ellipted]

Since cluttermm 1.6:
Parameters
reversetrue if the timeline should reverse the direction.
void Clutter::Timeline::set_delay ( guint  msecs)

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

Since cluttermm 0.4:
Parameters
msecsDelay in milliseconds.
void Clutter::Timeline::set_direction ( TimelineDirection  direction)

Sets the direction of timeline, either Clutter::TIMELINE_FORWARD or Clutter::TIMELINE_BACKWARD.

Since cluttermm 0.6:
Parameters
directionThe direction of the timeline.
void Clutter::Timeline::set_duration ( guint  msecs)

Sets the duration of the timeline, in milliseconds.

The speed of the timeline depends on the ClutterTimeline:fps setting.

Since cluttermm 0.6:
Parameters
msecsDuration of the timeline in milliseconds.
void Clutter::Timeline::set_loop ( bool  loop = true)

Sets whether timeline should loop.

This function is equivalent to calling set_repeat_count() with -1 if loop is true, and with 0 if loop is false.

Deprecated: 1.10: Use set_repeat_count() instead.

Deprecated:
Use set_repeat_count() instead.
Parameters
looptrue for enable looping.
void Clutter::Timeline::set_progress_mode ( AnimationMode  mode)

Sets the progress function using a value from the Clutter::AnimationMode enumeration.

The mode cannot be Clutter::CUSTOM_MODE or bigger than Clutter::ANIMATION_LAST.

Since cluttermm 1.10:
Parameters
modeThe progress mode, as a Clutter::AnimationMode.
void Clutter::Timeline::set_repeat_count ( int  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.

Since cluttermm 1.10:
Parameters
countThe number of times the timeline should repeat.
Glib::SignalProxy0< void > Clutter::Timeline::signal_completed ( )
Slot Prototype:
void on_my_completed()

The Clutter::Timeline::signal_completed() signal is emitted when the timeline's elapsed time reaches the value of the Clutter::Timeline::property_duration() property.

This signal will be emitted even if the Clutter::Timeline is set to be repeating.

If you want to get notification on whether the Clutter::Timeline has been stopped or has finished its run, including its eventual repeats, you should use the Clutter::Timeline::signal_stopped() signal instead.

Glib::SignalProxy2< void,const Glib::ustring&,int > Clutter::Timeline::signal_marker_reached ( )
Slot Prototype:
void on_my_marker_reached(const Glib::ustring& marker_name, int frame_num)

The signal_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 signal_marker_reached() signal for a specific marker with:

[C example ellipted]

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.

Since cluttermm 0.8:
Parameters
marker_nameThe name of the marker reached.
msecsThe elapsed time.
Glib::SignalProxy1< void,int > Clutter::Timeline::signal_new_frame ( )
Slot Prototype:
void on_my_new_frame(int fram_num)

The signal_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
msecsThe elapsed time between 0 and duration.
Glib::SignalProxy0< void > Clutter::Timeline::signal_paused ( )
Slot Prototype:
void on_my_paused()

The signal_paused() signal is emitted when Clutter::Timeline::pause() is invoked.

Glib::SignalProxy0< void > Clutter::Timeline::signal_started ( )
Slot Prototype:
void on_my_started()

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

void Clutter::Timeline::skip ( guint  n_frames)

Advance timeline by the requested time in milliseconds.

Parameters
msecsAmount of time to skip.
void Clutter::Timeline::start ( )

Starts the Clutter::Timeline playing.

void Clutter::Timeline::stop ( )

Stops the Clutter::Timeline and moves to frame 0.

Friends And Related Function Documentation

Glib::RefPtr< Clutter::Timeline > wrap ( ClutterTimeline *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:
  • cluttermm/timeline.h