1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = AudioScheduledSourceNode , extends = AudioNode , extends = EventTarget , extends = :: js_sys :: Object , js_name = AudioBufferSourceNode , typescript_type = "AudioBufferSourceNode")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `AudioBufferSourceNode` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
14 pub type AudioBufferSourceNode;
15 #[cfg(feature = "AudioBuffer")]
16 # [wasm_bindgen (structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = buffer)]
17 #[doc = "Getter for the `buffer` field of this object."]
18 #[doc = ""]
19 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/buffer)"]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferSourceNode`*"]
22 pub fn buffer(this: &AudioBufferSourceNode) -> Option<AudioBuffer>;
23 #[cfg(feature = "AudioBuffer")]
24 # [wasm_bindgen (structural , method , setter , js_class = "AudioBufferSourceNode" , js_name = buffer)]
25 #[doc = "Setter for the `buffer` field of this object."]
26 #[doc = ""]
27 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/buffer)"]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferSourceNode`*"]
30 pub fn set_buffer(this: &AudioBufferSourceNode, value: Option<&AudioBuffer>);
31 #[cfg(feature = "AudioParam")]
32 # [wasm_bindgen (structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = playbackRate)]
33 #[doc = "Getter for the `playbackRate` field of this object."]
34 #[doc = ""]
35 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/playbackRate)"]
36 #[doc = ""]
37 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `AudioParam`*"]
38 pub fn playback_rate(this: &AudioBufferSourceNode) -> AudioParam;
39 #[cfg(feature = "AudioParam")]
40 # [wasm_bindgen (structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = detune)]
41 #[doc = "Getter for the `detune` field of this object."]
42 #[doc = ""]
43 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/detune)"]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `AudioParam`*"]
46 pub fn detune(this: &AudioBufferSourceNode) -> AudioParam;
47 # [wasm_bindgen (structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = loop)]
48 #[doc = "Getter for the `loop` field of this object."]
49 #[doc = ""]
50 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop)"]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
53 pub fn loop_(this: &AudioBufferSourceNode) -> bool;
54 # [wasm_bindgen (structural , method , setter , js_class = "AudioBufferSourceNode" , js_name = loop)]
55 #[doc = "Setter for the `loop` field of this object."]
56 #[doc = ""]
57 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop)"]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
60 pub fn set_loop(this: &AudioBufferSourceNode, value: bool);
61 # [wasm_bindgen (structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = loopStart)]
62 #[doc = "Getter for the `loopStart` field of this object."]
63 #[doc = ""]
64 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopStart)"]
65 #[doc = ""]
66 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
67 pub fn loop_start(this: &AudioBufferSourceNode) -> f64;
68 # [wasm_bindgen (structural , method , setter , js_class = "AudioBufferSourceNode" , js_name = loopStart)]
69 #[doc = "Setter for the `loopStart` field of this object."]
70 #[doc = ""]
71 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopStart)"]
72 #[doc = ""]
73 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
74 pub fn set_loop_start(this: &AudioBufferSourceNode, value: f64);
75 # [wasm_bindgen (structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = loopEnd)]
76 #[doc = "Getter for the `loopEnd` field of this object."]
77 #[doc = ""]
78 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopEnd)"]
79 #[doc = ""]
80 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
81 pub fn loop_end(this: &AudioBufferSourceNode) -> f64;
82 # [wasm_bindgen (structural , method , setter , js_class = "AudioBufferSourceNode" , js_name = loopEnd)]
83 #[doc = "Setter for the `loopEnd` field of this object."]
84 #[doc = ""]
85 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopEnd)"]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
88 pub fn set_loop_end(this: &AudioBufferSourceNode, value: f64);
89 # [wasm_bindgen (structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = onended)]
90 #[doc = "Getter for the `onended` field of this object."]
91 #[doc = ""]
92 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/onended)"]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
95 pub fn onended(this: &AudioBufferSourceNode) -> Option<::js_sys::Function>;
96 # [wasm_bindgen (structural , method , setter , js_class = "AudioBufferSourceNode" , js_name = onended)]
97 #[doc = "Setter for the `onended` field of this object."]
98 #[doc = ""]
99 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/onended)"]
100 #[doc = ""]
101 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
102 pub fn set_onended(this: &AudioBufferSourceNode, value: Option<&::js_sys::Function>);
103 #[cfg(feature = "BaseAudioContext")]
104 #[wasm_bindgen(catch, constructor, js_class = "AudioBufferSourceNode")]
105 #[doc = "The `new AudioBufferSourceNode(..)` constructor, creating a new instance of `AudioBufferSourceNode`."]
106 #[doc = ""]
107 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/AudioBufferSourceNode)"]
108 #[doc = ""]
109 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `BaseAudioContext`*"]
110 pub fn new(context: &BaseAudioContext) -> Result<AudioBufferSourceNode, JsValue>;
111 #[cfg(all(feature = "AudioBufferSourceOptions", feature = "BaseAudioContext",))]
112 #[wasm_bindgen(catch, constructor, js_class = "AudioBufferSourceNode")]
113 #[doc = "The `new AudioBufferSourceNode(..)` constructor, creating a new instance of `AudioBufferSourceNode`."]
114 #[doc = ""]
115 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/AudioBufferSourceNode)"]
116 #[doc = ""]
117 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `AudioBufferSourceOptions`, `BaseAudioContext`*"]
118 pub fn new_with_options(
119 context: &BaseAudioContext,
120 options: &AudioBufferSourceOptions,
121 ) -> Result<AudioBufferSourceNode, JsValue>;
122 # [wasm_bindgen (catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = start)]
123 #[doc = "The `start()` method."]
124 #[doc = ""]
125 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start)"]
126 #[doc = ""]
127 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
128 pub fn start(this: &AudioBufferSourceNode) -> Result<(), JsValue>;
129 # [wasm_bindgen (catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = start)]
130 #[doc = "The `start()` method."]
131 #[doc = ""]
132 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start)"]
133 #[doc = ""]
134 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
135 pub fn start_with_when(this: &AudioBufferSourceNode, when: f64) -> Result<(), JsValue>;
136 # [wasm_bindgen (catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = start)]
137 #[doc = "The `start()` method."]
138 #[doc = ""]
139 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start)"]
140 #[doc = ""]
141 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
142 pub fn start_with_when_and_grain_offset(
143 this: &AudioBufferSourceNode,
144 when: f64,
145 grain_offset: f64,
146 ) -> Result<(), JsValue>;
147 # [wasm_bindgen (catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = start)]
148 #[doc = "The `start()` method."]
149 #[doc = ""]
150 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start)"]
151 #[doc = ""]
152 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
153 pub fn start_with_when_and_grain_offset_and_grain_duration(
154 this: &AudioBufferSourceNode,
155 when: f64,
156 grain_offset: f64,
157 grain_duration: f64,
158 ) -> Result<(), JsValue>;
159 # [wasm_bindgen (catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = stop)]
160 #[doc = "The `stop()` method."]
161 #[doc = ""]
162 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/stop)"]
163 #[doc = ""]
164 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
165 pub fn stop(this: &AudioBufferSourceNode) -> Result<(), JsValue>;
166 # [wasm_bindgen (catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = stop)]
167 #[doc = "The `stop()` method."]
168 #[doc = ""]
169 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/stop)"]
170 #[doc = ""]
171 #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
172 pub fn stop_with_when(this: &AudioBufferSourceNode, when: f64) -> Result<(), JsValue>;
173}
174