sound.h

来自「游戏音频程序设计-Beginning.Game.Audio.Programmin」· C头文件 代码 · 共 53 行

H
53
字号
// 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"

namespace AudioEngine {

class CSound  
{
public:
  friend class CAudioManager;
	CSound(CAudioManager *mgr);
	virtual ~CSound();

  bool Play();
  bool IsPlaying();
protected:
  IDirectMusicSegment8* m_Segment;
  IDirectMusicSegmentState8 *m_SegmentState;
  CAudioManager *m_Manager;

};

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