Engine
The Game Engine for Ian Parberry's "Introduction to Game Physics with Box2D"
 All Classes Files Functions Variables Pages
Sound.h
Go to the documentation of this file.
1 
2 
3 
4 #pragma once
5 
6 #include <dsound.h> //DirectSound
7 
16 
17 class CSoundManager{ //sound manager
18 
19  private:
20  int m_nCount;
21  LPDIRECTSOUND8 m_lpDirectSound;
22  LPLPDIRECTSOUNDBUFFER* m_lpBuffer;
23  int* m_nCopyCount;
24  BOOL* m_bStartedThisFrame;
25  BOOL m_bOperational;
26  int m_nChannelsPerSample;
27  int m_nBitsPerSample;
28  int m_nSampleRate;
29  int m_nMaxSounds;
30 
31  BOOL CreateBuffer(int index, int length, int copies);
32  BOOL LoadBuffer(int index, BYTE *buffer, int length);
33  int LoadSound(char *filename, BYTE **sound);
34  BOOL CopyBuffer(int index, int copies);
35 
36  public:
37  CSoundManager(HWND hwnd);
38  ~CSoundManager();
39  void LoadSettings();
40  void LoadSounds(int level=0);
41  void beginframe(void);
42  void clear();
43  void load(char *filename, int copies=1);
44  void play(int index, BOOL looping=FALSE);
45  void stop(int index);
46  void stop(void);
47 }; //CSoundManager