#ifndef __CMOVIE_H__
#define __CMOVIE_H__

#include "stdafx.h"
#include "mmsystem.h"
#include "digitalv.h"

/////////////////////////////////////////////////////////////////////////////
#define BUFSIZE        	260
#define MOVPLAY_CLASS 	_T("movplay")
#define AVI_VIDEO 	  	_T("avivideo")

#define MOVE_TO_START    1
#define MOVE_TO_END      2

/////////////////////////////////////////////////////////////////////////////
class CMovie : public CStatic
{
public:
     BOOL  m_bMovieOpen;
	BOOL  m_bPlaying;
     MCIDEVICEID m_MCIDeviceID;   /* MCI Device ID for the AVI file */
     HWND  m_hWndMovie;
     TCHAR m_szError[256];

private:
     BOOL initAVI        (void);
     void termAVI        (void);

	void positionMovie  (void);
	void fileCloseMovie (void);
	void fileOpenMovie  (void);
	void playMovie      (int);
     void pauseMovie     (void);
	void seekMovie      (int);
	void stepMovie      (int);

public:
     CMovie ();
     ~CMovie();
     BOOL Create (LPCTSTR lpszText, DWORD dwStyle, const RECT& rect,
			   CWnd* pParentWnd, UINT nID = 0xffff);

     BOOL Open   (LPCTSTR);
     BOOL Play   (void);
     BOOL Pause  (void);
     BOOL Stop   (void);
     BOOL Close  (void);
	BOOL Rewind (void);
	void PositionMovie (void);
     void SetMovieBKColor(COLORREF);

private:

};

#endif // __CMOVIE_H__