static void foreach_running_timeline (gpointer key, gpointer value, gpointer user_data) { ClutterScoreEntry *entry = value; gint action = GPOINTER_TO_INT (user_data); switch (action) { case ACTION_START: clutter_timeline_start (entry->timeline); break; case ACTION_PAUSE: clutter_timeline_pause (entry->timeline); break; case ACTION_STOP: if (entry->complete_id) { g_signal_handler_disconnect (entry->timeline, entry->complete_id); entry->complete_id = 0; } clutter_timeline_stop (entry->timeline); break; } }
static gboolean red_button_press (ClutterActor *actor, ClutterButtonEvent *event, gpointer data) { GObject *timeline; g_print ("[*] Pressed `%s'\n", clutter_get_script_id (G_OBJECT (actor))); timeline = clutter_script_get_object (script, "main-timeline"); g_assert (CLUTTER_IS_TIMELINE (timeline)); if (!clutter_timeline_is_playing (CLUTTER_TIMELINE (timeline))) clutter_timeline_start (CLUTTER_TIMELINE (timeline)); else clutter_timeline_pause (CLUTTER_TIMELINE (timeline)); return TRUE; }
/** * clutter_timeline_stop: * @timeline: A #ClutterTimeline * * Stops the #ClutterTimeline and moves to frame 0 **/ void clutter_timeline_stop (ClutterTimeline *timeline) { clutter_timeline_pause (timeline); clutter_timeline_rewind (timeline); }