web_sys/features/
gen_OfflineAudioContextOptions.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 = OfflineAudioContextOptions)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `OfflineAudioContextOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"]
12    pub type OfflineAudioContextOptions;
13    #[doc = "Get the `length` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"]
16    #[wasm_bindgen(method, getter = "length")]
17    pub fn get_length(this: &OfflineAudioContextOptions) -> u32;
18    #[doc = "Change the `length` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"]
21    #[wasm_bindgen(method, setter = "length")]
22    pub fn set_length(this: &OfflineAudioContextOptions, val: u32);
23    #[doc = "Get the `numberOfChannels` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"]
26    #[wasm_bindgen(method, getter = "numberOfChannels")]
27    pub fn get_number_of_channels(this: &OfflineAudioContextOptions) -> Option<u32>;
28    #[doc = "Change the `numberOfChannels` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"]
31    #[wasm_bindgen(method, setter = "numberOfChannels")]
32    pub fn set_number_of_channels(this: &OfflineAudioContextOptions, val: u32);
33    #[doc = "Get the `sampleRate` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"]
36    #[wasm_bindgen(method, getter = "sampleRate")]
37    pub fn get_sample_rate(this: &OfflineAudioContextOptions) -> f32;
38    #[doc = "Change the `sampleRate` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"]
41    #[wasm_bindgen(method, setter = "sampleRate")]
42    pub fn set_sample_rate(this: &OfflineAudioContextOptions, val: f32);
43}
44impl OfflineAudioContextOptions {
45    #[doc = "Construct a new `OfflineAudioContextOptions`."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `OfflineAudioContextOptions`*"]
48    pub fn new(length: u32, sample_rate: f32) -> Self {
49        #[allow(unused_mut)]
50        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
51        ret.set_length(length);
52        ret.set_sample_rate(sample_rate);
53        ret
54    }
55    #[deprecated = "Use `set_length()` instead."]
56    pub fn length(&mut self, val: u32) -> &mut Self {
57        self.set_length(val);
58        self
59    }
60    #[deprecated = "Use `set_number_of_channels()` instead."]
61    pub fn number_of_channels(&mut self, val: u32) -> &mut Self {
62        self.set_number_of_channels(val);
63        self
64    }
65    #[deprecated = "Use `set_sample_rate()` instead."]
66    pub fn sample_rate(&mut self, val: f32) -> &mut Self {
67        self.set_sample_rate(val);
68        self
69    }
70}