sound.h

来自「对游戏编程感兴趣的 朋友可以 下载下来看看 对DX讲解的很很详细」· C头文件 代码 · 共 39 行

H
39
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?