// Animator.h: interface for the CAnimator class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(__RV_ANIMATOR_H_INCLUDED_)
#define __RV_ANIMATOR_H_INCLUDED_
 
#include "picture.h"

class INDIX_API CAnimator : public CPicture  
{
public:
	CAnimator();
	virtual ~CAnimator();

	virtual BOOL Serialize(HANDLE device, BOOL bIn ) ;
	virtual CUCObj* Clone(  CUCObj* twin) ;

	virtual void Show(CDelegate* pDelegate,int mode, BOOL bForce);
	

	virtual BOOL  Create(/*CDelegate* pDelegate=NULL,*/ const TCHAR* strName = NULL, UINT id =-1, int style = RV_UC_DEFAULT_STYLE ) ;

	virtual void  Destroy(/*BOOL bEraseStroke=FALSE*/) ;


	void Load(const TCHAR* strFilePath);
 

	//virtual void Play();
	virtual void Activate();
	virtual void Deactivate();

	virtual void Beat();

	//for internal use only 
	//void  Play();

 
	int MoveToNext();

	void Reset(int count = 0);

	//ÁÙÊ±±äÁ¿//
	UINT  m_nTimerID;

private:
	void FeedFrame(HANDLE hImagePage, int index);
	void GetCurFrame(RvImage image, int index);

	RvImage m_image;

	int m_nFrameIndex, m_nFrameCount;
	RV_HANDLE* m_pImgArray;

 	BOOL   m_bLoaded;
	BOOL   m_bImageChanged;

	__int64 m_nPrevTime;
	int     m_nCurDelay;

	CRITICAL_SECTION m_cs;

};






#endif // !defined(__RV_ANIMATOR_H_INCLUDED_)
