Skip to main content

web_sys/features/
gen_ConstantSourceNode.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 = "ConstantSourceNode",
13        typescript_type = "ConstantSourceNode"
14    )]
15    #[derive(Debug, Clone, PartialEq, Eq)]
16    #[doc = "The `ConstantSourceNode` class."]
17    #[doc = ""]
18    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ConstantSourceNode)"]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `ConstantSourceNode`*"]
21    pub type ConstantSourceNode;
22    #[cfg(feature = "AudioParam")]
23    #[wasm_bindgen(method, getter, js_class = "ConstantSourceNode", js_name = "offset")]
24    #[doc = "Getter for the `offset` field of this object."]
25    #[doc = ""]
26    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ConstantSourceNode/offset)"]
27    #[doc = ""]
28    #[doc = "*This API requires the following crate features to be activated: `AudioParam`, `ConstantSourceNode`*"]
29    pub fn offset(this: &ConstantSourceNode) -> AudioParam;
30    #[wasm_bindgen(method, getter, js_class = "ConstantSourceNode", js_name = "onended")]
31    #[doc = "Getter for the `onended` field of this object."]
32    #[doc = ""]
33    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ConstantSourceNode/onended)"]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `ConstantSourceNode`*"]
36    pub fn onended(this: &ConstantSourceNode) -> Option<::js_sys::Function>;
37    #[wasm_bindgen(method, setter, js_class = "ConstantSourceNode", js_name = "onended")]
38    #[doc = "Setter for the `onended` field of this object."]
39    #[doc = ""]
40    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ConstantSourceNode/onended)"]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `ConstantSourceNode`*"]
43    pub fn set_onended(this: &ConstantSourceNode, value: Option<&::js_sys::Function>);
44    #[cfg(feature = "BaseAudioContext")]
45    #[wasm_bindgen(catch, constructor, js_class = "ConstantSourceNode")]
46    #[doc = "The `new ConstantSourceNode(..)` constructor, creating a new instance of `ConstantSourceNode`."]
47    #[doc = ""]
48    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ConstantSourceNode/ConstantSourceNode)"]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ConstantSourceNode`*"]
51    pub fn new(context: &BaseAudioContext) -> Result<ConstantSourceNode, JsValue>;
52    #[cfg(all(feature = "BaseAudioContext", feature = "ConstantSourceOptions",))]
53    #[wasm_bindgen(catch, constructor, js_class = "ConstantSourceNode")]
54    #[doc = "The `new ConstantSourceNode(..)` constructor, creating a new instance of `ConstantSourceNode`."]
55    #[doc = ""]
56    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ConstantSourceNode/ConstantSourceNode)"]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ConstantSourceNode`, `ConstantSourceOptions`*"]
59    pub fn new_with_options(
60        context: &BaseAudioContext,
61        options: &ConstantSourceOptions,
62    ) -> Result<ConstantSourceNode, JsValue>;
63    #[wasm_bindgen(catch, method, js_class = "ConstantSourceNode")]
64    #[doc = "The `start()` method."]
65    #[doc = ""]
66    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ConstantSourceNode/start)"]
67    #[doc = ""]
68    #[doc = "*This API requires the following crate features to be activated: `ConstantSourceNode`*"]
69    pub fn start(this: &ConstantSourceNode) -> Result<(), JsValue>;
70    #[wasm_bindgen(catch, method, js_class = "ConstantSourceNode", js_name = "start")]
71    #[doc = "The `start()` method."]
72    #[doc = ""]
73    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ConstantSourceNode/start)"]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `ConstantSourceNode`*"]
76    pub fn start_with_when(this: &ConstantSourceNode, when: f64) -> Result<(), JsValue>;
77    #[wasm_bindgen(catch, method, js_class = "ConstantSourceNode")]
78    #[doc = "The `stop()` method."]
79    #[doc = ""]
80    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ConstantSourceNode/stop)"]
81    #[doc = ""]
82    #[doc = "*This API requires the following crate features to be activated: `ConstantSourceNode`*"]
83    pub fn stop(this: &ConstantSourceNode) -> Result<(), JsValue>;
84    #[wasm_bindgen(catch, method, js_class = "ConstantSourceNode", js_name = "stop")]
85    #[doc = "The `stop()` method."]
86    #[doc = ""]
87    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ConstantSourceNode/stop)"]
88    #[doc = ""]
89    #[doc = "*This API requires the following crate features to be activated: `ConstantSourceNode`*"]
90    pub fn stop_with_when(this: &ConstantSourceNode, when: f64) -> Result<(), JsValue>;
91}