Jazz2::Resources::SoundResource struct

Specific sound resource (from metadata).

A named sound declared in an object's metadata, holding the list of shared GenericSoundResource buffers it can use. When the sound has several variants, one of the buffers is chosen at playback time. Stored in a Metadata keyed by the sound's name.

Constructors, destructors, conversion operators

SoundResource() noexcept
Creates a new instance.

Public variables

SmallVector<GenericSoundResource*, 1> Buffers
List of underlying generic resources, empty until the samples are loaded.
SmallVector<String, 1> Paths
Paths of the samples this sound picks from.
bool Unavailable
Whether loading the samples has already been attempted and failed.

Variable documentation

SmallVector<String, 1> Jazz2::Resources::SoundResource::Paths

Paths of the samples this sound picks from.

Kept for the lifetime of the metadata so Buffers can be filled the first time the sound is actually played and dropped again afterwards, without reparsing the metadata. A sound is a name and a handful of short paths; the samples behind them are what costs memory (see ContentResolver::ResolveSound()).