WebAudio: Stub AudioDestinationContext

And expose it through `BaseAudioContext::destination`
This commit is contained in:
bbb651 2024-07-27 16:38:09 +03:00 committed by Andreas Kling
commit 779e3072f9
Notes: github-actions[bot] 2024-07-28 19:42:11 +00:00
8 changed files with 34 additions and 19 deletions

View file

@ -21,6 +21,7 @@ namespace Web::WebAudio {
BaseAudioContext::BaseAudioContext(JS::Realm& realm, float sample_rate)
: DOM::EventTarget(realm)
, m_destination(AudioDestinationNode::construct_impl(realm, *this))
, m_sample_rate(sample_rate)
{
}
@ -39,18 +40,6 @@ void BaseAudioContext::visit_edges(Cell::Visitor& 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);