OpenXcom  1.0
Open-source clone of the original X-Com
Public Member Functions | List of all members
OpenXcom::SoundSet Class Reference

Container of a set of sounds. More...

#include <SoundSet.h>

Public Member Functions

 SoundSet ()
 Crates a sound set. More...
 
 ~SoundSet ()
 Cleans up the sound set. More...
 
void loadCat (const std::string &filename, bool wav=true)
 Loads an X-Com CAT set of sound files. More...
 
SoundgetSound (unsigned int i)
 Gets a particular sound from the set. More...
 
SoundaddSound (unsigned int i)
 Creates a new sound and returns a pointer to it. More...
 
size_t getTotalSounds () const
 Gets the total sounds in the set. More...
 
void loadCatbyIndex (const std::string &filename, int index)
 Loads a specific entry from a CAT file into the soundset. More...
 

Detailed Description

Container of a set of sounds.

Used to manage file sets that contain a pack of sounds inside.

Constructor & Destructor Documentation

◆ SoundSet()

OpenXcom::SoundSet::SoundSet ( )

Crates a sound set.

Sets up a new empty sound set.

◆ ~SoundSet()

OpenXcom::SoundSet::~SoundSet ( )

Cleans up the sound set.

Deletes the sounds from memory.

Member Function Documentation

◆ addSound()

Sound * OpenXcom::SoundSet::addSound ( unsigned int  i)

Creates a new sound and returns a pointer to it.

Creates and returns a particular wave in the sound set.

Parameters
iSound number in the set.
Returns
Pointer to the respective sound.

◆ getSound()

Sound * OpenXcom::SoundSet::getSound ( unsigned int  i)

Gets a particular sound from the set.

Returns a particular wave from the sound set.

Parameters
iSound number in the set.
Returns
Pointer to the respective sound.

◆ getTotalSounds()

size_t OpenXcom::SoundSet::getTotalSounds ( ) const

Gets the total sounds in the set.

Returns the total amount of sounds currently stored in the set.

Returns
Number of sounds.

◆ loadCat()

void OpenXcom::SoundSet::loadCat ( const std::string &  filename,
bool  wav = true 
)

Loads an X-Com CAT set of sound files.

Loads the contents of an X-Com CAT file which usually contains a set of sound files.

The CAT starts with an index of the offset and size of every file contained within. Each file consists of a filename followed by its contents.

Parameters
filenameFilename of the CAT set.
wavAre the sounds in WAV format?
See also
http://www.ufopaedia.org/index.php?title=SOUND

◆ loadCatbyIndex()

void OpenXcom::SoundSet::loadCatbyIndex ( const std::string &  filename,
int  index 
)

Loads a specific entry from a CAT file into the soundset.

Loads individual contents of a TFTD CAT file by index.

a set of sound files. The CAT starts with an index of the offset and size of every file contained within. Each file consists of a filename followed by its contents.

Parameters
filenameFilename of the CAT set.
indexwhich index in the cat file do we load?
See also
http://www.ufopaedia.org/index.php?title=SOUND

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