synthizer/
noise_generator.rs1use crate::internal_prelude::*;
2
3#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash)]
4pub struct NoiseGenerator(pub(crate) Handle);
5
6impl NoiseGenerator {
7 pub fn new(context: &Context, channels: u32) -> Result<NoiseGenerator> {
8 wrap_constructor(|ud, cb| {
9 let mut h = Default::default();
10 check_error(unsafe {
11 syz_createNoiseGenerator(
12 &mut h as *mut syz_Handle,
13 context.to_syz_handle(),
14 channels,
15 null_mut(),
16 ud,
17 Some(cb),
18 )
19 })?;
20 Ok(NoiseGenerator(Handle::new(h)))
21 })
22 }
23
24 generator_properties!();
25 enum_p!(NoiseType, SYZ_P_NOISE_TYPE, noise_type);
26
27 object_common!();
28 pausable_common!();
29}
30
31handle_traits!(NoiseGenerator);