00001 /* 00002 $Id: stream_soundprovider.h,v 1.1 2001/03/06 15:09:12 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_stream_soundprovider 00018 #define header_stream_soundprovider 00019 00020 #include "soundformat.h" 00021 00022 class CL_StreamSoundProvider_Session; 00023 class CL_StreamSoundProvider 00024 //: Streamed soundprovider. 00025 // Interface to streamed sound sources. Used by the CL_SoundBuffer class to 00026 // start and stop playback. 00027 { 00028 public: 00029 virtual ~CL_StreamSoundProvider() { ; } 00030 00031 virtual CL_StreamSoundProvider_Session *begin_session()=0; 00032 //: Called by CL_SoundBuffer when a new session starts. 00035 00036 virtual void end_session(CL_StreamSoundProvider_Session *session)=0; 00037 //: Called by CL_SoundBuffer when a session has finished. After this call, 00038 //: CL_SoundBuffer will not access the session anymore. It can safely be deleted 00039 //: here (and in most cases should be delete here). 00040 }; 00041 00042 class CL_StreamSoundProvider_Session 00043 //: Streamed soundprovider playback session 00044 // Interface used by ClanLib during playback of streamed soundbuffers. 00045 { 00046 public: 00047 virtual ~CL_StreamSoundProvider_Session() { ; } 00048 00049 virtual bool eof() const =0; 00050 //: Returns true if no more input data is available. 00052 00053 virtual void stop()=0; 00054 //: Stops the current stream. 00055 00056 virtual bool play()=0; 00057 //: Start/continue playing of the stream. 00059 00060 virtual bool set_position(int pos)=0; 00061 //: Sets the position within the current stream. 00064 00065 virtual int get_data(void *data_ptr, int data_requested)=0; 00066 //: Called when a playback session needs more sample data. 00071 00072 virtual int get_frequency() const =0; 00073 //: Returns the playback frequency of the input data. 00075 00076 virtual SoundFormat get_format() const =0; 00077 //: Returns the playback sample format. 00079 }; 00080 00081 #endif
1.2.6 written by Dimitri van Heesch,
© 1997-2001