mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +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
42
Userland/Libraries/LibWeb/WebAudio/AudioBufferSourceNode.h
Normal file
42
Userland/Libraries/LibWeb/WebAudio/AudioBufferSourceNode.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Bar Yemini <bar.ye651@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Bindings/AudioBufferSourceNodePrototype.h>
|
||||
#include <LibWeb/WebAudio/AudioScheduledSourceNode.h>
|
||||
|
||||
namespace Web::WebAudio {
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#AudioBufferSourceOptions
|
||||
struct AudioBufferSourceOptions {
|
||||
JS::GCPtr<AudioBuffer> buffer;
|
||||
float detune { 0 };
|
||||
bool loop { false };
|
||||
double loop_end { 0 };
|
||||
double loop_start { 0 };
|
||||
float playback_rate { 1 };
|
||||
};
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode
|
||||
class AudioBufferSourceNode : public AudioScheduledSourceNode {
|
||||
WEB_PLATFORM_OBJECT(AudioBufferSourceNode, AudioScheduledSourceNode);
|
||||
JS_DECLARE_ALLOCATOR(AudioBufferSourceNode);
|
||||
|
||||
public:
|
||||
virtual ~AudioBufferSourceNode() override;
|
||||
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<AudioBufferSourceNode>> create(JS::Realm&, JS::NonnullGCPtr<BaseAudioContext>, AudioBufferSourceOptions const& = {});
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<AudioBufferSourceNode>> construct_impl(JS::Realm&, JS::NonnullGCPtr<BaseAudioContext>, AudioBufferSourceOptions const& = {});
|
||||
|
||||
protected:
|
||||
AudioBufferSourceNode(JS::Realm&, JS::NonnullGCPtr<BaseAudioContext>, AudioBufferSourceOptions const& = {});
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue