Line data Source code
1 : /* Copyright (C) 2021 Wildfire Games.
2 : * This file is part of 0 A.D.
3 : *
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.
8 : *
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.
13 : *
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/>.
16 : */
17 :
18 : #ifndef INCLUDED_ISOUNDMANAGER_H
19 : #define INCLUDED_ISOUNDMANAGER_H
20 :
21 : #include "lib/config2.h"
22 : #include "lib/file/vfs/vfs_path.h"
23 : #include "ps/CStr.h"
24 : #include "simulation2/system/Entity.h"
25 :
26 : class CVector3D;
27 :
28 0 : class ISoundManager
29 : {
30 : public:
31 0 : virtual ~ISoundManager() {};
32 :
33 : static void CreateSoundManager();
34 : static void SetEnabled(bool doEnable);
35 : static void CloseGame();
36 :
37 : virtual void StartWorker() = 0;
38 :
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;
44 :
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;
50 :
51 : virtual void RunHardwareDetection() = 0;
52 : virtual CStr8 GetSoundCardNames() const = 0;
53 : virtual CStr8 GetOpenALVersion() const = 0;
54 :
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;
59 :
60 : virtual bool InDistress() = 0;
61 : };
62 :
63 : extern ISoundManager* g_SoundManager;
64 :
65 : #endif // INCLUDED_ISOUNDMANAGER_H
66 :
|