web_sys/features/
gen_AudioBufferSourceOptions.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 = AudioBufferSourceOptions)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `AudioBufferSourceOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
12    pub type AudioBufferSourceOptions;
13    #[cfg(feature = "AudioBuffer")]
14    #[doc = "Get the `buffer` field of this object."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferSourceOptions`*"]
17    #[wasm_bindgen(method, getter = "buffer")]
18    pub fn get_buffer(this: &AudioBufferSourceOptions) -> Option<AudioBuffer>;
19    #[cfg(feature = "AudioBuffer")]
20    #[doc = "Change the `buffer` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferSourceOptions`*"]
23    #[wasm_bindgen(method, setter = "buffer")]
24    pub fn set_buffer(this: &AudioBufferSourceOptions, val: Option<&AudioBuffer>);
25    #[doc = "Get the `detune` field of this object."]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
28    #[wasm_bindgen(method, getter = "detune")]
29    pub fn get_detune(this: &AudioBufferSourceOptions) -> Option<f32>;
30    #[doc = "Change the `detune` field of this object."]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
33    #[wasm_bindgen(method, setter = "detune")]
34    pub fn set_detune(this: &AudioBufferSourceOptions, val: f32);
35    #[doc = "Get the `loop` field of this object."]
36    #[doc = ""]
37    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
38    #[wasm_bindgen(method, getter = "loop")]
39    pub fn get_loop(this: &AudioBufferSourceOptions) -> Option<bool>;
40    #[doc = "Change the `loop` field of this object."]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
43    #[wasm_bindgen(method, setter = "loop")]
44    pub fn set_loop(this: &AudioBufferSourceOptions, val: bool);
45    #[doc = "Get the `loopEnd` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
48    #[wasm_bindgen(method, getter = "loopEnd")]
49    pub fn get_loop_end(this: &AudioBufferSourceOptions) -> Option<f64>;
50    #[doc = "Change the `loopEnd` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
53    #[wasm_bindgen(method, setter = "loopEnd")]
54    pub fn set_loop_end(this: &AudioBufferSourceOptions, val: f64);
55    #[doc = "Get the `loopStart` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
58    #[wasm_bindgen(method, getter = "loopStart")]
59    pub fn get_loop_start(this: &AudioBufferSourceOptions) -> Option<f64>;
60    #[doc = "Change the `loopStart` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
63    #[wasm_bindgen(method, setter = "loopStart")]
64    pub fn set_loop_start(this: &AudioBufferSourceOptions, val: f64);
65    #[doc = "Get the `playbackRate` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
68    #[wasm_bindgen(method, getter = "playbackRate")]
69    pub fn get_playback_rate(this: &AudioBufferSourceOptions) -> Option<f32>;
70    #[doc = "Change the `playbackRate` field of this object."]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
73    #[wasm_bindgen(method, setter = "playbackRate")]
74    pub fn set_playback_rate(this: &AudioBufferSourceOptions, val: f32);
75}
76impl AudioBufferSourceOptions {
77    #[doc = "Construct a new `AudioBufferSourceOptions`."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
80    pub fn new() -> Self {
81        #[allow(unused_mut)]
82        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
83        ret
84    }
85    #[cfg(feature = "AudioBuffer")]
86    #[deprecated = "Use `set_buffer()` instead."]
87    pub fn buffer(&mut self, val: Option<&AudioBuffer>) -> &mut Self {
88        self.set_buffer(val);
89        self
90    }
91    #[deprecated = "Use `set_detune()` instead."]
92    pub fn detune(&mut self, val: f32) -> &mut Self {
93        self.set_detune(val);
94        self
95    }
96    #[deprecated = "Use `set_loop()` instead."]
97    pub fn loop_(&mut self, val: bool) -> &mut Self {
98        self.set_loop(val);
99        self
100    }
101    #[deprecated = "Use `set_loop_end()` instead."]
102    pub fn loop_end(&mut self, val: f64) -> &mut Self {
103        self.set_loop_end(val);
104        self
105    }
106    #[deprecated = "Use `set_loop_start()` instead."]
107    pub fn loop_start(&mut self, val: f64) -> &mut Self {
108        self.set_loop_start(val);
109        self
110    }
111    #[deprecated = "Use `set_playback_rate()` instead."]
112    pub fn playback_rate(&mut self, val: f32) -> &mut Self {
113        self.set_playback_rate(val);
114        self
115    }
116}
117impl Default for AudioBufferSourceOptions {
118    fn default() -> Self {
119        Self::new()
120    }
121}