xoreos  0.0.5
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Sound::FMODSampleBank Class Reference

Class to hold audio resource data of an FMOD samplebank file. More...

#include <fmodsamplebank.h>

Collaboration diagram for Sound::FMODSampleBank:
Collaboration graph
[legend]

Classes

struct  Sample
 

Public Member Functions

 FMODSampleBank (Common::SeekableReadStream *fsb)
 
 FMODSampleBank (const Common::UString &name)
 
 ~FMODSampleBank ()
 
size_t getSampleCount () const
 Return the number of sample files. More...
 
const Common::UStringgetSampleName (size_t index) const
 Return the name of a sample. More...
 
bool hasSample (const Common::UString &name) const
 Does a sample with this name exist in the sample bank? More...
 
RewindableAudioStreamgetSample (size_t index) const
 Return the audio stream of a sample, by index. More...
 
RewindableAudioStreamgetSample (const Common::UString &name) const
 Return the audio stream of a sample, by name. More...
 

Private Member Functions

void load (Common::SeekableReadStream &fsb)
 
RewindableAudioStreamgetSample (const Sample &sample) const
 

Private Attributes

Common::ScopedPtr< Common::SeekableReadStream_fsb
 
std::vector< Sample_samples
 
std::map< Common::UString, const Sample * > _sampleMap
 

Detailed Description

Class to hold audio resource data of an FMOD samplebank file.

An FSB file is a samplebank, i.e. an archive containing one or more audio files. It's part of FMOD sound middleware, and commonly used together with FEV files, which define events and effect chains.

FSB files are found in Dragon Age: Origins.

Only version 4 of the FSB format is supported, because that's the version used by Dragon Age: Origins.

Definition at line 47 of file fmodsamplebank.h.

Constructor & Destructor Documentation

◆ FMODSampleBank() [1/2]

Sound::FMODSampleBank::FMODSampleBank ( Common::SeekableReadStream fsb)

Definition at line 66 of file fmodsamplebank.cpp.

References _fsb, and load().

Here is the call graph for this function:

◆ FMODSampleBank() [2/2]

Sound::FMODSampleBank::FMODSampleBank ( const Common::UString name)

Definition at line 72 of file fmodsamplebank.cpp.

References _fsb, Common::UString::c_str(), Aurora::kFileTypeFSB, load(), Common::ScopedPtrBase< T, Deallocator >::reset(), and ResMan.

Here is the call graph for this function:

◆ ~FMODSampleBank()

Sound::FMODSampleBank::~FMODSampleBank ( )
inline

Definition at line 51 of file fmodsamplebank.h.

Member Function Documentation

◆ getSample() [1/3]

RewindableAudioStream * Sound::FMODSampleBank::getSample ( size_t  index) const

Return the audio stream of a sample, by index.

Definition at line 120 of file fmodsamplebank.cpp.

References _samples, Common::UString::c_str(), and Common::composeString().

Referenced by getSample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSample() [2/3]

RewindableAudioStream * Sound::FMODSampleBank::getSample ( const Common::UString name) const

Return the audio stream of a sample, by name.

Definition at line 129 of file fmodsamplebank.cpp.

References _sampleMap, Common::UString::c_str(), and getSample().

Here is the call graph for this function:

◆ getSample() [3/3]

RewindableAudioStream * Sound::FMODSampleBank::getSample ( const Sample sample) const
private

◆ getSampleCount()

size_t Sound::FMODSampleBank::getSampleCount ( ) const

Return the number of sample files.

Definition at line 80 of file fmodsamplebank.cpp.

References _samples.

◆ getSampleName()

const Common::UString & Sound::FMODSampleBank::getSampleName ( size_t  index) const

Return the name of a sample.

Definition at line 84 of file fmodsamplebank.cpp.

References _samples, Common::UString::c_str(), and Common::composeString().

Here is the call graph for this function:

◆ hasSample()

bool Sound::FMODSampleBank::hasSample ( const Common::UString name) const

Does a sample with this name exist in the sample bank?

Definition at line 93 of file fmodsamplebank.cpp.

References _sampleMap.

◆ load()

void Sound::FMODSampleBank::load ( Common::SeekableReadStream fsb)
private

Member Data Documentation

◆ _fsb

Common::ScopedPtr<Common::SeekableReadStream> Sound::FMODSampleBank::_fsb
private

Definition at line 96 of file fmodsamplebank.h.

Referenced by FMODSampleBank(), and getSample().

◆ _sampleMap

std::map<Common::UString, const Sample *> Sound::FMODSampleBank::_sampleMap
private

Definition at line 100 of file fmodsamplebank.h.

Referenced by getSample(), hasSample(), and load().

◆ _samples

std::vector<Sample> Sound::FMODSampleBank::_samples
private

Definition at line 98 of file fmodsamplebank.h.

Referenced by getSample(), getSampleCount(), getSampleName(), and load().


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