ScummVM API documentation
Draci::ZipSoundArchive Class Reference

#include <sound.h>

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

Public Member Functions

void openArchive (const char *path, const char *extension, SoundFormat format, int raw_frequency=0)
 
void closeArchive ()
 
uint size () const override
 
bool isOpen () const override
 
void clearCache () override
 
SoundSamplegetSample (int i, uint freq) override
 

Detailed Description

Reads ZIP archives with uncompressed files containing lossy-compressed samples in arbitrary format. Doesn't do any real caching and is thread-safe.

Member Function Documentation

◆ size()

uint Draci::ZipSoundArchive::size ( ) const
inlineoverridevirtual

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.

Implements Draci::SoundArchive.

◆ isOpen()

bool Draci::ZipSoundArchive::isOpen ( ) const
inlineoverridevirtual

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

Implements Draci::SoundArchive.

◆ clearCache()

void Draci::ZipSoundArchive::clearCache ( )
overridevirtual

Removes cached samples from memory.

Implements Draci::SoundArchive.

◆ getSample()

SoundSample* Draci::ZipSoundArchive::getSample ( int  i,
uint  freq 
)
overridevirtual

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).

Implements Draci::SoundArchive.


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