fmod/studio/event_instance/
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 attributes_3d;
10mod callback;
11mod general;
12mod parameters;
13mod playback;
14mod playback_properties;
15
16pub(crate) use callback::event_callback_impl;
17pub use callback::EventInstanceCallback;
18
19#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
20#[repr(transparent)] // so we can transmute between types
21pub struct EventInstance {
22    pub(crate) inner: *mut FMOD_STUDIO_EVENTINSTANCE,
23}
24
25unsafe impl Send for EventInstance {}
26unsafe impl Sync for EventInstance {}
27
28impl From<*mut FMOD_STUDIO_EVENTINSTANCE> for EventInstance {
29    fn from(value: *mut FMOD_STUDIO_EVENTINSTANCE) -> Self {
30        Self { inner: value }
31    }
32}
33
34impl From<EventInstance> for *mut FMOD_STUDIO_EVENTINSTANCE {
35    fn from(value: EventInstance) -> Self {
36        value.inner
37    }
38}