xoreos
0.0.5
|
Class to hold audio resource data of an FMOD samplebank file. More...
#include <fmodsamplebank.h>
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::UString & | getSampleName (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... | |
RewindableAudioStream * | getSample (size_t index) const |
Return the audio stream of a sample, by index. More... | |
RewindableAudioStream * | getSample (const Common::UString &name) const |
Return the audio stream of a sample, by name. More... | |
Private Member Functions | |
void | load (Common::SeekableReadStream &fsb) |
RewindableAudioStream * | getSample (const Sample &sample) const |
Private Attributes | |
Common::ScopedPtr< Common::SeekableReadStream > | _fsb |
std::vector< Sample > | _samples |
std::map< Common::UString, const Sample * > | _sampleMap |
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.
Sound::FMODSampleBank::FMODSampleBank | ( | Common::SeekableReadStream * | fsb | ) |
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.
|
inline |
Definition at line 51 of file fmodsamplebank.h.
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().
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().
|
private |
Definition at line 102 of file fmodsamplebank.cpp.
References _fsb, Sound::FMODSampleBank::Sample::channels, Sound::FMODSampleBank::Sample::defFreq, Sound::FMODSampleBank::Sample::flags, Sound::kADPCMMSIma, Sound::kSampleFlagIMAADPCM, Sound::kSampleFlagMP3, Sound::makeADPCMStream(), Sound::makeMP3Stream(), Sound::FMODSampleBank::Sample::offset, Sound::FMODSampleBank::Sample::size, and warning().
size_t Sound::FMODSampleBank::getSampleCount | ( | ) | const |
Return the number of sample files.
Definition at line 80 of file fmodsamplebank.cpp.
References _samples.
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().
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.
|
private |
Definition at line 141 of file fmodsamplebank.cpp.
References _sampleMap, _samples, Common::composeString(), Common::debugTag(), Common::kEncodingASCII, Sound::kHeaderFlagSimpleInfo, MKTAG, Common::ReadStream::readIEEEFloatLE(), Common::ReadStream::readSint16LE(), Common::ReadStream::readSint32LE(), Common::readStringFixed(), Common::ReadStream::readUint16LE(), Common::ReadStream::readUint32BE(), Common::ReadStream::readUint32LE(), Common::SeekableReadStream::seek(), and Common::SeekableReadStream::skip().
Referenced by FMODSampleBank().
|
private |
Definition at line 96 of file fmodsamplebank.h.
Referenced by FMODSampleBank(), and getSample().
|
private |
Definition at line 100 of file fmodsamplebank.h.
Referenced by getSample(), hasSample(), and load().
|
private |
Definition at line 98 of file fmodsamplebank.h.
Referenced by getSample(), getSampleCount(), getSampleName(), and load().