Files
ladybird/Libraries/LibWeb/WebAudio/ChannelMergerNode.h
Shannon Booth 5adfd1c43a LibWeb/Bindings: Generate struct definitions from IDL dictionaries
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.
2026-05-09 10:49:49 +02:00

39 lines
1.3 KiB
C++

/*
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/ChannelMergerNode.h>
#include <LibWeb/WebAudio/AudioNode.h>
namespace Web::WebAudio {
// https://webaudio.github.io/web-audio-api/#ChannelMergerNode
class ChannelMergerNode final : public AudioNode {
WEB_PLATFORM_OBJECT(ChannelMergerNode, AudioNode);
GC_DECLARE_ALLOCATOR(ChannelMergerNode);
public:
virtual ~ChannelMergerNode() override;
static WebIDL::ExceptionOr<GC::Ref<ChannelMergerNode>> create(JS::Realm&, GC::Ref<BaseAudioContext>, Bindings::ChannelMergerOptions const& = {});
static WebIDL::ExceptionOr<GC::Ref<ChannelMergerNode>> construct_impl(JS::Realm&, GC::Ref<BaseAudioContext>, Bindings::ChannelMergerOptions const& = {});
WebIDL::UnsignedLong number_of_inputs() override { return m_number_of_inputs; }
WebIDL::UnsignedLong number_of_outputs() override { return 1; }
// ^AudioNode
virtual WebIDL::ExceptionOr<void> set_channel_count(WebIDL::UnsignedLong) override;
virtual WebIDL::ExceptionOr<void> set_channel_count_mode(Bindings::ChannelCountMode) override;
private:
ChannelMergerNode(JS::Realm&, GC::Ref<BaseAudioContext>, Bindings::ChannelMergerOptions const&);
WebIDL::UnsignedLong m_number_of_inputs;
};
}