Etterna 0.74.4
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 void Update();
40 void StartMixing(RageSoundBase* snd); /* used by RageSound */
41 void StopMixing(RageSoundBase* snd); /* used by RageSound */
42 bool Pause(RageSoundBase* snd, bool bPause); /* used by RageSound */
43 int64_t GetPosition(RageTimer* pTimer) const; /* used by RageSound */
44 float GetPlayLatency() const;
45 int GetDriverSampleRate() const;
46
47 RageSoundReader* GetLoadedSound(const std::string& sPath);
48 void AddLoadedSound(const std::string& sPath,
50
51 void fix_bogus_sound_driver_pref(std::string const& valid_setting);
52
53 private:
54 std::map<std::string, RageSoundReader_Preload*> m_mapPreloadedSounds;
55
56 RageSoundDriver* m_pDriver;
57
58 /* Prefs: */
59 float m_fVolumeOfNonCriticalSounds{ 1.0f };
60 // Swallow up warnings. If they must be used, define them.
61 RageSoundManager& operator=(const RageSoundManager& rhs);
63};
64
65extern RageSoundManager* SOUNDMAN;
66
67#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:130
Definition RageTimer.h:9
The parameters to play a sound.
Definition RageSound.h:51