mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibWeb: Initialize OcillatorNode
with the correct default options
This commit is contained in:
parent
c804d08d34
commit
ed46d247de
Notes:
github-actions[bot]
2025-01-04 10:13:43 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/ed46d247ded Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3122 Reviewed-by: https://github.com/shannonbooth ✅
1 changed files with 11 additions and 1 deletions
|
@ -24,9 +24,19 @@ WebIDL::ExceptionOr<GC::Ref<OscillatorNode>> OscillatorNode::create(JS::Realm& r
|
|||
// https://webaudio.github.io/web-audio-api/#dom-oscillatornode-oscillatornode
|
||||
WebIDL::ExceptionOr<GC::Ref<OscillatorNode>> OscillatorNode::construct_impl(JS::Realm& realm, GC::Ref<BaseAudioContext> context, OscillatorOptions const& options)
|
||||
{
|
||||
// FIXME: Invoke "Initialize the AudioNode" steps.
|
||||
TRY(verify_valid_type(realm, options.type));
|
||||
auto node = realm.create<OscillatorNode>(realm, context, options);
|
||||
|
||||
// Default options for channel count and interpretation
|
||||
// https://webaudio.github.io/web-audio-api/#OscillatorNode
|
||||
AudioNodeDefaultOptions default_options;
|
||||
default_options.channel_count = 2;
|
||||
default_options.channel_count_mode = Bindings::ChannelCountMode::Max;
|
||||
default_options.channel_interpretation = Bindings::ChannelInterpretation::Speakers;
|
||||
// FIXME: Set tail-time to no
|
||||
|
||||
TRY(node->initialize_audio_node_options(options, default_options));
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue