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

📄 sound.h

📁 对游戏编程感兴趣的 朋友可以 下载下来看看 对DX讲解的很很详细
💻 H
字号:
// Sound.h: interface for the CSound class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SOUND_H__C89CE19D_7C1D_4741_BE61_5AD0836FCF3A__INCLUDED_)
#define AFX_SOUND_H__C89CE19D_7C1D_4741_BE61_5AD0836FCF3A__INCLUDED_

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

#include "Base.h"

class CSound : public CBase  
{
public:
	bool IsPlaying();
	bool Stop();
	bool Play(DWORD dwNumOfRepeats = 0);
	bool LoadSound(const char* szSoundFilePath);
	void InitialiseForWavMidi(IDirectMusicPerformance8* pDirectAudioPerformance, IDirectMusicLoader8* pDirectAudioLoader);
	void InitialiseForMP3();
	CSound();				//Use this constructor for mp3 files
	virtual ~CSound();

private:
	enum Format {Unknown, MP3, WavMidi};
	IDirectMusicSegment8* m_pSegment;
	IDirectMusicPerformance8* m_pDirectAudioPerformance;	
	IDirectMusicLoader8* m_pDirectAudioLoader;
	IGraphBuilder* m_pGraph;
	IMediaControl* m_pMediaControl;
	IMediaPosition* m_pMediaPosition;
	Format m_enumFormat;

};

#endif // !defined(AFX_SOUND_H__C89CE19D_7C1D_4741_BE61_5AD0836FCF3A__INCLUDED_)

⌨️ 快捷键说明

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