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

📄 audiomanager.h

📁 游戏音频程序设计-Beginning.Game.Audio.Programming
💻 H
字号:
// AudioManager.h: interface for the CAudioManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AUDIOMANAGER_H__4F8006D7_B974_48C4_9E08_262617786C8D__INCLUDED_)
#define AFX_AUDIOMANAGER_H__4F8006D7_B974_48C4_9E08_262617786C8D__INCLUDED_

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

#include <windows.h>
#include <mmreg.h>

#include <dmusicc.h>
#include <dmusici.h>
#include <dsound.h>
#include "dxutil.h"


#include "ErrorHandling.h"
#include "Sound.h"
#include "WAVFile.h"

namespace AudioEngine {

class CAudioManager  
{
public:
  CAudioManager();
	virtual ~CAudioManager();

  void Init(HWND hwnd, bool stereo = true, int perfchannels = 128);
  void UnInit();

  // loading routines
  CSoundPtr LoadSound(std::string filename);              // from disk
  CSoundPtr LoadSound(const CWAVFile &wavfile);           // from a WAV file class
  CSoundPtr LoadSound(unsigned char *data, int datalen);  // from memory
  CSoundPtr LoadSound(HMODULE hmod, WORD resID);          // from resources

  // this is for the CSound objects
  IDirectMusicPerformance8* GetPerformance() { return(m_Performance); }

protected:

  
  bool m_InitGood;
  IDirectMusicLoader8* m_Loader;
  IDirectMusicPerformance8* m_Performance;
};

// client app implements this
extern CAudioManager *GetAudioManager();

}; // namespace

#endif // !defined(AFX_AUDIOMANAGER_H__4F8006D7_B974_48C4_9E08_262617786C8D__INCLUDED_)

⌨️ 快捷键说明

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