123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #pragma once
- #include "CWMPPlayer4.h"
- #include "CWMPMedia.h"
- #include "CWMPPlaylist.h"
- #include "CWMPSettings.h"
- #include "CWMPControls.h"
- #include "libwmpplayer.h"
- #include "resource.h"
- // CPlayerDlg 对话框
- #define WM_SETVOLUME_MESSAGE WM_USER+100
- enum eplayer_loglevel {
- PLAYER_LOG_DEBUG,
- PLAYER_LOG_INFO,
- PLAYER_LOG_ERROR,
- PLAYER_LOG_NO
- };
- enum eplayer_monitor_error {
- PLAYER_NOTFUND_VICE,
- PLAYER_VICE_LOCATION_ERROR
- };
- typedef struct player_callback_s {
- void (*debug)(eplayer_loglevel elevel, void* user_data, const char* fmt, va_list arg);
- void (*player_event)(void* user_data, eplayer_monitor_error errortype, const char* errmsg);
- void* user_data;
- }player_callback_t;
- class CPlayerDlg : public CDialogEx
- {
- DECLARE_DYNAMIC(CPlayerDlg)
- public:
- CPlayerDlg(player_callback_t*pCalback, CWnd* pParent = NULL); // 标准构造函数
- CPlayerDlg(CWmpPlayConfig *pConfig, player_callback_t*pCalback, CWnd *pParent = NULL);
- virtual ~CPlayerDlg();
- // 对话框数据
- enum { IDD = IDD_DIALOG1 };
- protected:
- HICON m_hIcon;
- CWMPPlayer4 *m_player;
- CWMPSettings m_settings;
- CWMPPlaylist m_playlist;
- CWMPControls m_control;
- bool m_bMax;//窗口最大化标志
- CRect m_savedWndRect;//上一次的窗口矩形
- bool m_bInit;//OnInitDialog是否执行结束
- bool m_bTimer;//计时器是否在执行
- HMONITOR m_hMonitor;//音视频播放所在的屏幕的句柄
- CRect m_monitorRect;//音视频播放所在的屏幕的矩形
- int m_nPlayCnt; // 已重复播放次数(多个文件顺序播完一次算重复播一次)
- int m_nMediaInx; // 当前媒体序号
-
- CWmpPlayConfig *m_pConfig;
- player_callback_t m_callback;
- private:
- BOOL EndPlay();
- void PlayerLog(eplayer_loglevel elvel, const char* fmt, ...);
- void PlayerLogEvent(eplayer_monitor_error errortype, const char* errmsg);
-
- protected:
- virtual BOOL OnInitDialog();
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
- DECLARE_EVENTSINK_MAP()
- public:
- void PlayStateChangeOcx1(long NewState);
- DECLARE_MESSAGE_MAP()
- protected:
- afx_msg LRESULT OnSetVolumeMessage(WPARAM wParam, LPARAM lParam);
- public:
- afx_msg void OnClose();
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point);
- afx_msg LRESULT OnNcHitTest(CPoint point);
- afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
- afx_msg void OnTimer(UINT_PTR nIDEvent);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- };
|