Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
soundsystem.h
Go to the documentation of this file.
1 // File name: soundsystem.h
2 // Des: interface for the sound systems
3 // Date: 6/12/1389 (jalali), Feb-26-2011
4 // Programmer: Pooya Shahinfar(Pswin)
5 
6 
7 #ifndef SOUND_SYSTEM_H
8 #define SOUND_SYSTEM_H
9 
10 #include "../kgedef.h"
11 #include "SoundBuffer.h"
12 #include "../sn/Sound3D.h"
13 #include "../sn/Sound2D.h"
14 
15 namespace kge
16 {
17  namespace av
18  {
19 
20  // SoundSystemType
22  {
26  };
27 
28  // SoundSystem
30  {
31  public:
33  SoundSystem(SoundSystemType type, float musicVolume, float effectsVolume)
34  : m_eType(type), m_musicVolume(musicVolume), m_effectsVolume(effectsVolume) {}
35 
36  virtual ~SoundSystem() {}
37 
38  virtual bool Init(void* hwnd) = 0;
39 
41  virtual sn::Sound3D* CreateSound3D(const char* filename) = 0;
42 
44  virtual sn::Sound2D* CreateSound2D(const char* filename, bool streaming) = 0;
45 
47  virtual void SetListenerPosition(const math::Vector& pos) = 0;
48 
50  virtual void SetListenerVelocity(const math::Vector& vel) = 0;
51 
53  virtual void SetListenerOrientation(const math::Vector& forward, const math::Vector& up) = 0;
54 
56  virtual void Update() = 0;
57 
59  virtual void SetMusicVolume(float volume) = 0;
60 
62  float GetMusicVolume() const { return m_musicVolume; }
63 
65  virtual void SetEffectsVolume(float volume) = 0;
66 
68  float GetEffectsVolume() const { return m_effectsVolume; }
69 
71  virtual void Pause(bool pause) = 0;
72 
74  virtual void Stop() = 0;
75 
77  SoundSystemType GetType() const { return m_eType; }
78 
79  protected:
82 
83  private:
85 
86  }; // SoundSystem
87 
88  } // av
89 
90 } // kge
91 
92 #endif // SOUND_SYSTEM_H