web_sys/features/
gen_GainOptions.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 = GainOptions)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `GainOptions` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"]
12 pub type GainOptions;
13 #[doc = "Get the `channelCount` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"]
16 #[wasm_bindgen(method, getter = "channelCount")]
17 pub fn get_channel_count(this: &GainOptions) -> 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: `GainOptions`*"]
21 #[wasm_bindgen(method, setter = "channelCount")]
22 pub fn set_channel_count(this: &GainOptions, 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`, `GainOptions`*"]
27 #[wasm_bindgen(method, getter = "channelCountMode")]
28 pub fn get_channel_count_mode(this: &GainOptions) -> 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`, `GainOptions`*"]
33 #[wasm_bindgen(method, setter = "channelCountMode")]
34 pub fn set_channel_count_mode(this: &GainOptions, 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`, `GainOptions`*"]
39 #[wasm_bindgen(method, getter = "channelInterpretation")]
40 pub fn get_channel_interpretation(this: &GainOptions) -> 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`, `GainOptions`*"]
45 #[wasm_bindgen(method, setter = "channelInterpretation")]
46 pub fn set_channel_interpretation(this: &GainOptions, val: ChannelInterpretation);
47 #[doc = "Get the `gain` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"]
50 #[wasm_bindgen(method, getter = "gain")]
51 pub fn get_gain(this: &GainOptions) -> Option<f32>;
52 #[doc = "Change the `gain` field of this object."]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"]
55 #[wasm_bindgen(method, setter = "gain")]
56 pub fn set_gain(this: &GainOptions, val: f32);
57}
58impl GainOptions {
59 #[doc = "Construct a new `GainOptions`."]
60 #[doc = ""]
61 #[doc = "*This API requires the following crate features to be activated: `GainOptions`*"]
62 pub fn new() -> Self {
63 #[allow(unused_mut)]
64 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
65 ret
66 }
67 #[deprecated = "Use `set_channel_count()` instead."]
68 pub fn channel_count(&mut self, val: u32) -> &mut Self {
69 self.set_channel_count(val);
70 self
71 }
72 #[cfg(feature = "ChannelCountMode")]
73 #[deprecated = "Use `set_channel_count_mode()` instead."]
74 pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self {
75 self.set_channel_count_mode(val);
76 self
77 }
78 #[cfg(feature = "ChannelInterpretation")]
79 #[deprecated = "Use `set_channel_interpretation()` instead."]
80 pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self {
81 self.set_channel_interpretation(val);
82 self
83 }
84 #[deprecated = "Use `set_gain()` instead."]
85 pub fn gain(&mut self, val: f32) -> &mut Self {
86 self.set_gain(val);
87 self
88 }
89}
90impl Default for GainOptions {
91 fn default() -> Self {
92 Self::new()
93 }
94}