QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Q::Playback Struct Reference
[Animation]

Animation data to Object connector. More...

#include <Q/q.h>

Inheritance diagram for Q::Playback:

Q::ObjectBase List of all members.

Public Types

enum  Mode {
  replace,
  queue
}

Public Member Functions

Utils::Result playAnimation (Mode mode, const Animation &anim, float speed, float tweenDelay, float start, float end)
Utils::Result playAnimation (Mode mode, const Animation &anim, float speed, float tweenDelay)
Utils::Result seek (const Animation &, float time)
Utils::Result getAnimation (Mode mode, Animation &anim, float &speed, float &tweenDelay, float &start, float &end)
float speed () const
Utils::Result setSpeed (float speed)
Utils::Result addListener (PlaybackListener &listener)
Utils::Result removeListener (PlaybackListener &listener)

Static Public Member Functions

Playback create ()
Playback cast (const ObjectBase &)
ClassType classType ()

Detailed Description

Animation data to Object connector.

The Playback object is used with the Animation object to initiate and control animation playback on an object.


Member Enumeration Documentation

enum Q::Playback::Mode
 

A new animation playback can be started in various ways depending on how to handle cutting from the currently playing animation.

Enumeration values:
replace  Replace the current animation.
queue  Queue this animation after the current one.


Member Function Documentation

Utils::Result Q::Playback::addListener PlaybackListener listener  ) 
 

Add a listener object which is called for animation events.

Playback Q::Playback::cast const ObjectBase  )  [static]
 

If the object referenced by obj is a playback, then return a suitable Playback reference to the object.

ClassType Q::Playback::classType  )  [static]
 

Return the type for this class.

Playback Q::Playback::create  )  [static]
 

Create a new playback object.

Utils::Result Q::Playback::getAnimation Mode  mode,
Animation anim,
float &  speed,
float &  tweenDelay,
float &  start,
float &  end
 

Return the details of either the currently playing or queued animation segment, depending on the value of mode. The values returned in speed, tween, start and end can be used to start a new playback which is in an identical state

  • e.g. tween is set to the amount of time left in the current animation's tween stage (if any), start is set to the start time of the animation, if mid-tween, or the current time of the animation otherwise. end is set to the end time of the animation. If no animation with the given mode exists, return ENoAnimation, otherwise return Utils::Success.

Utils::Result Q::Playback::playAnimation Mode  mode,
const Animation anim,
float  speed,
float  tweenDelay
 

Play the entire contents of an animation (i.e. starting at the animation's start time and finishing at the animation's end time).

Utils::Result Q::Playback::playAnimation Mode  mode,
const Animation anim,
float  speed,
float  tweenDelay,
float  start,
float  end
 

Play part of an animation at the given speed through this playback object. The new animation either replaces the current animation (if any) or is queued to start after it. Only one level of queued animation is supported - queueing an animation replaces any currently queued animation. If the new animation is replacing an existing one, any queued animation is also cancelled.

When the new animation starts (either now or after the current animation finishes), the current values of the playback's channels are interpolated from their current positions to the start position of the animation's channels. The time taken for this interpolation is tweenDelay. For a hard cut to the new animation, specify a tweenDelay value of zero.

To cancel a queued animation, call Playback::playAnimation with a null animation handle and mode Playback::queue. To cancel both the currently playing animation and any currently queued animation, call Playback::playAnimation with a null animation handle and mode Playback::replace.

Utils::Result Q::Playback::removeListener PlaybackListener listener  ) 
 

Remove a listener object which is called for animation events.

Utils::Result Q::Playback::seek const Animation ,
float  time
 

Synchronously move to the specified time in the specified animation. Unlike the asynchronous playAnimation, any objects being animated with this playback are immediately updated.

Note:
calling this method only affects the objects which have it at the time of the call. Objects which get a playback on which Playback::seek has been previously called do not have their state updated.
Warning:
This method can only be called when the playback is not active, i.e. no animation is being played. Otherwise it fails and returns Utils::Failure.

Utils::Result Q::Playback::setSpeed float  speed  ) 
 

Set the speed of the currently playing animation. This speed is multiplied by the speed specified for the currently playing animation, allowing independent control of the entire sequence of animations. The value of speed must be greater than or equal to zero. Returns Utils::InvalidArgument if speed is negative, Utils::Success otherwise.

float Q::Playback::speed  )  const
 

Return the speed of the currently playing animation.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004