mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
WebAudio: Stub AudioBufferSourceNode
This commit is contained in:
parent
92f6336fe8
commit
6672fb4b47
Notes:
github-actions[bot]
2024-07-23 07:26:05 +00:00
Author: https://github.com/bbb651 🔰
Commit: 6672fb4b47
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/750
12 changed files with 136 additions and 2 deletions
49
Userland/Libraries/LibWeb/WebAudio/AudioBufferSourceNode.cpp
Normal file
49
Userland/Libraries/LibWeb/WebAudio/AudioBufferSourceNode.cpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Bar Yemini <bar.ye651@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/AudioScheduledSourceNodePrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/WebAudio/AudioBufferSourceNode.h>
|
||||
#include <LibWeb/WebAudio/AudioScheduledSourceNode.h>
|
||||
|
||||
namespace Web::WebAudio {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(AudioBufferSourceNode);
|
||||
|
||||
AudioBufferSourceNode::AudioBufferSourceNode(JS::Realm& realm, JS::NonnullGCPtr<BaseAudioContext> context, AudioBufferSourceOptions const&)
|
||||
: AudioScheduledSourceNode(realm, context)
|
||||
{
|
||||
}
|
||||
|
||||
AudioBufferSourceNode::~AudioBufferSourceNode() = default;
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<AudioBufferSourceNode>> AudioBufferSourceNode::create(JS::Realm& realm, JS::NonnullGCPtr<BaseAudioContext> context, AudioBufferSourceOptions const& options)
|
||||
{
|
||||
return construct_impl(realm, context, options);
|
||||
}
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#dom-audiobuffersourcenode-audiobuffersourcenode
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<AudioBufferSourceNode>> AudioBufferSourceNode::construct_impl(JS::Realm& realm, JS::NonnullGCPtr<BaseAudioContext> context, AudioBufferSourceOptions const& options)
|
||||
{
|
||||
// When the constructor is called with a BaseAudioContext c and an option object option, the user agent
|
||||
// MUST initialize the AudioNode this, with context and options as arguments.
|
||||
|
||||
auto node = realm.vm().heap().allocate<AudioBufferSourceNode>(realm, realm, context, options);
|
||||
return node;
|
||||
}
|
||||
|
||||
void AudioBufferSourceNode::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(AudioBufferSourceNode);
|
||||
}
|
||||
|
||||
void AudioBufferSourceNode::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue