Merged changes from branches/supertux-milestone2-grumbel/ to trunk/supertux/
[supertux.git] / src / audio / dummy_sound_source.cpp
1 //  SuperTux
2 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
3 //
4 //  This program is free software: you can redistribute it and/or modify
5 //  it under the terms of the GNU General Public License as published by
6 //  the Free Software Foundation, either version 3 of the License, or
7 //  (at your option) any later version.
8 //
9 //  This program is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //  GNU General Public License for more details.
13 //
14 //  You should have received a copy of the GNU General Public License
15 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 #include "audio/sound_source.hpp"
18
19 class DummySoundSource : public SoundSource
20 {
21 public:
22   DummySoundSource() :
23     is_playing()
24   {}
25   virtual ~DummySoundSource()
26   {}
27
28   virtual void play()
29   {
30     is_playing = true;
31   }
32
33   virtual void stop()
34   {
35     is_playing = false;
36   }
37
38   virtual bool playing()
39   {
40     return is_playing;
41   }
42
43   virtual void set_looping(bool )
44   {
45   }
46
47   virtual void set_gain(float )
48   {
49   }
50
51   virtual void set_pitch(float )
52   {
53   }
54
55   virtual void set_position(const Vector& )
56   {
57   }
58
59   virtual void set_velocity(const Vector& )
60   {
61   }
62
63   virtual void set_reference_distance(float )
64   {
65   }
66
67   virtual void set_rollof_factor(float )
68   {
69   }
70
71 private:
72   bool is_playing;
73 };
74
75 SoundSource* create_dummy_sound_source()
76 {
77   return new DummySoundSource();
78 }
79
80 /* EOF */