75 tableOffset =
_tlk->readUint32LE();
77 const uint32 stringsOffset =
_tlk->readUint32LE();
80 _tlk->seek(tableOffset);
89 e.
add(
"Failed reading TLK file");
95 for (Entries::iterator entry =
_entries.begin(); entry !=
_entries.end(); ++entry) {
96 entry->flags =
_tlk->readUint32LE();
98 entry->volumeVariance =
_tlk->readUint32LE();
99 entry->pitchVariance =
_tlk->readUint32LE();
100 entry->offset =
_tlk->readUint32LE() + stringsOffset;
101 entry->length =
_tlk->readUint32LE();
102 entry->soundLength =
_tlk->readIEEEFloatLE();
108 for (Entries::iterator entry =
_entries.begin(); entry !=
_entries.end(); ++entry) {
109 entry->soundID =
_tlk->readUint32LE();
110 entry->offset =
_tlk->readUint32LE();
111 entry->length =
_tlk->readUint16LE();
135 entry.
text =
"[???]";
160 return _entries[strRef].soundResRef;
const Common::UString & getSoundResRef(uint32 strRef) const
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
bool hasEntry(uint32 strRef) const
void add(const char *s,...) GCC_PRINTF(2
uint32 readUint32LE()
Read an unsigned 32-bit word stored in little endian (LSB first) order from the stream and return it...
A class holding an UTF-8 string.
Base class for BioWare's talk tables.
A simple streaming file reading class.
Implementing the reading stream interfaces for plain memory blocks.
void readString(Entry &entry) const
Utility templates and functions for working with strings and streams.
Exception that provides a stack of explanations.
static void readHeader(Common::ReadStream &stream, uint32 &id, uint32 &version, bool &utf16le)
Read the header out of a stream.
static const uint32 kVersion4
static const uint32 kVersion3
Basic exceptions to throw.
bool open(const UString &fileName)
Try to open the file with the given fileName.
Utility templates and functions.
Common::Encoding _encoding
Types and functions related to language.
bool empty() const
Is the string empty?
uint32 _id
The file's ID.
const Common::UString & getString(uint32 strRef) const
A scoped plain pointer, allowing pointer-y access and normal deletion.
uint32 _version
The file's version.
Handling BioWare's TLK talk tables.
Implementing the stream reading interfaces for files.
Plain, unextended ASCII (7bit clean).
uint32 getSoundID(uint32 strRef) const
#define LangMan
Shortcut for accessing the language manager.
UString debugTag(uint32 tag, bool trim)
Create an elaborate string from an integer tag, for debugging purposes.
static const uint32 kFieldIDInvalid
UString readString(SeekableReadStream &stream, Encoding encoding)
Read a string with the given encoding of a stream.
void readEntryTableV3(uint32 stringsOffset)
static const uint32 kTLKID
UString readStringFixed(SeekableReadStream &stream, Encoding encoding, size_t length)
Read length bytes as a string with the given encoding out of a stream.
TalkTable_TLK(Common::SeekableReadStream *tlk, Common::Encoding encoding)
Take over this stream and read a TLK out of it.
static const Common::UString kEmptyString
Common::ScopedPtr< Common::SeekableReadStream > _tlk
uint32 getLanguageID() const
Return the language ID (ungendered) of the talk table.
Interface for a seekable & readable data stream.