00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef VRS_SOUND_OGGSOUNDSTREAMAL_H
00019 #define VRS_SOUND_OGGSOUNDSTREAMAL_H
00020
00021
00022
00023
00024 #include <vrs/openal/erroral.h>
00025 #include <vrs/openal/soundstreamal.h>
00026 #include <vrs/openal/bufferal.h>
00027 #include <vrs/openal/memorydataal.h>
00028
00029
00030 struct vorbis_info;
00031 struct vorbis_comment;
00032 struct OggVorbis_File;
00033
00034
00035 namespace VRS
00036 {
00037 namespace SOUND
00038 {
00039 class VRS_OPENAL_API OGGSoundStreamAL : public SoundStreamAL
00040 {
00041
00042 private:
00043
00044 struct OggStreamWrapper
00045 {
00046 OggStreamWrapper();
00047 ~OggStreamWrapper();
00048 OggVorbis_File* m_oggStream;
00049 };
00050
00051 public:
00052
00053 OGGSoundStreamAL(const std::string fileName,
00054 SO<SourceAL> source = 0,
00055 unsigned int bufferSize = 32768,
00056 bool loopMode = false,
00057 bool enabled = true);
00058
00059 virtual ~OGGSoundStreamAL(void);
00060
00061 virtual bool create(void);
00062 virtual bool update(void);
00063 virtual void release(void);
00064
00065 VRS_TYPEINFO(OGGSoundStreamAL, SoundStreamAL);
00066 VRS_SERIALIZABLE(OGGSoundStreamAL);
00067
00068 protected:
00069
00070 OGGSoundStreamAL(void);
00071
00072 private:
00073
00074 bool stream(SO<BufferAL> buffer);
00075
00076 void display(void);
00077
00078 SO<BufferAL> backBuffer_;
00079 SO<BufferAL> frontBuffer_;
00080
00081 SO<MemoryDataAL> backBufferData_;
00082 SO<MemoryDataAL> frontBufferData_;
00083
00084 BufferDataAL::DataFormat format_;
00085
00086
00087
00088
00089 FILE* oggFile;
00090 OggStreamWrapper oggStream;
00091 vorbis_info* vorbisInfo;
00092 vorbis_comment* vorbisComment;
00093
00094 };
00095
00096 };
00097
00098 };
00099
00100 #endif //VRS_SOUND_OGGSOUNDSTREAMAL_H
00101