ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Grim::EMISubLoopingAudioStream Class Reference

This is a an extension of Audio::SubLooppingAudioStream that adds a start time parameter as well as a getter for the stream position. More...

Inheritance diagram for Grim::EMISubLoopingAudioStream:
Collaboration diagram for Grim::EMISubLoopingAudioStream:

List of all members.

Public Member Functions

 EMISubLoopingAudioStream (Audio::SeekableAudioStream *stream, uint loops, const Audio::Timestamp start, const Audio::Timestamp loopStart, const Audio::Timestamp loopEnd, DisposeAfterUse::Flag disposeAfterUse=DisposeAfterUse::YES)
int readBuffer (int16 *buffer, const int numSamples)
 Fill the given buffer with up to numSamples samples.
bool hasLooped () const
bool endOfData () const
 End of data reached? If this returns true, it means that at this time there is no data available in the stream.
bool isStereo () const
 Is this a stereo stream?
int getRate () const
 Sample rate of the stream.
Audio::Timestamp getPos () const

Private Attributes

Common::DisposablePtr
< Audio::SeekableAudioStream
_parent
Audio::Timestamp _pos
Audio::Timestamp _loopStart
Audio::Timestamp _loopEnd
bool _done
bool _hasLooped

Detailed Description

This is a an extension of Audio::SubLooppingAudioStream that adds a start time parameter as well as a getter for the stream position.

Definition at line 38 of file mp3track.cpp.


Constructor & Destructor Documentation

Grim::EMISubLoopingAudioStream::EMISubLoopingAudioStream ( Audio::SeekableAudioStream stream,
uint  loops,
const Audio::Timestamp  start,
const Audio::Timestamp  loopStart,
const Audio::Timestamp  loopEnd,
DisposeAfterUse::Flag  disposeAfterUse = DisposeAfterUse::YES 
) [inline]

Definition at line 40 of file mp3track.cpp.


Member Function Documentation

bool Grim::EMISubLoopingAudioStream::endOfData (  )  const [inline, virtual]

End of data reached? If this returns true, it means that at this time there is no data available in the stream.

However there may be more data in the future. This is used by e.g. a rate converter to decide whether to keep on converting data or stop.

Implements Audio::AudioStream.

Definition at line 87 of file mp3track.cpp.

Audio::Timestamp Grim::EMISubLoopingAudioStream::getPos (  )  const [inline]

Definition at line 91 of file mp3track.cpp.

int Grim::EMISubLoopingAudioStream::getRate (  )  const [inline, virtual]

Sample rate of the stream.

Implements Audio::AudioStream.

Definition at line 90 of file mp3track.cpp.

bool Grim::EMISubLoopingAudioStream::hasLooped (  )  const [inline]

Definition at line 86 of file mp3track.cpp.

bool Grim::EMISubLoopingAudioStream::isStereo (  )  const [inline, virtual]

Is this a stereo stream?

Implements Audio::AudioStream.

Definition at line 89 of file mp3track.cpp.

int Grim::EMISubLoopingAudioStream::readBuffer ( int16 buffer,
const int  numSamples 
) [inline, virtual]

Fill the given buffer with up to numSamples samples.

Returns the actual number of samples read, or -1 if a critical error occurred (note: you *must* check if this value is less than what you requested, this can happen when the stream is fully used up).

Data has to be in native endianess, 16 bit per sample, signed. For stereo stream, buffer will be filled with interleaved left and right channel samples, starting with a left sample. Furthermore, the samples in the left and right are summed up. So if you request 4 samples from a stereo stream, you will get a total of two left channel and two right channel samples.

Implements Audio::AudioStream.

Definition at line 56 of file mp3track.cpp.


Member Data Documentation

Definition at line 99 of file mp3track.cpp.

Definition at line 100 of file mp3track.cpp.


The documentation for this class was generated from the following file:


Generated on Sat Sep 21 2019 05:03:46 for ResidualVM by doxygen 1.7.1
curved edge   curved edge