1+ //! Data types used as DSP parameters.
2+
3+ /// A 3D vector. Part of DSP parameter types.
14#[ derive( Copy , Clone , Debug , PartialEq ) ]
25pub struct Vec3 {
36 pub x : f32 ,
47 pub y : f32 ,
58 pub z : f32
69}
710
11+ /// A perspective in 3D. Part of DSP parameter types.
812#[ derive( Copy , Clone , Debug , PartialEq ) ]
913pub struct _3DAttributes {
1014 pub position : Vec3 ,
@@ -13,38 +17,60 @@ pub struct _3DAttributes {
1317 pub up : Vec3
1418}
1519
20+ /// Multi-channel spectra, for use with [dsp::ParameterType::Fft].
1621#[ derive( Clone , Debug , PartialEq ) ]
1722pub struct FftData {
23+ /// Per-channel spectra, as a vector of per-channel data.
1824 pub data : Vec < Vec < f32 > >
1925}
2026
27+ /// Dynamic response, for use with [dsp::ParameterType::DynamicResponse].
2128#[ derive( Clone , Debug , PartialEq ) ]
2229pub struct DynamicResponseData {
30+ /// Per-channel average (RMS) gain factor.
2331 pub rms : Vec < f32 >
2432}
2533
34+ /// Overall gain, for use with [dsp::ParameterType::OverallGain]. FMOD reads this parameter type
35+ /// to determine when to virtualize voices.
2636#[ derive( Copy , Clone , Debug , PartialEq ) ]
2737pub struct OverallGainData {
38+ /// Overall linear gain applied to the signal.
2839 pub linear_gain : f32 ,
40+ /// Overall additive gain applied to the signal.
2941 pub linear_gain_additive : f32
3042}
3143
44+ /// Listener attributes, for use with [dsp::ParameterType::ListenerAttributes]. FMOD sets this
45+ /// parameter type based on the listener's and event's locations automatically.
3246#[ derive( Copy , Clone , Debug , PartialEq ) ]
3347pub struct ListenerAttributesData {
48+ /// Relative position of the sound to the listener.
3449 pub relative : _3DAttributes ,
50+ /// Absolute position of the sound in the world.
3551 pub absolute : _3DAttributes
3652}
3753
54+ /// Listener attributes when multiple listeners exist, for use with [dsp::ParameterType::ListenerAttributesList].
55+ /// FMOD sets this parameter type based on the listeners' and event's locations automatically.
3856#[ derive( Clone , Debug , PartialEq ) ]
3957pub struct ListenerAttributesListData {
58+ /// The number of listeners, equal to the length of the `relative` and `weights` fields.
4059 pub count : usize ,
60+ /// Relative position of the sound to each listener.
4161 pub relative : Vec < _3DAttributes > ,
62+ /// Weight of each listener to the sound output, in the range 0..1.
4263 pub weights : Vec < f32 > ,
64+ /// Absolute position of the sound in the world.
4365 pub absolute : _3DAttributes
4466}
4567
68+ /// Attenuation range of an event, for use with [dsp::ParameterType::AttenuationRange]. FMOD Studio
69+ /// sets and updates this parameter type based on the event's minimum and maximum distance.
4670#[ derive( Copy , Clone , Debug , PartialEq ) ]
4771pub struct AttenuationRangeData {
72+ /// Minimum distance for attenuation.
4873 pub min : f32 ,
74+ /// Maximum distance for attenuation.
4975 pub max : f32
5076}
0 commit comments