UGDK  0.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sample.h
Go to the documentation of this file.
1 #ifndef HORUSEYE_FRAMEWORK_SAMPLE_H_
2 #define HORUSEYE_FRAMEWORK_SAMPLE_H_
3 
4 #include <string>
5 #include "SDL_mixer.h"
6 
7 namespace ugdk {
8 
9 class AudioManager;
10 
17 class Sample {
18  public:
20  void Play();
21 
23  void PlayForever();
24 
26  void Play(int loops);
27 
29  void Stop();
30 
32  bool IsPlaying();
33 
35 
38  void SetVolume(double vol);
39 
41 
42  double Volume();
43 
44  private:
45  Sample(const std::string& filepath);
46  ~Sample();
47  Mix_Chunk *data_;
48  int channel_;
49  double volume_;
50 
51  friend class AudioManager;
52 };
53 
54 } // namespace ugdk
55 
56 #endif