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

Class to hold audio resources and information of a Wwise soundbank file. More...

#include <wwisesoundbank.h>

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

Classes

struct  File
 An embedded sound file within the SoundBank. More...
 
struct  Sound
 

Public Member Functions

 WwiseSoundBank (Common::SeekableReadStream *bnk)
 
 WwiseSoundBank (const Common::UString &name)
 
 WwiseSoundBank (uint64 hash)
 
 ~WwiseSoundBank ()
 
size_t getFileCount () const
 Return the number of embedded files. More...
 
size_t getSoundCount () const
 Return the number of sounds this bank references. More...
 
uint32 getFileID (size_t index) const
 Return the ID of an embedded file. More...
 
uint32 getSoundID (size_t index) const
 Return the ID of a referenced sound. More...
 
uint32 getSoundFileID (size_t index) const
 Return the ID of a file used by a referenced sound. More...
 
size_t findFileByID (uint32 id) const
 Return the index of a file from its ID, or SIZE_MAX if not found. More...
 
size_t findSoundByID (uint32 id) const
 Return the index of a sound from its ID, or SIZE_MAX if not found. More...
 
RewindableAudioStreamgetFile (size_t index) const
 
RewindableAudioStreamgetSound (size_t index) const
 

Private Types

enum  SoundType { kSoundTypeSFX, kSoundTypeVoice, kSoundTypeMusic }
 

Private Member Functions

void load (Common::SeekableReadStream &bnk)
 
const FilegetFileStruct (size_t index) const
 
const SoundgetSoundStruct (size_t index) const
 
bool isEmptyFile (size_t index) const
 
bool isEmptySound (size_t index) const
 
Common::SeekableReadStreamgetFileData (size_t index) const
 
Common::SeekableReadStreamgetSoundData (size_t index) const
 

Private Attributes

Common::ScopedPtr< Common::SeekableReadStream_bnk
 
uint32 _bankID
 
size_t _dataOffset
 
std::vector< File_files
 
std::vector< Sound_sounds
 
std::map< uint32, Common::UString_banks
 
std::map< uint32, size_t > _fileIDs
 
std::map< uint32, size_t > _soundIDs
 

Detailed Description

Class to hold audio resources and information of a Wwise soundbank file.

An BNK file is a Wwise soundbank, i.e. an archive containing one or more audio files, together with event, effect, track and similar information.

It is part of the Wwise middleware.

Definition at line 46 of file wwisesoundbank.h.

Member Enumeration Documentation

◆ SoundType

Enumerator
kSoundTypeSFX 
kSoundTypeVoice 
kSoundTypeMusic 

Definition at line 83 of file wwisesoundbank.h.

Constructor & Destructor Documentation

◆ WwiseSoundBank() [1/3]

Sound::WwiseSoundBank::WwiseSoundBank ( Common::SeekableReadStream bnk)

Definition at line 46 of file wwisesoundbank.cpp.

References _bnk, and load().

Here is the call graph for this function:

◆ WwiseSoundBank() [2/3]

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

Definition at line 54 of file wwisesoundbank.cpp.

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

Here is the call graph for this function:

◆ WwiseSoundBank() [3/3]

Sound::WwiseSoundBank::WwiseSoundBank ( uint64  hash)

Definition at line 62 of file wwisesoundbank.cpp.

References _bnk, Common::formatHash(), load(), Common::ScopedPtrBase< T, Deallocator >::reset(), and ResMan.

Here is the call graph for this function:

◆ ~WwiseSoundBank()

Sound::WwiseSoundBank::~WwiseSoundBank ( )
inline

Definition at line 51 of file wwisesoundbank.h.

Member Function Documentation

◆ findFileByID()

size_t Sound::WwiseSoundBank::findFileByID ( uint32  id) const

Return the index of a file from its ID, or SIZE_MAX if not found.

Definition at line 108 of file wwisesoundbank.cpp.

References _fileIDs, and SIZE_MAX.

◆ findSoundByID()

size_t Sound::WwiseSoundBank::findSoundByID ( uint32  id) const

Return the index of a sound from its ID, or SIZE_MAX if not found.

Definition at line 116 of file wwisesoundbank.cpp.

References _soundIDs, and SIZE_MAX.

◆ getFile()

RewindableAudioStream * Sound::WwiseSoundBank::getFile ( size_t  index) const

Definition at line 124 of file wwisesoundbank.cpp.

References getFileData(), isEmptyFile(), Sound::makeWwRIFFVorbisStream(), and Common::ScopedPtrBase< T, Deallocator >::release().

Here is the call graph for this function:

◆ getFileCount()

size_t Sound::WwiseSoundBank::getFileCount ( ) const

Return the number of embedded files.

Definition at line 70 of file wwisesoundbank.cpp.

References _files.

◆ getFileData()

Common::SeekableReadStream * Sound::WwiseSoundBank::getFileData ( size_t  index) const
private

Definition at line 150 of file wwisesoundbank.cpp.

