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