ScummVM API documentation
Draci::LegacySoundArchive Class Reference

#include <sound.h>

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

Public Member Functions

 LegacySoundArchive (const char *path, uint defaultFreq)
 
void openArchive (const char *path)
 
void closeArchive ()
 
uint size () const override
 
bool isOpen () const override
 
void clearCache () override
 
SoundSamplegetSample (int i, uint freq) override
 

Detailed Description

Reads CD.SAM (with dubbing) and CD2.SAM (with sound samples) from the original game. Caches all read samples in a thread-safe manner.

Member Function Documentation

◆ size()

uint Draci::LegacySoundArchive::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::LegacySoundArchive::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::LegacySoundArchive::clearCache ( )
overridevirtual

Removes cached samples from memory.

Implements Draci::SoundArchive.

◆ getSample()

SoundSample* Draci::LegacySoundArchive::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: