mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 17:37:33 +02:00
Previously we were inconsistent by generating code for enum definitions but not generating code for dictionaries. With future changes to the IDL generator to expose helpers to convert to and from IDL values this produced circular depdendencies. To solve this problem, also generate the dictionary definitions in bindings headers.
41 lines
1.4 KiB
C++
41 lines
1.4 KiB
C++
/*
|
|
* Copyright (c) 2025, Tim Ledbetter <tim.ledbetter@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Bindings/ConstantSourceNode.h>
|
|
#include <LibWeb/WebAudio/AudioScheduledSourceNode.h>
|
|
|
|
namespace Web::WebAudio {
|
|
|
|
// https://webaudio.github.io/web-audio-api/#ChannelMergerNode
|
|
class ConstantSourceNode final : public AudioScheduledSourceNode {
|
|
WEB_PLATFORM_OBJECT(ConstantSourceNode, AudioScheduledSourceNode);
|
|
GC_DECLARE_ALLOCATOR(ConstantSourceNode);
|
|
|
|
public:
|
|
virtual ~ConstantSourceNode() override;
|
|
|
|
static WebIDL::ExceptionOr<GC::Ref<ConstantSourceNode>> create(JS::Realm&, GC::Ref<BaseAudioContext>, Bindings::ConstantSourceOptions const& = {});
|
|
static WebIDL::ExceptionOr<GC::Ref<ConstantSourceNode>> construct_impl(JS::Realm&, GC::Ref<BaseAudioContext>, Bindings::ConstantSourceOptions const& = {});
|
|
|
|
virtual WebIDL::UnsignedLong number_of_inputs() override { return 0; }
|
|
virtual WebIDL::UnsignedLong number_of_outputs() override { return 1; }
|
|
|
|
GC::Ref<AudioParam const> offset() const { return m_offset; }
|
|
|
|
private:
|
|
ConstantSourceNode(JS::Realm&, GC::Ref<BaseAudioContext>, Bindings::ConstantSourceOptions const&);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
|
|
|
// https://webaudio.github.io/web-audio-api/#dom-constantsourcenode-offset
|
|
GC::Ref<AudioParam> m_offset;
|
|
};
|
|
|
|
}
|