Skip to main content

rustenium_cdp_definitions/browser_protocol/web_audio/
commands.rs

1use serde::{Deserialize, Serialize};
2#[doc = "Enables the WebAudio domain and starts sending context lifetime events.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#method-enable)"]
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct EnableParams {}
5#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6pub enum EnableMethod {
7    #[serde(rename = "WebAudio.enable")]
8    Enable,
9}
10#[doc = "Enables the WebAudio domain and starts sending context lifetime events.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#method-enable)"]
11#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12pub struct Enable {
13    pub method: EnableMethod,
14    pub params: EnableParams,
15}
16impl Enable {
17    pub const IDENTIFIER: &'static str = "WebAudio.enable";
18    pub fn identifier(&self) -> &'static str {
19        Self::IDENTIFIER
20    }
21}
22impl crate::CommandResult for Enable {
23    type Result = super::results::EnableResult;
24}
25#[doc = "Disables the WebAudio domain.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#method-disable)"]
26#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
27pub struct DisableParams {}
28#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
29pub enum DisableMethod {
30    #[serde(rename = "WebAudio.disable")]
31    Disable,
32}
33#[doc = "Disables the WebAudio domain.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#method-disable)"]
34#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
35pub struct Disable {
36    pub method: DisableMethod,
37    pub params: DisableParams,
38}
39impl Disable {
40    pub const IDENTIFIER: &'static str = "WebAudio.disable";
41    pub fn identifier(&self) -> &'static str {
42        Self::IDENTIFIER
43    }
44}
45impl crate::CommandResult for Disable {
46    type Result = super::results::DisableResult;
47}
48#[doc = "Fetch the realtime data from the registered contexts.\n[getRealtimeData](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#method-getRealtimeData)"]
49#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
50pub struct GetRealtimeDataParams {
51    #[serde(rename = "contextId")]
52    pub context_id: super::types::GraphObjectId,
53}
54impl GetRealtimeDataParams {
55    pub fn new(context_id: impl Into<super::types::GraphObjectId>) -> Self {
56        Self {
57            context_id: context_id.into(),
58        }
59    }
60}
61#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
62pub enum GetRealtimeDataMethod {
63    #[serde(rename = "WebAudio.getRealtimeData")]
64    GetRealtimeData,
65}
66#[doc = "Fetch the realtime data from the registered contexts.\n[getRealtimeData](https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/#method-getRealtimeData)"]
67#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
68pub struct GetRealtimeData {
69    pub method: GetRealtimeDataMethod,
70    pub params: GetRealtimeDataParams,
71}
72impl GetRealtimeData {
73    pub const IDENTIFIER: &'static str = "WebAudio.getRealtimeData";
74    pub fn identifier(&self) -> &'static str {
75        Self::IDENTIFIER
76    }
77}
78impl crate::CommandResult for GetRealtimeData {
79    type Result = super::results::GetRealtimeDataResult;
80}
81group_enum ! (WebAudioCommands { Enable (Enable) , Disable (Disable) , GetRealtimeData (GetRealtimeData) } + identifiable);