UGDK
|
00001 #ifndef HORUSEYE_FRAMEWORK_AUDIOMANAGER_H_ 00002 #define HORUSEYE_FRAMEWORK_AUDIOMANAGER_H_ 00003 00004 #include <string> 00005 #include <map> 00006 #include <ugdk/audio/music.h> 00007 #include <ugdk/audio/sample.h> 00008 00009 #define AUDIO_MANAGER() ugdk::Engine::reference()->audio_manager() 00010 00011 namespace ugdk { 00012 00013 // Gerenciador de audio 00014 class AudioManager { 00015 public: 00016 AudioManager(); 00017 ~AudioManager(); 00018 00020 00022 bool Initialize(); 00023 00025 00027 bool Release(); 00028 00030 void Update(); 00031 00033 00035 Sample* LoadSample(const std::string& filepath); 00036 00038 00040 Music* LoadMusic(const std::string& filepath); 00041 00043 00045 Music* CurrentMusic() const; 00046 00047 private: 00048 std::map<std::string, Sample*> sample_data_; 00049 std::map<std::string, Music*> music_data_; 00050 static const int NUM_CHANNELS = 16; 00051 00052 void ReleaseSamples(); 00053 void ReleaseMusics(); 00054 }; 00055 00056 } // namespace ugdk 00057 00058 #endif