Building Game Engines
AudioManager.hpp
Go to the documentation of this file.
1 #ifndef AUDIO_MANAGER_HPP
2 #define AUDIO_MANAGER_HPP
3 
4 #include <SDL2/SDL.h>
5 #include <SDL2/SDL_mixer.h>
6 
10 class AudioManager {
11  public:
15  static AudioManager* GetInstance();
16 
20  void Start();
21 
25  void Shutdown();
26 
30  void Play(int clip);
31 
32  private:
33  // The static instance of the audio manager
34  static AudioManager* instance;
35 
36  // A private constructor
37  AudioManager() {};
38 
39  // A private alternate constructor that cannot be used
40  AudioManager(AudioManager const&);
41 
42  // A private copy constructor that cannot be used
43  void operator=(AudioManager const&);
44 
45  // Points to the background music for the game
46  Mix_Music* backgroundMusic;
47 
48  // Points to the jump sound effect for the player
49  Mix_Chunk* jumpSFX;
50 };
51 
52 #endif
void Play(int clip)
Definition: AudioManager.cpp:42
static AudioManager * GetInstance()
Definition: AudioManager.cpp:11
void Shutdown()
Definition: AudioManager.cpp:37
Definition: AudioManager.hpp:10
void Start()
Definition: AudioManager.cpp:19