xoreos  0.0.5
Public Member Functions | Static Public Attributes | List of all members
Sound::RewindableAudioStream Class Referenceabstract

A rewindable audio stream. More...

#include <audiostream.h>

Inheritance diagram for Sound::RewindableAudioStream:
Inheritance graph
[legend]
Collaboration diagram for Sound::RewindableAudioStream:
Collaboration graph
[legend]

Public Member Functions

virtual bool rewind ()=0
 Rewinds the stream to its start. More...
 
virtual uint64 getLength () const
 Estimate the total number of samples per channel in this stream. More...
 
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 int getChannels () const =0
 Return the number channels in this stream. More...
 
virtual int getRate () const =0
 Sample rate of the stream. More...
 
virtual bool endOfData () const =0
 End of data reached? If this returns true, it means that at this time there is no data available in the stream. 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...
 

Static Public Attributes

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

Detailed Description

A rewindable audio stream.

This allows for resetting the AudioStream to its initial state. Note that rewinding itself is not required to be working when the stream is being played by Mixer!

Definition at line 125 of file audiostream.h.

Member Function Documentation

◆ getDuration()

virtual uint64 Sound::RewindableAudioStream::getDuration ( ) const
inlinevirtual

Estimate the total duration of the stream in milliseconds.

If this value is not calculable, return kInvalidLength.

Reimplemented in Sound::ASFStream.

Definition at line 146 of file audiostream.h.

References getLength(), Sound::AudioStream::getRate(), and kInvalidLength.

Here is the call graph for this function:

◆ getLength()

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

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

If this value is not calculatable, return kInvalidLength.

Reimplemented in Sound::WwRIFFVorbisStream, Sound::EmptyAudioStream, Sound::VorbisStream, Sound::ASFStream, Sound::MP3Stream, Sound::PCMStream< is16Bit, isUnsigned, isLE >, and Sound::ADPCMStream.

Definition at line 140 of file audiostream.h.

References kInvalidLength.

Referenced by getDuration().

Here is the caller graph for this function:

◆ rewind()

virtual bool Sound::RewindableAudioStream::rewind ( )
pure virtual

Rewinds the stream to its start.

Returns
true on success, false otherwise.

Implemented in Sound::WwRIFFVorbisStream, Sound::EmptyAudioStream, Sound::VorbisStream, Sound::ASFStream, Sound::MP3Stream, Sound::PCMStream< is16Bit, isUnsigned, isLE >, and Sound::ADPCMStream.

Member Data Documentation

◆ kInvalidLength

const uint64 Sound::RewindableAudioStream::kInvalidLength = UINT64_C(0xFFFFFFFFFFFFFFFF)
static

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