Skip to main content

web_sys/features/
gen_OscillatorNode.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 = "OscillatorNode",
13        typescript_type = "OscillatorNode"
14    )]
15    #[derive(Debug, Clone, PartialEq, Eq)]
16    #[doc = "The `OscillatorNode` class."]
17    #[doc = ""]
18    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode)"]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
21    pub type OscillatorNode;
22    #[cfg(feature = "OscillatorType")]
23    #[wasm_bindgen(method, getter, js_class = "OscillatorNode", js_name = "type")]
24    #[doc = "Getter for the `type` field of this object."]
25    #[doc = ""]
26    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/type)"]
27    #[doc = ""]
28    #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`, `OscillatorType`*"]
29    pub fn type_(this: &OscillatorNode) -> OscillatorType;
30    #[cfg(feature = "OscillatorType")]
31    #[wasm_bindgen(method, setter, js_class = "OscillatorNode", js_name = "type")]
32    #[doc = "Setter for the `type` field of this object."]
33    #[doc = ""]
34    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/type)"]
35    #[doc = ""]
36    #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`, `OscillatorType`*"]
37    pub fn set_type(this: &OscillatorNode, value: OscillatorType);
38    #[cfg(feature = "AudioParam")]
39    #[wasm_bindgen(method, getter, js_class = "OscillatorNode", js_name = "frequency")]
40    #[doc = "Getter for the `frequency` field of this object."]
41    #[doc = ""]
42    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/frequency)"]
43    #[doc = ""]
44    #[doc = "*This API requires the following crate features to be activated: `AudioParam`, `OscillatorNode`*"]
45    pub fn frequency(this: &OscillatorNode) -> AudioParam;
46    #[cfg(feature = "AudioParam")]
47    #[wasm_bindgen(method, getter, js_class = "OscillatorNode", js_name = "detune")]
48    #[doc = "Getter for the `detune` field of this object."]
49    #[doc = ""]
50    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/detune)"]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `AudioParam`, `OscillatorNode`*"]
53    pub fn detune(this: &OscillatorNode) -> AudioParam;
54    #[wasm_bindgen(method, getter, js_class = "OscillatorNode", js_name = "onended")]
55    #[doc = "Getter for the `onended` field of this object."]
56    #[doc = ""]
57    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/onended)"]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
60    pub fn onended(this: &OscillatorNode) -> Option<::js_sys::Function>;
61    #[wasm_bindgen(method, setter, js_class = "OscillatorNode", js_name = "onended")]
62    #[doc = "Setter for the `onended` field of this object."]
63    #[doc = ""]
64    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/onended)"]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
67    pub fn set_onended(this: &OscillatorNode, value: Option<&::js_sys::Function>);
68    #[cfg(feature = "BaseAudioContext")]
69    #[wasm_bindgen(catch, constructor, js_class = "OscillatorNode")]
70    #[doc = "The `new OscillatorNode(..)` constructor, creating a new instance of `OscillatorNode`."]
71    #[doc = ""]
72    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/OscillatorNode)"]
73    #[doc = ""]
74    #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `OscillatorNode`*"]
75    pub fn new(context: &BaseAudioContext) -> Result<OscillatorNode, JsValue>;
76    #[cfg(all(feature = "BaseAudioContext", feature = "OscillatorOptions",))]
77    #[wasm_bindgen(catch, constructor, js_class = "OscillatorNode")]
78    #[doc = "The `new OscillatorNode(..)` constructor, creating a new instance of `OscillatorNode`."]
79    #[doc = ""]
80    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/OscillatorNode)"]
81    #[doc = ""]
82    #[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `OscillatorNode`, `OscillatorOptions`*"]
83    pub fn new_with_options(
84        context: &BaseAudioContext,
85        options: &OscillatorOptions,
86    ) -> Result<OscillatorNode, JsValue>;
87    #[cfg(feature = "PeriodicWave")]
88    #[wasm_bindgen(method, js_class = "OscillatorNode", js_name = "setPeriodicWave")]
89    #[doc = "The `setPeriodicWave()` method."]
90    #[doc = ""]
91    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/setPeriodicWave)"]
92    #[doc = ""]
93    #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`, `PeriodicWave`*"]
94    pub fn set_periodic_wave(this: &OscillatorNode, periodic_wave: &PeriodicWave);
95    #[wasm_bindgen(catch, method, js_class = "OscillatorNode")]
96    #[doc = "The `start()` method."]
97    #[doc = ""]
98    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/start)"]
99    #[doc = ""]
100    #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
101    pub fn start(this: &OscillatorNode) -> Result<(), JsValue>;
102    #[wasm_bindgen(catch, method, js_class = "OscillatorNode", js_name = "start")]
103    #[doc = "The `start()` method."]
104    #[doc = ""]
105    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/start)"]
106    #[doc = ""]
107    #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
108    pub fn start_with_when(this: &OscillatorNode, when: f64) -> Result<(), JsValue>;
109    #[wasm_bindgen(catch, method, js_class = "OscillatorNode")]
110    #[doc = "The `stop()` method."]
111    #[doc = ""]
112    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/stop)"]
113    #[doc = ""]
114    #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
115    pub fn stop(this: &OscillatorNode) -> Result<(), JsValue>;
116    #[wasm_bindgen(catch, method, js_class = "OscillatorNode", js_name = "stop")]
117    #[doc = "The `stop()` method."]
118    #[doc = ""]
119    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/stop)"]
120    #[doc = ""]
121    #[doc = "*This API requires the following crate features to be activated: `OscillatorNode`*"]
122    pub fn stop_with_when(this: &OscillatorNode, when: f64) -> Result<(), JsValue>;
123}