1use serde::{Deserialize, Serialize};
2#[doc = "Notifies that a new BaseAudioContext has been created.\n[contextCreated](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-contextCreated)"]
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct ContextCreatedParams {
5 #[serde(rename = "context")]
6 pub context: super::types::BaseAudioContext,
7}
8#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9pub enum ContextCreatedMethod {
10 #[serde(rename = "WebAudio.contextCreated")]
11 ContextCreated,
12}
13#[doc = "Notifies that a new BaseAudioContext has been created.\n[contextCreated](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-contextCreated)"]
14#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
15pub struct ContextCreated {
16 pub method: ContextCreatedMethod,
17 pub params: ContextCreatedParams,
18}
19impl ContextCreated {
20 pub const IDENTIFIER: &'static str = "WebAudio.contextCreated";
21 pub fn identifier(&self) -> &'static str {
22 Self::IDENTIFIER
23 }
24}
25#[doc = "Notifies that an existing BaseAudioContext will be destroyed.\n[contextWillBeDestroyed](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-contextWillBeDestroyed)"]
26#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
27pub struct ContextWillBeDestroyedParams {
28 #[serde(rename = "contextId")]
29 pub context_id: super::types::GraphObjectId,
30}
31#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
32pub enum ContextWillBeDestroyedMethod {
33 #[serde(rename = "WebAudio.contextWillBeDestroyed")]
34 ContextWillBeDestroyed,
35}
36#[doc = "Notifies that an existing BaseAudioContext will be destroyed.\n[contextWillBeDestroyed](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-contextWillBeDestroyed)"]
37#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
38pub struct ContextWillBeDestroyed {
39 pub method: ContextWillBeDestroyedMethod,
40 pub params: ContextWillBeDestroyedParams,
41}
42impl ContextWillBeDestroyed {
43 pub const IDENTIFIER: &'static str = "WebAudio.contextWillBeDestroyed";
44 pub fn identifier(&self) -> &'static str {
45 Self::IDENTIFIER
46 }
47}
48#[doc = "Notifies that existing BaseAudioContext has changed some properties (id stays the same)..\n[contextChanged](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-contextChanged)"]
49#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
50pub struct ContextChangedParams {
51 #[serde(rename = "context")]
52 pub context: super::types::BaseAudioContext,
53}
54#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
55pub enum ContextChangedMethod {
56 #[serde(rename = "WebAudio.contextChanged")]
57 ContextChanged,
58}
59#[doc = "Notifies that existing BaseAudioContext has changed some properties (id stays the same)..\n[contextChanged](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-contextChanged)"]
60#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
61pub struct ContextChanged {
62 pub method: ContextChangedMethod,
63 pub params: ContextChangedParams,
64}
65impl ContextChanged {
66 pub const IDENTIFIER: &'static str = "WebAudio.contextChanged";
67 pub fn identifier(&self) -> &'static str {
68 Self::IDENTIFIER
69 }
70}
71#[doc = "Notifies that the construction of an AudioListener has finished.\n[audioListenerCreated](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioListenerCreated)"]
72#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
73pub struct AudioListenerCreatedParams {
74 #[serde(rename = "listener")]
75 pub listener: super::types::AudioListener,
76}
77#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
78pub enum AudioListenerCreatedMethod {
79 #[serde(rename = "WebAudio.audioListenerCreated")]
80 AudioListenerCreated,
81}
82#[doc = "Notifies that the construction of an AudioListener has finished.\n[audioListenerCreated](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioListenerCreated)"]
83#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
84pub struct AudioListenerCreated {
85 pub method: AudioListenerCreatedMethod,
86 pub params: AudioListenerCreatedParams,
87}
88impl AudioListenerCreated {
89 pub const IDENTIFIER: &'static str = "WebAudio.audioListenerCreated";
90 pub fn identifier(&self) -> &'static str {
91 Self::IDENTIFIER
92 }
93}
94#[doc = "Notifies that a new AudioListener has been created.\n[audioListenerWillBeDestroyed](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioListenerWillBeDestroyed)"]
95#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
96pub struct AudioListenerWillBeDestroyedParams {
97 #[serde(rename = "contextId")]
98 pub context_id: super::types::GraphObjectId,
99 #[serde(rename = "listenerId")]
100 pub listener_id: super::types::GraphObjectId,
101}
102#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
103pub enum AudioListenerWillBeDestroyedMethod {
104 #[serde(rename = "WebAudio.audioListenerWillBeDestroyed")]
105 AudioListenerWillBeDestroyed,
106}
107#[doc = "Notifies that a new AudioListener has been created.\n[audioListenerWillBeDestroyed](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioListenerWillBeDestroyed)"]
108#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
109pub struct AudioListenerWillBeDestroyed {
110 pub method: AudioListenerWillBeDestroyedMethod,
111 pub params: AudioListenerWillBeDestroyedParams,
112}
113impl AudioListenerWillBeDestroyed {
114 pub const IDENTIFIER: &'static str = "WebAudio.audioListenerWillBeDestroyed";
115 pub fn identifier(&self) -> &'static str {
116 Self::IDENTIFIER
117 }
118}
119#[doc = "Notifies that a new AudioNode has been created.\n[audioNodeCreated](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioNodeCreated)"]
120#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
121pub struct AudioNodeCreatedParams {
122 #[serde(rename = "node")]
123 pub node: super::types::AudioNode,
124}
125#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
126pub enum AudioNodeCreatedMethod {
127 #[serde(rename = "WebAudio.audioNodeCreated")]
128 AudioNodeCreated,
129}
130#[doc = "Notifies that a new AudioNode has been created.\n[audioNodeCreated](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioNodeCreated)"]
131#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
132pub struct AudioNodeCreated {
133 pub method: AudioNodeCreatedMethod,
134 pub params: AudioNodeCreatedParams,
135}
136impl AudioNodeCreated {
137 pub const IDENTIFIER: &'static str = "WebAudio.audioNodeCreated";
138 pub fn identifier(&self) -> &'static str {
139 Self::IDENTIFIER
140 }
141}
142#[doc = "Notifies that an existing AudioNode has been destroyed.\n[audioNodeWillBeDestroyed](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioNodeWillBeDestroyed)"]
143#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
144pub struct AudioNodeWillBeDestroyedParams {
145 #[serde(rename = "contextId")]
146 pub context_id: super::types::GraphObjectId,
147 #[serde(rename = "nodeId")]
148 pub node_id: super::types::GraphObjectId,
149}
150#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
151pub enum AudioNodeWillBeDestroyedMethod {
152 #[serde(rename = "WebAudio.audioNodeWillBeDestroyed")]
153 AudioNodeWillBeDestroyed,
154}
155#[doc = "Notifies that an existing AudioNode has been destroyed.\n[audioNodeWillBeDestroyed](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioNodeWillBeDestroyed)"]
156#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
157pub struct AudioNodeWillBeDestroyed {
158 pub method: AudioNodeWillBeDestroyedMethod,
159 pub params: AudioNodeWillBeDestroyedParams,
160}
161impl AudioNodeWillBeDestroyed {
162 pub const IDENTIFIER: &'static str = "WebAudio.audioNodeWillBeDestroyed";
163 pub fn identifier(&self) -> &'static str {
164 Self::IDENTIFIER
165 }
166}
167#[doc = "Notifies that a new AudioParam has been created.\n[audioParamCreated](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioParamCreated)"]
168#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
169pub struct AudioParamCreatedParams {
170 #[serde(rename = "param")]
171 pub param: super::types::AudioParam,
172}
173#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
174pub enum AudioParamCreatedMethod {
175 #[serde(rename = "WebAudio.audioParamCreated")]
176 AudioParamCreated,
177}
178#[doc = "Notifies that a new AudioParam has been created.\n[audioParamCreated](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioParamCreated)"]
179#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
180pub struct AudioParamCreated {
181 pub method: AudioParamCreatedMethod,
182 pub params: AudioParamCreatedParams,
183}
184impl AudioParamCreated {
185 pub const IDENTIFIER: &'static str = "WebAudio.audioParamCreated";
186 pub fn identifier(&self) -> &'static str {
187 Self::IDENTIFIER
188 }
189}
190#[doc = "Notifies that an existing AudioParam has been destroyed.\n[audioParamWillBeDestroyed](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioParamWillBeDestroyed)"]
191#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
192pub struct AudioParamWillBeDestroyedParams {
193 #[serde(rename = "contextId")]
194 pub context_id: super::types::GraphObjectId,
195 #[serde(rename = "nodeId")]
196 pub node_id: super::types::GraphObjectId,
197 #[serde(rename = "paramId")]
198 pub param_id: super::types::GraphObjectId,
199}
200#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
201pub enum AudioParamWillBeDestroyedMethod {
202 #[serde(rename = "WebAudio.audioParamWillBeDestroyed")]
203 AudioParamWillBeDestroyed,
204}
205#[doc = "Notifies that an existing AudioParam has been destroyed.\n[audioParamWillBeDestroyed](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-audioParamWillBeDestroyed)"]
206#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
207pub struct AudioParamWillBeDestroyed {
208 pub method: AudioParamWillBeDestroyedMethod,
209 pub params: AudioParamWillBeDestroyedParams,
210}
211impl AudioParamWillBeDestroyed {
212 pub const IDENTIFIER: &'static str = "WebAudio.audioParamWillBeDestroyed";
213 pub fn identifier(&self) -> &'static str {
214 Self::IDENTIFIER
215 }
216}
217#[doc = "Notifies that two AudioNodes are connected.\n[nodesConnected](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-nodesConnected)"]
218#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
219pub struct NodesConnectedParams {
220 #[serde(rename = "contextId")]
221 pub context_id: super::types::GraphObjectId,
222 #[serde(rename = "sourceId")]
223 pub source_id: super::types::GraphObjectId,
224 #[serde(rename = "destinationId")]
225 pub destination_id: super::types::GraphObjectId,
226 #[serde(rename = "sourceOutputIndex")]
227 #[serde(skip_serializing_if = "Option::is_none")]
228 #[serde(default)]
229 pub source_output_index: Option<f64>,
230 #[serde(rename = "destinationInputIndex")]
231 #[serde(skip_serializing_if = "Option::is_none")]
232 #[serde(default)]
233 pub destination_input_index: Option<f64>,
234}
235#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
236pub enum NodesConnectedMethod {
237 #[serde(rename = "WebAudio.nodesConnected")]
238 NodesConnected,
239}
240#[doc = "Notifies that two AudioNodes are connected.\n[nodesConnected](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-nodesConnected)"]
241#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
242pub struct NodesConnected {
243 pub method: NodesConnectedMethod,
244 pub params: NodesConnectedParams,
245}
246impl NodesConnected {
247 pub const IDENTIFIER: &'static str = "WebAudio.nodesConnected";
248 pub fn identifier(&self) -> &'static str {
249 Self::IDENTIFIER
250 }
251}
252#[doc = "Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected.\n[nodesDisconnected](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-nodesDisconnected)"]
253#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
254pub struct NodesDisconnectedParams {
255 #[serde(rename = "contextId")]
256 pub context_id: super::types::GraphObjectId,
257 #[serde(rename = "sourceId")]
258 pub source_id: super::types::GraphObjectId,
259 #[serde(rename = "destinationId")]
260 pub destination_id: super::types::GraphObjectId,
261 #[serde(rename = "sourceOutputIndex")]
262 #[serde(skip_serializing_if = "Option::is_none")]
263 #[serde(default)]
264 pub source_output_index: Option<f64>,
265 #[serde(rename = "destinationInputIndex")]
266 #[serde(skip_serializing_if = "Option::is_none")]
267 #[serde(default)]
268 pub destination_input_index: Option<f64>,
269}
270#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
271pub enum NodesDisconnectedMethod {
272 #[serde(rename = "WebAudio.nodesDisconnected")]
273 NodesDisconnected,
274}
275#[doc = "Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected.\n[nodesDisconnected](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-nodesDisconnected)"]
276#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
277pub struct NodesDisconnected {
278 pub method: NodesDisconnectedMethod,
279 pub params: NodesDisconnectedParams,
280}
281impl NodesDisconnected {
282 pub const IDENTIFIER: &'static str = "WebAudio.nodesDisconnected";
283 pub fn identifier(&self) -> &'static str {
284 Self::IDENTIFIER
285 }
286}
287#[doc = "Notifies that an AudioNode is connected to an AudioParam.\n[nodeParamConnected](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-nodeParamConnected)"]
288#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
289pub struct NodeParamConnectedParams {
290 #[serde(rename = "contextId")]
291 pub context_id: super::types::GraphObjectId,
292 #[serde(rename = "sourceId")]
293 pub source_id: super::types::GraphObjectId,
294 #[serde(rename = "destinationId")]
295 pub destination_id: super::types::GraphObjectId,
296 #[serde(rename = "sourceOutputIndex")]
297 #[serde(skip_serializing_if = "Option::is_none")]
298 #[serde(default)]
299 pub source_output_index: Option<f64>,
300}
301#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
302pub enum NodeParamConnectedMethod {
303 #[serde(rename = "WebAudio.nodeParamConnected")]
304 NodeParamConnected,
305}
306#[doc = "Notifies that an AudioNode is connected to an AudioParam.\n[nodeParamConnected](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-nodeParamConnected)"]
307#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
308pub struct NodeParamConnected {
309 pub method: NodeParamConnectedMethod,
310 pub params: NodeParamConnectedParams,
311}
312impl NodeParamConnected {
313 pub const IDENTIFIER: &'static str = "WebAudio.nodeParamConnected";
314 pub fn identifier(&self) -> &'static str {
315 Self::IDENTIFIER
316 }
317}
318#[doc = "Notifies that an AudioNode is disconnected to an AudioParam.\n[nodeParamDisconnected](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-nodeParamDisconnected)"]
319#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
320pub struct NodeParamDisconnectedParams {
321 #[serde(rename = "contextId")]
322 pub context_id: super::types::GraphObjectId,
323 #[serde(rename = "sourceId")]
324 pub source_id: super::types::GraphObjectId,
325 #[serde(rename = "destinationId")]
326 pub destination_id: super::types::GraphObjectId,
327 #[serde(rename = "sourceOutputIndex")]
328 #[serde(skip_serializing_if = "Option::is_none")]
329 #[serde(default)]
330 pub source_output_index: Option<f64>,
331}
332#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
333pub enum NodeParamDisconnectedMethod {
334 #[serde(rename = "WebAudio.nodeParamDisconnected")]
335 NodeParamDisconnected,
336}
337#[doc = "Notifies that an AudioNode is disconnected to an AudioParam.\n[nodeParamDisconnected](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#event-nodeParamDisconnected)"]
338#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
339pub struct NodeParamDisconnected {
340 pub method: NodeParamDisconnectedMethod,
341 pub params: NodeParamDisconnectedParams,
342}
343impl NodeParamDisconnected {
344 pub const IDENTIFIER: &'static str = "WebAudio.nodeParamDisconnected";
345 pub fn identifier(&self) -> &'static str {
346 Self::IDENTIFIER
347 }
348}
349group_enum ! (WebAudioEvents { ContextCreated (ContextCreated) , ContextWillBeDestroyed (ContextWillBeDestroyed) , ContextChanged (ContextChanged) , AudioListenerCreated (AudioListenerCreated) , AudioListenerWillBeDestroyed (AudioListenerWillBeDestroyed) , AudioNodeCreated (AudioNodeCreated) , AudioNodeWillBeDestroyed (AudioNodeWillBeDestroyed) , AudioParamCreated (AudioParamCreated) , AudioParamWillBeDestroyed (AudioParamWillBeDestroyed) , NodesConnected (NodesConnected) , NodesDisconnected (NodesDisconnected) , NodeParamConnected (NodeParamConnected) , NodeParamDisconnected (NodeParamDisconnected) } + identifiable);