LibWeb: Implement BaseAudioContext.createGain

This commit is contained in:
Shannon Booth 2024-05-28 15:48:10 +12:00 committed by Andreas Kling
parent 1fa7235fec
commit 6466fca20a
Notes: sideshowbarker 2024-07-17 07:08:37 +09:00
5 changed files with 39 additions and 1 deletions

View file

@ -11,6 +11,7 @@
#include <LibWeb/WebAudio/AudioBuffer.h>
#include <LibWeb/WebAudio/BaseAudioContext.h>
#include <LibWeb/WebAudio/DynamicsCompressorNode.h>
#include <LibWeb/WebAudio/GainNode.h>
#include <LibWeb/WebAudio/OscillatorNode.h>
namespace Web::WebAudio {
@ -61,6 +62,13 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<DynamicsCompressorNode>> BaseAudioContext::
return DynamicsCompressorNode::create(realm(), *this);
}
// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-creategain
JS::NonnullGCPtr<GainNode> BaseAudioContext::create_gain()
{
// Factory method for GainNode.
return GainNode::create(realm(), *this);
}
// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createbuffer
WebIDL::ExceptionOr<void> BaseAudioContext::verify_audio_options_inside_nominal_range(JS::Realm& realm, WebIDL::UnsignedLong number_of_channels, WebIDL::UnsignedLong length, float sample_rate)
{