use std::ptr::NonNull;
use fmod_sys::*;
mod builder;
mod callback;
mod creation;
mod device_selection;
mod filesystem;
mod general;
mod geometry;
mod information;
mod lifetime;
mod network;
mod plugin;
mod recording;
mod runtime_control;
mod setup;
pub use builder::SystemBuilder;
pub use callback::{ErrorCallbackInfo, Instance, SystemCallback, SystemCallbackMask};
pub use setup::RolloffCallback;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(transparent)] pub struct System {
pub(crate) inner: NonNull<FMOD_SYSTEM>,
}
#[cfg(not(feature = "thread-unsafe"))]
unsafe impl Send for System {}
#[cfg(not(feature = "thread-unsafe"))]
unsafe impl Sync for System {}
impl System {
pub unsafe fn from_ffi(value: *mut FMOD_SYSTEM) -> Self {
let inner = NonNull::new(value).unwrap();
System { inner }
}
pub fn as_ptr(self) -> *mut FMOD_SYSTEM {
self.inner.as_ptr()
}
}
impl From<System> for *mut FMOD_SYSTEM {
fn from(value: System) -> Self {
value.inner.as_ptr()
}
}