22 #ifndef AUDIO_AUDIOSTREAM_H 23 #define AUDIO_AUDIOSTREAM_H 25 #include "common/ptr.h" 26 #include "common/scummsys.h" 27 #include "common/types.h" 29 #include "audio/timestamp.h" 33 class SeekableReadStream;
70 virtual int readBuffer(int16 *buffer,
const int numSamples) = 0;
73 virtual bool isStereo()
const = 0;
76 virtual int getRate()
const = 0;
87 virtual bool endOfData()
const = 0;
116 virtual bool rewind() = 0;
129 virtual uint getCompleteIterations()
const = 0;
135 virtual void setRemainingIterations(uint loops) = 0;
174 int readBuffer(int16 *buffer,
const int numSamples);
175 bool endOfData()
const;
176 bool endOfStream()
const;
178 bool isStereo()
const {
return _parent->isStereo(); }
179 int getRate()
const {
return _parent->getRate(); }
187 uint _completeIterations;
235 return seek(
Timestamp(where, getRate()));
245 virtual bool seek(
const Timestamp &where) = 0;
254 virtual bool rewind() {
return seek(0); }
305 DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);
307 int readBuffer(int16 *buffer,
const int numSamples);
308 bool endOfData()
const;
309 bool endOfStream()
const;
311 bool isStereo()
const {
return _parent->isStereo(); }
312 int getRate()
const {
return _parent->getRate(); }
320 uint _completeIterations;
346 int readBuffer(int16 *buffer,
const int numSamples);
348 bool isStereo()
const {
return _parent->isStereo(); }
350 int getRate()
const {
return _parent->getRate(); }
352 bool endOfData()
const {
return (_pos >= _length) || _parent->endOfData(); }
353 bool endOfStream()
const {
return (_pos >= _length) || _parent->endOfStream(); }
381 DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES) = 0;
397 void queueBuffer(byte *data, uint32 size, DisposeAfterUse::Flag disposeAfterUse, byte flags);
405 virtual void finish() = 0;
411 virtual uint32 numQueuedStreams()
const = 0;
461 virtual void finish() = 0;
478 _rate(rate), _channels(channels), _stream(makeQueuingAudioStream(rate, channels == 2)) {}
484 int readBuffer(int16 *data,
const int numSamples) {
return _stream->readBuffer(data, numSamples); }
bool endOfData() const
Definition: audiostream.h:485
Definition: audiostream.h:123
int readBuffer(int16 *data, const int numSamples)
Definition: audiostream.h:484
bool endOfStream() const
Definition: audiostream.h:486
bool isStereo() const
Definition: audiostream.h:311
AudioStream * makeSilentAudioStream(int rate, bool stereo)
Definition: audiostream.h:334
QueuingAudioStream * makeQueuingAudioStream(int rate, bool stereo)
bool endOfStream() const
Definition: audiostream.h:353
Definition: timestamp.h:83
virtual bool endOfStream() const
Definition: audiostream.h:99
Definition: audiostream.h:446
Definition: audiostream.h:212
AudioStream * makeLimitingAudioStream(AudioStream *parentStream, const Timestamp &length, DisposeAfterUse::Flag disposeAfterUse=DisposeAfterUse::YES)
StatelessPacketizedAudioStream(uint rate, uint channels)
Definition: audiostream.h:477
int getRate() const
Definition: audiostream.h:350
void finish()
Definition: audiostream.h:490
bool endOfData() const
Definition: audiostream.h:352
Path
Definition: game.h:75
Definition: audiostream.h:144
uint getChannels() const
Definition: audiostream.h:495
int getRate() const
Definition: audiostream.h:483
bool seek(uint32 where)
Definition: audiostream.h:234
Definition: algorithm.h:29
Definition: audiostream.h:50
uint getCompleteIterations() const
Definition: audiostream.h:181
bool isStereo() const
Definition: audiostream.h:178
Definition: audiostream.h:109
int getRate() const
Definition: audiostream.h:179
Definition: audiostream.h:287
Definition: audiostream.h:471
Definition: audiostream.h:370
int getRate() const
Definition: audiostream.h:312
void setRemainingIterations(uint loops)
Definition: audiostream.h:315
Timestamp convertTimeToStreamPos(const Timestamp &where, int rate, bool isStereo)
virtual bool rewind()
Definition: audiostream.h:254
void queuePacket(Common::SeekableReadStream *data)
Definition: audiostream.h:489
bool isStereo() const
Definition: audiostream.h:348
bool isStereo() const
Definition: audiostream.h:482
AudioStream * makeNullAudioStream()
AudioStream * makeLoopingAudioStream(SeekableAudioStream *stream, Timestamp start, Timestamp end, uint loops)
Timestamp getLength() const
Definition: audiostream.h:357
void setRemainingIterations(uint loops)
Definition: audiostream.h:182
uint getCompleteIterations() const
Definition: audiostream.h:314