ScummVM API documentation
Draci::SoundArchive Class Referenceabstract

#include <sound.h>

Inheritance diagram for Draci::SoundArchive:
Draci::LegacySoundArchive Draci::ZipSoundArchive

Public Member Functions

virtual uint size () const =0
 
virtual bool isOpen () const =0
 
virtual void clearCache ()=0
 
virtual SoundSamplegetSample (int i, uint freq)=0
 

Detailed Description

An abstract wrapper around archives of sound samples or dubbing.

Member Function Documentation

◆ size()

virtual uint Draci::SoundArchive::size ( ) const
pure virtual

Returns the number of sound samples in the archive. Zero means that a fake empty archive has been opened and the caller may consider opening a different one, for example with compressed music.

Implemented in Draci::ZipSoundArchive, and Draci::LegacySoundArchive.

◆ isOpen()

virtual bool Draci::SoundArchive::isOpen ( ) const
pure virtual

Checks whether there is an archive opened. Should be called before reading from the archive to check whether opening of the archive has succeeded.

Implemented in Draci::ZipSoundArchive, and Draci::LegacySoundArchive.

◆ clearCache()

virtual void Draci::SoundArchive::clearCache ( )
pure virtual

Removes cached samples from memory.

Implemented in Draci::ZipSoundArchive, and Draci::LegacySoundArchive.

◆ getSample()

virtual SoundSample* Draci::SoundArchive::getSample ( int  i,
uint  freq 
)
pure virtual

Caches a given sample into memory and returns a pointer into it. We own the returned pointer, but the user may call .close() on it, which deallocates the memory of the actual sample data. If freq is nonzero, then the sample is played at a different frequency (only works for uncompressed samples).

Implemented in Draci::ZipSoundArchive, and Draci::LegacySoundArchive.


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