OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
SoundAL.h
Go to the documentation of this file.
1 
8 #ifndef _SOUND_AL_H_
9 #define _SOUND_AL_H_
10 
11 #include <vector>
12 
13 class SoundAL {
14  public:
15  static int initialize();
16  static void shutdown();
17  static void clear();
18 
19  static int numBuffers();
20  static int loadBuffer(unsigned char* buffer, unsigned int length);
21 
22  static int numSources(bool atListener);
23  static int addSource(int buffer, float volume, bool atListener, bool loop);
24 
25  static int sourceAt(int source, glm::vec3 pos);
26  static void listenAt(glm::vec3 pos, glm::vec3 at, glm::vec3 up);
27 
28  static void play(int source, bool atListener);
29  static void stop(int source);
30  static void stopAll();
31 
32  static void setEnabled(bool on);
33  static bool getEnabled();
34 
35  static void setVolume(float vol);
36  static float getVolume();
37 
38  private:
39  static bool init;
40  static bool enabled;
41  static float volume;
42 
43  static std::vector<unsigned int> buffers;
44  static std::vector<unsigned int> sources;
45  static std::vector<unsigned int> listenerSources;
46 
47  static glm::vec3 lastPosition;
48 };
49 
50 #endif
51 
static void setEnabled(bool on)
Definition: SoundAL.cpp:243
static int initialize()
Definition: SoundAL.cpp:33
static void clear()
Definition: SoundAL.cpp:74
static float getVolume()
Definition: SoundAL.cpp:258
static int loadBuffer(unsigned char *buffer, unsigned int length)
Definition: SoundAL.cpp:113
static glm::vec3 lastPosition
Definition: SoundAL.h:47
static bool init
Definition: SoundAL.h:39
static void stopAll()
Definition: SoundAL.cpp:235
static bool enabled
Definition: SoundAL.h:40
static void play(int source, bool atListener)
Definition: SoundAL.cpp:208
static int numSources(bool atListener)
Definition: SoundAL.cpp:129
static std::vector< unsigned int > listenerSources
Definition: SoundAL.h:45
static bool getEnabled()
Definition: SoundAL.cpp:247
static std::vector< unsigned int > sources
Definition: SoundAL.h:44
static void stop(int source)
Definition: SoundAL.cpp:225
static void setVolume(float vol)
Definition: SoundAL.cpp:251
static void listenAt(glm::vec3 pos, glm::vec3 at, glm::vec3 up)
Definition: SoundAL.cpp:191
static void shutdown()
Definition: SoundAL.cpp:61
static int numBuffers()
Definition: SoundAL.cpp:109
static std::vector< unsigned int > buffers
Definition: SoundAL.h:43
static float volume
Definition: SoundAL.h:41
static int addSource(int buffer, float volume, bool atListener, bool loop)
Definition: SoundAL.cpp:136
static int sourceAt(int source, glm::vec3 pos)
Definition: SoundAL.cpp:175