UtiLite  0.3.1
A lite utilities library
audio/include/utilite/UAudioPlayer.h
Go to the documentation of this file.
00001 
00007 #ifndef UAUDIOPLAYER_H
00008 #define UAUDIOPLAYER_H
00009 
00010 #include "utilite/UtiLiteAudioExp.h" // DLL export/import defines
00011 
00012 #include <string>
00013 
00014 class FMOD_SOUND;
00015 class FMOD_CHANNEL;
00016 
00017 
00024 class UTILITEAUDIO_EXP UAudioPlayer
00025 {
00026 public:
00027     UAudioPlayer();
00028     UAudioPlayer(const std::string & fileName);
00029 
00030     void setFileName(const std::string & fileName) {_fileName = fileName;}
00031     const std::string & getFileName() {return _fileName;}
00032 
00033     virtual ~UAudioPlayer();
00034 
00035     virtual void play();
00036     virtual void pause();
00037     virtual void stop();
00038     virtual unsigned int positionMs();
00039     virtual unsigned int getSoundLengthMs();
00040 
00041     virtual bool isPlaying();
00042 
00043     virtual void setPositionMs(unsigned int pos);
00044 
00045     virtual int init();
00046 
00047 protected:
00048 
00049 protected:
00050     FMOD_SOUND * _sound;
00051     FMOD_CHANNEL * _channel;;
00052     std::string _fileName;
00053 };
00054 
00055 #endif
 All Classes Files Functions Variables Enumerations Friends Defines