00001 /* 00002 $Id: vorbis_soundprovider_generic.h,v 1.7 2000/10/21 13:38:58 mbn Exp $ 00003 00004 ------------------------------------------------------------------------ 00005 ClanLib, the platform independent game SDK. 00006 00007 This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE 00008 version 2. See COPYING for details. 00009 00010 For a total list of contributers see CREDITS. 00011 00012 ------------------------------------------------------------------------ 00013 */ 00014 00016 00017 #ifndef header_vorbis_soundprovider_generic 00018 #define header_vorbis_soundprovider_generic 00019 00020 #include "API/Vorbis/vorbis_soundprovider.h" 00021 #include "vorbis/codec.h" 00022 00023 class CL_VorbisSoundProvider_Generic 00024 { 00025 public: 00026 std::string name; 00027 CL_InputSourceProvider *provider; 00028 bool delete_provider; 00029 }; 00030 00031 class CL_VorbisStream : public CL_StreamSoundProvider_Session 00032 { 00033 public: 00034 CL_VorbisStream(CL_InputSource *input); 00035 virtual ~CL_VorbisStream(); 00036 00037 virtual bool eof() const; 00038 virtual void stop(); 00039 virtual bool play(); 00040 virtual bool set_position(int pos); 00041 virtual int get_data(void *data_ptr, int data_requested); 00042 virtual int get_frequency() const; 00043 virtual SoundFormat get_format() const; 00044 00045 private: 00046 void init(); 00047 void deinit(); 00048 void stream_data(); 00049 00050 bool inited; 00051 CL_InputSource *input; 00052 bool stream_eof; 00053 00054 ogg_sync_state oy; /* sync and verify incoming physical bitstream */ 00055 ogg_stream_state os; /* take physical pages, weld into a logical 00056 stream of packets */ 00057 ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */ 00058 ogg_packet op; /* one raw packet of data for decode */ 00059 00060 vorbis_info vi; /* struct that stores all the static vorbis bitstream 00061 settings */ 00062 vorbis_comment vc; /* struct that stores all the bitstream user comments */ 00063 vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ 00064 vorbis_block vb; /* local working space for packet->PCM decode */ 00065 }; 00066 00067 #endif
1.2.6 written by Dimitri van Heesch,
© 1997-2001