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

📄 soundsystem.h

📁 <B>很多DirectX 9.0游戏编程源码例子</B>
💻 H
字号:
//-----------------------------------------------------------------------------
// Name: SoundSystem.h
//
// Description: Helper class to play sound files
//
// File Function: Header file
//
// Code: 
//		Copyright (c) 2002-2003 LostLogic Corporation. All rights reserved.
//
// Libraries Required:
//		dxguid.lib comctl32.lib winmm.lib dsound.lib
//
// Local Files Required:
//		SoundSystem.h
//		SoundSystem.cpp
//		DXUtil.cpp
//
// DX Files: 
//		Copyright (c) 1997-2001 Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#include <dmusici.h>
#include <dsound.h>
#include <dshow.h>
#include <dxutil.h>

// Error codes
#define SOUNDERROR_MUSICLOADER		0x85000001
#define SOUNDERROR_MUSICPERFORMANCE	0x85000002
#define SOUNDERROR_INITAUDIO		0x85000003
#define SOUNDERROR_PATH				0x85000004
#define SOUNDERROR_VOLUME			0x85000005
#define SOUNDERROR_LOAD				0x85000006
#define SOUNDERROR_DOWNLOAD			0x85000007
#define SOUNDERROR_NOSEGMENT		0x85000008
#define SOUNDERROR_PLAYFAIL			0x85000009

class GameSound
{
	public:
		IDirectMusicSegment8		*m_pSound;
		IDirectMusicPerformance8	*m_pPerformance;
		~GameSound();
		GameSound();
};

class SoundSystem
{
	private:	

	public:
		HWND						m_hWnd;
		//
		// Sound System
		//
		IDirectMusicLoader8			*m_pLoader;
		IDirectMusicPerformance8	*m_pPerformance;
		
		// Functions
		SoundSystem();
		~SoundSystem();
		HRESULT	hrInitSoundSystem( void );
		HRESULT hrLoadSound( char *szname,GameSound *gs );
		HRESULT hrPlaySound( GameSound *gs );
};

⌨️ 快捷键说明

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