use std::ffi::c_float;
use fmod_sys::*;
use crate::studio::EventDescription;
#[cfg(doc)]
use crate::studio::EventInstance;
use crate::{FmodResultExt, Result};
impl EventDescription {
pub fn is_3d(&self) -> Result<bool> {
let mut is_3d = FMOD_BOOL::FALSE;
unsafe {
FMOD_Studio_EventDescription_Is3D(self.inner.as_ptr(), &raw mut is_3d).to_result()?;
}
Ok(is_3d.into())
}
pub fn is_doppler_enabled(&self) -> Result<bool> {
let mut is_doppler = FMOD_BOOL::FALSE;
unsafe {
FMOD_Studio_EventDescription_IsDopplerEnabled(self.inner.as_ptr(), &raw mut is_doppler)
.to_result()?;
}
Ok(is_doppler.into())
}
pub fn is_oneshot(&self) -> Result<bool> {
let mut is_oneshot = FMOD_BOOL::FALSE;
unsafe {
FMOD_Studio_EventDescription_IsOneshot(self.inner.as_ptr(), &raw mut is_oneshot)
.to_result()?;
}
Ok(is_oneshot.into())
}
pub fn is_snapshot(&self) -> Result<bool> {
let mut is_snapshot = FMOD_BOOL::FALSE;
unsafe {
FMOD_Studio_EventDescription_IsSnapshot(self.inner.as_ptr(), &raw mut is_snapshot)
.to_result()?;
}
Ok(is_snapshot.into())
}
pub fn is_stream(&self) -> Result<bool> {
let mut is_stream = FMOD_BOOL::FALSE;
unsafe {
FMOD_Studio_EventDescription_IsStream(self.inner.as_ptr(), &raw mut is_stream)
.to_result()?;
}
Ok(is_stream.into())
}
pub fn has_sustain_point(&self) -> Result<bool> {
let mut sustain_point = FMOD_BOOL::FALSE;
unsafe {
FMOD_Studio_EventDescription_HasSustainPoint(
self.inner.as_ptr(),
&raw mut sustain_point,
)
.to_result()?;
}
Ok(sustain_point.into())
}
pub fn get_min_max_distance(&self) -> Result<(c_float, c_float)> {
let mut min = 0.0;
let mut max = 0.0;
unsafe {
FMOD_Studio_EventDescription_GetMinMaxDistance(
self.inner.as_ptr(),
&raw mut min,
&raw mut max,
)
.to_result()?;
}
Ok((min, max))
}
pub fn get_sound_size(&self) -> Result<c_float> {
let mut size = 0.0;
unsafe {
FMOD_Studio_EventDescription_GetSoundSize(self.inner.as_ptr(), &raw mut size)
.to_result()?;
}
Ok(size)
}
}