Skip to main content

web_sys/features/
gen_AudioBufferSourceNode.rs

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