fmod/core/sound/
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 data_reading;
10mod defaults;
11mod general;
12mod information;
13mod music;
14mod relationship;
15mod synchronization;
16pub use synchronization::SyncPoint;
17
18#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
19#[repr(transparent)] // so we can transmute between types
20pub struct Sound {
21    pub(crate) inner: *mut FMOD_SOUND,
22}
23
24unsafe impl Send for Sound {}
25unsafe impl Sync for Sound {}
26
27impl From<*mut FMOD_SOUND> for Sound {
28    fn from(value: *mut FMOD_SOUND) -> Self {
29        Sound { inner: value }
30    }
31}
32
33impl From<Sound> for *mut FMOD_SOUND {
34    fn from(value: Sound) -> Self {
35        value.inner
36    }
37}