1 /* Copyright (C) 2021 Wildfire Games.
2 * This file is part of 0 A.D.
4 * 0 A.D. 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 2 of the License, or
7 * (at your option) any later version.
9 * 0 A.D. 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.
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef INCLUDED_ISOUNDMANAGER_H
19 #define INCLUDED_ISOUNDMANAGER_H
21 #include "lib/config2.h"
22 #include "lib/file/vfs/vfs_path.h"
24 #include "simulation2/system/Entity.h"
31 virtual ~ISoundManager() {};
33 static void CreateSoundManager();
34 static void SetEnabled(bool doEnable
);
35 static void CloseGame();
37 virtual void StartWorker() = 0;
39 virtual void IdleTask() = 0;
40 virtual void Pause(bool pauseIt
) = 0;
41 virtual void PauseMusic(bool pauseIt
) = 0;
42 virtual void PauseAmbient(bool pauseIt
) = 0;
43 virtual void PauseAction(bool pauseIt
) = 0;
45 virtual void SetMasterGain(float gain
) = 0;
46 virtual void SetMusicGain(float gain
) = 0;
47 virtual void SetAmbientGain(float gain
) = 0;
48 virtual void SetActionGain(float gain
) = 0;
49 virtual void SetUIGain(float gain
) = 0;
51 virtual void RunHardwareDetection() = 0;
52 virtual CStr8
GetSoundCardNames() const = 0;
53 virtual CStr8
GetOpenALVersion() const = 0;
55 virtual void PlayAsUI(const VfsPath
& itemPath
, bool looping
) = 0;
56 virtual void PlayAsMusic(const VfsPath
& itemPath
, bool looping
) = 0;
57 virtual void PlayAsAmbient(const VfsPath
& itemPath
, bool looping
) = 0;
58 virtual void PlayAsGroup(const VfsPath
& groupPath
, const CVector3D
& sourcePos
, entity_id_t source
, bool ownedSound
) = 0;
60 virtual bool InDistress() = 0;
63 extern ISoundManager
* g_SoundManager
;
65 #endif // INCLUDED_ISOUNDMANAGER_H