mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
WebAudio: Add stub for AudioDestinationNode.destination
This is called by https://athenacrisis.com/ and passed through to AudioNode.connect, which expects an AudioNode. Implement this function enough so that we return an AudioNode so that AudioNode.connect does not throw a TypeError.
This commit is contained in:
parent
5eb80b8697
commit
a51095f705
Notes:
github-actions[bot]
2024-07-24 09:15:48 +00:00
Author: https://github.com/shannonbooth
Commit: a51095f705
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/800
3 changed files with 26 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <LibWeb/HTML/EventNames.h>
|
||||
#include <LibWeb/WebAudio/AudioBuffer.h>
|
||||
#include <LibWeb/WebAudio/AudioBufferSourceNode.h>
|
||||
#include <LibWeb/WebAudio/AudioDestinationNode.h>
|
||||
#include <LibWeb/WebAudio/BaseAudioContext.h>
|
||||
#include <LibWeb/WebAudio/BiquadFilterNode.h>
|
||||
#include <LibWeb/WebAudio/DynamicsCompressorNode.h>
|
||||
|
@ -32,6 +33,24 @@ void BaseAudioContext::initialize(JS::Realm& realm)
|
|||
WEB_SET_PROTOTYPE_FOR_INTERFACE(BaseAudioContext);
|
||||
}
|
||||
|
||||
void BaseAudioContext::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_destination);
|
||||
}
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-destination
|
||||
JS::NonnullGCPtr<AudioDestinationNode> BaseAudioContext::destination()
|
||||
{
|
||||
auto& realm = this->realm();
|
||||
|
||||
dbgln("FIXME: Properly implement BaseAudioContext::destination");
|
||||
|
||||
if (!m_destination)
|
||||
m_destination = realm.heap().allocate<AudioDestinationNode>(realm, realm, *this);
|
||||
return *m_destination;
|
||||
}
|
||||
|
||||
void BaseAudioContext::set_onstatechange(WebIDL::CallbackType* event_handler)
|
||||
{
|
||||
set_event_handler_attribute(HTML::EventNames::statechange, event_handler);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue