web_sys/features/
gen_AudioDecoderConfig.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AudioDecoderConfig)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `AudioDecoderConfig` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
13 #[doc = ""]
14 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16 pub type AudioDecoderConfig;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `codec` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
21 #[doc = ""]
22 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24 #[wasm_bindgen(method, getter = "codec")]
25 pub fn get_codec(this: &AudioDecoderConfig) -> ::alloc::string::String;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `codec` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
30 #[doc = ""]
31 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
33 #[wasm_bindgen(method, setter = "codec")]
34 pub fn set_codec(this: &AudioDecoderConfig, val: &str);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Get the `description` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
39 #[doc = ""]
40 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
42 #[wasm_bindgen(method, getter = "description")]
43 pub fn get_description(this: &AudioDecoderConfig) -> Option<::js_sys::Object>;
44 #[cfg(web_sys_unstable_apis)]
45 #[doc = "Change the `description` field of this object."]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
48 #[doc = ""]
49 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
51 #[wasm_bindgen(method, setter = "description")]
52 pub fn set_description(this: &AudioDecoderConfig, val: &::js_sys::Object);
53 #[cfg(web_sys_unstable_apis)]
54 #[doc = "Get the `numberOfChannels` field of this object."]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
57 #[doc = ""]
58 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
59 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
60 #[wasm_bindgen(method, getter = "numberOfChannels")]
61 pub fn get_number_of_channels(this: &AudioDecoderConfig) -> u32;
62 #[cfg(web_sys_unstable_apis)]
63 #[doc = "Change the `numberOfChannels` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
66 #[doc = ""]
67 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
68 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
69 #[wasm_bindgen(method, setter = "numberOfChannels")]
70 pub fn set_number_of_channels(this: &AudioDecoderConfig, val: u32);
71 #[cfg(web_sys_unstable_apis)]
72 #[doc = "Get the `sampleRate` field of this object."]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
75 #[doc = ""]
76 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
77 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
78 #[wasm_bindgen(method, getter = "sampleRate")]
79 pub fn get_sample_rate(this: &AudioDecoderConfig) -> u32;
80 #[cfg(web_sys_unstable_apis)]
81 #[doc = "Change the `sampleRate` field of this object."]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
84 #[doc = ""]
85 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
86 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
87 #[wasm_bindgen(method, setter = "sampleRate")]
88 pub fn set_sample_rate(this: &AudioDecoderConfig, val: u32);
89}
90#[cfg(web_sys_unstable_apis)]
91impl AudioDecoderConfig {
92 #[doc = "Construct a new `AudioDecoderConfig`."]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
95 #[doc = ""]
96 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
97 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
98 pub fn new(codec: &str, number_of_channels: u32, sample_rate: u32) -> Self {
99 #[allow(unused_mut)]
100 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
101 ret.set_codec(codec);
102 ret.set_number_of_channels(number_of_channels);
103 ret.set_sample_rate(sample_rate);
104 ret
105 }
106 #[cfg(web_sys_unstable_apis)]
107 #[deprecated = "Use `set_codec()` instead."]
108 pub fn codec(&mut self, val: &str) -> &mut Self {
109 self.set_codec(val);
110 self
111 }
112 #[cfg(web_sys_unstable_apis)]
113 #[deprecated = "Use `set_description()` instead."]
114 pub fn description(&mut self, val: &::js_sys::Object) -> &mut Self {
115 self.set_description(val);
116 self
117 }
118 #[cfg(web_sys_unstable_apis)]
119 #[deprecated = "Use `set_number_of_channels()` instead."]
120 pub fn number_of_channels(&mut self, val: u32) -> &mut Self {
121 self.set_number_of_channels(val);
122 self
123 }
124 #[cfg(web_sys_unstable_apis)]
125 #[deprecated = "Use `set_sample_rate()` instead."]
126 pub fn sample_rate(&mut self, val: u32) -> &mut Self {
127 self.set_sample_rate(val);
128 self
129 }
130}