📄 demodlg.h
字号:
#if !defined(AFX_DEMODLG_H__8F6FD55B_7C94_405D_A1E0_7C60E7054A81__INCLUDED_)
#define AFX_DEMODLG_H__8F6FD55B_7C94_405D_A1E0_7C60E7054A81__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DemoDlg.h : header file
//
#include "gif89a.h"
/////////////////////////////////////////////////////////////////////////////
// CDemoDlg dialog
class CDemoDlg : public CDialog
{
// Construction
private:
bool m_video_finished_flag;
CBrush m_brush ; // background brush
bool m_drag_flag;
//和媒体控制相关的成员变量
private:
IGraphBuilder *m_pGraph; //IGraphBuilder 接口提供了生成Filter Graph相//关的方法
IMediaControl *m_pMediaControl;
//IMediaControl 接口提供了控制流经Filter //Graph数据流的相关方法
IMediaEventEx *m_pEvent;
//IMediaEventEx 继承自IMediaEvent,提供了从
//Filter Graph 管理器获取事件消息的方法
IVideoWindow *m_pVidWin;//
IMediaSeeking *m_pMediaSeeking;
//IMediaSeeking 提供了控制流的播放位置和播放//速度的方法
//CString m_strMediaFile; //当前播放的媒体文件的名称
IBasicVideo *pBV ;
BOOL m_isPlaying; //当前的播放状态
public:
int m_position;
void MoveVideoWindow(void);
BOOL Stop(void);
BOOL Play(void);
BOOL Pause(void);
//
void CleanUp(void);
//
bool IsRunning(void); // Filter graph status
bool IsStopped(void);
bool IsPaused(void);
//bool m_video_finished_flag;
bool OnRun();
bool OnPause();
bool OnStop();
public:
//for gif
LPCGLOBAL_INFO gi;
LPCFRAME fm;
//UINT m_cur_frame;
BYTE user_myrgb[3*256];
//BYTE myrgb[3*256];
CGif89a gif;
BYTE *imageData;
//for gif pic and gif ani
HBITMAP LoadGifCurFrame(BYTE *imageData,LPCGLOBAL_INFO gi,LPCFRAME fm);
//GGIF ANI
//CDC MemDC;
//CBitmap tmpbmp,*oldbmp;
//for jpeg and gif
//HBITMAP m_hBitmap;
//for jpeg
//HBITMAP LoadJpegImage(CString strFileName);
//show text
//show picture
//show gif ani
//show video
void ShowTextFile(CString filename,int in,int out,long speed,long delaytime,TEXTPROPERTY tp);
void ShowLeftTextFile(CString filename,int WW,int HH,long speed,long delaytime,TEXTPROPERTY tp);
void ShowPicture(CString filename,int in,int out,long speed,long delaytime,int position);
void ShowGifAni(CString filename,long speed,long times,int position);
void ShowVideo(CString filename,int position);
//
void DemoPic(CDC &dc,CDC &MemDC,int w,int h,int fun_in,int fun_out,long speed,long delaytime);
//
inline void SleepMS(long ms);
void MySleep(long delaytime);
public:
CDemoDlg(CWnd* pParent = NULL); // standard constructor
public:
void SetPosSize(int x,int y,int w,int h,bool flag)
{
if(flag)// HWND_NOTOPMOST SWP_NOMOVE | SWP_NOOWNERZORDER HWND_TOP
::SetWindowPos(this->m_hWnd,HWND_TOP,x,y,w,h,SWP_FRAMECHANGED|SWP_SHOWWINDOW);
else
::SetWindowPos(this->m_hWnd,HWND_TOP,x,y,w,h,SWP_FRAMECHANGED|SWP_HIDEWINDOW);
}
void SetVideoForeground(void);
// Dialog Data
//{{AFX_DATA(CDemoDlg)
enum { IDD = IDD_DEMO_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDemoDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDemoDlg)
afx_msg void OnPaint();
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
virtual BOOL OnInitDialog();
afx_msg void OnDestroy();
afx_msg void OnMove(int x, int y);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg HRESULT OnGraphNotify(WPARAM wParam,LPARAM lParam);
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg UINT OnNcHitTest(CPoint pt);
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_DEMODLG_H__8F6FD55B_7C94_405D_A1E0_7C60E7054A81__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -