pub struct Dat { /* private fields */ }Expand description
Represents a DAT audio configuration file decoded in memory.
Contains six blocks of audio event configuration data including parameters, enumerations, and event lists used to configure Wwise sound playback.
§Structure
The file is organized into six sequential blocks, each serving a different purpose in the audio configuration system. The exact semantic meaning of each block may vary between Total War games.
§Fields
event_0- Event parameters with float values (e.g., volume, pitch defaults)block_1- Event enumerations with multiple values (e.g., sound categories)block_2- Event enumerations with multiple values (e.g., sound categories)voice_events- Voice event enumerations with associated valuesblock_4- Simple event enumeration listblock_5- Simple event enumeration list
§Examples
let dat = Dat::decode(&mut data, &None)?;
// Iterate through event parameters
for (name, value) in dat.event_0() {
println!("Parameter: {} = {}", name, value);
}
// Iterate through voice events
for (voice_event, voice_values) in dat.voice_events() {
for value in voice_values {
println!(" {} -> {}", voice_event, value);
}
}Implementations§
Source§impl Dat
impl Dat
Sourcepub fn event_0(&self) -> &Vec<(String, f32)>
pub fn event_0(&self) -> &Vec<(String, f32)>
Event parameters with floating-point values.
Maps event parameter names to their default float values. Typically used for parameters like volume, pitch, or other numeric settings.
Sourcepub fn block_1(&self) -> &Vec<(String, Vec<String>)>
pub fn block_1(&self) -> &Vec<(String, Vec<String>)>
Event enumerations with string lists.
Maps enumeration names to lists of possible string values. Used for categorical audio properties.
Sourcepub fn block_2(&self) -> &Vec<(String, Vec<String>)>
pub fn block_2(&self) -> &Vec<(String, Vec<String>)>
Event enumerations with string lists.
Maps enumeration names to lists of possible string values. Similar to block_1, potentially for different enumeration categories.
Sourcepub fn voice_events(&self) -> &Vec<(String, Vec<String>)>
pub fn voice_events(&self) -> &Vec<(String, Vec<String>)>
Voice event enumerations with string lists.
Maps voice event names to lists of possible voice event values. Used for categorizing and organizing voice-related audio events.
Source§impl Dat
impl Dat
Sourcepub fn event_0_mut(&mut self) -> &mut Vec<(String, f32)>
pub fn event_0_mut(&mut self) -> &mut Vec<(String, f32)>
Event parameters with floating-point values.
Maps event parameter names to their default float values. Typically used for parameters like volume, pitch, or other numeric settings.
Sourcepub fn block_1_mut(&mut self) -> &mut Vec<(String, Vec<String>)>
pub fn block_1_mut(&mut self) -> &mut Vec<(String, Vec<String>)>
Event enumerations with string lists.
Maps enumeration names to lists of possible string values. Used for categorical audio properties.
Sourcepub fn block_2_mut(&mut self) -> &mut Vec<(String, Vec<String>)>
pub fn block_2_mut(&mut self) -> &mut Vec<(String, Vec<String>)>
Event enumerations with string lists.
Maps enumeration names to lists of possible string values. Similar to block_1, potentially for different enumeration categories.
Sourcepub fn voice_events_mut(&mut self) -> &mut Vec<(String, Vec<String>)>
pub fn voice_events_mut(&mut self) -> &mut Vec<(String, Vec<String>)>
Voice event enumerations with string lists.
Maps voice event names to lists of possible voice event values. Used for categorizing and organizing voice-related audio events.
Sourcepub fn block_4_mut(&mut self) -> &mut Vec<String>
pub fn block_4_mut(&mut self) -> &mut Vec<String>
Simple event enumeration list.
List of event enumeration names without associated values. FIXME: Possible wrong implementation.
Sourcepub fn block_5_mut(&mut self) -> &mut Vec<String>
pub fn block_5_mut(&mut self) -> &mut Vec<String>
Simple event enumeration list.
List of event enumeration names without associated values. Similar to block_4, potentially for a different category.
Source§impl Dat
impl Dat
Sourcepub fn set_event_0(&mut self, val: Vec<(String, f32)>) -> &mut Self
pub fn set_event_0(&mut self, val: Vec<(String, f32)>) -> &mut Self
Event parameters with floating-point values.
Maps event parameter names to their default float values. Typically used for parameters like volume, pitch, or other numeric settings.
Sourcepub fn set_block_1(&mut self, val: Vec<(String, Vec<String>)>) -> &mut Self
pub fn set_block_1(&mut self, val: Vec<(String, Vec<String>)>) -> &mut Self
Event enumerations with string lists.
Maps enumeration names to lists of possible string values. Used for categorical audio properties.
Sourcepub fn set_block_2(&mut self, val: Vec<(String, Vec<String>)>) -> &mut Self
pub fn set_block_2(&mut self, val: Vec<(String, Vec<String>)>) -> &mut Self
Event enumerations with string lists.
Maps enumeration names to lists of possible string values. Similar to block_1, potentially for different enumeration categories.
Sourcepub fn set_voice_events(&mut self, val: Vec<(String, Vec<String>)>) -> &mut Self
pub fn set_voice_events(&mut self, val: Vec<(String, Vec<String>)>) -> &mut Self
Voice event enumerations with string lists.
Maps voice event names to lists of possible voice event values. Used for categorizing and organizing voice-related audio events.
Sourcepub fn set_block_4(&mut self, val: Vec<String>) -> &mut Self
pub fn set_block_4(&mut self, val: Vec<String>) -> &mut Self
Simple event enumeration list.
List of event enumeration names without associated values. FIXME: Possible wrong implementation.
Sourcepub fn set_block_5(&mut self, val: Vec<String>) -> &mut Self
pub fn set_block_5(&mut self, val: Vec<String>) -> &mut Self
Simple event enumeration list.
List of event enumeration names without associated values. Similar to block_4, potentially for a different category.
Trait Implementations§
Source§impl Decodeable for Dat
impl Decodeable for Dat
Source§impl<'de> Deserialize<'de> for Dat
impl<'de> Deserialize<'de> for Dat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Encodeable for Dat
impl Encodeable for Dat
Source§fn encode<W: WriteBytes>(
&mut self,
buffer: &mut W,
_extra_data: &Option<EncodeableExtraData<'_>>,
) -> Result<()>
fn encode<W: WriteBytes>( &mut self, buffer: &mut W, _extra_data: &Option<EncodeableExtraData<'_>>, ) -> Result<()>
impl StructuralPartialEq for Dat
Auto Trait Implementations§
impl Freeze for Dat
impl RefUnwindSafe for Dat
impl Send for Dat
impl Sync for Dat
impl Unpin for Dat
impl UnsafeUnpin for Dat
impl UnwindSafe for Dat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.