From 144cf2299a4f0c560f9b6c08076288e8c8cd86ec Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 5 Nov 2002 20:51:13 +0000 Subject: [PATCH] Provide a timestamp with animation events. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1904 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../animation/AnimationCompletedEvent.java | 6 +++--- .../media/animation/AnimationEvent.java | 17 +++++++++++++++-- .../media/animation/FrameReachedEvent.java | 7 ++++--- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/java/com/threerings/media/animation/AnimationCompletedEvent.java b/src/java/com/threerings/media/animation/AnimationCompletedEvent.java index 215ef52f0..d36aab11d 100644 --- a/src/java/com/threerings/media/animation/AnimationCompletedEvent.java +++ b/src/java/com/threerings/media/animation/AnimationCompletedEvent.java @@ -1,5 +1,5 @@ // -// $Id: AnimationCompletedEvent.java,v 1.1 2002/01/11 16:17:33 shaper Exp $ +// $Id: AnimationCompletedEvent.java,v 1.2 2002/11/05 20:51:13 mdb Exp $ package com.threerings.media.animation; @@ -9,8 +9,8 @@ package com.threerings.media.animation; */ public class AnimationCompletedEvent extends AnimationEvent { - public AnimationCompletedEvent (Animation anim) + public AnimationCompletedEvent (Animation anim, long when) { - super(anim); + super(anim, when); } } diff --git a/src/java/com/threerings/media/animation/AnimationEvent.java b/src/java/com/threerings/media/animation/AnimationEvent.java index 8f643460a..493b67d82 100644 --- a/src/java/com/threerings/media/animation/AnimationEvent.java +++ b/src/java/com/threerings/media/animation/AnimationEvent.java @@ -1,5 +1,5 @@ // -// $Id: AnimationEvent.java,v 1.1 2002/01/11 16:17:33 shaper Exp $ +// $Id: AnimationEvent.java,v 1.2 2002/11/05 20:51:13 mdb Exp $ package com.threerings.media.animation; @@ -13,10 +13,12 @@ public class AnimationEvent * Create an animation event. * * @param animation the involved animation. + * @param when the time at which this event took place. */ - public AnimationEvent (Animation anim) + public AnimationEvent (Animation anim, long when) { _anim = anim; + _when = when; } /** @@ -27,6 +29,17 @@ public class AnimationEvent return _anim; } + /** + * Returns the time associated with this event. + */ + public long getWhen () + { + return _when; + } + /** The animation associated with this event. */ protected Animation _anim; + + /** The time associated with this event. */ + protected long _when; } diff --git a/src/java/com/threerings/media/animation/FrameReachedEvent.java b/src/java/com/threerings/media/animation/FrameReachedEvent.java index 5c31f84ab..a20f735c1 100644 --- a/src/java/com/threerings/media/animation/FrameReachedEvent.java +++ b/src/java/com/threerings/media/animation/FrameReachedEvent.java @@ -1,5 +1,5 @@ // -// $Id: FrameReachedEvent.java,v 1.1 2002/09/20 21:35:11 ray Exp $ +// $Id: FrameReachedEvent.java,v 1.2 2002/11/05 20:51:13 mdb Exp $ package com.threerings.media.animation; @@ -11,9 +11,10 @@ public class FrameReachedEvent extends AnimationEvent /** * Construct a FrameReachedEvent. */ - public FrameReachedEvent (Animation anim, int frameIdx, int frameSeq) + public FrameReachedEvent (Animation anim, long when, + int frameIdx, int frameSeq) { - super(anim); + super(anim, when); _frameIdx = frameIdx; _frameSeq = frameSeq; }