1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[wasm_bindgen]
5 extern "C" {
6     # [wasm_bindgen (extends = :: js_sys :: Object , js_name = PannerOptions)]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `PannerOptions` dictionary."]
9     #[doc = ""]
10     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
11     pub type PannerOptions;
12 }
13 impl PannerOptions {
14     #[doc = "Construct a new `PannerOptions`."]
15     #[doc = ""]
16     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
new() -> Self17     pub fn new() -> Self {
18         #[allow(unused_mut)]
19         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20         ret
21     }
22     #[doc = "Change the `channelCount` field of this object."]
23     #[doc = ""]
24     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
channel_count(&mut self, val: u32) -> &mut Self25     pub fn channel_count(&mut self, val: u32) -> &mut Self {
26         use wasm_bindgen::JsValue;
27         let r = ::js_sys::Reflect::set(
28             self.as_ref(),
29             &JsValue::from("channelCount"),
30             &JsValue::from(val),
31         );
32         debug_assert!(
33             r.is_ok(),
34             "setting properties should never fail on our dictionary objects"
35         );
36         let _ = r;
37         self
38     }
39     #[cfg(feature = "ChannelCountMode")]
40     #[doc = "Change the `channelCountMode` field of this object."]
41     #[doc = ""]
42     #[doc = "*This API requires the following crate features to be activated: `ChannelCountMode`, `PannerOptions`*"]
channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self43     pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self {
44         use wasm_bindgen::JsValue;
45         let r = ::js_sys::Reflect::set(
46             self.as_ref(),
47             &JsValue::from("channelCountMode"),
48             &JsValue::from(val),
49         );
50         debug_assert!(
51             r.is_ok(),
52             "setting properties should never fail on our dictionary objects"
53         );
54         let _ = r;
55         self
56     }
57     #[cfg(feature = "ChannelInterpretation")]
58     #[doc = "Change the `channelInterpretation` field of this object."]
59     #[doc = ""]
60     #[doc = "*This API requires the following crate features to be activated: `ChannelInterpretation`, `PannerOptions`*"]
channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self61     pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self {
62         use wasm_bindgen::JsValue;
63         let r = ::js_sys::Reflect::set(
64             self.as_ref(),
65             &JsValue::from("channelInterpretation"),
66             &JsValue::from(val),
67         );
68         debug_assert!(
69             r.is_ok(),
70             "setting properties should never fail on our dictionary objects"
71         );
72         let _ = r;
73         self
74     }
75     #[doc = "Change the `coneInnerAngle` field of this object."]
76     #[doc = ""]
77     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
cone_inner_angle(&mut self, val: f64) -> &mut Self78     pub fn cone_inner_angle(&mut self, val: f64) -> &mut Self {
79         use wasm_bindgen::JsValue;
80         let r = ::js_sys::Reflect::set(
81             self.as_ref(),
82             &JsValue::from("coneInnerAngle"),
83             &JsValue::from(val),
84         );
85         debug_assert!(
86             r.is_ok(),
87             "setting properties should never fail on our dictionary objects"
88         );
89         let _ = r;
90         self
91     }
92     #[doc = "Change the `coneOuterAngle` field of this object."]
93     #[doc = ""]
94     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
cone_outer_angle(&mut self, val: f64) -> &mut Self95     pub fn cone_outer_angle(&mut self, val: f64) -> &mut Self {
96         use wasm_bindgen::JsValue;
97         let r = ::js_sys::Reflect::set(
98             self.as_ref(),
99             &JsValue::from("coneOuterAngle"),
100             &JsValue::from(val),
101         );
102         debug_assert!(
103             r.is_ok(),
104             "setting properties should never fail on our dictionary objects"
105         );
106         let _ = r;
107         self
108     }
109     #[doc = "Change the `coneOuterGain` field of this object."]
110     #[doc = ""]
111     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
cone_outer_gain(&mut self, val: f64) -> &mut Self112     pub fn cone_outer_gain(&mut self, val: f64) -> &mut Self {
113         use wasm_bindgen::JsValue;
114         let r = ::js_sys::Reflect::set(
115             self.as_ref(),
116             &JsValue::from("coneOuterGain"),
117             &JsValue::from(val),
118         );
119         debug_assert!(
120             r.is_ok(),
121             "setting properties should never fail on our dictionary objects"
122         );
123         let _ = r;
124         self
125     }
126     #[cfg(feature = "DistanceModelType")]
127     #[doc = "Change the `distanceModel` field of this object."]
128     #[doc = ""]
129     #[doc = "*This API requires the following crate features to be activated: `DistanceModelType`, `PannerOptions`*"]
distance_model(&mut self, val: DistanceModelType) -> &mut Self130     pub fn distance_model(&mut self, val: DistanceModelType) -> &mut Self {
131         use wasm_bindgen::JsValue;
132         let r = ::js_sys::Reflect::set(
133             self.as_ref(),
134             &JsValue::from("distanceModel"),
135             &JsValue::from(val),
136         );
137         debug_assert!(
138             r.is_ok(),
139             "setting properties should never fail on our dictionary objects"
140         );
141         let _ = r;
142         self
143     }
144     #[doc = "Change the `maxDistance` field of this object."]
145     #[doc = ""]
146     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
max_distance(&mut self, val: f64) -> &mut Self147     pub fn max_distance(&mut self, val: f64) -> &mut Self {
148         use wasm_bindgen::JsValue;
149         let r = ::js_sys::Reflect::set(
150             self.as_ref(),
151             &JsValue::from("maxDistance"),
152             &JsValue::from(val),
153         );
154         debug_assert!(
155             r.is_ok(),
156             "setting properties should never fail on our dictionary objects"
157         );
158         let _ = r;
159         self
160     }
161     #[doc = "Change the `orientationX` field of this object."]
162     #[doc = ""]
163     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
orientation_x(&mut self, val: f32) -> &mut Self164     pub fn orientation_x(&mut self, val: f32) -> &mut Self {
165         use wasm_bindgen::JsValue;
166         let r = ::js_sys::Reflect::set(
167             self.as_ref(),
168             &JsValue::from("orientationX"),
169             &JsValue::from(val),
170         );
171         debug_assert!(
172             r.is_ok(),
173             "setting properties should never fail on our dictionary objects"
174         );
175         let _ = r;
176         self
177     }
178     #[doc = "Change the `orientationY` field of this object."]
179     #[doc = ""]
180     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
orientation_y(&mut self, val: f32) -> &mut Self181     pub fn orientation_y(&mut self, val: f32) -> &mut Self {
182         use wasm_bindgen::JsValue;
183         let r = ::js_sys::Reflect::set(
184             self.as_ref(),
185             &JsValue::from("orientationY"),
186             &JsValue::from(val),
187         );
188         debug_assert!(
189             r.is_ok(),
190             "setting properties should never fail on our dictionary objects"
191         );
192         let _ = r;
193         self
194     }
195     #[doc = "Change the `orientationZ` field of this object."]
196     #[doc = ""]
197     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
orientation_z(&mut self, val: f32) -> &mut Self198     pub fn orientation_z(&mut self, val: f32) -> &mut Self {
199         use wasm_bindgen::JsValue;
200         let r = ::js_sys::Reflect::set(
201             self.as_ref(),
202             &JsValue::from("orientationZ"),
203             &JsValue::from(val),
204         );
205         debug_assert!(
206             r.is_ok(),
207             "setting properties should never fail on our dictionary objects"
208         );
209         let _ = r;
210         self
211     }
212     #[cfg(feature = "PanningModelType")]
213     #[doc = "Change the `panningModel` field of this object."]
214     #[doc = ""]
215     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`, `PanningModelType`*"]
panning_model(&mut self, val: PanningModelType) -> &mut Self216     pub fn panning_model(&mut self, val: PanningModelType) -> &mut Self {
217         use wasm_bindgen::JsValue;
218         let r = ::js_sys::Reflect::set(
219             self.as_ref(),
220             &JsValue::from("panningModel"),
221             &JsValue::from(val),
222         );
223         debug_assert!(
224             r.is_ok(),
225             "setting properties should never fail on our dictionary objects"
226         );
227         let _ = r;
228         self
229     }
230     #[doc = "Change the `positionX` field of this object."]
231     #[doc = ""]
232     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
position_x(&mut self, val: f32) -> &mut Self233     pub fn position_x(&mut self, val: f32) -> &mut Self {
234         use wasm_bindgen::JsValue;
235         let r = ::js_sys::Reflect::set(
236             self.as_ref(),
237             &JsValue::from("positionX"),
238             &JsValue::from(val),
239         );
240         debug_assert!(
241             r.is_ok(),
242             "setting properties should never fail on our dictionary objects"
243         );
244         let _ = r;
245         self
246     }
247     #[doc = "Change the `positionY` field of this object."]
248     #[doc = ""]
249     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
position_y(&mut self, val: f32) -> &mut Self250     pub fn position_y(&mut self, val: f32) -> &mut Self {
251         use wasm_bindgen::JsValue;
252         let r = ::js_sys::Reflect::set(
253             self.as_ref(),
254             &JsValue::from("positionY"),
255             &JsValue::from(val),
256         );
257         debug_assert!(
258             r.is_ok(),
259             "setting properties should never fail on our dictionary objects"
260         );
261         let _ = r;
262         self
263     }
264     #[doc = "Change the `positionZ` field of this object."]
265     #[doc = ""]
266     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
position_z(&mut self, val: f32) -> &mut Self267     pub fn position_z(&mut self, val: f32) -> &mut Self {
268         use wasm_bindgen::JsValue;
269         let r = ::js_sys::Reflect::set(
270             self.as_ref(),
271             &JsValue::from("positionZ"),
272             &JsValue::from(val),
273         );
274         debug_assert!(
275             r.is_ok(),
276             "setting properties should never fail on our dictionary objects"
277         );
278         let _ = r;
279         self
280     }
281     #[doc = "Change the `refDistance` field of this object."]
282     #[doc = ""]
283     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
ref_distance(&mut self, val: f64) -> &mut Self284     pub fn ref_distance(&mut self, val: f64) -> &mut Self {
285         use wasm_bindgen::JsValue;
286         let r = ::js_sys::Reflect::set(
287             self.as_ref(),
288             &JsValue::from("refDistance"),
289             &JsValue::from(val),
290         );
291         debug_assert!(
292             r.is_ok(),
293             "setting properties should never fail on our dictionary objects"
294         );
295         let _ = r;
296         self
297     }
298     #[doc = "Change the `rolloffFactor` field of this object."]
299     #[doc = ""]
300     #[doc = "*This API requires the following crate features to be activated: `PannerOptions`*"]
rolloff_factor(&mut self, val: f64) -> &mut Self301     pub fn rolloff_factor(&mut self, val: f64) -> &mut Self {
302         use wasm_bindgen::JsValue;
303         let r = ::js_sys::Reflect::set(
304             self.as_ref(),
305             &JsValue::from("rolloffFactor"),
306             &JsValue::from(val),
307         );
308         debug_assert!(
309             r.is_ok(),
310             "setting properties should never fail on our dictionary objects"
311         );
312         let _ = r;
313         self
314     }
315 }
316 impl Default for PannerOptions {
default() -> Self317     fn default() -> Self {
318         Self::new()
319     }
320 }
321