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