synthizer/
source_3d.rs

1use crate::internal_prelude::*;
2
3#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash)]
4pub struct Source3D(pub(crate) Handle);
5
6impl Source3D {
7    pub fn new(
8        context: &Context,
9        panner_strategy: PannerStrategy,
10        initial_position: (f64, f64, f64),
11    ) -> Result<Source3D> {
12        wrap_constructor(|ud, cb| {
13            let mut h = Default::default();
14            check_error(unsafe {
15                syz_createSource3D(
16                    &mut h as *mut syz_Handle,
17                    context.to_syz_handle(),
18                    panner_strategy as i32,
19                    initial_position.0,
20                    initial_position.1,
21                    initial_position.2,
22                    null_mut(),
23                    ud,
24                    Some(cb),
25                )
26            })?;
27            Ok(Source3D(Handle::new(h)))
28        })
29    }
30
31    source_properties!();
32    enum_p!(DistanceModel, SYZ_P_DISTANCE_MODEL, distance_model);
33    double_p!(SYZ_P_DISTANCE_REF, distance_ref);
34    double_p!(SYZ_P_DISTANCE_MAX, distance_max);
35    double_p!(SYZ_P_ROLLOFF, rolloff);
36    double_p!(SYZ_P_CLOSENESS_BOOST, closeness_boost);
37    double_p!(SYZ_P_CLOSENESS_BOOST_DISTANCE, closeness_boost_distance);
38    double3_p!(SYZ_P_POSITION, position);
39    double6_p!(SYZ_P_ORIENTATION, orientation);
40
41    object_common!();
42    pausable_common!();
43    source_common!();
44}
45
46handle_traits!(Source3D);