xoreos  0.0.5
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Sound::ADPCMStream Class Reference
Inheritance diagram for Sound::ADPCMStream:
Inheritance graph
[legend]
Collaboration diagram for Sound::ADPCMStream:
Collaboration graph
[legend]

Public Member Functions

 ADPCMStream (Common::SeekableReadStream *stream, bool disposeAfterUse, size_t size, int rate, int channels, uint32 blockAlign)
 
 ~ADPCMStream ()
 
virtual 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. More...
 
virtual int getChannels () const
 Return the number channels in this stream. More...
 
virtual int getRate () const
 Sample rate of the stream. More...
 
virtual uint64 getLength () const
 Estimate the total number of samples per channel in this stream. More...
 
virtual bool rewind ()
 Rewinds the stream to its start. More...
 
- Public Member Functions inherited from Sound::RewindableAudioStream
virtual uint64 getDuration () const
 Estimate the total duration of the stream in milliseconds. More...
 
- Public Member Functions inherited from Sound::AudioStream
virtual ~AudioStream ()
 
virtual size_t readBuffer (int16 *buffer, const size_t numSamples)=0
 Fill the given buffer with up to numSamples samples. More...
 
virtual bool endOfStream () const
 End of stream reached? If this returns true, it means that all data in this stream is used up and no additional data will appear in it in the future. More...
 

Protected Member Functions

virtual void reset ()
 
int16 stepAdjust (byte)
 

Protected Attributes

Common::DisposablePtr< Common::SeekableReadStream_stream
 
const size_t _size
 
const size_t _startpos
 
const size_t _endpos
 
const int _channels
 
const uint32 _blockAlign
 
uint32 _blockPos [2]
 
const int _rate
 
uint64 _length
 
struct {
   struct {
      int32   last
 
      int32   stepIndex
 
   }   ima_ch [2]
 
_status
 

Additional Inherited Members

- Static Public Attributes inherited from Sound::RewindableAudioStream
static const uint64 kInvalidLength = UINT64_C(0xFFFFFFFFFFFFFFFF)
 
- Static Public Attributes inherited from Sound::AudioStream
static const size_t kSizeInvalid = SIZE_MAX
 

Detailed Description

Definition at line 61 of file adpcm.cpp.

Constructor & Destructor Documentation

◆ ADPCMStream()

Sound::ADPCMStream::ADPCMStream ( Common::SeekableReadStream stream,
bool  disposeAfterUse,
size_t  size,
int  rate,
int  channels,
uint32  blockAlign 
)

Definition at line 104 of file adpcm.cpp.

References reset().

Here is the call graph for this function:

◆ ~ADPCMStream()

Sound::ADPCMStream::~ADPCMStream ( )

Definition at line 117 of file adpcm.cpp.

Member Function Documentation

◆ endOfData()

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

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 Sound::AudioStream.

Definition at line 89 of file adpcm.cpp.

References _endpos, and _stream.

◆ getChannels()

virtual int Sound::ADPCMStream::getChannels ( ) const
inlinevirtual

Return the number channels in this stream.

Implements Sound::AudioStream.

Definition at line 90 of file adpcm.cpp.

References _channels.

◆ getLength()

virtual uint64 Sound::ADPCMStream::getLength ( ) const
inlinevirtual

Estimate the total number of samples per channel in this stream.

If this value is not calculatable, return kInvalidLength.

Reimplemented from Sound::RewindableAudioStream.

Definition at line 92 of file adpcm.cpp.

References _length.

◆ getRate()

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

Sample rate of the stream.

Implements Sound::AudioStream.

Definition at line 91 of file adpcm.cpp.

References _rate.

◆ reset()

void Sound::ADPCMStream::reset ( )
protectedvirtual

◆ rewind()

bool Sound::ADPCMStream::rewind ( )
virtual

Rewinds the stream to its start.

Returns
true on success, false otherwise.

Implements Sound::RewindableAudioStream.

Definition at line 125 of file adpcm.cpp.

References _startpos, _stream, and reset().

Here is the call graph for this function:

◆ stepAdjust()

int16 Sound::ADPCMStream::stepAdjust ( byte  code)
protected

Definition at line 445 of file adpcm.cpp.

Referenced by Sound::Ima_ADPCMStream::decodeIMA().

Here is the caller graph for this function:

Member Data Documentation

◆ _blockAlign

const uint32 Sound::ADPCMStream::_blockAlign
protected

◆ _blockPos

uint32 Sound::ADPCMStream::_blockPos[2]
protected

◆ _channels

const int Sound::ADPCMStream::_channels
protected

◆ _endpos

const size_t Sound::ADPCMStream::_endpos
protected

◆ _length

uint64 Sound::ADPCMStream::_length
protected

◆ _rate

const int Sound::ADPCMStream::_rate
protected

Definition at line 70 of file adpcm.cpp.

Referenced by getRate().

◆ _size

const size_t Sound::ADPCMStream::_size
protected

◆ _startpos

const size_t Sound::ADPCMStream::_startpos
protected

Definition at line 65 of file adpcm.cpp.

Referenced by rewind().

◆ _status

struct { ... } Sound::ADPCMStream::_status

◆ _stream

Common::DisposablePtr<Common::SeekableReadStream> Sound::ADPCMStream::_stream
protected

◆ ima_ch

struct { ... } Sound::ADPCMStream::ima_ch[2]

◆ last

int32 Sound::ADPCMStream::last

Definition at line 77 of file adpcm.cpp.

◆ stepIndex

int32 Sound::ADPCMStream::stepIndex

Definition at line 78 of file adpcm.cpp.


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