Guiliani  Version 2.4 revision 5970 (build 3)
CGUIAnimationChain Class Reference

An AnimationChain is a combination of several independent animations. More...

#include <GUIAnimationChain.h>

Inheritance diagram for CGUIAnimationChain:

Classes

struct  AnimationInfo_t
 Holds the animation id and the offset for each animation. More...
 

Public Types

enum  AnimationChain_t { PARALLEL_ANIMATION, CHAINED_ANIMATION }
 Defines the chain type. More...
 
typedef eC_TListDoubleLinked< AnimationInfo_tAnimationList_t
 The animation list is a double-linked list of animation info structs.
 

Public Member Functions

 CGUIAnimationChain (const AnimationChain_t eType, const eC_Bool bCyclic=false)
 
 CGUIAnimationChain ()
 
virtual ~CGUIAnimationChain ()
 Destructor.
 
void AddAnimation (CGUIAnimation *pkAnimation, eC_UInt uiTimeOffset=0)
 
void ContinueAnimation ()
 
virtual void DoAnimate (const eC_Value &vTimes=eC_FromInt(1))
 
const CGUIAnimationGetAnimation (eC_UInt uiID)
 
const AnimationList_tGetAnimations ()
 
AnimationChain_t GetChainType ()
 
eC_Bool GetCyclicAnimation () const
 
eC_UInt GetID ()
 
virtual eC_Bool IsAnimating () const
 
eC_Bool IsPaused () const
 
void OnStatusChanged (CGUIAnimation::AnimationStatus_t eStatus, CGUIAnimation *pAnimation)
 
void PauseAnimation ()
 
void ReadFromStream ()
 
void RemoveAllAnimations ()
 
void RemoveAnimation (CGUIAnimation *pkAnimation)
 
void SetCyclicAnimation (const eC_Bool bCyclicAnimation)
 
void StartAnimation ()
 
void StopAnimation ()
 
void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIAnimatable
virtual ~CGUIAnimatable ()
 Destructor. Removes all existing animation callbacks.
 
- Public Member Functions inherited from CGUIAnimationObserver
virtual ~CGUIAnimationObserver ()
 
- Public Member Functions inherited from CGUIStreamableObject
const eC_String & GetXMLTag () const
 
void SetXMLTag (const eC_String &kXMLTag)
 

Static Public Attributes

static const eC_UInt ANIMATION_CHAIN_CLASS_VERSION = 2
 The class version of the animation chain class.
 
- Static Public Attributes inherited from CGUIStreamableObject
static const eC_Char XMLTAG_CLASSVERSION [] = "ClassVersion"
 

Friends

class CGUIAnimationHandler
 

Additional Inherited Members

- Protected Member Functions inherited from CGUIStreamableObject
eC_UInt ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const
 
void WriteStreamingFooter (const eC_Bool &bWriteClassID) const
 
void WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const
 

Detailed Description

An AnimationChain is a combination of several independent animations.

The animations can be started one after the other, or in parallel. For each animation which is added an optional time offset can be defined.

For an AnimationChain which allows parallel animations (AnimationChain_t::PARALLEL_ANIMATION), this offset is relative to the start time of the AnimationChain. For an AnimationChain which does not allow parallel execution(AnimationChain_t::CHAINED_ANIMATION), the time offset is relative to the end of the previous animation.

Each animation which is added to the animation chain will be added to the CGUIAnimationHandler.

Example:

CGUIAnimation* pAnimation;
pAnimation = new CGUIAnimationMove(pkMessageBox, CGUIEasing::EASE_IN_OUT_SINE, CGUIEasing::EASE_IN_OUT_SINE,
GETGUI.GetHalfWidth() - pkMessageBox->GetHalfWidth(),
GETGUI.GetHalfHeight() - pkMessageBox->GetHalfHeight(),
eC_FromInt(0),
eC_FromInt(0), 1000);
pChain->AddAnimation(pAnimation,0);
pAnimation = new CGUIAnimationMove(pkMessageBox, CGUIEasing::EASE_IN_OUT_SINE, CGUIEasing::EASE_NONE,
eC_FromInt(0),
eC_FromInt(0),
GETGUI.GetWidth() - pkMessageBox->GetWidth(),
eC_FromInt(0), 1000);
pChain->AddAnimation(pAnimation,2000);
// Start the animation chain.
pChain->StartAnimation();

Member Enumeration Documentation

◆ AnimationChain_t

Defines the chain type.

Enumerator
PARALLEL_ANIMATION 

Each animation is started based on its offset relative to the start of the animation chain.

CHAINED_ANIMATION 

The animations are started one after the other. The offset is used as time between the animations.

Constructor & Destructor Documentation

◆ CGUIAnimationChain() [1/2]

CGUIAnimationChain::CGUIAnimationChain ( const AnimationChain_t  eType,
const eC_Bool  bCyclic = false 
)

Constructor

Parameters
eTypeThe type of the animation chain.
bCyclicDefines if the chain starts at the beginning again, when the last animation is finished.

◆ CGUIAnimationChain() [2/2]

CGUIAnimationChain::CGUIAnimationChain ( )

Default constructor used by the factory.

Member Function Documentation

◆ AddAnimation()

void CGUIAnimationChain::AddAnimation ( CGUIAnimation pkAnimation,
eC_UInt  uiTimeOffset = 0 
)

Add an animation. The animation is owned and handled by the AnimationChain.

Parameters
pkAnimationThe animation to add.
uiTimeOffsetThe offset relative to the previous animation in case of CHAINED_ANIMATION or relative to the animation start in case of PARALLEL_ANIMATION.

◆ ContinueAnimation()

void CGUIAnimationChain::ContinueAnimation ( )

Continue the execution of the animation chain. The timer callback will be restored (installed again).

◆ DoAnimate()

void CGUIAnimationChain::DoAnimate ( const eC_Value &  vTimes = eC_FromInt(1))
virtual

Timer callback for the animation chain which is used to handle the animation offsets.

Parameters
vTimesIgnored by base class, used by implemented animation to compensate for jitter

Reimplemented from CGUIAnimatable.

◆ GetAnimation()

const CGUIAnimation * CGUIAnimationChain::GetAnimation ( eC_UInt  uiID)
Parameters
uiIDThe animation ID
Returns
The animation with the ID "uiID" if part of the animation chain else NULL

◆ GetAnimations()

const AnimationList_t* CGUIAnimationChain::GetAnimations ( )
inline
Returns
The list of animations which are part of the chain.

◆ GetChainType()

AnimationChain_t CGUIAnimationChain::GetChainType ( )
inline
Returns
The type of the animation chain.

◆ GetCyclicAnimation()

eC_Bool CGUIAnimationChain::GetCyclicAnimation ( ) const
inline
Returns
True if cyclic animation is activated, else False.

◆ GetID()

eC_UInt CGUIAnimationChain::GetID ( )
inline
Returns
The unique id of the animation chain.

◆ IsAnimating()

eC_Bool CGUIAnimationChain::IsAnimating ( ) const
virtual

Checks if the animation chain is currently animating.

Returns
True if an animation callback is registered, otherwise False.

Reimplemented from CGUIAnimatable.

◆ IsPaused()

eC_Bool CGUIAnimationChain::IsPaused ( ) const

Checks if the animation chain is currently paused.

Returns
True if an animation chain is currently paused

◆ OnStatusChanged()

void CGUIAnimationChain::OnStatusChanged ( CGUIAnimation::AnimationStatus_t  eStatus,
CGUIAnimation pAnimation 
)
virtual

Called by the animations when they are finished or deleted. This is used for chained animations.

Parameters
eStatusThe new status of the animation.
pAnimationThe Animation whose status is updated.

Implements CGUIAnimationObserver.

◆ PauseAnimation()

void CGUIAnimationChain::PauseAnimation ( )

Pause the execution of an animation chain. This includes pausing of the gaps (time offset) between animations. The timer callback will be removed.

◆ ReadFromStream()

void CGUIAnimationChain::ReadFromStream ( )
virtual

Reads attributes from the streaming file. Only for use with GUIFactoryManager.

See also
CGUIObject::ReadFromStream()

Reimplemented from CGUIStreamableObject.

◆ RemoveAllAnimations()

void CGUIAnimationChain::RemoveAllAnimations ( )

Remove all contained animations. This only clears the internal list. It does NOT delete any animation!

◆ RemoveAnimation()

void CGUIAnimationChain::RemoveAnimation ( CGUIAnimation pkAnimation)

Remove an animation. This only removes the animation from internal list. It does NOT delete the animation!

Parameters
pkAnimationThe animation to remove.

◆ SetCyclicAnimation()

void CGUIAnimationChain::SetCyclicAnimation ( const eC_Bool  bCyclicAnimation)
inline

Activate or deactivate cyclic animation. The chain will restart at the beginning after the last animation finished, if cyclic animation is activated.

Parameters
bCyclicAnimationTrue to activate cyclic animation, false to deactivate.

◆ StartAnimation()

void CGUIAnimationChain::StartAnimation ( )
virtual

Start the animation chain. All contained animations will be triggered based on their offsets and on the order in which they were added (only for CHAINED_ANIMATION).

Reimplemented from CGUIAnimatable.

◆ StopAnimation()

void CGUIAnimationChain::StopAnimation ( )
virtual

Stops all animations which are part of this chain.

Reimplemented from CGUIAnimatable.

◆ WriteToStream()

void CGUIAnimationChain::WriteToStream ( const eC_Bool  bWriteClassID = false)
virtual

Writes attributes to the streaming file. A CGUIStreamWriter has to be initialized.

Parameters
bWriteClassIDThis flag is used to switch writing of the class ID, leading and trailing tags. When implementing a new streamable object, check this flag. If it is true, first write the class ID, then continue with this object's attributes, and finally call the base class implementation with this flag set to false (this is the default).

Reimplemented from CGUIStreamableObject.

Friends And Related Function Documentation

◆ CGUIAnimationHandler

friend class CGUIAnimationHandler
friend

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