Etterna 0.75.1
Loading...
Searching...
No Matches
RageSoundManager.h
1/* RageSoundManager - A global singleton to interface RageSound and
2 * RageSoundDriver. */
3
4#ifndef RAGE_SOUND_MANAGER_H
5#define RAGE_SOUND_MANAGER_H
6
7#include <map>
8
9class RageSound;
10class RageSoundBase;
11class RageSoundDriver;
12struct RageSoundParams;
13class RageSoundReader;
15class RageTimer;
16
18{
19 public:
22
23 /* This may be called when shutting down, in order to stop all sounds. This
24 * should be called before shutting down threads that may have running
25 * sounds, in order to prevent DirectSound delays and glitches. Further
26 * attempts to start sounds will do nothing, and threads may be shut down.
27 */
28 void Shutdown();
29
30 void Init();
31
32 void SetMixVolume();
33 float GetVolumeOfNonCriticalSounds() const
34 {
35 return m_fVolumeOfNonCriticalSounds;
36 }
37 void SetVolumeOfNonCriticalSounds(float fVolumeOfNonCriticalSounds);
38
39 float GetActionVolume() const;
40 float GetBGMVolume() const;
41 float GetMasterVolume() const;
42
43 void Update();
44 void StartMixing(RageSoundBase* snd); /* used by RageSound */
45 void StopMixing(RageSoundBase* snd); /* used by RageSound */
46 bool Pause(RageSoundBase* snd, bool bPause); /* used by RageSound */
47 int64_t GetPosition(RageTimer* pTimer) const; /* used by RageSound */
48 float GetPlayLatency() const;
49 int GetDriverSampleRate() const;
50
51 RageSoundReader* GetLoadedSound(const std::string& sPath);
52 void AddLoadedSound(const std::string& sPath,
54
55 void fix_bogus_sound_driver_pref(std::string const& valid_setting);
56
57 private:
58 std::map<std::string, RageSoundReader_Preload*> m_mapPreloadedSounds;
59
60 RageSoundDriver* m_pDriver;
61
62 /* Prefs: */
63 float m_fVolumeOfNonCriticalSounds{ 1.0f };
64
65 // Swallow up warnings. If they must be used, define them.
66 RageSoundManager& operator=(const RageSoundManager& rhs);
68};
69
70extern RageSoundManager* SOUNDMAN;
71
72#endif
Definition RageSound.h:27
Definition RageSoundDriver.h:15
Definition RageSoundManager.h:18
Definition RageSoundReader_Preload.h:9
Definition RageSoundReader.h:7
Definition RageSound.h:135
Definition RageTimer.h:9
The parameters to play a sound.
Definition RageSound.h:51