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

@ -1,13 +1,15 @@
/*
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
* Copyright (c) 2024, Bar Yemini <bar.ye651@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/AudioDestinationNodePrototype.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/HTML/EventNames.h>
#include <LibWeb/WebAudio/AudioDestinationNode.h>
#include <LibWeb/WebAudio/AudioNode.h>
#include <LibWeb/WebAudio/BaseAudioContext.h>
namespace Web::WebAudio {
@ -20,6 +22,18 @@ AudioDestinationNode::AudioDestinationNode(JS::Realm& realm, JS::NonnullGCPtr<Ba
AudioDestinationNode::~AudioDestinationNode() = default;
// https://webaudio.github.io/web-audio-api/#dom-audiodestinationnode-maxchannelcount
WebIDL::UnsignedLong AudioDestinationNode::max_channel_count()
{
dbgln("FIXME: Implement Audio::DestinationNode::max_channel_count()");
return 2;
}
JS::NonnullGCPtr<AudioDestinationNode> AudioDestinationNode::construct_impl(JS::Realm& realm, JS::NonnullGCPtr<BaseAudioContext> context)
{
return realm.heap().allocate<AudioDestinationNode>(realm, realm, context);
}
void AudioDestinationNode::initialize(JS::Realm& realm)
{
Base::initialize(realm);