web_sys/features/
gen_ConvolverOptions.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ConvolverOptions)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `ConvolverOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"]
12    pub type ConvolverOptions;
13    #[doc = "Get the `channelCount` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"]
16    #[wasm_bindgen(method, getter = "channelCount")]
17    pub fn get_channel_count(this: &ConvolverOptions) -> Option<u32>;
18    #[doc = "Change the `channelCount` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"]
21    #[wasm_bindgen(method, setter = "channelCount")]
22    pub fn set_channel_count(this: &ConvolverOptions, val: u32);
23    #[cfg(feature = "ChannelCountMode")]
24    #[doc = "Get the `channelCountMode` field of this object."]
25    #[doc = ""]
26    #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ConvolverOptions`*"]
27    #[wasm_bindgen(method, getter = "channelCountMode")]
28    pub fn get_channel_count_mode(this: &ConvolverOptions) -> Option<ChannelCountMode>;
29    #[cfg(feature = "ChannelCountMode")]
30    #[doc = "Change the `channelCountMode` field of this object."]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `ConvolverOptions`*"]
33    #[wasm_bindgen(method, setter = "channelCountMode")]
34    pub fn set_channel_count_mode(this: &ConvolverOptions, val: ChannelCountMode);
35    #[cfg(feature = "ChannelInterpretation")]
36    #[doc = "Get the `channelInterpretation` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ConvolverOptions`*"]
39    #[wasm_bindgen(method, getter = "channelInterpretation")]
40    pub fn get_channel_interpretation(this: &ConvolverOptions) -> Option<ChannelInterpretation>;
41    #[cfg(feature = "ChannelInterpretation")]
42    #[doc = "Change the `channelInterpretation` field of this object."]
43    #[doc = ""]
44    #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `ConvolverOptions`*"]
45    #[wasm_bindgen(method, setter = "channelInterpretation")]
46    pub fn set_channel_interpretation(this: &ConvolverOptions, val: ChannelInterpretation);
47    #[cfg(feature = "AudioBuffer")]
48    #[doc = "Get the `buffer` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `ConvolverOptions`*"]
51    #[wasm_bindgen(method, getter = "buffer")]
52    pub fn get_buffer(this: &ConvolverOptions) -> Option<AudioBuffer>;
53    #[cfg(feature = "AudioBuffer")]
54    #[doc = "Change the `buffer` field of this object."]
55    #[doc = ""]
56    #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `ConvolverOptions`*"]
57    #[wasm_bindgen(method, setter = "buffer")]
58    pub fn set_buffer(this: &ConvolverOptions, val: Option<&AudioBuffer>);
59    #[doc = "Get the `disableNormalization` field of this object."]
60    #[doc = ""]
61    #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"]
62    #[wasm_bindgen(method, getter = "disableNormalization")]
63    pub fn get_disable_normalization(this: &ConvolverOptions) -> Option<bool>;
64    #[doc = "Change the `disableNormalization` field of this object."]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"]
67    #[wasm_bindgen(method, setter = "disableNormalization")]
68    pub fn set_disable_normalization(this: &ConvolverOptions, val: bool);
69}
70impl ConvolverOptions {
71    #[doc = "Construct a new `ConvolverOptions`."]
72    #[doc = ""]
73    #[doc = "*This API requires the following crate features to be activated: `ConvolverOptions`*"]
74    pub fn new() -> Self {
75        #[allow(unused_mut)]
76        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
77        ret
78    }
79    #[deprecated = "Use `set_channel_count()` instead."]
80    pub fn channel_count(&mut self, val: u32) -> &mut Self {
81        self.set_channel_count(val);
82        self
83    }
84    #[cfg(feature = "ChannelCountMode")]
85    #[deprecated = "Use `set_channel_count_mode()` instead."]
86    pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self {
87        self.set_channel_count_mode(val);
88        self
89    }
90    #[cfg(feature = "ChannelInterpretation")]
91    #[deprecated = "Use `set_channel_interpretation()` instead."]
92    pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self {
93        self.set_channel_interpretation(val);
94        self
95    }
96    #[cfg(feature = "AudioBuffer")]
97    #[deprecated = "Use `set_buffer()` instead."]
98    pub fn buffer(&mut self, val: Option<&AudioBuffer>) -> &mut Self {
99        self.set_buffer(val);
100        self
101    }
102    #[deprecated = "Use `set_disable_normalization()` instead."]
103    pub fn disable_normalization(&mut self, val: bool) -> &mut Self {
104        self.set_disable_normalization(val);
105        self
106    }
107}
108impl Default for ConvolverOptions {
109    fn default() -> Self {
110        Self::new()
111    }
112}