web_sys/features/
gen_OscillatorOptions.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = OscillatorOptions)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `OscillatorOptions` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"]
12 pub type OscillatorOptions;
13 #[doc = "Get the `channelCount` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"]
16 #[wasm_bindgen(method, getter = "channelCount")]
17 pub fn get_channel_count(this: &OscillatorOptions) -> Option<u32>;
18 #[doc = "Change the `channelCount` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"]
21 #[wasm_bindgen(method, setter = "channelCount")]
22 pub fn set_channel_count(this: &OscillatorOptions, val: u32);
23 #[cfg(feature = "ChannelCountMode")]
24 #[doc = "Get the `channelCountMode` field of this object."]
25 #[doc = ""]
26 #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `OscillatorOptions`*"]
27 #[wasm_bindgen(method, getter = "channelCountMode")]
28 pub fn get_channel_count_mode(this: &OscillatorOptions) -> Option<ChannelCountMode>;
29 #[cfg(feature = "ChannelCountMode")]
30 #[doc = "Change the `channelCountMode` field of this object."]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `OscillatorOptions`*"]
33 #[wasm_bindgen(method, setter = "channelCountMode")]
34 pub fn set_channel_count_mode(this: &OscillatorOptions, val: ChannelCountMode);
35 #[cfg(feature = "ChannelInterpretation")]
36 #[doc = "Get the `channelInterpretation` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `OscillatorOptions`*"]
39 #[wasm_bindgen(method, getter = "channelInterpretation")]
40 pub fn get_channel_interpretation(this: &OscillatorOptions) -> Option<ChannelInterpretation>;
41 #[cfg(feature = "ChannelInterpretation")]
42 #[doc = "Change the `channelInterpretation` field of this object."]
43 #[doc = ""]
44 #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `OscillatorOptions`*"]
45 #[wasm_bindgen(method, setter = "channelInterpretation")]
46 pub fn set_channel_interpretation(this: &OscillatorOptions, val: ChannelInterpretation);
47 #[doc = "Get the `detune` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"]
50 #[wasm_bindgen(method, getter = "detune")]
51 pub fn get_detune(this: &OscillatorOptions) -> Option<f32>;
52 #[doc = "Change the `detune` field of this object."]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"]
55 #[wasm_bindgen(method, setter = "detune")]
56 pub fn set_detune(this: &OscillatorOptions, val: f32);
57 #[doc = "Get the `frequency` field of this object."]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"]
60 #[wasm_bindgen(method, getter = "frequency")]
61 pub fn get_frequency(this: &OscillatorOptions) -> Option<f32>;
62 #[doc = "Change the `frequency` field of this object."]
63 #[doc = ""]
64 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"]
65 #[wasm_bindgen(method, setter = "frequency")]
66 pub fn set_frequency(this: &OscillatorOptions, val: f32);
67 #[cfg(feature = "PeriodicWave")]
68 #[doc = "Get the `periodicWave` field of this object."]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `PeriodicWave`*"]
71 #[wasm_bindgen(method, getter = "periodicWave")]
72 pub fn get_periodic_wave(this: &OscillatorOptions) -> Option<PeriodicWave>;
73 #[cfg(feature = "PeriodicWave")]
74 #[doc = "Change the `periodicWave` field of this object."]
75 #[doc = ""]
76 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `PeriodicWave`*"]
77 #[wasm_bindgen(method, setter = "periodicWave")]
78 pub fn set_periodic_wave(this: &OscillatorOptions, val: &PeriodicWave);
79 #[cfg(feature = "OscillatorType")]
80 #[doc = "Get the `type` field of this object."]
81 #[doc = ""]
82 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `OscillatorType`*"]
83 #[wasm_bindgen(method, getter = "type")]
84 pub fn get_type(this: &OscillatorOptions) -> Option<OscillatorType>;
85 #[cfg(feature = "OscillatorType")]
86 #[doc = "Change the `type` field of this object."]
87 #[doc = ""]
88 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`, `OscillatorType`*"]
89 #[wasm_bindgen(method, setter = "type")]
90 pub fn set_type(this: &OscillatorOptions, val: OscillatorType);
91}
92impl OscillatorOptions {
93 #[doc = "Construct a new `OscillatorOptions`."]
94 #[doc = ""]
95 #[doc = "*This API requires the following crate features to be activated: `OscillatorOptions`*"]
96 pub fn new() -> Self {
97 #[allow(unused_mut)]
98 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
99 ret
100 }
101 #[deprecated = "Use `set_channel_count()` instead."]
102 pub fn channel_count(&mut self, val: u32) -> &mut Self {
103 self.set_channel_count(val);
104 self
105 }
106 #[cfg(feature = "ChannelCountMode")]
107 #[deprecated = "Use `set_channel_count_mode()` instead."]
108 pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self {
109 self.set_channel_count_mode(val);
110 self
111 }
112 #[cfg(feature = "ChannelInterpretation")]
113 #[deprecated = "Use `set_channel_interpretation()` instead."]
114 pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self {
115 self.set_channel_interpretation(val);
116 self
117 }
118 #[deprecated = "Use `set_detune()` instead."]
119 pub fn detune(&mut self, val: f32) -> &mut Self {
120 self.set_detune(val);
121 self
122 }
123 #[deprecated = "Use `set_frequency()` instead."]
124 pub fn frequency(&mut self, val: f32) -> &mut Self {
125 self.set_frequency(val);
126 self
127 }
128 #[cfg(feature = "PeriodicWave")]
129 #[deprecated = "Use `set_periodic_wave()` instead."]
130 pub fn periodic_wave(&mut self, val: &PeriodicWave) -> &mut Self {
131 self.set_periodic_wave(val);
132 self
133 }
134 #[cfg(feature = "OscillatorType")]
135 #[deprecated = "Use `set_type()` instead."]
136 pub fn type_(&mut self, val: OscillatorType) -> &mut Self {
137 self.set_type(val);
138 self
139 }
140}
141impl Default for OscillatorOptions {
142 fn default() -> Self {
143 Self::new()
144 }
145}