Go to the documentation of this file.00001 #pragma once
00002 #include <ogg/ogg.h>
00003 #include <vorbis/codec.h>
00004 #include <vorbis/vorbisenc.h>
00005 #include <vorbis/vorbisfile.h>
00006
00007 class ogg_stream
00008 {
00009 public:
00010 ogg_stream(bool& _loop, bool& _play);
00011
00012 bool create(rchar* path, float volume);
00013 bool recreate(void);
00014 void free();
00015 void play();
00016 void stop();
00017 void pause();
00018 void resume();
00019 bool isPlaying();
00020 void update();
00021 bool isLooping(){return m_loop;};
00022
00023 protected:
00024 bool stream(ALuint buffer);
00025 void empty();
00026
00027 private:
00028 FILE* oggFile;
00029 OggVorbis_File oggStream;
00030 vorbis_info* vorbisInfo;
00031
00032 ALuint source, buffers[2];
00033 ALenum format;
00034 bool& m_loop;
00035 bool& m_play;
00036 bool m_release;
00037 };