web_sys/features/
gen_AnalyserOptions.rs1#![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 = AnalyserOptions)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `AnalyserOptions` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
12 pub type AnalyserOptions;
13 #[doc = "Get the `channelCount` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
16 #[wasm_bindgen(method, getter = "channelCount")]
17 pub fn get_channel_count(this: &AnalyserOptions) -> 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: `AnalyserOptions`*"]
21 #[wasm_bindgen(method, setter = "channelCount")]
22 pub fn set_channel_count(this: &AnalyserOptions, 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: `AnalyserOptions`, `ChannelCountMode`*"]
27 #[wasm_bindgen(method, getter = "channelCountMode")]
28 pub fn get_channel_count_mode(this: &AnalyserOptions) -> 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: `AnalyserOptions`, `ChannelCountMode`*"]
33 #[wasm_bindgen(method, setter = "channelCountMode")]
34 pub fn set_channel_count_mode(this: &AnalyserOptions, 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: `AnalyserOptions`, `ChannelInterpretation`*"]
39 #[wasm_bindgen(method, getter = "channelInterpretation")]
40 pub fn get_channel_interpretation(this: &AnalyserOptions) -> 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: `AnalyserOptions`, `ChannelInterpretation`*"]
45 #[wasm_bindgen(method, setter = "channelInterpretation")]
46 pub fn set_channel_interpretation(this: &AnalyserOptions, val: ChannelInterpretation);
47 #[doc = "Get the `fftSize` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
50 #[wasm_bindgen(method, getter = "fftSize")]
51 pub fn get_fft_size(this: &AnalyserOptions) -> Option<u32>;
52 #[doc = "Change the `fftSize` field of this object."]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
55 #[wasm_bindgen(method, setter = "fftSize")]
56 pub fn set_fft_size(this: &AnalyserOptions, val: u32);
57 #[doc = "Get the `maxDecibels` field of this object."]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
60 #[wasm_bindgen(method, getter = "maxDecibels")]
61 pub fn get_max_decibels(this: &AnalyserOptions) -> Option<f64>;
62 #[doc = "Change the `maxDecibels` field of this object."]
63 #[doc = ""]
64 #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
65 #[wasm_bindgen(method, setter = "maxDecibels")]
66 pub fn set_max_decibels(this: &AnalyserOptions, val: f64);
67 #[doc = "Get the `minDecibels` field of this object."]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
70 #[wasm_bindgen(method, getter = "minDecibels")]
71 pub fn get_min_decibels(this: &AnalyserOptions) -> Option<f64>;
72 #[doc = "Change the `minDecibels` field of this object."]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
75 #[wasm_bindgen(method, setter = "minDecibels")]
76 pub fn set_min_decibels(this: &AnalyserOptions, val: f64);
77 #[doc = "Get the `smoothingTimeConstant` field of this object."]
78 #[doc = ""]
79 #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
80 #[wasm_bindgen(method, getter = "smoothingTimeConstant")]
81 pub fn get_smoothing_time_constant(this: &AnalyserOptions) -> Option<f64>;
82 #[doc = "Change the `smoothingTimeConstant` field of this object."]
83 #[doc = ""]
84 #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
85 #[wasm_bindgen(method, setter = "smoothingTimeConstant")]
86 pub fn set_smoothing_time_constant(this: &AnalyserOptions, val: f64);
87}
88impl AnalyserOptions {
89 #[doc = "Construct a new `AnalyserOptions`."]
90 #[doc = ""]
91 #[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
92 pub fn new() -> Self {
93 #[allow(unused_mut)]
94 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
95 ret
96 }
97 #[deprecated = "Use `set_channel_count()` instead."]
98 pub fn channel_count(&mut self, val: u32) -> &mut Self {
99 self.set_channel_count(val);
100 self
101 }
102 #[cfg(feature = "ChannelCountMode")]
103 #[deprecated = "Use `set_channel_count_mode()` instead."]
104 pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self {
105 self.set_channel_count_mode(val);
106 self
107 }
108 #[cfg(feature = "ChannelInterpretation")]
109 #[deprecated = "Use `set_channel_interpretation()` instead."]
110 pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self {
111 self.set_channel_interpretation(val);
112 self
113 }
114 #[deprecated = "Use `set_fft_size()` instead."]
115 pub fn fft_size(&mut self, val: u32) -> &mut Self {
116 self.set_fft_size(val);
117 self
118 }
119 #[deprecated = "Use `set_max_decibels()` instead."]
120 pub fn max_decibels(&mut self, val: f64) -> &mut Self {
121 self.set_max_decibels(val);
122 self
123 }
124 #[deprecated = "Use `set_min_decibels()` instead."]
125 pub fn min_decibels(&mut self, val: f64) -> &mut Self {
126 self.set_min_decibels(val);
127 self
128 }
129 #[deprecated = "Use `set_smoothing_time_constant()` instead."]
130 pub fn smoothing_time_constant(&mut self, val: f64) -> &mut Self {
131 self.set_smoothing_time_constant(val);
132 self
133 }
134}
135impl Default for AnalyserOptions {
136 fn default() -> Self {
137 Self::new()
138 }
139}