1use std::ptr::NonNull;
8
9use fmod_sys::*;
10
11mod builder;
12mod callback;
13mod creation;
14mod device_selection;
15mod filesystem;
16mod general;
17mod geometry;
18mod information;
19mod lifetime;
20mod network;
21mod plugin;
22mod recording;
23mod runtime_control;
24mod setup;
25pub use builder::SystemBuilder;
26pub use callback::{ErrorCallbackInfo, Instance, SystemCallback, SystemCallbackMask};
27pub use setup::RolloffCallback;
28
29#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
31#[repr(transparent)] pub struct System {
33 pub(crate) inner: NonNull<FMOD_SYSTEM>,
34}
35
36#[cfg(not(feature = "thread-unsafe"))]
37unsafe impl Send for System {}
38#[cfg(not(feature = "thread-unsafe"))]
39unsafe impl Sync for System {}
40
41impl System {
42 pub unsafe fn from_ffi(value: *mut FMOD_SYSTEM) -> Self {
50 let inner = NonNull::new(value).unwrap();
51 System { inner }
52 }
53
54 pub fn as_ptr(self) -> *mut FMOD_SYSTEM {
56 self.inner.as_ptr()
57 }
58}
59
60impl From<System> for *mut FMOD_SYSTEM {
61 fn from(value: System) -> Self {
62 value.inner.as_ptr()
63 }
64}