summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippo Argiolas <filippo.argiolas@gmail.com>2009-04-05 21:37:19 +0200
committerFilippo Argiolas <filippo.argiolas@gmail.com>2009-04-05 21:37:19 +0200
commitf149e818e1091aeac0aa12971750508dcf05a665 (patch)
tree3a9c89ec8d0045eed5e959283a2d04eb70a10df7
parent89be731f82ed2b5c1d6b9288f7ffdf4fd3f0c85c (diff)
Stop previous animation before starting new one
-rw-r--r--src/cheese-stage.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/cheese-stage.c b/src/cheese-stage.c
index 005118a..60e7a14 100644
--- a/src/cheese-stage.c
+++ b/src/cheese-stage.c
@@ -71,9 +71,15 @@ create_window (GstBus * bus, GstMessage * message, gpointer data)
static gboolean
on_enter_animate (ClutterActor *actor, ClutterEvent *event, gpointer data)
{
- clutter_actor_animate (actor, CLUTTER_LINEAR, 200,
- "scale-x", 1.0,
- "scale-y", 1.0,
+ ClutterAnimation *previous_animation;
+
+ previous_animation = clutter_actor_get_animation (actor);
+ if (previous_animation)
+ clutter_animation_completed (previous_animation);
+
+ clutter_actor_animate (actor, CLUTTER_LINEAR, 250,
+ "scale-x", 0.99,
+ "scale-y", 0.99,
NULL);
return TRUE;
}
@@ -81,7 +87,13 @@ on_enter_animate (ClutterActor *actor, ClutterEvent *event, gpointer data)
static gboolean
on_leave_animate (ClutterActor *actor, ClutterEvent *event, gpointer data)
{
- clutter_actor_animate (actor, CLUTTER_LINEAR, 200,
+ ClutterAnimation *previous_animation;
+
+ previous_animation = clutter_actor_get_animation (actor);
+ if (previous_animation)
+ clutter_animation_completed (previous_animation);
+
+ clutter_actor_animate (actor, CLUTTER_LINEAR, 250,
"scale-x", 0.95,
"scale-y", 0.95,
NULL);
@@ -157,7 +169,7 @@ main (int argc, char *argv[])
*/
desc = g_strdup_printf ("videotestsrc ! "
- "video/x-raw-rgb, width=%d, height=%d, framerate=10/1 ! ffmpegcolorspace ! identity", W, H);
+ "video/x-raw-rgb, width=%d, height=%d, framerate=10/1 ! ffmpegcolorspace ! identity", W, H);
pipeline = GST_PIPELINE (gst_pipeline_new (NULL));
srcbin = gst_parse_bin_from_description (desc, TRUE, NULL);