⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 musicplayerdlg.h

📁 在WCE4.2下面用EVC开发的一个带图型界面的音乐播放器,带音乐播放的一般功能,如快进快退,拖动,音量拖动调节,等功能,不到歌词显示功能,
💻 H
字号:
// MusicPlayerDlg.h : header file
//
#include "Playlist.h"
#include "Dshow.h"
#include "streams.h"
#include "uuids.h"
#include "BmpStatic.h"
#include "resource.h"

#pragma comment (lib,"Ole32.lib")
#pragma comment (lib,"Strmiids.lib")
#pragma comment (lib,"Mmtimer.lib")

#if !defined(AFX_MUSICPLAYERDLG_H__4C1232D9_A0A8_4C0B_8978_1448CE5F0467__INCLUDED_)
#define AFX_MUSICPLAYERDLG_H__4C1232D9_A0A8_4C0B_8978_1448CE5F0467__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#define  WM_DSPLAYER		(WM_USER + 100)

// 绘制播放时间消息
#define WM_DRAWPLAYTIME		(WM_USER + 105)

// 定时器回调函数
void PlayerTimeProc(UINT uTimerID,UINT uMsg,DWORD_PTR dwUser,DWORD_PTR dw1,DWORD dw2);
/////////////////////////////////////////////////////////////////////////////
// CMusicPlayerDlg dialog
typedef struct InitInfmation			
{
	int	     FileviewPosition;
	int 	     FileListSize;
	int	     CurrentFileNO;
	CString   SourceFile;		//上次打开的文件及目录
	CStringArray FileList;
	 
} RunInit;


class CMusicPlayerDlg : public CDialog
{
private:
	CDC			m_BgDC;	
	CDC			m_MemDC;
	CDC			m_BlockDC;
	CDC			m_BlockDCD;	
	MMRESULT	m_Timer;
	
	unsigned char m_txtFontNumber;

	bool			m_BlockD;
	bool			m_InitDC;
	CString		m_TitleText;
	CString		m_TitleDirText;
	CString		m_SourceFile;	//文件完整路径
	CString		m_SourceFileName;
	bool			m_InitGraph;
	// DirectShow 接口
	IGraphBuilder *m_pGraph;			// Graph
	IMediaControl *m_pMediaControl;		// 播放器接口	
	IMediaEventEx *m_pEvent;			// 事件接口
	IMediaSeeking *m_pSeek;				// 数据流定位接口
	CPlaylist		m_Playlist;
	bool			m_RandomPlay;
	bool			m_ReplayAll;
	bool			m_PickPosition;
	bool			m_PickVolume;
	
	RunInit		m_InitInf;

// Construction
public:
	void ShowPlayTime(void);
	void ShowProgress(void);
	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);
	CMusicPlayerDlg(CWnd* pParent = NULL);	// standard constructor
	~CMusicPlayerDlg();
	BOOL UpDateRegistryFromAudio(DWORD dwVolume);
// Dialog Data
	//{{AFX_DATA(CMusicPlayerDlg)
	enum { IDD = IDD_MUSICPLAYER_DIALOG };
	CBmpStatic	m_labTime;
	CBmpStatic	m_labFile;
	CBmpStatic	m_labAllTime;
	CBmpButton	m_butStop;
	CBmpButton	m_butRandom;
	CBmpButton	m_butPre;
	CBmpButton	m_butOpen;
	CBmpButton	m_butPlay;
	CBmpButton	m_butNext;
	CBmpButton	m_butExit;
	CBmpButton	m_butAll;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMusicPlayerDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CMusicPlayerDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnButtonCircle();
	afx_msg void OnButtonExit();
	afx_msg void OnButtonNext();
	afx_msg void OnButtonOpen();
	afx_msg void OnButtonPlay();
	afx_msg void OnButtonPre();
	afx_msg void OnButtonRedom();
	afx_msg void OnButtonStop();
	afx_msg void OnDSPlayer();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnPlayerTimer(WPARAM wParam, LPARAM lParam);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point) ;
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(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_MUSICPLAYERDLG_H__4C1232D9_A0A8_4C0B_8978_1448CE5F0467__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -