// VCDemoDlg.h : 头文件
//

#pragma once
#include "afxcmn.h"

typedef struct
{
	BOOL   bSound;		//Sound open or not
	BOOL   bLocRecord;  //Local Record
	BOOL   bSpeak;        //Remote Speak or not
	BOOL   bVideo;        //Watch or not

	char   szDevId[128];
	char   szDevName[VS_USER_NAME_LEN];
}DspWndInfo;

enum EventCode
{
	RECVDATATIMEOUT=1			//收取流时，如果10秒内都没有数据，则会发送此消息
	,FOCUSCHANGE				//播放器焦点改变时发生
	,STARTPLAY					//开始播放
	,ENTERWAITFORBUFFER			//进入缓冲
	,SETUP_VIDEO_PARAM_OK		//SetupDecoder返回成功
	,SETUP_AUDIO_PARAM_OK		//SetupDecoder返回成功
	,SNAPSHORT_FINISH			//抓图结束
	,BINDPORTERROR				//邦定端口失败
	,VSS_STOPPLAY				//播放VSS文件结束
	,VSS_STARTPLAY				//开始播放
	,VSS_PLAYNEXT				//播放下一个文件
	,VSS_SETUPERROR				//调用setup返回失败
	,CREATE_THREAD_ERROR		//创建线程失败
	,LOC_STOPPLAY				//停止本地文件播放
	,LOC_OPENFILEERROR			//本地文件播放时打开文件失败
	,LOC_PLAYERROR				//播放失败退出
	,LOC_PAUSEPLAY				//暂停播放
	,LOC_OPENFILE_ERROR			//打开本地文件失败
	,RECV_RETUN_ERROR			//RTPRECV读取数据返回少于16个字节
	,FIRSTPLAY					//第一次播放
	,RECORDEND
	,CAPTUREPICEND
	,PLAYTIMECHANGE
};


// CVCDemoDlg 对话框
class CVCDemoDlg : public CDialog
{
// 构造
public:
	CVCDemoDlg(CWnd* pParent = NULL);	// 标准构造函数

	void OnUpdataDevInfoTree();
	int  RefreshDevTree(CTreeCtrl *pTree);
	HTREEITEM CheckGroup(CTreeCtrl *pTree, CString szGroup);	
	afx_msg LRESULT OnMainGuiMsgProc( WPARAM wParam, LPARAM lParam );
	void On_InviteMsgProc(MSG_Invite_t *pInviteMsg);
	void On_IPCStatusNotifyMsgProc(MSG_IPCStatus_t *pIPCStatusMsg);
	int RefreshDevTree(CTreeCtrl *pTree, S8* pDevId, U32 nStatus, U32 nType);
	void On_AllIPCStatusNotifyMsgProc();

// 对话框数据
	enum { IDD = IDD_VCDEMO_DIALOG };

	CImageList m_ImageList;
	HTREEITEM m_HRootDev;
	DspWndInfo  m_dspwndinfo;
	CCameraDevice *m_pCameraDev;
	BOOL m_bPlay;

	std::list<CMasterDevice *> m_lstRelatedDevice;

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


// 实现
protected:
	HICON m_hIcon;

	// 生成的消息映射函数
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedBtnLogin();
public:
	afx_msg void OnBnClickedBtnGetDevlist();
public:
	afx_msg void OnBnClickedBtnStopVideo();
public:
	afx_msg void OnClose();
public:
	CTreeCtrl m_treeDev;
public:
	afx_msg void OnNMDblclkDevTree(NMHDR *pNMHDR, LRESULT *pResult);
};
