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

📄 gamemp3.h

📁 一个类似坦克大战的小小游戏
💻 H
字号:

/**************************************************************************************
	Project  Name			: Pirates of the Caribbean
	Module Name				: Music
	File Name				: GameMp3.h: interface for the CGameMp3 class.
	Create					: 2007-7-15, by Vigame
	Update					: 2007-7-27, Modified the Init() Fuction, by Vigame
	Copyright				: 
	Reference				: 
	Abstrct					: Encapsulation of the DirectShow interface, you can use
							  this to play music as *.mp3 & *.wmv, and you can also 
							  use IGraphBuilder::RenderFile() method to play more and
							  more media format 
 **************************************************************************************/

#ifndef __H_GameMp3__
#define __H_GameMp3__

#pragma once
#pragma	comment(lib, "strmiids.lib")

#include <dshow.h>

#define WM_GRAPHNOTIFY (WM_APP + 100)	// Private message

class CGameMp3
{
public:
	CGameMp3(void);
	~CGameMp3(void);

public:
	BOOL Init(HWND hWnd);		 // Init the interfaces
	IMediaEventEx * GetEvnetInterface();
	void Release();
	BOOL LoadMp3File(HWND hWnd); // Open a Mp3 file from disk and play
	BOOL LoadDefaultMusic();	 // Mp3 default named "background.mp3"	

	// Media control
	BOOL Play();
	BOOL Pause();
	BOOL Stop();

	// Meida status
	BOOL IsPlaying();
	BOOL IsPaused();
	BOOL IsStopped();

private:
	IGraphBuilder *m_pGraph;		// Graph builder interface
	IMediaControl *m_pMediaControl;	// Used to control the mp3
	IMediaPosition *m_pMediaPosition;
	IMediaEventEx *m_pEvent;
	HWND m_hWnd;	// Notify window
};

#endif

⌨️ 快捷键说明

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