| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #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 (*onmediaplayfinished)(void* user_data, int imediatype);
- 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);
- void OnMediaPlayFinished(int iMediaType);
- 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);
- };
|