Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CS_SNDSYS_CYCLICBUF_H__
00020 #define __CS_SNDSYS_CYCLICBUF_H__
00021
00026 namespace CS
00027 {
00028 namespace SndSys
00029 {
00030
00034 class CS_CRYSTALSPACE_EXPORT SoundCyclicBuffer
00035 {
00036 public:
00038 SoundCyclicBuffer(size_t buffer_size);
00039 ~SoundCyclicBuffer();
00040
00042 size_t GetFreeBytes();
00043
00049 void AddBytes(void *bytes_ptr, size_t bytes_length);
00050
00054 size_t GetStartValue();
00059 size_t GetEndValue();
00064 void AdvanceStartValue (size_t advance_amount);
00065
00069 void Clear (long value=0);
00070
00074 void GetDataPointersFromPosition (size_t* position_value, size_t max_length,
00075 uint8 **buffer1, size_t* buffer1_length, uint8 **buffer2,
00076 size_t* buffer2_length);
00077
00081 size_t GetLength() { return length; };
00082
00083 private:
00085 size_t length;
00087
00091 size_t start_value;
00092 size_t end_value;
00094
00096
00100 uint8 *buffer_base;
00101 uint8 *write_ptr;
00103 };
00104
00105 }
00106 }
00107
00108 #endif // __CS_SNDSYS_CYCLICBUF_H__