fmod/core/system/
mod.rs

1// Copyright (c) 2024 Lily Lyons
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
7use fmod_sys::*;
8
9mod builder;
10mod callback;
11mod creation;
12mod device_selection;
13mod filesystem;
14mod general;
15mod geometry;
16mod information;
17mod lifetime;
18mod network;
19mod plugin;
20mod recording;
21mod runtime_control;
22mod setup;
23pub use builder::SystemBuilder;
24pub use callback::{ErrorCallbackInfo, Instance, SystemCallback, SystemCallbackMask};
25pub use setup::RolloffCallback;
26
27#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
28#[repr(transparent)] // so we can transmute between types
29pub struct System {
30    pub(crate) inner: *mut FMOD_SYSTEM,
31}
32
33unsafe impl Send for System {}
34unsafe impl Sync for System {}
35
36impl From<*mut FMOD_SYSTEM> for System {
37    fn from(value: *mut FMOD_SYSTEM) -> Self {
38        System { inner: value }
39    }
40}
41
42impl From<System> for *mut FMOD_SYSTEM {
43    fn from(value: System) -> Self {
44        value.inner
45    }
46}