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
00020 #ifndef SOUND_STREAMINGSOUND_H
00021 #define SOUND_STREAMINGSOUND_H
00022
00023 #include <boost/scoped_ptr.hpp>
00024 #include <cassert>
00025 #include <boost/cstdint.hpp>
00026
00027 #include "LiveSound.h"
00028 #include "AudioDecoder.h"
00029 #include "SoundEnvelope.h"
00030 #include "SimpleBuffer.h"
00031 #include "StreamingSoundData.h"
00032 #include "sound_handler.h"
00033
00034
00035 namespace gnash {
00036 namespace sound {
00037 class StreamingSoundData;
00038 }
00039 namespace media {
00040 class MediaHandler;
00041 }
00042 }
00043
00044 namespace gnash {
00045 namespace sound {
00046
00048
00051 class StreamingSound : public LiveSound
00052 {
00053 public:
00054
00056
00061 StreamingSound(StreamingSoundData& def, media::MediaHandler& mh,
00062 sound_handler::StreamBlockId blockId);
00063
00064
00065 virtual bool eof() const;
00066
00068
00070 ~StreamingSound();
00071
00072 size_t currentBlock() const {
00073 return _currentBlock;
00074 }
00075
00076 private:
00077
00079
00082 virtual bool moreData();
00083
00085 virtual bool decodingCompleted() const {
00086 return _positionInBlock == 0 &&
00087 _currentBlock >= _soundDef.blockCount();
00088 }
00089
00091
00093 void decodeNextBlock();
00094
00095
00096 size_t _currentBlock;
00097
00098
00099 size_t _positionInBlock;
00100
00102
00106 StreamingSoundData& _soundDef;
00107 };
00108
00109
00110 }
00111 }
00112
00113 #endif