1/*
2 * LegacyClonk
3 *
4 * Copyright (c) 2017-2020, The LegacyClonk Team and contributors
5 *
6 * Distributed under the terms of the ISC license; see accompanying file
7 * "COPYING" for details.
8 *
9 * "Clonk" is a registered trademark of Matthes Bender, used with permission.
10 * See accompanying file "TRADEMARK" for details.
11 *
12 * To redistribute this file separately, substitute the full license texts
13 * for the above references.
14 */
15
16#pragma once
17
18#include "C4AudioSystem.h"
19
20class C4AudioSystemNone : public C4AudioSystem
21{
22public:
23 C4AudioSystemNone() = default;
24 void FadeOutMusic(std::int32_t) override {}
25 bool IsMusicPlaying() const override { return false; }
26 void PlayMusic(const MusicFile *const, bool) override {}
27 void SetMusicVolume(float) override {}
28 void StopMusic() override {}
29 void UnpauseMusic() override {}
30
31 class MusicFileNone : public MusicFile
32 {
33 public:
34 MusicFileNone() = default;
35 };
36
37 MusicFile *CreateMusicFile(const void *, std::size_t) override { return new MusicFileNone{}; }
38
39 class SoundChannelNone : public SoundChannel
40 {
41 public:
42 SoundChannelNone() = default;
43 bool IsPlaying() const override { return false; }
44 void SetPosition(std::uint32_t) override {}
45 void SetVolumeAndPan(float, float) override {}
46 void Unpause() override {}
47 };
48
49 SoundChannel *CreateSoundChannel(const SoundFile *const, bool) override { return new SoundChannelNone{}; }
50
51 class SoundFileNone : public SoundFile
52 {
53 public:
54 SoundFileNone() = default;
55 std::uint32_t GetDuration() const override { return 0u; }
56 };
57
58 SoundFile *CreateSoundFile(const void *, std::size_t) override { return new SoundFileNone{}; }
59};
60