UGDK
src/ugdk/audio/sample.h
Go to the documentation of this file.
00001 #ifndef HORUSEYE_FRAMEWORK_SAMPLE_H_
00002 #define HORUSEYE_FRAMEWORK_SAMPLE_H_
00003 
00004 #include <string>
00005 #include "SDL_mixer.h"
00006 
00007 namespace ugdk {
00008 
00009 class AudioManager;
00010 
00017 class Sample {
00018   public:
00020     void Play();
00021 
00023     void PlayForever();
00024 
00026     void Play(int loops);
00027 
00029     void Stop();
00030 
00032     bool IsPlaying();
00033 
00035 
00038     void SetVolume(double vol);
00039     
00041 
00042     double Volume(); 
00043 
00044   private:
00045     Sample(const std::string& filepath);
00046     ~Sample();
00047     Mix_Chunk *data_;
00048     int channel_;
00049     double volume_;
00050 
00051   friend class AudioManager;
00052 };
00053 
00054 }  // namespace ugdk
00055 
00056 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines