mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-29 07:48:47 +00:00
LibWeb: Add MediaElementAudioSourceNode
interface
This commit is contained in:
parent
a588756105
commit
aa39aa50f7
Notes:
github-actions[bot]
2025-01-17 19:05:50 +00:00
Author: https://github.com/tcl3
Commit: aa39aa50f7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3266
7 changed files with 111 additions and 0 deletions
47
Libraries/LibWeb/WebAudio/MediaElementAudioSourceNode.cpp
Normal file
47
Libraries/LibWeb/WebAudio/MediaElementAudioSourceNode.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Tim Ledbetter <tim.ledbetter@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/MediaElementAudioSourceNodePrototype.h>
|
||||
#include <LibWeb/HTML/HTMLMediaElement.h>
|
||||
#include <LibWeb/WebAudio/AudioContext.h>
|
||||
#include <LibWeb/WebAudio/MediaElementAudioSourceNode.h>
|
||||
|
||||
namespace Web::WebAudio {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(MediaElementAudioSourceNode);
|
||||
|
||||
MediaElementAudioSourceNode::MediaElementAudioSourceNode(JS::Realm& realm, GC::Ref<AudioContext> context, MediaElementAudioSourceOptions const& options)
|
||||
: AudioNode(realm, context)
|
||||
, m_media_element(*options.media_element)
|
||||
{
|
||||
}
|
||||
|
||||
MediaElementAudioSourceNode::~MediaElementAudioSourceNode() = default;
|
||||
|
||||
WebIDL::ExceptionOr<GC::Ref<MediaElementAudioSourceNode>> MediaElementAudioSourceNode::create(JS::Realm& realm, GC::Ref<AudioContext> context, MediaElementAudioSourceOptions const& options)
|
||||
{
|
||||
return construct_impl(realm, context, options);
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<GC::Ref<MediaElementAudioSourceNode>> MediaElementAudioSourceNode::construct_impl(JS::Realm& realm, GC::Ref<AudioContext> context, MediaElementAudioSourceOptions const& options)
|
||||
{
|
||||
return realm.create<MediaElementAudioSourceNode>(realm, context, options);
|
||||
}
|
||||
|
||||
void MediaElementAudioSourceNode::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(MediaElementAudioSourceNode);
|
||||
}
|
||||
|
||||
void MediaElementAudioSourceNode::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_media_element);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue