Next: ClutterScriptable, Previous: ClutterRectangle, Up: Top
Controller for multiple timelines
<clutter-score> is a base class for sequencing multiple timelines in
order. Using <clutter-score> it is possible to start multiple timelines
at the same time or launch multiple timelines when a particular timeline has
emitted the ClutterTimeline::completed signal.
Each time a <clutter-timeline> is started and completed, a signal will be
emitted.
For example, this code will start two <clutter-timeline>s after a third
timeline terminates:
ClutterTimeline *timeline_1, *timeline_2, *timeline_3;
ClutterScore *score;
timeline_1 = clutter_timeline_new_for_duration (1000);
timeline_2 = clutter_timeline_new_for_duration (500);
timeline_3 = clutter_timeline_new_for_duration (500);
score = clutter_score_new ();
clutter_score_append (score, NULL, timeline_1);
clutter_score_append (score, timeline_1, timeline_2);
clutter_score_append (score, timeline_1, timeline_3);
clutter_score_start ();
A <clutter-score> takes a reference on the timelines it manages, so
timelines can be safely unreferenced after being appended.
New timelines can be appended to the <clutter-score> using
clutter-score-append and removed using clutter-score-remove.
Timelines can also be appended to a specific marker on the parent timeline,
using clutter-score-append-at-marker.
The score can be cleared using clutter-score-remove-all.
The list of timelines can be retrieved using
clutter-score-list-timelines.
The score state is controlled using clutter-score-start,
clutter-score-pause, clutter-score-stop and
clutter-score-rewind. The state can be queried using
clutter-score-is-playing.
<clutter-score> is available since Clutter 0.6
Derives from
<gobject>.This class defines the following slots:
loop- Whether the score should restart once finished
The ::completed signal is emitted each time a
<clutter-score>terminates.Since 0.6
The ::started signal is emitted each time a
<clutter-score>starts playing.Since 0.6
The ::paused signal is emitted each time a
<clutter-score>is paused.Since 0.6
<clutter-timeline>)The ::timeline-started signal is emitted each time a new timeline inside a
<clutter-score>starts playing.Since 0.6
<clutter-timeline>)The ::timeline-completed signal is emitted each time a timeline inside a
<clutter-score>terminates.Since 0.6
<clutter-score>)Creates a new
<clutter-score>. A<clutter-score>is an object that can hold multiple<clutter-timeline>s in a sequential order.
- ret
- the newly created
<clutter-score>. Useg-object-unrefwhen done.Since 0.6
<clutter-score>) (loop bool)Sets whether score should loop. A looping
<clutter-score>will start from its initial state after the ::complete signal has been fired.
- score
- a
<clutter-score>- loop
- ‘
#t’ for enable loopingSince 0.6
<clutter-score>) (ret bool)Gets whether score is looping
- score
- a
<clutter-score>- ret
- ‘
#t’ if the score is loopingSince 0.6
<clutter-score>) (parent <clutter-timeline>) (timeline <clutter-timeline>) (ret unsigned-long)Appends a timeline to another one existing in the score; the newly appended timeline will be started when parent is complete.
If parent is ‘
#f’, the new<clutter-timeline>will be started whenclutter-score-startis called.
<clutter-score>will take a reference on timeline.
- score
- a
<clutter-score>- parent
- a
<clutter-timeline>in the score, or ‘#f’- timeline
- a
<clutter-timeline>- ret
- the id of the
<clutter-timeline>inside the score, or 0 on failure. The returned id can be used withclutter-score-removeorclutter-score-get-timeline.Since 0.6
<clutter-score>) (parent <clutter-timeline>) (marker_name mchars) (timeline <clutter-timeline>) (ret unsigned-long)Appends timeline at the given marker-name on the parent
<clutter-timeline>.If you want to append timeline at the end of parent, use
clutter-score-append.The
<clutter-score>will take a reference on timeline.
- score
- a
<clutter-score>- parent
- the parent
<clutter-timeline>- marker-name
- the name of the marker to use
- timeline
- the
<clutter-timeline>to append- ret
- the id of the
<clutter-timeline>inside the score, or 0 on failure. The returned id can be used withclutter-score-removeorclutter-score-get-timeline.Since 0.8
<clutter-score>) (id unsigned-long)Removes the
<clutter-timeline>with the given id inside score. If the timeline has other timelines attached to it, those are removed as well.
- score
- a
<clutter-score>- id
- the id of the timeline to remove
Since 0.6
<clutter-score>)Removes all the timelines inside score.
- score
- a
<clutter-score>Since 0.6
<clutter-score>) (id unsigned-long) (ret <clutter-timeline>)Retrieves the
<clutter-timeline>for id inside score.
- score
- a
<clutter-score>- id
- the id of the timeline
- ret
- the requested timeline, or ‘
#f’. This function does not increase the reference count on the returned<clutter-timeline>Since 0.6
<clutter-score>) (ret gslist-of)Retrieves a list of all the
<clutter-timelines>managed by score.
- score
- a
<clutter-score>- ret
- a
<gs-list>containing all the timelines in the score. This function does not increase the reference count of the returned timelines. Useg-slist-freeon the returned list to deallocate its resources.Since 0.6
<clutter-score>)Starts the score.
- score
- A
<clutter-score>Since 0.6
<clutter-score>)Pauses a playing score score.
- score
- a
<clutter-score>Since 0.6
<clutter-score>)Stops and rewinds a playing
<clutter-score>instance.
- score
- A
<clutter-score>Since 0.6