00001
00024 #ifndef FILESTREAMUPDATER_H_INCLUDED
00025 #define FILESTREAMUPDATER_H_INCLUDED
00026 #include "openalpp/streamupdater.h"
00027 #include "stdlib.h"
00028 #include <vorbis/codec.h>
00029 #include <vorbis/vorbisfile.h>
00030 #include "openalpp/export.h"
00031
00032
00033
00034 namespace openalpp {
00035
00039 class OPENALPP_API FileStreamUpdater : public StreamUpdater
00040 {
00041 OggVorbis_File *oggfile_;
00042 const unsigned int buffersize_;
00043 ALshort *buffer;
00044 bool seekPending;
00045 float seekTime;
00046 bool looping_;
00047
00051 void seekNow(float time_s);
00052
00053 public:
00063 FileStreamUpdater(OggVorbis_File *oggfile,
00064 const ALuint buffer1,ALuint buffer2,
00065 ALenum format,unsigned int frequency,
00066 unsigned int buffersize);
00067
00068
00073 void run();
00074
00078 void seek(float time_s);
00079
00084 void setLooping(bool loop = true);
00085
00086 protected:
00090 virtual ~FileStreamUpdater();
00091 };
00092
00093 }
00094
00095 #endif