Guiliani  Version 2.6 revision 7293 (documentation build 12)
CGUIAnimationHandler Class Reference

The AnimationHandler is the management class for animations. More...

#include <GUIAnimationHandler.h>

Public Types

typedef eC_TListDoubleLinked< CGUIAnimationChain * > AnimationChainPtrList
 The animation chain pointer list is a double-linked list of animation chain pointers.
 
typedef eC_TListDoubleLinked< CGUIAnimation * > AnimationPtrList
 The animation pointer list is a double-linked list of animation pointers.
 
enum  DeletionPolicy_t { DP_STOP , DP_REMOVE }
 

Public Member Functions

void AssignNewId (CGUIAnimation *pkAnimation)
 
void AssignNewId (CGUIAnimationChain *pkAnimationChain)
 
void DeInit ()
 
CGUIAnimationGetAnimation (eC_UInt uiID) const
 
CGUIAnimationChainGetAnimationChain (eC_UInt uiID) const
 
const AnimationChainPtrListGetAnimationChains (void) const
 
AnimationPtrList GetAnimations (const CGUIObject *pkObjToCheck) const
 
AnimationPtrList GetAnimationsOfObject (const CGUIObject *pkObject)
 
eC_UInt GetDefaultStepTime () const
 
DeletionPolicy_t GetDeletionPolicy () const
 
void NotifyOfDestruction (CGUIAnimation *pkAnimation)
 
void NotifyOfDestruction (CGUIAnimationChain *pkAnimationChain)
 
void NotifyOfDestruction (CGUIAnimationObserver *pkObserver)
 
void NotifyOfDestruction (CGUIObject *pkDeletedObject)
 
eC_Bool ObjHasAnimations (const CGUIObject *pkObjToCheck) const
 
eC_Bool ReadAnimationsFromFile (const eC_String &rkPath)
 
void ReadFromStream ()
 
eC_Bool RemoveAnimation (const AnimationHandle_t &eAnimation)
 
void SetDefaultSteptime (const eC_UInt &uiDefaultStepTime)
 
void SetDeletionPolicy (const DeletionPolicy_t &eDeletionPolicy)
 
void SetID (CGUIAnimation *pkAnimation, const eC_UInt &uiID)
 
void SetID (CGUIAnimationChain *pkAnimationChain, const eC_UInt &uiID)
 
void StartAllAnimationChains ()
 
void StartAnimationChain (const eC_UInt &uiID)
 
void StopAllAnimationChains ()
 
void StopAllAnimations ()
 
void StopAllAnimations (CGUIObject *pkAnimatedObject)
 
void StopAnimationChain (const eC_UInt &uiID)
 
eC_Bool WriteAnimationsToFile (const eC_String &rkPath)
 
void WriteToStream ()
 

Static Public Member Functions

static void CreateInstance ()
 
static void DeleteInstance ()
 

Friends

class CGUIAnimation
 
class CGUIAnimationChain
 
class CGUIComponentManager
 
class CGUILoadAnimationsCmd
 

Detailed Description

The AnimationHandler is the management class for animations.

It takes ownership for all animations and animation chains. When a GUIObject is deleted, the AnimationHandler is informed and deletes all animations that are animating this object.

When an animation or an animation chain is created, they are registered in the animation handler. The AnimationHandler will generate a unique id and sets it in the generated animation or animation chain.

When an animation, an animation chain or an animation observer is deleted, the animation handler is informed. The respective destructor calls NotifyOfDestruction().

The animation handler as owner of animations provides the interface to access an animation or an animation chain based on the unique id which was set when the object was instantiated

Store the unique id when creating the animation.

CGUIAnimationMove* pAnimation = new CGUIAnimationMove(pkAnimatedObject, CGUIEasing::EASE_NONE, CGUIEasing::EASE_NONE, uiDuration);
m_myAnimationID = pAnimation->GetID();
eC_UInt GetID() const
Definition: GUIAnimation.h:184
This animation translates a CGUIObject from a start position to a target position.
Definition: GUIAnimationMove.h:54

Later access the animation by the ID to start it.

CGUIAnimationMove* pAnimation = GETANIMATIONHDL.GetAnimation(m_myAnimationID);
if (pAnimation != NULL)
{
pAnimation->StartAnimation();
}
void StartAnimation()

It is also possible to check if an GUIObject has animations (i.e. if there are animations that are animating the object) by calling ObjHasAnimations() and to get the list of all animations by calling GetAnimations().

Member Enumeration Documentation

◆ DeletionPolicy_t

policy when objects that are used in animations are deleted

Enumerator
DP_STOP 

stop the animation

DP_REMOVE 

remove the animation

Member Function Documentation

◆ AssignNewId() [1/2]

void CGUIAnimationHandler::AssignNewId ( CGUIAnimation pkAnimation)

Generates a new unique animation id and assigns it to the animation.

Parameters
pkAnimationanimation which id will be changed

◆ AssignNewId() [2/2]

void CGUIAnimationHandler::AssignNewId ( CGUIAnimationChain pkAnimationChain)

Generates a new unique animation chain id and assigns it to the animation chain.

Parameters
pkAnimationChainanimation-chain whose id will be changed

◆ CreateInstance()

static void CGUIAnimationHandler::CreateInstance ( )
static

Create Instance

◆ DeInit()

void CGUIAnimationHandler::DeInit ( )

Delete and remove all remaining animations and animation chains.

◆ DeleteInstance()

static void CGUIAnimationHandler::DeleteInstance ( )
static

Delete Instance

◆ GetAnimation()

CGUIAnimation * CGUIAnimationHandler::GetAnimation ( eC_UInt  uiID) const
Parameters
uiIDThe unique ID of the Animation.
Returns
Pointer to the animation that is mapped to the id or NULL if the id is invalid.

◆ GetAnimationChain()

CGUIAnimationChain * CGUIAnimationHandler::GetAnimationChain ( eC_UInt  uiID) const
Parameters
uiIDThe unique ID of the AnimationChain.
Returns
Pointer to the animation chain that is mapped to the id or NULL if the id is invalid.

◆ GetAnimationChains()

const AnimationChainPtrList * CGUIAnimationHandler::GetAnimationChains ( void  ) const

Get all existing animation chains.

Returns
Pointer to a list of all existing animation chains. Value is NULL if no chain exists.

◆ GetAnimations()

AnimationPtrList CGUIAnimationHandler::GetAnimations ( const CGUIObject pkObjToCheck) const

Get all animations that are mapped to an object.

Parameters
pkObjToCheckThe GUIObject that is animated.
Returns
A list of all animations that are animating the object.

◆ GetAnimationsOfObject()

AnimationPtrList CGUIAnimationHandler::GetAnimationsOfObject ( const CGUIObject pkObject)

Returns a list of all animations that are animating an object.

Parameters
pkObjectThe object whose animations shall be returned.
Returns
A list of animation pointers

◆ GetDefaultStepTime()

eC_UInt CGUIAnimationHandler::GetDefaultStepTime ( ) const

Get the currently set default step-time

Returns
step-time

◆ GetDeletionPolicy()

DeletionPolicy_t CGUIAnimationHandler::GetDeletionPolicy ( ) const

Get the currently used policy when objects are deleted

Returns
the policy

◆ NotifyOfDestruction() [1/4]

void CGUIAnimationHandler::NotifyOfDestruction ( CGUIAnimation pkAnimation)

Called by the destructor of CGUIAnimation. The Animation will be removed from the internal list.

Parameters
pkAnimationThe destroyed animation.

◆ NotifyOfDestruction() [2/4]

void CGUIAnimationHandler::NotifyOfDestruction ( CGUIAnimationChain pkAnimationChain)

Called by the destructor of CGUIAnimationChain. The Animation will be removed from the internal list.

Parameters
pkAnimationChainThe destroyed animation chain.

◆ NotifyOfDestruction() [3/4]

void CGUIAnimationHandler::NotifyOfDestruction ( CGUIAnimationObserver pkObserver)

Called whenever a AnimationObserver is deleted. Sets the observer pointer for all animations that are using this observer to NULL.

Parameters
pkObserverThe animation observer which will be deleted.

◆ NotifyOfDestruction() [4/4]

