org.openqa.selenium.devtools.v91.webaudio.WebAudio Maven / Gradle / Ivy
package org.openqa.selenium.devtools.v91.webaudio;
import org.openqa.selenium.Beta;
import org.openqa.selenium.devtools.Command;
import org.openqa.selenium.devtools.Event;
import org.openqa.selenium.devtools.ConverterFunctions;
import com.google.common.collect.ImmutableMap;
import org.openqa.selenium.json.JsonInput;
/**
* This domain allows inspection of Web Audio API.
* https://webaudio.github.io/web-audio-api/
*/
@Beta()
public class WebAudio {
/**
* Enables the WebAudio domain and starts sending context lifetime events.
*/
public static Command enable() {
ImmutableMap.Builder params = ImmutableMap.builder();
return new Command<>("WebAudio.enable", params.build());
}
/**
* Disables the WebAudio domain.
*/
public static Command disable() {
ImmutableMap.Builder params = ImmutableMap.builder();
return new Command<>("WebAudio.disable", params.build());
}
/**
* Fetch the realtime data from the registered contexts.
*/
public static Command getRealtimeData(org.openqa.selenium.devtools.v91.webaudio.model.GraphObjectId contextId) {
java.util.Objects.requireNonNull(contextId, "contextId is required");
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("contextId", contextId);
return new Command<>("WebAudio.getRealtimeData", params.build(), ConverterFunctions.map("realtimeData", org.openqa.selenium.devtools.v91.webaudio.model.ContextRealtimeData.class));
}
public static Event contextCreated() {
return new Event<>("WebAudio.contextCreated", ConverterFunctions.map("context", org.openqa.selenium.devtools.v91.webaudio.model.BaseAudioContext.class));
}
public static Event contextWillBeDestroyed() {
return new Event<>("WebAudio.contextWillBeDestroyed", ConverterFunctions.map("contextId", org.openqa.selenium.devtools.v91.webaudio.model.GraphObjectId.class));
}
public static Event contextChanged() {
return new Event<>("WebAudio.contextChanged", ConverterFunctions.map("context", org.openqa.selenium.devtools.v91.webaudio.model.BaseAudioContext.class));
}
public static Event audioListenerCreated() {
return new Event<>("WebAudio.audioListenerCreated", ConverterFunctions.map("listener", org.openqa.selenium.devtools.v91.webaudio.model.AudioListener.class));
}
public static Event audioListenerWillBeDestroyed() {
return new Event<>("WebAudio.audioListenerWillBeDestroyed", input -> input.read(org.openqa.selenium.devtools.v91.webaudio.model.AudioListenerWillBeDestroyed.class));
}
public static Event audioNodeCreated() {
return new Event<>("WebAudio.audioNodeCreated", ConverterFunctions.map("node", org.openqa.selenium.devtools.v91.webaudio.model.AudioNode.class));
}
public static Event audioNodeWillBeDestroyed() {
return new Event<>("WebAudio.audioNodeWillBeDestroyed", input -> input.read(org.openqa.selenium.devtools.v91.webaudio.model.AudioNodeWillBeDestroyed.class));
}
public static Event audioParamCreated() {
return new Event<>("WebAudio.audioParamCreated", ConverterFunctions.map("param", org.openqa.selenium.devtools.v91.webaudio.model.AudioParam.class));
}
public static Event audioParamWillBeDestroyed() {
return new Event<>("WebAudio.audioParamWillBeDestroyed", input -> input.read(org.openqa.selenium.devtools.v91.webaudio.model.AudioParamWillBeDestroyed.class));
}
public static Event nodesConnected() {
return new Event<>("WebAudio.nodesConnected", input -> input.read(org.openqa.selenium.devtools.v91.webaudio.model.NodesConnected.class));
}
public static Event nodesDisconnected() {
return new Event<>("WebAudio.nodesDisconnected", input -> input.read(org.openqa.selenium.devtools.v91.webaudio.model.NodesDisconnected.class));
}
public static Event nodeParamConnected() {
return new Event<>("WebAudio.nodeParamConnected", input -> input.read(org.openqa.selenium.devtools.v91.webaudio.model.NodeParamConnected.class));
}
public static Event nodeParamDisconnected() {
return new Event<>("WebAudio.nodeParamDisconnected", input -> input.read(org.openqa.selenium.devtools.v91.webaudio.model.NodeParamDisconnected.class));
}
}