/* * Copyright (c) 2024, Shannon Booth * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Web::WebAudio { // https://webaudio.github.io/web-audio-api/#PeriodicWaveConstraints struct PeriodicWaveConstraints { bool disable_normalization { false }; }; // https://webaudio.github.io/web-audio-api/#PeriodicWaveOptions struct PeriodicWaveOptions : PeriodicWaveConstraints { Optional> real; Optional> imag; }; // https://webaudio.github.io/web-audio-api/#PeriodicWave class PeriodicWave : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(PeriodicWave, Bindings::PlatformObject); GC_DECLARE_ALLOCATOR(PeriodicWave); public: static WebIDL::ExceptionOr> construct_impl(JS::Realm&, GC::Ref, PeriodicWaveOptions const&); explicit PeriodicWave(JS::Realm&); virtual ~PeriodicWave() override; protected: virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; private: GC::Ptr m_real; GC::Ptr m_imag; bool m_normalize { true }; }; }