void CGUIAnimationHandler::NotifyOfDestruction ( CGUIObject pkDeletedObject)

Called by the destructor of CGUIObject. Removes all animations of the object.

Parameters
pkDeletedObjectThe object which was deleted.

◆ ObjHasAnimations()

eC_Bool CGUIAnimationHandler::ObjHasAnimations ( const CGUIObject pkObjToCheck) const

Check if an animation was added that animates an object.

Parameters
pkObjToCheckThe object to check.
Returns
True if animations for pObjToCheck are available, otherwise False.

◆ ReadAnimationsFromFile()

eC_Bool CGUIAnimationHandler::ReadAnimationsFromFile ( const eC_String &  rkPath)

Read all animations and animation chains from file and adds them to the internal animation list.

Parameters
rkPathThe path to the animation file.
Returns
True if all animations were successfully read, otherwise False.

◆ ReadFromStream()

void CGUIAnimationHandler::ReadFromStream ( )

Read from streaming-file

◆ RemoveAnimation()

eC_Bool CGUIAnimationHandler::RemoveAnimation ( const AnimationHandle_t eAnimation)

Remove the animation with the specified id

Parameters
eAnimationid of the animation
Returns
true if successful

◆ SetDefaultSteptime()

void CGUIAnimationHandler::SetDefaultSteptime ( const eC_UInt &  uiDefaultStepTime)

Set the default step-time to be used when animations are set to 0

Parameters
uiDefaultStepTimestep-time

◆ SetDeletionPolicy()

void CGUIAnimationHandler::SetDeletionPolicy ( const DeletionPolicy_t eDeletionPolicy)

Set the policy to be used when objects are deleted that are used in animations

Parameters
eDeletionPolicypolicy to use

◆ SetID() [1/2]

void CGUIAnimationHandler::SetID ( CGUIAnimation pkAnimation,
const eC_UInt &  uiID 
)

Set ID of Animation to given value. Will not change ID on collisions.

Parameters
pkAnimationanimation
uiIDID

◆ SetID() [2/2]

void CGUIAnimationHandler::SetID ( CGUIAnimationChain pkAnimationChain,
const eC_UInt &  uiID 
)

Set ID of AnimationChain to given value. Will not change ID on collisions

Parameters
pkAnimationChainanimation-chain
uiIDID

◆ StartAllAnimationChains()

void CGUIAnimationHandler::StartAllAnimationChains ( )

Start all animation-chains

◆ StartAnimationChain()

void CGUIAnimationHandler::StartAnimationChain ( const eC_UInt &  uiID)

Start animation-chain with id

Parameters
uiIDid of animation-chain to start

◆ StopAllAnimationChains()

void CGUIAnimationHandler::StopAllAnimationChains ( )

Stop all currently running animation-chains

◆ StopAllAnimations() [1/2]

void CGUIAnimationHandler::StopAllAnimations ( )

Stops all animations that were added to the animation handler.

◆ StopAllAnimations() [2/2]

void CGUIAnimationHandler::StopAllAnimations ( CGUIObject pkAnimatedObject)

Stops all animations that are animating a specific GUIObject.

Parameters
pkAnimatedObjectThe Object that is animated by the animations that shall be stopped.

◆ StopAnimationChain()

void CGUIAnimationHandler::StopAnimationChain ( const eC_UInt &  uiID)

Stop animation-chain with id

Parameters
uiIDid of animation-chain to stop

◆ WriteAnimationsToFile()

eC_Bool CGUIAnimationHandler::WriteAnimationsToFile ( const eC_String &  rkPath)

Write all animations and animation chains to file.

Parameters
rkPathThe path to the animation file.
Returns
True if all animations were successfully written, otherwise False.

◆ WriteToStream()

void CGUIAnimationHandler::WriteToStream ( )

Write to streaming-file

Friends And Related Function Documentation

◆ CGUIAnimation

friend class CGUIAnimation
friend

◆ CGUIAnimationChain

friend class CGUIAnimationChain
friend

◆ CGUIComponentManager

friend class CGUIComponentManager
friend

◆ CGUILoadAnimationsCmd

friend class CGUILoadAnimationsCmd
friend

The documentation for this class was generated from the following file: