#if !defined(AFX_PLAYSTATIC_H__3439F347_157A_4F9E_85F1_F77585181F39__INCLUDED_)
#define AFX_PLAYSTATIC_H__3439F347_157A_4F9E_85F1_F77585181F39__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PlayStatic.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CPlayStatic window
#include "MsIpcSDK.h"
#include <Vfw.h>

void CALLBACK PlayCallBack(LONG nLiveHandle, DWORD dwDataType, void *pBuffer, DWORD dwBuffSize, int nWidth, int nHeight, void *pUser);

class CPlayStatic : public CStatic
{
// Construction
public:
	CPlayStatic();

// Attributes
private:
	BOOL m_bDestory;
	int m_bStartPlay;
	int m_nBuffLen;
	int m_nBmpWidth;
	int m_nBmpHeight;
	int m_nShowWidth;
	int m_nShowHeight;
	unsigned char* m_pDspBuffer;
	BOOL m_bMaskMapShow;
	BOOL m_bLButtonDown;
	BITMAPINFO* m_pBmpInfo;
	HDRAWDIB m_hDib;
public:
	CPoint m_ptCurrent;
	CPoint m_ptStart;
	CRect m_rcMask;
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPlayStatic)
	//}}AFX_VIRTUAL

// Implementation
public:
	BOOL IsMaskShow(){return m_bMaskMapShow;}
	void SetMaskShow(BOOL bShow){m_bMaskMapShow = bShow;}
	BOOL IsWndDestory(){return m_bDestory;}
	BOOL IsPlayStart(){return m_bStartPlay;}
	int GetShowWidth(){return m_nShowWidth;}
	int GetShowHeight(){return m_nShowHeight;}
	int StartDisplay(int nDisplayWidth, int nDisplayHeight, int nBmpWidth, int nBmpHeight);
	void StopDisplay();
	int  DisplayVideoBuffer(CDC* hDC, unsigned char* data, int ShowPosX, int ShowPosY, int showWidth, int showHeight, int BmpPosX, int BmpPosY, int BmpWidth, int BmpHeight);

	int PutVideoBuffer(unsigned char* data, int width, int height);
public:
	BOOL GetMaskRect(LPRECT rcMask);
public:
	virtual ~CPlayStatic();

	// Generated message map functions
protected:
	//{{AFX_MSG(CPlayStatic)
	afx_msg void OnPaint();
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_PLAYSTATIC_H__3439F347_157A_4F9E_85F1_F77585181F39__INCLUDED_)
