Platformer
Platformer
SoundManager.hpp
1 #ifndef SOUND_MANAGER_HPP
2 #define SOUND_MANAGER_HPP
3 
4 #include <memory>
5 #include "SDLSoundWrapper.hpp"
6 
11 class SoundManager {
12  public:
14  bool init();
15 
17  void shutdown();
18 
20  static SoundManager& instance();
21 
23  static void PlaySound(
24  std::shared_ptr<SDLSoundWrapper> sound,
26  int times);
27 
29  SoundManager(const SoundManager&) = delete;
30 
32  SoundManager& operator=(const SoundManager&) = delete;
33 
34  private:
36  SoundManager();
37 
39  ~SoundManager();
40 };
41 
42 #endif
SoundManager & operator=(const SoundManager &)=delete
Stop the compiler from generating methods to copy the object.
~SoundManager()
Destructs a SoundManager.
Definition: SoundManager.cpp:6
This class manages the sounds of our game as a singleton.
Definition: SoundManager.hpp:11
static SoundManager & instance()
The singleton instance of the SoundManager.
Definition: SoundManager.cpp:8
bool init()
Initializes the SoundManager.
Definition: SoundManager.cpp:14
void shutdown()
Shuts down the SoundManager.
Definition: SoundManager.cpp:22
static void PlaySound(std::shared_ptr< SDLSoundWrapper > sound, int times)
Plays the given sound the given number of times.
Definition: SoundManager.cpp:24
SoundManager()
Constructs a SoundManager.
Definition: SoundManager.cpp:5