ScummVM API documentation
Audio::SeekableAudioStream Class Referenceabstract

#include <audiostream.h>

Inheritance diagram for Audio::SeekableAudioStream:
Audio::RewindableAudioStream Audio::AudioStream Audio::ADPCMStream Audio::Mp3PspStream Audio::QuickTimeAudioDecoder::QuickTimeAudioTrack Audio::SubSeekableAudioStream Audio::VocStream AudioCDStream Macs2::MacsAudioStream Sci::SOLStream< STEREO, S16BIT, OLDDPCM8 >

Public Member Functions

bool seek (uint32 where)
 
virtual bool seek (const Timestamp &where)=0
 
virtual Timestamp getLength () const =0
 
bool rewind () override
 
- Public Member Functions inherited from Audio::AudioStream
virtual int readBuffer (int16 *buffer, const int numSamples)=0
 
virtual bool isStereo () const =0
 
virtual int getRate () const =0
 
virtual bool endOfData () const =0
 
virtual bool endOfStream () const
 

Static Public Member Functions

static SeekableAudioStreamopenStreamFile (const Common::Path &basename)
 

Detailed Description

A seekable audio stream.

Subclasses of this class implement an interface for seeking. The seeking itself is not required to be working while the stream is being played by the mixer.

Member Function Documentation

◆ openStreamFile()

static SeekableAudioStream* Audio::SeekableAudioStream::openStreamFile ( const Common::Path basename)
static

Attempt to load a file by trying all available formats.

In case of an error, the file handle will be closed, but deleting it is still the responsibility of the caller.

Parameters
basenameFile name without an extension.
Returns
A SeekableAudioStream ready to use in case of success. NULL in case of an error (e.g. invalid/non-existing file).

◆ seek() [1/2]

bool Audio::SeekableAudioStream::seek ( uint32  where)
inline

Seek to a given offset in the stream.

Parameters
whereOffset in milliseconds.
Returns
True on success, false on failure.

◆ seek() [2/2]

virtual bool Audio::SeekableAudioStream::seek ( const Timestamp where)
pure virtual

Seek to a given offset in the stream.

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

Implemented in Audio::SubSeekableAudioStream, Audio::Mp3PspStream, Macs2::MacsAudioStream, Audio::VocStream, Audio::QuickTimeAudioDecoder::QuickTimeAudioTrack, Audio::ADPCMStream, and AudioCDStream.

◆ getLength()

virtual Timestamp Audio::SeekableAudioStream::getLength ( ) const
pure virtual

◆ rewind()

bool Audio::SeekableAudioStream::rewind ( )
inlineoverridevirtual

Rewind the stream to its start.

Returns
True on success, false otherwise.

Implements Audio::RewindableAudioStream.

Reimplemented in Audio::ADPCMStream.


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