fmod/studio/bank/
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 general;
10mod loading;
11mod lookups; // general lookups that are too small to be their own module
12
13#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
14#[repr(transparent)] // so we can transmute between types
15pub struct Bank {
16    pub(crate) inner: *mut FMOD_STUDIO_BANK,
17}
18
19unsafe impl Send for Bank {}
20unsafe impl Sync for Bank {}
21
22impl From<*mut FMOD_STUDIO_BANK> for Bank {
23    fn from(value: *mut FMOD_STUDIO_BANK) -> Self {
24        Self { inner: value }
25    }
26}
27
28impl From<Bank> for *mut FMOD_STUDIO_BANK {
29    fn from(value: Bank) -> Self {
30        value.inner
31    }
32}