use fmod_sys::*;
use lanyard::Utf8CStr;
use crate::studio::{CommandCaptureFlags, CommandReplay, CommandReplayFlags, System};
use crate::{FmodResultExt, Result};
impl System {
pub fn start_command_capture(
&self,
filename: &Utf8CStr,
flags: CommandCaptureFlags,
) -> Result<()> {
unsafe {
FMOD_Studio_System_StartCommandCapture(
self.inner.as_ptr(),
filename.as_ptr(),
flags.into(),
)
.to_result()
}
}
pub fn stop_command_capture(&self) -> Result<()> {
unsafe { FMOD_Studio_System_StopCommandCapture(self.inner.as_ptr()).to_result() }
}
pub fn load_command_replay(
&self,
filename: &Utf8CStr,
flags: CommandReplayFlags,
) -> Result<CommandReplay> {
let mut replay = std::ptr::null_mut();
unsafe {
FMOD_Studio_System_LoadCommandReplay(
self.inner.as_ptr(),
filename.as_ptr(),
flags.into(),
&raw mut replay,
)
.to_result()?;
Ok(CommandReplay::from_ffi(replay))
}
}
}