References _bnk, _dataOffset, getFileStruct(), Sound::WwiseSoundBank::File::offset, Sound::WwiseSoundBank::File::size, and SIZE_MAX.

Referenced by getFile().

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

◆ getFileID()

uint32 Sound::WwiseSoundBank::getFileID ( size_t  index) const

Return the ID of an embedded file.

Definition at line 96 of file wwisesoundbank.cpp.

References getFileStruct(), and Sound::WwiseSoundBank::File::id.

Here is the call graph for this function:

◆ getFileStruct()

const WwiseSoundBank::File & Sound::WwiseSoundBank::getFileStruct ( size_t  index) const
private

Definition at line 78 of file wwisesoundbank.cpp.

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

Referenced by getFileData(), getFileID(), and isEmptyFile().

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

◆ getSound()

RewindableAudioStream * Sound::WwiseSoundBank::getSound ( size_t  index) const

Definition at line 132 of file wwisesoundbank.cpp.

References getSoundData(), isEmptySound(), Sound::makeWwRIFFVorbisStream(), and Common::ScopedPtrBase< T, Deallocator >::release().

Here is the call graph for this function:

◆ getSoundCount()

size_t Sound::WwiseSoundBank::getSoundCount ( ) const

Return the number of sounds this bank references.

Definition at line 74 of file wwisesoundbank.cpp.

References _sounds.

◆ getSoundData()

Common::SeekableReadStream * Sound::WwiseSoundBank::getSoundData ( size_t  index) const
private

Definition at line 161 of file wwisesoundbank.cpp.

References _bankID, _banks, _bnk, Common::UString::c_str(), Common::composeString(), getSoundStruct(), Aurora::kFileTypeBNK, Aurora::kFileTypeOGG, and ResMan.

Referenced by getSound().

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

◆ getSoundFileID()

uint32 Sound::WwiseSoundBank::getSoundFileID ( size_t  index) const

Return the ID of a file used by a referenced sound.

Definition at line 104 of file wwisesoundbank.cpp.

References Sound::WwiseSoundBank::Sound::fileID, and getSoundStruct().

Here is the call graph for this function:

◆ getSoundID()

uint32 Sound::WwiseSoundBank::getSoundID ( size_t  index) const

Return the ID of a referenced sound.

Definition at line 100 of file wwisesoundbank.cpp.

References getSoundStruct(), and Sound::WwiseSoundBank::Sound::id.

Here is the call graph for this function:

◆ getSoundStruct()

const WwiseSoundBank::Sound & Sound::WwiseSoundBank::getSoundStruct ( size_t  index) const
private

Definition at line 87 of file wwisesoundbank.cpp.

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

Referenced by getSoundData(), getSoundFileID(), getSoundID(), and isEmptySound().

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

◆ isEmptyFile()

bool Sound::WwiseSoundBank::isEmptyFile ( size_t  index) const
private

Definition at line 140 of file wwisesoundbank.cpp.

References getFileStruct(), and Sound::WwiseSoundBank::File::size.

Referenced by getFile().

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

◆ isEmptySound()

bool Sound::WwiseSoundBank::isEmptySound ( size_t  index) const
private

Definition at line 144 of file wwisesoundbank.cpp.

References getSoundStruct().

Referenced by getSound().

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

◆ load()

void Sound::WwiseSoundBank::load ( Common::SeekableReadStream bnk)
private

Member Data Documentation

◆ _bankID

uint32 Sound::WwiseSoundBank::_bankID
private

Definition at line 106 of file wwisesoundbank.h.

Referenced by getSoundData(), and load().

◆ _banks

std::map<uint32, Common::UString> Sound::WwiseSoundBank::_banks
private

Definition at line 112 of file wwisesoundbank.h.

Referenced by getSoundData(), and load().

◆ _bnk

Common::ScopedPtr<Common::SeekableReadStream> Sound::WwiseSoundBank::_bnk
private

Definition at line 104 of file wwisesoundbank.h.

Referenced by getFileData(), getSoundData(), and WwiseSoundBank().

◆ _dataOffset

size_t Sound::WwiseSoundBank::_dataOffset
private

Definition at line 107 of file wwisesoundbank.h.

Referenced by getFileData(), and load().

◆ _fileIDs

std::map<uint32, size_t> Sound::WwiseSoundBank::_fileIDs
private

Definition at line 114 of file wwisesoundbank.h.

Referenced by findFileByID(), and load().

◆ _files

std::vector<File> Sound::WwiseSoundBank::_files
private

Definition at line 109 of file wwisesoundbank.h.

Referenced by getFileCount(), getFileStruct(), and load().

◆ _soundIDs

std::map<uint32, size_t> Sound::WwiseSoundBank::_soundIDs
private

Definition at line 115 of file wwisesoundbank.h.

Referenced by findSoundByID(), and load().

◆ _sounds

std::vector<Sound> Sound::WwiseSoundBank::_sounds
private

Definition at line 110 of file wwisesoundbank.h.

Referenced by getSoundCount(), getSoundStruct(), and load().


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