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

📄 sound.h

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

#if !defined(AFX_AUDIOENGINESOUND_H__AA19B78E_4401_495D_B88C_4D8C49918D33__INCLUDED_)
#define AFX_AUDIOENGINESOUND_H__AA19B78E_4401_495D_B88C_4D8C49918D33__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 "RefCountPtr.h"
#include "Volume.h"

namespace AudioEngine {

class CAudioManager;

// this class contains things common to all sounds (sound effects and music).
// for sound effect specific methods, look at CSoundEffect.
// for music methods, look at C*Music (CMIDIMusic, etc.)
class CSound  
{
public:
  CSound(CAudioManager *mgr);
	virtual ~CSound();

  // these methods are required by every sound in the game
  virtual bool Play() = 0;
  virtual bool Stop() = 0;
  virtual bool IsPlaying() = 0;

  // this class provides these functions to all derived classes
  // (everything, sound, music, etc., has a volume)
  virtual CVolume GetVolume() { return(m_Volume); }
  virtual void SetVolume(const CVolume &v) { m_Volume = v; }

protected:
  CAudioManager *m_Manager;
  CVolume m_Volume;
};

// smart pointer to CSound
class CSoundPtr : public CRefCountPtr<CSound>
{
public:
  explicit CSoundPtr(CSound* p = NULL);
  void Release();

};

}; // namespace

#endif // !defined(AFX_AUDIOENGINESOUND_H__AA19B78E_4401_495D_B88C_4D8C49918D33__INCLUDED_)

⌨️ 快捷键说明

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