Skip to main content

web_sys/features/
gen_AudioConfiguration.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 = AudioConfiguration)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `AudioConfiguration` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
12    pub type AudioConfiguration;
13    #[doc = "Get the `bitrate` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
16    #[wasm_bindgen(method, getter = "bitrate")]
17    pub fn get_bitrate(this: &AudioConfiguration) -> Option<f64>;
18    #[doc = "Change the `bitrate` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
21    #[wasm_bindgen(method, setter = "bitrate")]
22    pub fn set_bitrate(this: &AudioConfiguration, val: f64);
23    #[doc = "Change the `bitrate` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
26    #[wasm_bindgen(method, setter = "bitrate")]
27    pub fn set_bitrate_u32(this: &AudioConfiguration, val: u32);
28    #[doc = "Change the `bitrate` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
31    #[wasm_bindgen(method, setter = "bitrate")]
32    pub fn set_bitrate_f64(this: &AudioConfiguration, val: f64);
33    #[doc = "Get the `channels` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
36    #[wasm_bindgen(method, getter = "channels")]
37    pub fn get_channels(this: &AudioConfiguration) -> Option<::alloc::string::String>;
38    #[doc = "Change the `channels` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
41    #[wasm_bindgen(method, setter = "channels")]
42    pub fn set_channels(this: &AudioConfiguration, val: &str);
43    #[doc = "Get the `contentType` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
46    #[wasm_bindgen(method, getter = "contentType")]
47    pub fn get_content_type(this: &AudioConfiguration) -> Option<::alloc::string::String>;
48    #[doc = "Change the `contentType` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
51    #[wasm_bindgen(method, setter = "contentType")]
52    pub fn set_content_type(this: &AudioConfiguration, val: &str);
53    #[doc = "Get the `samplerate` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
56    #[wasm_bindgen(method, getter = "samplerate")]
57    pub fn get_samplerate(this: &AudioConfiguration) -> Option<u32>;
58    #[doc = "Change the `samplerate` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
61    #[wasm_bindgen(method, setter = "samplerate")]
62    pub fn set_samplerate(this: &AudioConfiguration, val: u32);
63}
64impl AudioConfiguration {
65    #[doc = "Construct a new `AudioConfiguration`."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
68    pub fn new() -> Self {
69        #[allow(unused_mut)]
70        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
71        ret
72    }
73    #[deprecated = "Use `set_bitrate()` instead."]
74    pub fn bitrate(&mut self, val: f64) -> &mut Self {
75        self.set_bitrate(val);
76        self
77    }
78    #[deprecated = "Use `set_channels()` instead."]
79    pub fn channels(&mut self, val: &str) -> &mut Self {
80        self.set_channels(val);
81        self
82    }
83    #[deprecated = "Use `set_content_type()` instead."]
84    pub fn content_type(&mut self, val: &str) -> &mut Self {
85        self.set_content_type(val);
86        self
87    }
88    #[deprecated = "Use `set_samplerate()` instead."]
89    pub fn samplerate(&mut self, val: u32) -> &mut Self {
90        self.set_samplerate(val);
91        self
92    }
93}
94impl Default for AudioConfiguration {
95    fn default() -> Self {
96        Self::new()
97    }
98}