ScummVM API documentation
Audio::ADPCMStream Class Reference
Inheritance diagram for Audio::ADPCMStream:
Audio::SeekableAudioStream Audio::RewindableAudioStream Audio::AudioStream Audio::Ima_ADPCMStream Audio::MS_ADPCMStream Audio::Oki_ADPCMStream Audio::XA_ADPCMStream Tinsel::Tinsel_ADPCMStream Audio::Apple_ADPCMStream Audio::DK3_ADPCMStream Audio::DVI_ADPCMStream Audio::MSIma_ADPCMStream Tinsel::Tinsel4_ADPCMStream Tinsel::Tinsel6_ADPCMStream Tinsel::Tinsel8_ADPCMStream

Classes

struct  ADPCMStatus
 

Public Member Functions

 ADPCMStream (Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign)
 
virtual bool endOfData () const
 
virtual bool isStereo () const
 
virtual int getRate () const
 
virtual bool rewind ()
 
virtual bool seek (const Timestamp &where)
 
virtual Timestamp getLength () const
 
- Public Member Functions inherited from Audio::SeekableAudioStream
bool seek (uint32 where)
 
- Public Member Functions inherited from Audio::AudioStream
virtual int readBuffer (int16 *buffer, const int numSamples)=0
 
virtual bool endOfStream () const
 

Static Public Attributes

static const int16 _stepAdjustTable [16]
 

Protected Member Functions

virtual void reset ()
 

Protected Attributes

Common::DisposablePtr< Common::SeekableReadStream_stream
 
int32 _startpos
 
const int32 _endpos
 
const int _channels
 
const uint32 _blockAlign
 
uint32 _blockPos [2]
 
const int _rate
 
struct Audio::ADPCMStream::ADPCMStatus _status
 

Additional Inherited Members

- Static Public Member Functions inherited from Audio::SeekableAudioStream
static SeekableAudioStreamopenStreamFile (const Common::Path &basename)
 

Member Function Documentation

◆ endOfData()

virtual bool Audio::ADPCMStream::endOfData ( ) const
inlinevirtual

Check whether end of data has been reached.

If this returns true, it indicates that at this time there is no data available in the stream. However, there might be more data in the future.

This is used by e.g. a rate converter to decide whether to keep on converting data or to stop.

Implements Audio::AudioStream.

Reimplemented in Audio::MS_ADPCMStream, Audio::DVI_ADPCMStream, Audio::XA_ADPCMStream, and Audio::Oki_ADPCMStream.

◆ isStereo()

virtual bool Audio::ADPCMStream::isStereo ( ) const
inlinevirtual

Check whether this is a stereo stream.

Implements Audio::AudioStream.

◆ getRate()

virtual int Audio::ADPCMStream::getRate ( ) const
inlinevirtual

Sample rate of the stream.

Implements Audio::AudioStream.

◆ rewind()

virtual bool Audio::ADPCMStream::rewind ( )
virtual

Rewind the stream to its start.

Returns
True on success, false otherwise.

Reimplemented from Audio::SeekableAudioStream.

◆ seek()

virtual bool Audio::ADPCMStream::seek ( const Timestamp where)
inlinevirtual

Seek to a given offset in the stream.

Parameters
whereOffset as a timestamp.
Returns
True on success, false on failure.

Implements Audio::SeekableAudioStream.

◆ getLength()

virtual Timestamp Audio::ADPCMStream::getLength ( ) const
inlinevirtual

Return the length of the stream.

Returns
Length as a timestamp.

Implements Audio::SeekableAudioStream.

Member Data Documentation

◆ _stepAdjustTable

const int16 Audio::ADPCMStream::_stepAdjustTable[16]
static

This table is used by some ADPCM variants (IMA and OKI) to adjust the step for use on the next sample. The first 8 entries are identical to the second 8 entries. Hence, we could half the table in size. But since the lookup index is always a 4-bit nibble, it is more efficient to just keep it as it is.


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