diff --git a/Userland/Libraries/LibWeb/WebAudio/AudioBufferSourceNode.h b/Userland/Libraries/LibWeb/WebAudio/AudioBufferSourceNode.h index 52dac427362..c6cb9bbe412 100644 --- a/Userland/Libraries/LibWeb/WebAudio/AudioBufferSourceNode.h +++ b/Userland/Libraries/LibWeb/WebAudio/AudioBufferSourceNode.h @@ -41,6 +41,8 @@ public: double loop_start() const; WebIDL::ExceptionOr set_loop_end(double); double loop_end() const; + WebIDL::UnsignedLong number_of_inputs() override { return 0; } + WebIDL::UnsignedLong number_of_outputs() override { return 2; } WebIDL::ExceptionOr start(Optional, Optional, Optional); diff --git a/Userland/Libraries/LibWeb/WebAudio/AudioDestinationNode.h b/Userland/Libraries/LibWeb/WebAudio/AudioDestinationNode.h index 0f20bc54fc1..d2fcfe0709a 100644 --- a/Userland/Libraries/LibWeb/WebAudio/AudioDestinationNode.h +++ b/Userland/Libraries/LibWeb/WebAudio/AudioDestinationNode.h @@ -23,6 +23,8 @@ public: virtual ~AudioDestinationNode() override; WebIDL::UnsignedLong max_channel_count(); + WebIDL::UnsignedLong number_of_inputs() override { return 1; } + WebIDL::UnsignedLong number_of_outputs() override { return 1; } static JS::NonnullGCPtr construct_impl(JS::Realm&, JS::NonnullGCPtr); diff --git a/Userland/Libraries/LibWeb/WebAudio/AudioNode.cpp b/Userland/Libraries/LibWeb/WebAudio/AudioNode.cpp index 67af990712a..fcb3284cce2 100644 --- a/Userland/Libraries/LibWeb/WebAudio/AudioNode.cpp +++ b/Userland/Libraries/LibWeb/WebAudio/AudioNode.cpp @@ -98,20 +98,6 @@ void AudioNode::disconnect(JS::NonnullGCPtr destination_param, WebID dbgln("FIXME: Implement AudioNode::disconnect(destination_param, output)"); } -// https://webaudio.github.io/web-audio-api/#dom-audionode-numberofinputs -WebIDL::UnsignedLong AudioNode::number_of_inputs() -{ - dbgln("FIXME: Implement AudioNode::number_of_inputs()"); - return 0; -} - -// https://webaudio.github.io/web-audio-api/#dom-audionode-numberofoutputs -WebIDL::UnsignedLong AudioNode::number_of_outputs() -{ - dbgln("FIXME: Implement AudioNode::number_of_outputs()"); - return 0; -} - // https://webaudio.github.io/web-audio-api/#dom-audionode-channelcount WebIDL::ExceptionOr AudioNode::set_channel_count(WebIDL::UnsignedLong channel_count) { diff --git a/Userland/Libraries/LibWeb/WebAudio/AudioNode.h b/Userland/Libraries/LibWeb/WebAudio/AudioNode.h index 0c9e39830d9..1f09f0ab7d5 100644 --- a/Userland/Libraries/LibWeb/WebAudio/AudioNode.h +++ b/Userland/Libraries/LibWeb/WebAudio/AudioNode.h @@ -48,8 +48,11 @@ public: return m_context; } - WebIDL::UnsignedLong number_of_inputs(); - WebIDL::UnsignedLong number_of_outputs(); + // https://webaudio.github.io/web-audio-api/#dom-audionode-numberofinputs + virtual WebIDL::UnsignedLong number_of_inputs() = 0; + // https://webaudio.github.io/web-audio-api/#dom-audionode-numberofoutputs + virtual WebIDL::UnsignedLong number_of_outputs() = 0; + WebIDL::ExceptionOr set_channel_count(WebIDL::UnsignedLong); WebIDL::UnsignedLong channel_count(); WebIDL::ExceptionOr set_channel_count_mode(Bindings::ChannelCountMode); diff --git a/Userland/Libraries/LibWeb/WebAudio/BiquadFilterNode.h b/Userland/Libraries/LibWeb/WebAudio/BiquadFilterNode.h index a401c4cbef5..952b39f03d2 100644 --- a/Userland/Libraries/LibWeb/WebAudio/BiquadFilterNode.h +++ b/Userland/Libraries/LibWeb/WebAudio/BiquadFilterNode.h @@ -29,6 +29,9 @@ class BiquadFilterNode : public AudioNode { public: virtual ~BiquadFilterNode() override; + WebIDL::UnsignedLong number_of_inputs() override { return 1; } + WebIDL::UnsignedLong number_of_outputs() override { return 1; } + WebIDL::ExceptionOr set_type(Bindings::BiquadFilterType); Bindings::BiquadFilterType type() const; JS::NonnullGCPtr frequency() const; diff --git a/Userland/Libraries/LibWeb/WebAudio/DynamicsCompressorNode.h b/Userland/Libraries/LibWeb/WebAudio/DynamicsCompressorNode.h index 78af0b59294..1a4a0661556 100644 --- a/Userland/Libraries/LibWeb/WebAudio/DynamicsCompressorNode.h +++ b/Userland/Libraries/LibWeb/WebAudio/DynamicsCompressorNode.h @@ -30,6 +30,9 @@ public: static WebIDL::ExceptionOr> create(JS::Realm&, JS::NonnullGCPtr, DynamicsCompressorOptions const& = {}); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, JS::NonnullGCPtr, DynamicsCompressorOptions const& = {}); + WebIDL::UnsignedLong number_of_inputs() override { return 1; } + WebIDL::UnsignedLong number_of_outputs() override { return 1; } + JS::NonnullGCPtr threshold() const { return m_threshold; } JS::NonnullGCPtr knee() const { return m_knee; } JS::NonnullGCPtr ratio() const { return m_ratio; } diff --git a/Userland/Libraries/LibWeb/WebAudio/GainNode.h b/Userland/Libraries/LibWeb/WebAudio/GainNode.h index 13fd5c64265..2e28cbc059d 100644 --- a/Userland/Libraries/LibWeb/WebAudio/GainNode.h +++ b/Userland/Libraries/LibWeb/WebAudio/GainNode.h @@ -27,6 +27,9 @@ public: static JS::NonnullGCPtr create(JS::Realm&, JS::NonnullGCPtr, GainOptions const& = {}); static JS::NonnullGCPtr construct_impl(JS::Realm&, JS::NonnullGCPtr, GainOptions const& = {}); + WebIDL::UnsignedLong number_of_inputs() override { return 1; } + WebIDL::UnsignedLong number_of_outputs() override { return 1; } + JS::NonnullGCPtr gain() const { return m_gain; } protected: diff --git a/Userland/Libraries/LibWeb/WebAudio/OscillatorNode.h b/Userland/Libraries/LibWeb/WebAudio/OscillatorNode.h index 4311b0f007b..6bd32cac0f4 100644 --- a/Userland/Libraries/LibWeb/WebAudio/OscillatorNode.h +++ b/Userland/Libraries/LibWeb/WebAudio/OscillatorNode.h @@ -34,6 +34,8 @@ public: WebIDL::ExceptionOr set_type(Bindings::OscillatorType); JS::NonnullGCPtr frequency() const { return m_frequency; } + WebIDL::UnsignedLong number_of_inputs() override { return 0; } + WebIDL::UnsignedLong number_of_outputs() override { return 1; } protected: OscillatorNode(JS::Realm&, JS::NonnullGCPtr, OscillatorOptions const& = {});