/* * Copyright (c) 2025, Tim Ledbetter * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::WebAudio { // https://webaudio.github.io/web-audio-api/#StereoPannerOptions struct StereoPannerOptions : AudioNodeOptions { float pan { 0 }; }; // https://webaudio.github.io/web-audio-api/#stereopannernode class StereoPannerNode : public AudioNode { WEB_PLATFORM_OBJECT(StereoPannerNode, AudioNode); GC_DECLARE_ALLOCATOR(StereoPannerNode); public: virtual ~StereoPannerNode() override; static WebIDL::ExceptionOr> create(JS::Realm&, GC::Ref, StereoPannerOptions const& = {}); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, GC::Ref, StereoPannerOptions const& = {}); WebIDL::UnsignedLong number_of_inputs() override { return 1; } WebIDL::UnsignedLong number_of_outputs() override { return 1; } WebIDL::ExceptionOr set_channel_count_mode(Bindings::ChannelCountMode) override; WebIDL::ExceptionOr set_channel_count(WebIDL::UnsignedLong) override; GC::Ref pan() const { return m_pan; } protected: StereoPannerNode(JS::Realm&, GC::Ref, StereoPannerOptions const& = {}); virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; private: // https://webaudio.github.io/web-audio-api/#dom-stereopannernode-pan GC::Ref m_pan; }; }