ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge
Inheritance diagram for Audio::VorbisStream:
Collaboration diagram for Audio::VorbisStream:

List of all members.

Public Member Functions

 VorbisStream (Common::SeekableReadStream *inStream, DisposeAfterUse::Flag dispose)
 ~VorbisStream ()
int readBuffer (int16 *buffer, const int numSamples)
 Fill the given buffer with up to numSamples samples.
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.
bool seek (const Timestamp &where)
 Seeks to a given offset in the stream.
Timestamp getLength () const
 Returns the length of the stream.

Protected Member Functions

bool refill ()

Protected Attributes

Common::DisposablePtr
< Common::SeekableReadStream
_inStream
bool _isStereo
int _rate
Timestamp _length
OggVorbis_File _ovFile
int16 _buffer [4096]
const int16_bufferEnd
const int16_pos

Detailed Description

Definition at line 91 of file vorbis.cpp.


Constructor & Destructor Documentation

Audio::VorbisStream::VorbisStream ( Common::SeekableReadStream inStream,
DisposeAfterUse::Flag  dispose 
)

Definition at line 123 of file vorbis.cpp.

Audio::VorbisStream::~VorbisStream (  ) 

Definition at line 150 of file vorbis.cpp.


Member Function Documentation

bool Audio::VorbisStream::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 113 of file vorbis.cpp.

Timestamp Audio::VorbisStream::getLength (  )  const [inline, virtual]

Returns the length of the stream.

Returns:
length as Timestamp.

Implements Audio::SeekableAudioStream.

Definition at line 118 of file vorbis.cpp.

int Audio::VorbisStream::getRate (  )  const [inline, virtual]

Sample rate of the stream.

Implements Audio::AudioStream.

Definition at line 115 of file vorbis.cpp.

bool Audio::VorbisStream::isStereo (  )  const [inline, virtual]

Is this a stereo stream?

Implements Audio::AudioStream.

Definition at line 114 of file vorbis.cpp.

int Audio::VorbisStream::readBuffer ( int16 buffer,
const int  numSamples 
) [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 154 of file vorbis.cpp.

bool Audio::VorbisStream::refill (  )  [protected]

Definition at line 183 of file vorbis.cpp.

bool Audio::VorbisStream::seek ( const Timestamp where  )  [virtual]

Seeks to a given offset in the stream.

Parameters:
where offset as timestamp
Returns:
true on success, false on failure.

Implements Audio::SeekableAudioStream.

Definition at line 170 of file vorbis.cpp.


Member Data Documentation

Definition at line 102 of file vorbis.cpp.

Definition at line 103 of file vorbis.cpp.

Definition at line 95 of file vorbis.cpp.

Definition at line 98 of file vorbis.cpp.

OggVorbis_File Audio::VorbisStream::_ovFile [protected]

Definition at line 100 of file vorbis.cpp.

const int16* Audio::VorbisStream::_pos [protected]

Definition at line 104 of file vorbis.cpp.

int Audio::VorbisStream::_rate [protected]

Definition at line 96 of file vorbis.cpp.


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


Generated on Sat Aug 17 2019 05:02:32 for ResidualVM by doxygen 1.7.1
curved edge   curved edge