OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
Sound.cpp
Go to the documentation of this file.
1 
8 #include "global.h"
9 #include "system/Sound.h"
10 
11 #ifdef USING_AL
12 #include "system/SoundAL.h"
13 #endif
14 
16 #ifdef USING_AL
17  return SoundAL::initialize();
18 #else
19  return 0;
20 #endif
21 }
22 
24 #ifdef USING_AL
26 #endif
27 }
28 
29 void Sound::clear() {
30 #ifdef USING_AL
32 #endif
33 }
34 
36 #ifdef USING_AL
37  return SoundAL::numBuffers();
38 #else
39  return 0;
40 #endif
41 }
42 
43 int Sound::loadBuffer(unsigned char* buffer, unsigned int length) {
44 #ifdef USING_AL
45  return SoundAL::loadBuffer(buffer, length);
46 #else
47  return 0;
48 #endif
49 }
50 
51 int Sound::numSources(bool atListener) {
52 #ifdef USING_AL
53  return SoundAL::numSources(atListener);
54 #else
55  return 0;
56 #endif
57 }
58 
59 int Sound::addSource(int buffer, float volume, bool atListener, bool loop) {
60 #ifdef USING_AL
61  return SoundAL::addSource(buffer, volume, atListener, loop);
62 #else
63  return 0;
64 #endif
65 }
66 
67 int Sound::sourceAt(int source, glm::vec3 pos) {
68 #ifdef USING_AL
69  return SoundAL::sourceAt(source, pos);
70 #else
71  return 0;
72 #endif
73 }
74 
75 void Sound::listenAt(glm::vec3 pos, glm::vec3 at, glm::vec3 up) {
76 #ifdef USING_AL
77  SoundAL::listenAt(pos, at, up);
78 #endif
79 }
80 
81 void Sound::play(int source, bool atListener) {
82 #ifdef USING_AL
83  SoundAL::play(source, atListener);
84 #endif
85 }
86 
87 void Sound::stop(int source) {
88 #ifdef USING_AL
89  SoundAL::stop(source);
90 #endif
91 }
92 
94 #ifdef USING_AL
96 #endif
97 }
98 
99 void Sound::setEnabled(bool on) {
100 #ifdef USING_AL
102 #endif
103 }
104 
106 #ifdef USING_AL
107  return SoundAL::getEnabled();
108 #else
109  return false;
110 #endif
111 }
112 
113 void Sound::setVolume(float vol) {
114 #ifdef USING_AL
115  SoundAL::setVolume(vol);
116 #endif
117 }
118 
120 #ifdef USING_AL
121  return SoundAL::getVolume();
122 #else
123  return 0.0f;
124 #endif
125 }
126 
static void setEnabled(bool on)
Definition: SoundAL.cpp:243
static int initialize()
Definition: Sound.cpp:15
static float getVolume()
Definition: Sound.cpp:119
static int initialize()
Definition: SoundAL.cpp:33
static void clear()
Definition: SoundAL.cpp:74
static void listenAt(glm::vec3 pos, glm::vec3 at, glm::vec3 up)
Definition: Sound.cpp:75
static float getVolume()
Definition: SoundAL.cpp:258
static void stop(int source)
Definition: Sound.cpp:87
static int loadBuffer(unsigned char *buffer, unsigned int length)
Definition: SoundAL.cpp:113
Included everywhere.
static void shutdown()
Definition: Sound.cpp:23
static int numBuffers()
Definition: Sound.cpp:35
static int sourceAt(int source, glm::vec3 pos)
Definition: Sound.cpp:67
static void stopAll()
Definition: SoundAL.cpp:235
OpenAL Sound Implementation.
static void play(int source, bool atListener)
Definition: SoundAL.cpp:208
static void setEnabled(bool on=true)
Definition: Sound.cpp:99
static int loadBuffer(unsigned char *buffer, unsigned int length)
Definition: Sound.cpp:43
static int numSources(bool atListener)
Definition: SoundAL.cpp:129
static bool getEnabled()
Definition: SoundAL.cpp:247
static void stop(int source)
Definition: SoundAL.cpp:225
static int addSource(int buffer, float volume=1.0f, bool atListener=false, bool loop=false)
Definition: Sound.cpp:59
static void setVolume(float vol)
Definition: SoundAL.cpp:251
static bool getEnabled()
Definition: Sound.cpp:105
static void listenAt(glm::vec3 pos, glm::vec3 at, glm::vec3 up)
Definition: SoundAL.cpp:191
static void shutdown()
Definition: SoundAL.cpp:61
static void setVolume(float vol=1.0f)
Definition: Sound.cpp:113
static int numBuffers()
Definition: SoundAL.cpp:109
static void stopAll()
Definition: Sound.cpp:93
static int numSources(bool atListener=false)
Definition: Sound.cpp:51
static int addSource(int buffer, float volume, bool atListener, bool loop)
Definition: SoundAL.cpp:136
static void clear()
Definition: Sound.cpp:29
Sound Interface.
static int sourceAt(int source, glm::vec3 pos)
Definition: SoundAL.cpp:175
static void play(int source, bool atListener=false)
Definition: Sound.cpp:81