00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00019
00020 #ifndef header_streamed_raw_sample
00021 #define header_streamed_raw_sample
00022
00023 #include <stdlib.h>
00024 #include "../stream_soundprovider.h"
00025 #include "../soundbuffer.h"
00026
00027 class CL_Streamed_RawSample : public CL_StreamSoundProvider
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00044
00045 public:
00046 static CL_SoundBuffer *create(
00047 const char *filename,
00048 SoundFormat format,
00049 int frequency,
00050 CL_InputSourceProvider *inputprovider = NULL,
00051 bool looped = false);
00052
00059
00060 CL_Streamed_RawSample(
00061 const char *filename,
00062 SoundFormat format,
00063 int frequency,
00064 CL_InputSourceProvider *inputprovider = NULL,
00065 bool looped = false);
00066
00072
00073 virtual ~CL_Streamed_RawSample();
00074
00075 virtual CL_StreamSoundProvider_Session *begin_session();
00076
00077
00078 virtual void end_session(CL_StreamSoundProvider_Session *session);
00079
00080
00081
00082 protected:
00083 std::string filename;
00084 CL_InputSourceProvider *inputprovider;
00085 bool looped;
00086 SoundFormat format;
00087 int frequency;
00088 };
00089
00090 class CL_Streamed_RawSample_Session : public CL_StreamSoundProvider_Session
00091 {
00092 protected:
00093 CL_InputSource *input;
00094
00095 SoundFormat sample_format;
00096 int sample_size;
00097 int sample_freq;
00098 int sample_left;
00099 bool looped;
00100
00101 public:
00102 CL_Streamed_RawSample_Session(
00103 CL_InputSource *input,
00104 SoundFormat format,
00105 int frequency,
00106 bool looped);
00107
00108 virtual ~CL_Streamed_RawSample_Session();
00109
00110 virtual void stop() {};
00111 virtual bool play() { return false; };
00112 virtual bool set_position(int pos) { pos=pos; return false; };
00113
00114 virtual bool eof() const;
00115 virtual int get_data(void *data_ptr, int data_requested);
00116 virtual int get_frequency() const;
00117 virtual SoundFormat get_format() const;
00118 };
00119
00120 #endif