Skip to main content

web_sys/features/
gen_AudioDecoderConfig.rs

1#![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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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 = "Change the `description` 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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
60    #[wasm_bindgen(method, setter = "description")]
61    pub fn set_description_u8_slice(this: &AudioDecoderConfig, val: &mut [u8]);
62    #[cfg(web_sys_unstable_apis)]
63    #[doc = "Change the `description` 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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
69    #[wasm_bindgen(method, setter = "description")]
70    pub fn set_description_u8_array(this: &AudioDecoderConfig, val: &::js_sys::Uint8Array);
71    #[cfg(web_sys_unstable_apis)]
72    #[doc = "Get the `numberOfChannels` 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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
78    #[wasm_bindgen(method, getter = "numberOfChannels")]
79    pub fn get_number_of_channels(this: &AudioDecoderConfig) -> u32;
80    #[cfg(web_sys_unstable_apis)]
81    #[doc = "Change the `numberOfChannels` 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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
87    #[wasm_bindgen(method, setter = "numberOfChannels")]
88    pub fn set_number_of_channels(this: &AudioDecoderConfig, val: u32);
89    #[cfg(web_sys_unstable_apis)]
90    #[doc = "Get the `sampleRate` field of this object."]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
93    #[doc = ""]
94    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
95    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
96    #[wasm_bindgen(method, getter = "sampleRate")]
97    pub fn get_sample_rate(this: &AudioDecoderConfig) -> u32;
98    #[cfg(web_sys_unstable_apis)]
99    #[doc = "Change the `sampleRate` field of this object."]
100    #[doc = ""]
101    #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
102    #[doc = ""]
103    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
104    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
105    #[wasm_bindgen(method, setter = "sampleRate")]
106    pub fn set_sample_rate(this: &AudioDecoderConfig, val: u32);
107}
108#[cfg(web_sys_unstable_apis)]
109impl AudioDecoderConfig {
110    #[doc = "Construct a new `AudioDecoderConfig`."]
111    #[doc = ""]
112    #[doc = "*This API requires the following crate features to be activated: `AudioDecoderConfig`*"]
113    #[doc = ""]
114    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
115    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
116    pub fn new(codec: &str, number_of_channels: u32, sample_rate: u32) -> Self {
117        #[allow(unused_mut)]
118        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
119        ret.set_codec(codec);
120        ret.set_number_of_channels(number_of_channels);
121        ret.set_sample_rate(sample_rate);
122        ret
123    }
124    #[cfg(web_sys_unstable_apis)]
125    #[deprecated = "Use `set_codec()` instead."]
126    pub fn codec(&mut self, val: &str) -> &mut Self {
127        self.set_codec(val);
128        self
129    }
130    #[cfg(web_sys_unstable_apis)]
131    #[deprecated = "Use `set_description()` instead."]
132    pub fn description(&mut self, val: &::js_sys::Object) -> &mut Self {
133        self.set_description(val);
134        self
135    }
136    #[cfg(web_sys_unstable_apis)]
137    #[deprecated = "Use `set_number_of_channels()` instead."]
138    pub fn number_of_channels(&mut self, val: u32) -> &mut Self {
139        self.set_number_of_channels(val);
140        self
141    }
142    #[cfg(web_sys_unstable_apis)]
143    #[deprecated = "Use `set_sample_rate()` instead."]
144    pub fn sample_rate(&mut self, val: u32) -> &mut Self {
145        self.set_sample_rate(val);
146        self
147    }
148}