fmod/core/dsp_connection/mix_properties.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::*;
8use std::ffi::c_float;
9
10use crate::DspConnection;
11
12impl DspConnection {
13 /// Sets the connection's volume scale.
14 pub fn set_mix(&self, volume: c_float) -> Result<()> {
15 unsafe { FMOD_DSPConnection_SetMix(self.inner, volume).to_result() }
16 }
17
18 /// Retrieves the connection's volume scale.
19 pub fn get_mix(&self) -> Result<c_float> {
20 let mut volume = 0.0;
21 unsafe { FMOD_DSPConnection_GetMix(self.inner, &mut volume).to_result()? };
22 Ok(volume)
23 }
24
25 // TODO mix matrix
26}