UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
manager.h
Go to the documentation of this file.
1 #ifndef UGDK_AUDIO_MANAGER_H_
2 #define UGDK_AUDIO_MANAGER_H_
3 
4 #include <string>
5 #include <map>
6 #include <ugdk/audio/music.h>
7 #include <ugdk/audio/sample.h>
8 
9 namespace ugdk {
10 namespace audio {
11 
12 class Manager {
13  public:
14  Manager();
15  ~Manager();
16 
18 
20  bool Initialize();
21 
23  void Release();
24 
26  void Update();
27 
29 
31  Sample* LoadSample(const std::string& filepath);
32 
34 
36  Music* LoadMusic(const std::string& filepath);
37 
39 
41  Music* CurrentMusic() const;
42 
43  private:
44  static const int NUM_CHANNELS = 16;
45  std::map<std::string, Sample*> sample_data_;
46  std::map<std::string, Music*> music_data_;
47 
48  void ReleaseSamples();
49  void ReleaseMusics();
50 };
51 
52 } // namespace audio
53 } // namespace ugdk
54 
55 #endif // UGDK_AUDIO_MANAGER_H_
Sample * LoadSample(const std::string &filepath)
Loads an audio sample.
Definition: sample.h:18
Definition: animation.h:11
Definition: music.h:18
Definition: manager.h:12
Music * LoadMusic(const std::string &filepath)
Loads a music.
bool Initialize()
Initializes audio channels.
void Update()
Logical update. Currently does nothing.
Music * CurrentMusic() const
Getter for the music that is currently playing.
void Release()
Frees all audio samples and music, and closes the audio channels.