UGDK  0.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
music.h
Go to the documentation of this file.
1 #ifndef HORUSEYE_FRAMEWORK_MUSIC_H_
2 #define HORUSEYE_FRAMEWORK_MUSIC_H_
3 
4 #include <string>
5 #include "SDL_mixer.h"
6 
7 namespace ugdk {
8 
9 class AudioManager;
10 
15 class Music {
16  public:
18  void Play();
19 
21  void PlayForever();
22 
24  void Play(int loops);
25 
27  void Stop();
28 
30  bool IsPlaying() const;
31 
33  void Pause();
34 
36  void Unpause();
37 
39  bool IsPaused() const;
40 
42 
43  void SetVolume(double vol);
44 
46  double Volume();
47 
48  private:
49  Music(const std::string& filepath);
50  ~Music();
51  Mix_Music *data_;
52  double volume_;
53 
54  static void UpdateVolume(double vol);
55  static void MusicDone();
56  static Music *playing_music_;
57 
58  friend class AudioManager;
59 };
60 
61 } // namespace ugdk
62 
63 #endif