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

List of all members.

Public Member Functions

 XAStream (Common::SeekableReadStream *stream, int rate, DisposeAfterUse::Flag disposeAfterUse)
 ~XAStream ()
bool isStereo () const
 Is this a stereo stream?
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.
int getRate () const
 Sample rate of the stream.
int readBuffer (int16 *buffer, const int numSamples)
 Fill the given buffer with up to numSamples samples.
bool rewind ()
 Rewinds the stream to its start.

Private Member Functions

void seekToPos (uint pos)

Private Attributes

Common::SeekableReadStream_stream
DisposeAfterUse::Flag _disposeAfterUse
byte _predictor
double _samples [28]
byte _samplesRemaining
int _rate
double _s1
double _s2
uint _loopPoint
bool _endOfData

Detailed Description

Definition at line 29 of file xa.cpp.


Constructor & Destructor Documentation

Audio::XAStream::XAStream ( Common::SeekableReadStream stream,
int  rate,
DisposeAfterUse::Flag  disposeAfterUse 
)

Definition at line 55 of file xa.cpp.

Audio::XAStream::~XAStream (  ) 

Definition at line 66 of file xa.cpp.


Member Function Documentation

bool Audio::XAStream::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 35 of file xa.cpp.

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

Sample rate of the stream.

Implements Audio::AudioStream.

Definition at line 36 of file xa.cpp.

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

Is this a stereo stream?

Implements Audio::AudioStream.

Definition at line 34 of file xa.cpp.

int Audio::XAStream::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 79 of file xa.cpp.

bool Audio::XAStream::rewind (  )  [virtual]

Rewinds the stream to its start.

Returns:
true on success, false otherwise.

Implements Audio::RewindableAudioStream.

Definition at line 147 of file xa.cpp.

void Audio::XAStream::seekToPos ( uint  pos  )  [private]

Definition at line 152 of file xa.cpp.


Member Data Documentation

Definition at line 42 of file xa.cpp.

Definition at line 52 of file xa.cpp.

Definition at line 51 of file xa.cpp.

Definition at line 46 of file xa.cpp.

int Audio::XAStream::_rate [private]

Definition at line 49 of file xa.cpp.

double Audio::XAStream::_s1 [private]

Definition at line 50 of file xa.cpp.

double Audio::XAStream::_s2 [private]

Definition at line 50 of file xa.cpp.

double Audio::XAStream::_samples[28] [private]

Definition at line 47 of file xa.cpp.

Definition at line 48 of file xa.cpp.

Definition at line 41 of file xa.cpp.


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


Generated on Sat May 18 2019 05:05:44 for ResidualVM by doxygen 1.7.1
curved edge   curved edge