Class: Selenium::DevTools::V149::WebAudio
- Inherits:
-
Object
- Object
- Selenium::DevTools::V149::WebAudio
- Defined in:
- lib/selenium/devtools/v149/web_audio.rb
Constant Summary collapse
- EVENTS =
{ context_created: 'contextCreated', context_will_be_destroyed: 'contextWillBeDestroyed', context_changed: 'contextChanged', audio_listener_created: 'audioListenerCreated', audio_listener_will_be_destroyed: 'audioListenerWillBeDestroyed', audio_node_created: 'audioNodeCreated', audio_node_will_be_destroyed: 'audioNodeWillBeDestroyed', audio_param_created: 'audioParamCreated', audio_param_will_be_destroyed: 'audioParamWillBeDestroyed', nodes_connected: 'nodesConnected', nodes_disconnected: 'nodesDisconnected', node_param_connected: 'nodeParamConnected', node_param_disconnected: 'nodeParamDisconnected', }.freeze
Instance Method Summary collapse
- #disable ⇒ Object
- #enable ⇒ Object
- #get_realtime_data(context_id:) ⇒ Object
-
#initialize(devtools) ⇒ WebAudio
constructor
A new instance of WebAudio.
- #on(event, &block) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ WebAudio
Returns a new instance of WebAudio.
42 43 44 |
# File 'lib/selenium/devtools/v149/web_audio.rb', line 42 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#disable ⇒ Object
55 56 57 |
# File 'lib/selenium/devtools/v149/web_audio.rb', line 55 def disable @devtools.send_cmd('WebAudio.disable') end |
#enable ⇒ Object
51 52 53 |
# File 'lib/selenium/devtools/v149/web_audio.rb', line 51 def enable @devtools.send_cmd('WebAudio.enable') end |
#get_realtime_data(context_id:) ⇒ Object
59 60 61 62 |
# File 'lib/selenium/devtools/v149/web_audio.rb', line 59 def get_realtime_data(context_id:) @devtools.send_cmd('WebAudio.getRealtimeData', contextId: context_id) end |
#on(event, &block) ⇒ Object
46 47 48 49 |
# File 'lib/selenium/devtools/v149/web_audio.rb', line 46 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["WebAudio.#{event}"] << block end |