#pragma once

#include "CNZSDK.h"
#include "DlgScreen.h"
#include "afxwin.h"
#include "afxdtctl.h"

class CDlgLiveSample : public CDialog
{
	DECLARE_DYNAMIC(CDlgLiveSample)

public:
	CDlgLiveSample					( NZ_SDK_KIND eSdkKind, CWnd* pParent=NULL );
	virtual ~CDlgLiveSample			( );

	BOOL	ThreadProc				( );

protected:
	void	EnableVideo				( BOOL enable );
	void	EnableAudio				( BOOL enable );
	void	EnableEvent				( BOOL enable );
	void	EnableTalk				( BOOL enable );
	void	EnableBackup			( BOOL enable );
	void	EnablePTZ				( BOOL enable );
	void	EnableData				( BOOL enable );

	NZ_VMS_DATA_TYPE GetDataCategory();
	CString GetDataCategoryName();
	CString GetImageFormat();

	static void CALLBACK OnExportMessage(NZ_EXPORT_MESSAGE eMessage, LONG_PTR pParam1, LONG_PTR pParam2, LONG_PTR pUserParam);

	CNZSDK							m_sdk;
	CList<CDlgScreen*,CDlgScreen*>	m_list_screen;

	BOOL							m_stop_capture;
	UINT							m_id_capture;
	HANDLE							m_capture_thread;
	NZ_SDK_KIND						m_eSdkKind;

	int								m_capture_nrs_id;
	int								m_capture_session_type;

	CComboBox m_cb_ptz_speed;
	CComboBox m_cb_model;
	CDateTimeCtrl m_dtp;
	CComboBox m_cb_data_category;
	CDateTimeCtrl m_export_from_date;
	CDateTimeCtrl m_export_from_time;
	CDateTimeCtrl m_export_to_date;
	CDateTimeCtrl m_export_to_time;
	CComboBox m_cb_data_image;

protected:
	enum { IDD = IDD_LIVE_SAMPLE };
	DECLARE_MESSAGE_MAP()
	virtual void DoDataExchange(CDataExchange* pDX);
	virtual BOOL OnInitDialog();
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	afx_msg void OnDestroy();
	afx_msg void OnBnClickedNrsBtnConnect();
	afx_msg void OnBnClickedNrsBtnDisconnect();
	afx_msg void OnBnClickedVideoBtnOpen();
	afx_msg void OnBnClickedVideoBtnClose();
	afx_msg void OnClose();
	afx_msg void OnBnClickedPresetBtnSet();
	afx_msg void OnBnClickedPresetBtnMove();
	afx_msg void OnBnClickedAudioBtnOpen();
	afx_msg void OnBnClickedAudioBtnClose();
	afx_msg void OnBnClickedEventBtnOpen();
	afx_msg void OnBnClickedEventBtnClose();
	afx_msg void OnCbnSelchangeCbModel();
	afx_msg void OnBnClickedBtnTourStart();
	afx_msg void OnBnClickedBtnTourStop();
	afx_msg void OnBnClickedTalkBtnStart();
	afx_msg void OnBnClickedTalkBtnStop();
	afx_msg void OnBnClickedPbVideoBtnOpen();
	afx_msg void OnBnClickedPbVideoBtnClose();
	afx_msg void OnBnClickedPbPlay();
	afx_msg void OnBnClickedPbPause();
	afx_msg void OnBnClickedGetDatas();
	afx_msg void OnBnClickedExportVideo();
	afx_msg void OnBnClickedCancelExport();
	afx_msg void OnBnClickedExportImage();
	afx_msg void OnBnClickedGetPtzSpecification();
	afx_msg void OnBnClickedGetPtzPosition();
	afx_msg void OnBnClickedSetPtzPosition();
};
