Added a new SoundManager based on OpenAL. I also simplified the API along the
[supertux.git] / src / audio / sound_source.h
1 #ifndef __SOUND_SOURCE_H__
2 #define __SOUND_SOURCE_H__
3
4 #include <AL/al.h>
5 #include "math/vector.h"
6
7 class SoundSource
8 {
9 public:
10   SoundSource();
11   virtual ~SoundSource();
12
13   void play();
14   void stop();
15   bool playing();
16
17   void set_looping(bool looping);
18   /// Set volume (0.0 is silent, 1.0 is normal)
19   void set_gain(float gain);
20   void set_position(Vector position);
21   void set_velocity(Vector position);
22   void set_reference_distance(float distance);
23
24 protected:
25   friend class SoundManager;
26   
27   ALuint source;
28 };
29
30 #endif
31