// TestVPlayerDlg.h : header file
//

#pragma once

#include "SDK\VideoPlayerSDK.h"
#include "afxwin.h"

// CTestVPlayerDlg dialog
class CTestVPlayerDlg : public CDialog
{
// Construction
public:
	CTestVPlayerDlg(CWnd* pParent = NULL);	// standard constructor
	~CTestVPlayerDlg() { ReleaseVPlayer(); }

// Dialog Data
	enum { IDD = IDD_TESTVPLAYER_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
public:
	HICON m_hIcon;
	CComboBox m_VPCombo;
	CEdit m_ctrlFileName;
	CEdit m_LoopCount;
	CEdit m_RestTime;

public:
	struct VPInfo {
		CString m_szUserName;
		CString m_szRegName;
		CLSID m_CLSID;
		long m_nIndex;
	} m_VPInfo[16];
	int m_nVPNumber;
	CComPtr<ISLTMVideoPlayer4> m_pVPlayer;
	CString m_sFileName;
	bool m_bInTimer;
	double m_fLastMovieDuration;
	int m_nLoopCount;
	double m_fRestTime;

public:
	HRESULT InitVPList();
	HRESULT CreateVPlayerTE(CLSID clsidTE, int index);
	void ReleaseVPlayer();
	HRESULT Play();
	HRESULT Pause();
	HRESULT Stop();
	HRESULT StartPlayback();
	HRESULT Unpause();
	HRESULT CheckTime();
	HRESULT CheckTime2();

public:
	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
	afx_msg void OnCbnSelchangeVplist();
	afx_msg void OnBnClickedBrowse();
	afx_msg void OnBnClickedPlay();
	afx_msg void OnBnClickedPause();
	afx_msg void OnBnClickedStop();
	afx_msg void OnTimer(UINT_PTR nIDEvent);
};
