UGDK
|
00001 #ifndef HORUSEYE_FRAMEWORK_MUSIC_H_ 00002 #define HORUSEYE_FRAMEWORK_MUSIC_H_ 00003 00004 #include <string> 00005 #include "SDL_mixer.h" 00006 00007 namespace ugdk { 00008 00009 class AudioManager; 00010 00015 class Music { 00016 public: 00018 void Play(); 00019 00021 void PlayForever(); 00022 00024 void Play(int loops); 00025 00027 void Stop(); 00028 00030 bool IsPlaying() const; 00031 00033 void Pause(); 00034 00036 void Unpause(); 00037 00039 bool IsPaused() const; 00040 00042 00043 void SetVolume(double vol); 00044 00046 double Volume(); 00047 00048 private: 00049 Music(const std::string& filepath); 00050 ~Music(); 00051 Mix_Music *data_; 00052 double volume_; 00053 00054 static void UpdateVolume(double vol); 00055 static void MusicDone(); 00056 static Music *playing_music_; 00057 00058 friend class AudioManager; 00059 }; 00060 00061 } // namespace ugdk 00062 00063 #endif