Skip to main content

web_sys/features/
gen_AudioEncoderConfig.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 = AudioEncoderConfig)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `AudioEncoderConfig` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
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 AudioEncoderConfig;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `bitrate` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
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 = "bitrate")]
25    pub fn get_bitrate(this: &AudioEncoderConfig) -> Option<f64>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `bitrate` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
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 = "bitrate")]
34    pub fn set_bitrate(this: &AudioEncoderConfig, val: u32);
35    #[cfg(web_sys_unstable_apis)]
36    #[doc = "Change the `bitrate` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
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, setter = "bitrate")]
43    pub fn set_bitrate_f64(this: &AudioEncoderConfig, val: f64);
44    #[cfg(web_sys_unstable_apis)]
45    #[cfg(feature = "BitrateMode")]
46    #[doc = "Get the `bitrateMode` field of this object."]
47    #[doc = ""]
48    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`, `BitrateMode`*"]
49    #[doc = ""]
50    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
51    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
52    #[wasm_bindgen(method, getter = "bitrateMode")]
53    pub fn get_bitrate_mode(this: &AudioEncoderConfig) -> Option<BitrateMode>;
54    #[cfg(web_sys_unstable_apis)]
55    #[cfg(feature = "BitrateMode")]
56    #[doc = "Change the `bitrateMode` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`, `BitrateMode`*"]
59    #[doc = ""]
60    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
62    #[wasm_bindgen(method, setter = "bitrateMode")]
63    pub fn set_bitrate_mode(this: &AudioEncoderConfig, val: BitrateMode);
64    #[cfg(web_sys_unstable_apis)]
65    #[doc = "Get the `codec` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
68    #[doc = ""]
69    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
71    #[wasm_bindgen(method, getter = "codec")]
72    pub fn get_codec(this: &AudioEncoderConfig) -> ::alloc::string::String;
73    #[cfg(web_sys_unstable_apis)]
74    #[doc = "Change the `codec` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
77    #[doc = ""]
78    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
80    #[wasm_bindgen(method, setter = "codec")]
81    pub fn set_codec(this: &AudioEncoderConfig, val: &str);
82    #[cfg(web_sys_unstable_apis)]
83    #[doc = "Get the `numberOfChannels` field of this object."]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
86    #[doc = ""]
87    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
88    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
89    #[wasm_bindgen(method, getter = "numberOfChannels")]
90    pub fn get_number_of_channels(this: &AudioEncoderConfig) -> u32;
91    #[cfg(web_sys_unstable_apis)]
92    #[doc = "Change the `numberOfChannels` field of this object."]
93    #[doc = ""]
94    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
98    #[wasm_bindgen(method, setter = "numberOfChannels")]
99    pub fn set_number_of_channels(this: &AudioEncoderConfig, val: u32);
100    #[cfg(web_sys_unstable_apis)]
101    #[doc = "Get the `sampleRate` field of this object."]
102    #[doc = ""]
103    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
104    #[doc = ""]
105    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
106    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
107    #[wasm_bindgen(method, getter = "sampleRate")]
108    pub fn get_sample_rate(this: &AudioEncoderConfig) -> u32;
109    #[cfg(web_sys_unstable_apis)]
110    #[doc = "Change the `sampleRate` field of this object."]
111    #[doc = ""]
112    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
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    #[wasm_bindgen(method, setter = "sampleRate")]
117    pub fn set_sample_rate(this: &AudioEncoderConfig, val: u32);
118}
119#[cfg(web_sys_unstable_apis)]
120impl AudioEncoderConfig {
121    #[doc = "Construct a new `AudioEncoderConfig`."]
122    #[doc = ""]
123    #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
124    #[doc = ""]
125    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
126    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
127    pub fn new(codec: &str, number_of_channels: u32, sample_rate: u32) -> Self {
128        #[allow(unused_mut)]
129        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
130        ret.set_codec(codec);
131        ret.set_number_of_channels(number_of_channels);
132        ret.set_sample_rate(sample_rate);
133        ret
134    }
135    #[cfg(web_sys_unstable_apis)]
136    #[deprecated = "Use `set_bitrate()` instead."]
137    pub fn bitrate(&mut self, val: u32) -> &mut Self {
138        self.set_bitrate(val);
139        self
140    }
141    #[cfg(web_sys_unstable_apis)]
142    #[cfg(feature = "BitrateMode")]
143    #[deprecated = "Use `set_bitrate_mode()` instead."]
144    pub fn bitrate_mode(&mut self, val: BitrateMode) -> &mut Self {
145        self.set_bitrate_mode(val);
146        self
147    }
148    #[cfg(web_sys_unstable_apis)]
149    #[deprecated = "Use `set_codec()` instead."]
150    pub fn codec(&mut self, val: &str) -> &mut Self {
151        self.set_codec(val);
152        self
153    }
154    #[cfg(web_sys_unstable_apis)]
155    #[deprecated = "Use `set_number_of_channels()` instead."]
156    pub fn number_of_channels(&mut self, val: u32) -> &mut Self {
157        self.set_number_of_channels(val);
158        self
159    }
160    #[cfg(web_sys_unstable_apis)]
161    #[deprecated = "Use `set_sample_rate()` instead."]
162    pub fn sample_rate(&mut self, val: u32) -> &mut Self {
163        self.set_sample_rate(val);
164        self
165    }
166}