]>
git.proxmox.com Git - rustc.git/blob - vendor/web-sys/src/features/gen_AudioBufferSourceOptions.rs
1 #![allow(unused_imports)]
4 use wasm_bindgen
::prelude
::*;
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AudioBufferSourceOptions)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `AudioBufferSourceOptions` dictionary."]
11 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
12 pub type AudioBufferSourceOptions
;
14 impl AudioBufferSourceOptions
{
15 #[doc = "Construct a new `AudioBufferSourceOptions`."]
17 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
18 pub fn new() -> Self {
20 let mut ret
: Self = ::wasm_bindgen
::JsCast
::unchecked_into(::js_sys
::Object
::new());
23 #[cfg(feature = "AudioBuffer")]
24 #[doc = "Change the `buffer` field of this object."]
26 #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferSourceOptions`*"]
27 pub fn buffer(&mut self, val
: Option
<&AudioBuffer
>) -> &mut Self {
28 use wasm_bindgen
::JsValue
;
30 ::js_sys
::Reflect
::set(self.as_ref(), &JsValue
::from("buffer"), &JsValue
::from(val
));
33 "setting properties should never fail on our dictionary objects"
38 #[doc = "Change the `detune` field of this object."]
40 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
41 pub fn detune(&mut self, val
: f32) -> &mut Self {
42 use wasm_bindgen
::JsValue
;
44 ::js_sys
::Reflect
::set(self.as_ref(), &JsValue
::from("detune"), &JsValue
::from(val
));
47 "setting properties should never fail on our dictionary objects"
52 #[doc = "Change the `loop` field of this object."]
54 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
55 pub fn loop_(&mut self, val
: bool
) -> &mut Self {
56 use wasm_bindgen
::JsValue
;
57 let r
= ::js_sys
::Reflect
::set(self.as_ref(), &JsValue
::from("loop"), &JsValue
::from(val
));
60 "setting properties should never fail on our dictionary objects"
65 #[doc = "Change the `loopEnd` field of this object."]
67 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
68 pub fn loop_end(&mut self, val
: f64) -> &mut Self {
69 use wasm_bindgen
::JsValue
;
70 let r
= ::js_sys
::Reflect
::set(
72 &JsValue
::from("loopEnd"),
77 "setting properties should never fail on our dictionary objects"
82 #[doc = "Change the `loopStart` field of this object."]
84 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
85 pub fn loop_start(&mut self, val
: f64) -> &mut Self {
86 use wasm_bindgen
::JsValue
;
87 let r
= ::js_sys
::Reflect
::set(
89 &JsValue
::from("loopStart"),
94 "setting properties should never fail on our dictionary objects"
99 #[doc = "Change the `playbackRate` field of this object."]
101 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
102 pub fn playback_rate(&mut self, val
: f32) -> &mut Self {
103 use wasm_bindgen
::JsValue
;
104 let r
= ::js_sys
::Reflect
::set(
106 &JsValue
::from("playbackRate"),
111 "setting properties should never fail on our dictionary objects"
117 impl Default
for AudioBufferSourceOptions
{
118 fn default() -> Self {