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/dummy_sound_source.hpp" |
18 | |
19 | #include <memory> |
20 | |
21 | #include "audio/sound_source.hpp" |
22 | |
23 | class DummySoundSource final : public SoundSource |
24 | { |
25 | public: |
26 | DummySoundSource() : |
27 | is_playing() |
28 | {} |
29 | virtual ~DummySoundSource() |
30 | {} |
31 | |
32 | virtual void play() override |
33 | { |
34 | is_playing = true; |
35 | } |
36 | |
37 | virtual void stop() override |
38 | { |
39 | is_playing = false; |
40 | } |
41 | |
42 | virtual bool playing() const override |
43 | { |
44 | return is_playing; |
45 | } |
46 | |
47 | virtual void set_looping(bool ) override |
48 | { |
49 | } |
50 | |
51 | virtual void set_relative(bool ) override |
52 | { |
53 | } |
54 | |
55 | virtual void set_gain(float ) override |
56 | { |
57 | } |
58 | |
59 | virtual void set_pitch(float ) override |
60 | { |
61 | } |
62 | |
63 | virtual void set_position(const Vector& ) override |
64 | { |
65 | } |
66 | |
67 | virtual void set_velocity(const Vector& ) override |
68 | { |
69 | } |
70 | |
71 | virtual void set_reference_distance(float ) override |
72 | { |
73 | } |
74 | |
75 | private: |
76 | bool is_playing; |
77 | |
78 | private: |
79 | DummySoundSource(const DummySoundSource&) = delete; |
80 | DummySoundSource& operator=(const DummySoundSource&) = delete; |
81 | }; |
82 | |
83 | std::unique_ptr<SoundSource> create_dummy_sound_source() |
84 | { |
85 | return std::make_unique<DummySoundSource>(); |
86 | } |
87 | |
88 | /* EOF */ |
89 | |