00001 #ifndef INPUT_OGG_H 00002 #define INPUT_OGG_H 00003 00004 00005 #include <vorbis/vorbisfile.h> 00006 #include "audiere.h" 00007 #include "basic_source.h" 00008 00009 00010 namespace audiere { 00011 00012 class OGGInputStream : public BasicSource { 00013 public: 00014 OGGInputStream(); 00015 ~OGGInputStream(); 00016 00017 bool initialize(FilePtr file); 00018 00019 void ADR_CALL getFormat( 00020 int& channel_count, 00021 int& sample_rate, 00022 SampleFormat& sample_format); 00023 int doRead(int frame_count, void* buffer); 00024 void ADR_CALL reset(); 00025 00026 bool ADR_CALL isSeekable(); 00027 int ADR_CALL getLength(); 00028 void ADR_CALL setPosition(int position); 00029 int ADR_CALL getPosition(); 00030 00031 private: 00032 static size_t FileRead(void* buffer, size_t size, size_t n, void* opaque); 00033 static int FileSeek(void* opaque, ogg_int64_t offset, int whence); 00034 static int FileClose(void* opaque); 00035 static long FileTell(void* opaque); 00036 00037 private: 00038 FilePtr m_file; 00039 00040 OggVorbis_File m_vorbis_file; 00041 00042 int m_channel_count; 00043 int m_sample_rate; 00044 SampleFormat m_sample_format; 00045 }; 00046 00047 } 00048 00049 #endif