/src/serenity/Userland/Libraries/LibWeb/WebAudio/AudioScheduledSourceNode.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2024, Shannon Booth <shannon@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #include <LibWeb/Bindings/AudioScheduledSourceNodePrototype.h> |
8 | | #include <LibWeb/Bindings/Intrinsics.h> |
9 | | #include <LibWeb/HTML/EventNames.h> |
10 | | #include <LibWeb/WebAudio/AudioScheduledSourceNode.h> |
11 | | |
12 | | namespace Web::WebAudio { |
13 | | |
14 | | JS_DEFINE_ALLOCATOR(AudioScheduledSourceNode); |
15 | | |
16 | | AudioScheduledSourceNode::AudioScheduledSourceNode(JS::Realm& realm, JS::NonnullGCPtr<BaseAudioContext> context) |
17 | 0 | : AudioNode(realm, context) |
18 | 0 | { |
19 | 0 | } |
20 | | |
21 | 0 | AudioScheduledSourceNode::~AudioScheduledSourceNode() = default; |
22 | | |
23 | | // https://webaudio.github.io/web-audio-api/#dom-audioscheduledsourcenode-onended |
24 | | JS::GCPtr<WebIDL::CallbackType> AudioScheduledSourceNode::onended() |
25 | 0 | { |
26 | 0 | return event_handler_attribute(HTML::EventNames::ended); |
27 | 0 | } |
28 | | |
29 | | // https://webaudio.github.io/web-audio-api/#dom-audioscheduledsourcenode-onended |
30 | | void AudioScheduledSourceNode::set_onended(JS::GCPtr<WebIDL::CallbackType> value) |
31 | 0 | { |
32 | 0 | set_event_handler_attribute(HTML::EventNames::ended, value); |
33 | 0 | } |
34 | | |
35 | | // https://webaudio.github.io/web-audio-api/#dom-audioscheduledsourcenode-start |
36 | | WebIDL::ExceptionOr<void> AudioScheduledSourceNode::start(double when) |
37 | 0 | { |
38 | 0 | (void)when; |
39 | 0 | return WebIDL::NotSupportedError::create(realm(), "FIXME: Implement AudioScheduledSourceNode::start"_string); |
40 | 0 | } |
41 | | |
42 | | // https://webaudio.github.io/web-audio-api/#dom-audioscheduledsourcenode-stop |
43 | | WebIDL::ExceptionOr<void> AudioScheduledSourceNode::stop(double when) |
44 | 0 | { |
45 | 0 | (void)when; |
46 | 0 | return WebIDL::NotSupportedError::create(realm(), "FIXME: Implement AudioScheduledSourceNode::stop"_string); |
47 | 0 | } |
48 | | |
49 | | void AudioScheduledSourceNode::initialize(JS::Realm& realm) |
50 | 0 | { |
51 | 0 | Base::initialize(realm); |
52 | 0 | WEB_SET_PROTOTYPE_FOR_INTERFACE(AudioScheduledSourceNode); |
53 | 0 | } |
54 | | |
55 | | void AudioScheduledSourceNode::visit_edges(Cell::Visitor& visitor) |
56 | 0 | { |
57 | 0 | Base::visit_edges(visitor); |
58 | 0 | } |
59 | | |
60 | | } |