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

Grim::SCXStream Class Reference

#include <scx.h>

Inheritance diagram for Grim::SCXStream:
Collaboration diagram for Grim::SCXStream:

List of all members.

Public Member Functions

 SCXStream (Common::SeekableReadStream *stream, const Audio::Timestamp *start, DisposeAfterUse::Flag disposeAfterUse)
 ~SCXStream ()
bool isStereo () const override
 Is this a stereo stream?
bool endOfData () const override
 End of data reached? If this returns true, it means that at this time there is no data available in the stream.
int getRate () const override
 Sample rate of the stream.
int readBuffer (int16 *buffer, const int numSamples) override
 Fill the given buffer with up to numSamples samples.
bool rewind () override
 Rewinds the stream to its start.
Audio::Timestamp getPos () const

Private Attributes

int _channels
int _rate
uint16 _blockSize
Common::SeekableReadStream_fileStreams [SCX_MAX_CHANNELS]
Audio::RewindableAudioStream_xaStreams [SCX_MAX_CHANNELS]

Detailed Description

Definition at line 35 of file scx.h.


Constructor & Destructor Documentation

Grim::SCXStream::SCXStream ( Common::SeekableReadStream stream,
const Audio::Timestamp start,
DisposeAfterUse::Flag  disposeAfterUse 
)

Definition at line 32 of file scx.cpp.

Grim::SCXStream::~SCXStream (  ) 

Definition at line 140 of file scx.cpp.


Member Function Documentation

bool Grim::SCXStream::endOfData (  )  const [inline, override, 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 41 of file scx.h.

Audio::Timestamp Grim::SCXStream::getPos (  )  const

Definition at line 185 of file scx.cpp.

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

Sample rate of the stream.

Implements Audio::AudioStream.

Definition at line 42 of file scx.h.

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

Is this a stereo stream?

Implements Audio::AudioStream.

Definition at line 40 of file scx.h.

int Grim::SCXStream::readBuffer ( int16 buffer,
const int  numSamples 
) [override, 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 145 of file scx.cpp.

bool Grim::SCXStream::rewind (  )  [override, virtual]

Rewinds the stream to its start.

Returns:
true on success, false otherwise.

Implements Audio::RewindableAudioStream.

Definition at line 178 of file scx.cpp.


Member Data Documentation

Definition at line 51 of file scx.h.

Definition at line 49 of file scx.h.

Definition at line 53 of file scx.h.

int Grim::SCXStream::_rate [private]

Definition at line 50 of file scx.h.

Definition at line 54 of file scx.h.


The documentation for this class was generated from the following files:
  • engines/grim/emi/sound/codecs/scx.h
  • engines/grim/emi/sound/codecs/scx.cpp


Generated on Sat Oct 19 2019 05:05:32 for ResidualVM by doxygen 1.7.1
curved edge   curved edge