/* * Copyright (c) 2025, Tim Ledbetter * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include namespace Web::WebAudio { GC_DEFINE_ALLOCATOR(ConstantSourceNode); ConstantSourceNode::ConstantSourceNode(JS::Realm& realm, GC::Ref context, ConstantSourceOptions const& options) : AudioScheduledSourceNode(realm, context) , m_offset(AudioParam::create(realm, context, options.offset, NumericLimits::lowest(), NumericLimits::max(), Bindings::AutomationRate::ARate)) { } ConstantSourceNode::~ConstantSourceNode() = default; WebIDL::ExceptionOr> ConstantSourceNode::create(JS::Realm& realm, GC::Ref context, ConstantSourceOptions const& options) { return construct_impl(realm, context, options); } WebIDL::ExceptionOr> ConstantSourceNode::construct_impl(JS::Realm& realm, GC::Ref context, ConstantSourceOptions const& options) { return realm.create(realm, context, options); } void ConstantSourceNode::initialize(JS::Realm& realm) { Base::initialize(realm); WEB_SET_PROTOTYPE_FOR_INTERFACE(ConstantSourceNode); } void ConstantSourceNode::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); visitor.visit(m_offset); } }