mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
WebAudio: Add IDL interface for AudioDestinationNode
This is an AudioNode representing the final audio destination and is what the user will ultimately hear. This node is used as one of the connecting nodes in athenacrisis.com Add a placeholder for the interface without anything backing it for now.
This commit is contained in:
parent
9a7e6158af
commit
5eb80b8697
Notes:
github-actions[bot]
2024-07-24 09:15:53 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/5eb80b8697d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/800
@ -14,6 +14,7 @@ Audio
|
||||
AudioBuffer
|
||||
AudioBufferSourceNode
|
||||
AudioContext
|
||||
AudioDestinationNode
|
||||
AudioNode
|
||||
AudioParam
|
||||
AudioScheduledSourceNode
|
||||
|
@ -684,6 +684,7 @@ set(SOURCES
|
||||
WebAudio/AudioBuffer.cpp
|
||||
WebAudio/AudioBufferSourceNode.cpp
|
||||
WebAudio/AudioContext.cpp
|
||||
WebAudio/AudioDestinationNode.cpp
|
||||
WebAudio/AudioNode.cpp
|
||||
WebAudio/AudioParam.cpp
|
||||
WebAudio/AudioScheduledSourceNode.cpp
|
||||
|
@ -712,6 +712,7 @@ class Table;
|
||||
namespace Web::WebAudio {
|
||||
class AudioBuffer;
|
||||
class AudioBufferSourceNode;
|
||||
class AudioDestinationNode;
|
||||
class AudioContext;
|
||||
class AudioNode;
|
||||
class AudioParam;
|
||||
|
34
Userland/Libraries/LibWeb/WebAudio/AudioDestinationNode.cpp
Normal file
34
Userland/Libraries/LibWeb/WebAudio/AudioDestinationNode.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
|
||||
*
|
||||
* 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>
|
||||
|
||||
namespace Web::WebAudio {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(AudioDestinationNode);
|
||||
|
||||
AudioDestinationNode::AudioDestinationNode(JS::Realm& realm, JS::NonnullGCPtr<BaseAudioContext> context)
|
||||
: AudioNode(realm, context)
|
||||
{
|
||||
}
|
||||
|
||||
AudioDestinationNode::~AudioDestinationNode() = default;
|
||||
|
||||
void AudioDestinationNode::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(AudioDestinationNode);
|
||||
}
|
||||
|
||||
void AudioDestinationNode::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
}
|
||||
|
||||
}
|
28
Userland/Libraries/LibWeb/WebAudio/AudioDestinationNode.h
Normal file
28
Userland/Libraries/LibWeb/WebAudio/AudioDestinationNode.h
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/WebAudio/AudioNode.h>
|
||||
|
||||
namespace Web::WebAudio {
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#AudioDestinationNode
|
||||
class AudioDestinationNode : public AudioNode {
|
||||
WEB_PLATFORM_OBJECT(AudioDestinationNode, AudioNode);
|
||||
JS_DECLARE_ALLOCATOR(AudioDestinationNode);
|
||||
|
||||
public:
|
||||
virtual ~AudioDestinationNode() override;
|
||||
|
||||
protected:
|
||||
AudioDestinationNode(JS::Realm&, JS::NonnullGCPtr<BaseAudioContext>);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
};
|
||||
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
#import <WebAudio/AudioNode.idl>
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#AudioDestinationNode
|
||||
[Exposed=Window]
|
||||
interface AudioDestinationNode : AudioNode {
|
||||
[FIXME] readonly attribute unsigned long maxChannelCount;
|
||||
};
|
@ -312,6 +312,7 @@ libweb_js_bindings(WebAssembly/WebAssembly NAMESPACE)
|
||||
libweb_js_bindings(WebAudio/AudioBuffer)
|
||||
libweb_js_bindings(WebAudio/AudioBufferSourceNode)
|
||||
libweb_js_bindings(WebAudio/AudioContext)
|
||||
libweb_js_bindings(WebAudio/AudioDestinationNode)
|
||||
libweb_js_bindings(WebAudio/AudioNode)
|
||||
libweb_js_bindings(WebAudio/AudioParam)
|
||||
libweb_js_bindings(WebAudio/AudioScheduledSourceNode)
|
||||
|
Loading…
Reference in New Issue
Block a user