synthizer/
angular_panned_source.rs

1use crate::internal_prelude::*;
2
3#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash)]
4pub struct AngularPannedSource(pub(crate) Handle);
5
6impl AngularPannedSource {
7    pub fn new(
8        context: &Context,
9        panner_strategy: PannerStrategy,
10        azimuth: f64,
11        elevation: f64,
12    ) -> Result<AngularPannedSource> {
13        wrap_constructor(|ud, cb| {
14            let mut h = Default::default();
15            check_error(unsafe {
16                syz_createAngularPannedSource(
17                    &mut h as *mut syz_Handle,
18                    context.to_syz_handle(),
19                    panner_strategy as i32,
20                    azimuth,
21                    elevation,
22                    std::ptr::null_mut(),
23                    ud,
24                    Some(cb),
25                )
26            })?;
27            Ok(AngularPannedSource(Handle::new(h)))
28        })
29    }
30
31    source_properties!();
32    double_p!(SYZ_P_ELEVATION, elevation);
33    double_p!(SYZ_P_AZIMUTH, azimuth);
34
35    object_common!();
36    pausable_common!();
37    source_common!();
38}
39
40handle_traits!(AngularPannedSource);