SVN-Revision: 2418
[supertux.git] / src / object / ambient_sound.h
1 // ambient_sound.h   basti_
2 // 
3 //  SuperTux
4 //
5 //  This program is free software; you can redistribute it and/or
6 //  modify it under the terms of the GNU General Public License
7 //  as published by the Free Software Foundation; either version 2
8 //  of the License, or (at your option) any later version.
9 //
10 //  This program is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU General Public License for more details.
14 // 
15 //  You should have received a copy of the GNU General Public License
16 //  along with this program; if not, write to the Free Software
17 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 //  02111-1307, USA.
19
20 #ifndef __AMBIENT_SOUND_H__
21 #define __AMBIENT_SOUND_H__
22
23
24 #include "game_object.h"
25 #include "resources.h"
26 #include "player.h"
27
28 class AmbientSound : public GameObject
29 {
30 public:
31   AmbientSound(const lisp::Lisp& lisp);
32
33 protected:
34   virtual void hit(Player& player);
35   virtual void action(float time);
36   virtual void draw(DrawingContext&);
37   virtual void startPlaying();
38 private:
39   Vector position;
40   Sprite *sprite;
41
42   std::string sample;
43   int playing;
44   float distance_factor;
45
46   float distance_bias;
47   float silence_distance;
48
49   float * volume_ptr; // this will be used by the volume adjustment effect.
50 };
51
52 #endif
53