// CPlayBackAtl.h : 由 Microsoft Visual C++ 创建的 ActiveX 控件包装类的声明

#pragma once

/////////////////////////////////////////////////////////////////////////////
// CPlayBackAtl

class CPlayBackAtl : public CWnd
{
protected:
	DECLARE_DYNCREATE(CPlayBackAtl)
public:
	CLSID const& GetClsid()
	{
		static CLSID const clsid
			= { 0x833FA59, 0xA823, 0x4FE1, { 0xAF, 0xD, 0xD1, 0xF0, 0x6, 0xD, 0x2F, 0x99 } };
		return clsid;
	}
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle,
						const RECT& rect, CWnd* pParentWnd, UINT nID, 
						CCreateContext* pContext = NULL)
	{ 
		return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); 
	}

    BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, 
				UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE,
				BSTR bstrLicKey = NULL)
	{ 
		return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
		pPersist, bStorage, bstrLicKey); 
	}

// 属性
public:

// 操作
public:

	long SetFullScreen(long isFullScreen)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x1, DISPATCH_METHOD, VT_I4, (void*)&result, parms, isFullScreen);
		return result;
	}
	long GetFullScreen()
	{
		long result;
		InvokeHelper(0x2, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}
	long SetShowTitle(LPCTSTR TitleMsg, long x, long y, long NeedShow)
	{
		long result;
		static BYTE parms[] = VTS_BSTR VTS_I4 VTS_I4 VTS_I4 ;
		InvokeHelper(0x3, DISPATCH_METHOD, VT_I4, (void*)&result, parms, TitleMsg, x, y, NeedShow);
		return result;
	}
	long SetStatus(long ShowY, long StatusValue)
	{
		long result;
		static BYTE parms[] = VTS_I4 VTS_I4 ;
		InvokeHelper(0x4, DISPATCH_METHOD, VT_I4, (void*)&result, parms, ShowY, StatusValue);
		return result;
	}
	long SetupDecode(LPCTSTR data, long datalen, long type)
	{
		long result;
		static BYTE parms[] = VTS_BSTR VTS_I4 VTS_I4 ;
		InvokeHelper(0x5, DISPATCH_METHOD, VT_I4, (void*)&result, parms, data, datalen, type);
		return result;
	}
	long InputVideoStream(unsigned char * data, long datalen, unsigned char * pExdata, long pExDataLen)
	{
		long result;
		static BYTE parms[] = VTS_PUI1 VTS_I4 VTS_PUI1 VTS_I4 ;
		InvokeHelper(0x6, DISPATCH_METHOD, VT_I4, (void*)&result, parms, data, datalen, pExdata, pExDataLen);
		return result;
	}
	long InputAudioStream(unsigned char * data, long datalen, unsigned char * pExdata, long pExDataLen)
	{
		long result;
		static BYTE parms[] = VTS_PUI1 VTS_I4 VTS_PUI1 VTS_I4 ;
		InvokeHelper(0x7, DISPATCH_METHOD, VT_I4, (void*)&result, parms, data, datalen, pExdata, pExDataLen);
		return result;
	}
	long InputStream(unsigned char * data, long len)
	{
		long result;
		static BYTE parms[] = VTS_PUI1 VTS_I4 ;
		InvokeHelper(0x8, DISPATCH_METHOD, VT_I4, (void*)&result, parms, data, len);
		return result;
	}
	long SetVideoParameter(unsigned long McastIp, long videoprt, unsigned long ServerIP, long ServerPort, unsigned long nSvrInstHole)
	{
		long result;
		static BYTE parms[] = VTS_UI4 VTS_I4 VTS_UI4 VTS_I4 VTS_UI4 ;
		InvokeHelper(0xa, DISPATCH_METHOD, VT_I4, (void*)&result, parms, McastIp, videoprt, ServerIP, ServerPort, nSvrInstHole);
		return result;
	}
	long IpStr2Value(LPCTSTR ip)
	{
		long result;
		static BYTE parms[] = VTS_BSTR ;
		InvokeHelper(0xb, DISPATCH_METHOD, VT_I4, (void*)&result, parms, ip);
		return result;
	}
	long SetAudioOn(long b_isOn)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0xc, DISPATCH_METHOD, VT_I4, (void*)&result, parms, b_isOn);
		return result;
	}
	long SetMotionDetectConfigOn(long value)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0xd, DISPATCH_METHOD, VT_I4, (void*)&result, parms, value);
		return result;
	}
	long SetMotionDetectConfig(long xBlocks, long yBlocks, LPCTSTR configString)
	{
		long result;
		static BYTE parms[] = VTS_I4 VTS_I4 VTS_BSTR ;
		InvokeHelper(0xe, DISPATCH_METHOD, VT_I4, (void*)&result, parms, xBlocks, yBlocks, configString);
		return result;
	}
	CString GetMotionDetectConfigString()
	{
		CString result;
		InvokeHelper(0xf, DISPATCH_METHOD, VT_BSTR, (void*)&result, NULL);
		return result;
	}
	long SnapShot(LPCTSTR saveDir)
	{
		long result;
		static BYTE parms[] = VTS_BSTR ;
		InvokeHelper(0x10, DISPATCH_METHOD, VT_I4, (void*)&result, parms, saveDir);
		return result;
	}
	long Play()
	{
		long result;
		InvokeHelper(0x9, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}
	long Stop()
	{
		long result;
		InvokeHelper(0x11, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}
	long SetFocus(long isFocus)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x12, DISPATCH_METHOD, VT_I4, (void*)&result, parms, isFocus);
		return result;
	}
	long get_AudioIsOn()
	{
		long result;
		InvokeHelper(0x13, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
		return result;
	}
	void put_AudioIsOn(long newValue)
	{
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x13, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
	}
	long get_VideoIsOn()
	{
		long result;
		InvokeHelper(0x14, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
		return result;
	}
	long get_isOnFocus()
	{
		long result;
		InvokeHelper(0x15, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
		return result;
	}
	void put_isOnFocus(long newValue)
	{
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x15, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);
	}
	long SetVolume(long value)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x16, DISPATCH_METHOD, VT_I4, (void*)&result, parms, value);
		return result;
	}
	long SetBuffer(long bufferCount)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x17, DISPATCH_METHOD, VT_I4, (void*)&result, parms, bufferCount);
		return result;
	}
	long PlayFile(LPCTSTR FileName)
	{
		long result;
		static BYTE parms[] = VTS_BSTR ;
		InvokeHelper(0x18, DISPATCH_METHOD, VT_I4, (void*)&result, parms, FileName);
		return result;
	}
	long GetBindPort()
	{
		long result;
		InvokeHelper(0x19, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}
	long StopWithOutWait()
	{
		long result;
		InvokeHelper(0x1a, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}
	long PlayVSSFile(long vssIp, long vssPort, LPCTSTR userId, LPCTSTR DevId, LPCTSTR item, long type)
	{
		long result;
		static BYTE parms[] = VTS_I4 VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 ;
		InvokeHelper(0x1b, DISPATCH_METHOD, VT_I4, (void*)&result, parms, vssIp, vssPort, userId, DevId, item, type);
		return result;
	}
	long GetPlayStatus()
	{
		long result;
		InvokeHelper(0x1c, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}
	long WriteWebLog(LPCTSTR Log)
	{
		long result;
		static BYTE parms[] = VTS_BSTR ;
		InvokeHelper(0x1d, DISPATCH_METHOD, VT_I4, (void*)&result, parms, Log);
		return result;
	}
	long SetDrawBorder(long AllowDrawBorder)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x1e, DISPATCH_METHOD, VT_I4, (void*)&result, parms, AllowDrawBorder);
		return result;
	}
	long SetCaptureDir(long langType, LPCTSTR path)
	{
		long result;
		static BYTE parms[] = VTS_I4 VTS_BSTR ;
		InvokeHelper(0x1f, DISPATCH_METHOD, VT_I4, (void*)&result, parms, langType, path);
		return result;
	}
	CString GetCaptureDir(long langType)
	{
		CString result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x20, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, langType);
		return result;
	}
	long StartRecord(LPCTSTR filePath)
	{
		long result;
		static BYTE parms[] = VTS_BSTR ;
		InvokeHelper(0x21, DISPATCH_METHOD, VT_I4, (void*)&result, parms, filePath);
		return result;
	}
	long StopRecord()
	{
		long result;
		InvokeHelper(0x22, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}
	long get_IsRecording()
	{
		long result;
		InvokeHelper(0x23, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
		return result;
	}
	CString GetUserData(LPCTSTR file)
	{
		CString result;
		static BYTE parms[] = VTS_BSTR ;
		InvokeHelper(0x24, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, file);
		return result;
	}
	long SaveUserData(LPCTSTR file, LPCTSTR data)
	{
		long result;
		static BYTE parms[] = VTS_BSTR VTS_BSTR ;
		InvokeHelper(0x25, DISPATCH_METHOD, VT_I4, (void*)&result, parms, file, data);
		return result;
	}
	long GetWindowSize()
	{
		long result;
		InvokeHelper(0x26, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}
	long GetHWnd()
	{
		long result;
		InvokeHelper(0x27, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}
	CString GetHostByName(LPCTSTR hostName)
	{
		CString result;
		static BYTE parms[] = VTS_BSTR ;
		InvokeHelper(0x28, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, hostName);
		return result;
	}
	long SetConnectType(long type)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x29, DISPATCH_METHOD, VT_I4, (void*)&result, parms, type);
		return result;
	}
	CString GetMacAddr()
	{
		CString result;
		InvokeHelper(0x2a, DISPATCH_METHOD, VT_BSTR, (void*)&result, NULL);
		return result;
	}
	long GetFrameBuffer(unsigned char * buffer, long BufferLen, long * width, long * height)
	{
		long result;
		static BYTE parms[] = VTS_PUI1 VTS_I4 VTS_PI4 VTS_PI4 ;
		InvokeHelper(0x2b, DISPATCH_METHOD, VT_I4, (void*)&result, parms, buffer, BufferLen, width, height);
		return result;
	}
	long YUVBufferToRGBBuffer(long nClolrBits, long widht, long height, unsigned char * pYuvBuffer, unsigned char * pRGBBUffer)
	{
		long result;
		static BYTE parms[] = VTS_I4 VTS_I4 VTS_I4 VTS_PUI1 VTS_PUI1 ;
		InvokeHelper(0x2c, DISPATCH_METHOD, VT_I4, (void*)&result, parms, nClolrBits, widht, height, pYuvBuffer, pRGBBUffer);
		return result;
	}
	long SetFullFillStatus(long bIsFullFill)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x2d, DISPATCH_METHOD, VT_I4, (void*)&result, parms, bIsFullFill);
		return result;
	}
	long GetFullFillStatus()
	{
		long result;
		InvokeHelper(0x2e, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}
	void SetTipLanguage(long bIsEngLish)
	{
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x2f, DISPATCH_METHOD, VT_EMPTY, NULL, parms, bIsEngLish);
	}
	long SeekToPlayTime(long nSeconds)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x30, DISPATCH_METHOD, VT_I4, (void*)&result, parms, nSeconds);
		return result;
	}
	long IsRunning()
	{
		long result;
		InvokeHelper(0x31, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}
	long SetToolBar(long nValue)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x32, DISPATCH_METHOD, VT_I4, (void*)&result, parms, nValue);
		return result;
	}
	long SetPlayMode(long nPlayMode, long nRecvThreadId)
	{
		long result;
		static BYTE parms[] = VTS_I4 VTS_I4 ;
		InvokeHelper(0x33, DISPATCH_METHOD, VT_I4, (void*)&result, parms, nPlayMode, nRecvThreadId);
		return result;
	}
	long SetPlaySeconds(long nValueType, long nValue)
	{
		long result;
		static BYTE parms[] = VTS_I4 VTS_I4 ;
		InvokeHelper(0x34, DISPATCH_METHOD, VT_I4, (void*)&result, parms, nValueType, nValue);
		return result;
	}
	long SetZoomRectOn(long value)
	{
		long result;
		static BYTE parms[] = VTS_I4 ;
		InvokeHelper(0x35, DISPATCH_METHOD, VT_I4, (void*)&result, parms, value);
		return result;
	}
	long GetZoomRectStatus()
	{
		long result;
		InvokeHelper(0x36, DISPATCH_METHOD, VT_I4, (void*)&result, NULL);
		return result;
	}


};
