// MediaPlayerDlg.h : header file // #include "Dshow.h" #include "streams.h" #include "uuids.h" #include "BmpButton.h" #include "BmpStatic.h" #include "OpenMoveFileDlg.h" #pragma comment (lib,"Ole32.lib") #pragma comment (lib,"Strmiids.lib") #pragma comment (lib,"Mmtimer.lib") #if !defined(AFX_MEDIAPLAYERDLG_H__5C22057A_6612_4530_98D4_3DA59D1F6828__INCLUDED_) #define AFX_MEDIAPLAYERDLG_H__5C22057A_6612_4530_98D4_3DA59D1F6828__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 #define WM_DSPLAYER (WM_USER + 101) // 绘制播放时间消息 #define WM_DRAWPLAYTIME (WM_USER + 106) // 定时器回调函数 void PlayerTimeProc(UINT uTimerID,UINT uMsg,DWORD_PTR dwUser,DWORD_PTR dw1,DWORD dw2); ///////////////////////////////////////////////////////////////////////////// // CMediaPlayerDlg dialog class CMediaPlayerDlg : public CDialog { private: CDC m_BgDC; CDC m_MemDC; CDC m_BlockDC; CDC m_BlockDCD; MMRESULT m_Timer; CFont m_txtFont; bool m_BlockD; bool m_InitDC; CString m_TitleText; CString m_SourceFile; bool m_InitGraph; bool m_FullScreen; // DirectShow 接口 IGraphBuilder *m_pGraph; // Graph IMediaControl *m_pMediaControl; // 播放器接口 IMediaEventEx *m_pEvent; // 事件接口 IMediaSeeking *m_pSeek; // 数据流定位接口 IVideoWindow *m_pVideo; // 视频窗口 // Construction public: void ShowProgress(); CString GetFileName(CString sPath); void CreateGraph(void); int GetCurrentPosition(void); int GetDuration(void); HRESULT GetPlayerStatus(void); bool IsStopped(void); bool IsPaused(void); bool IsPlaying(void); void DisposeGraph(void); bool SetCurrentPosition(int iPosition); CMediaPlayerDlg(CWnd* pParent = NULL); // standard constructor ~CMediaPlayerDlg(); // Dialog Data //{{AFX_DATA(CMediaPlayerDlg) enum { IDD = IDD_MEDIAPLAYER_DIALOG }; CBmpStatic m_labTime; CStatic m_wndVideo; CBmpButton m_butStop; CBmpButton m_butSeek; CBmpButton m_butPlay; CBmpButton m_butOpen; CBmpButton m_butFullScreen; CBmpButton m_butExit; //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMediaPlayerDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: HICON m_hIcon; // Generated message map functions //{{AFX_MSG(CMediaPlayerDlg) afx_msg void OnDSPlayer(); afx_msg void OnPlayerTimer(WPARAM wParam, LPARAM lParam); virtual BOOL OnInitDialog(); afx_msg void OnPaint(); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnTimer(UINT nIDEvent); afx_msg void OnButtonClose(); afx_msg void OnStaticVideo(); afx_msg void OnButtonPlay(); afx_msg void OnButtonOpen(); afx_msg void OnButtonSeek(); afx_msg void OnButtonStop(); afx_msg void OnButtonFullscreen(); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MEDIAPLAYERDLG_H__5C22057A_6612_4530_98D4_3DA59D1F6828__INCLUDED_)