mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
WebAudio: Stub remainder of AudioBufferSourceNode
This commit is contained in:
parent
779e3072f9
commit
014a069157
Notes:
github-actions[bot]
2024-07-28 19:42:06 +00:00
Author: https://github.com/bbb651
Commit: 014a069157
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/867
3 changed files with 116 additions and 8 deletions
|
@ -7,6 +7,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibWeb/Bindings/AudioBufferSourceNodePrototype.h>
|
||||
#include <LibWeb/WebAudio/AudioBuffer.h>
|
||||
#include <LibWeb/WebAudio/AudioParam.h>
|
||||
#include <LibWeb/WebAudio/AudioScheduledSourceNode.h>
|
||||
|
||||
namespace Web::WebAudio {
|
||||
|
@ -29,6 +31,19 @@ class AudioBufferSourceNode : public AudioScheduledSourceNode {
|
|||
public:
|
||||
virtual ~AudioBufferSourceNode() override;
|
||||
|
||||
WebIDL::ExceptionOr<void> set_buffer(JS::GCPtr<AudioBuffer>);
|
||||
JS::GCPtr<AudioBuffer> buffer() const;
|
||||
JS::NonnullGCPtr<AudioParam> playback_rate() const;
|
||||
JS::NonnullGCPtr<AudioParam> detune() const;
|
||||
WebIDL::ExceptionOr<void> set_loop(bool);
|
||||
bool loop() const;
|
||||
WebIDL::ExceptionOr<void> set_loop_start(double);
|
||||
double loop_start() const;
|
||||
WebIDL::ExceptionOr<void> set_loop_end(double);
|
||||
double loop_end() const;
|
||||
|
||||
WebIDL::ExceptionOr<void> start(Optional<double>, Optional<double>, Optional<double>);
|
||||
|
||||
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& = {});
|
||||
|
||||
|
@ -37,6 +52,14 @@ protected:
|
|||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
private:
|
||||
JS::GCPtr<AudioBuffer> m_buffer;
|
||||
JS::NonnullGCPtr<AudioParam> m_playback_rate;
|
||||
JS::NonnullGCPtr<AudioParam> m_detune;
|
||||
bool m_loop { false };
|
||||
double m_loop_start { 0.0 };
|
||||
double m_loop_end { 0.0 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue