mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
webaudio: Implement IIRFilterNode (#33001)
* Basic IIRFIlterNode bindings Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add constructor to BaseAudioContext Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update IDL and use statements Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update non-crashing test expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Tidy Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add missing spec link Signed-off-by: Daniel Adams <msub2official@gmail.com> * Optimize error checks Signed-off-by: Daniel Adams <msub2official@gmail.com> * Pass context channel count to servo-media Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update test expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update legacy expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add IIRFilterNode in interfaces.html Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update MANIFEST Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
parent
1af3ad8a74
commit
5520a9eb50
19 changed files with 206 additions and 175 deletions
|
@ -42,6 +42,7 @@ use crate::dom::bindings::codegen::Bindings::ChannelMergerNodeBinding::ChannelMe
|
|||
use crate::dom::bindings::codegen::Bindings::ChannelSplitterNodeBinding::ChannelSplitterOptions;
|
||||
use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::ConstantSourceOptions;
|
||||
use crate::dom::bindings::codegen::Bindings::GainNodeBinding::GainOptions;
|
||||
use crate::dom::bindings::codegen::Bindings::IIRFilterNodeBinding::IIRFilterOptions;
|
||||
use crate::dom::bindings::codegen::Bindings::OscillatorNodeBinding::OscillatorOptions;
|
||||
use crate::dom::bindings::codegen::Bindings::PannerNodeBinding::PannerOptions;
|
||||
use crate::dom::bindings::codegen::Bindings::StereoPannerNodeBinding::StereoPannerOptions;
|
||||
|
@ -58,6 +59,7 @@ use crate::dom::constantsourcenode::ConstantSourceNode;
|
|||
use crate::dom::domexception::{DOMErrorName, DOMException};
|
||||
use crate::dom::eventtarget::EventTarget;
|
||||
use crate::dom::gainnode::GainNode;
|
||||
use crate::dom::iirfilternode::IIRFilterNode;
|
||||
use crate::dom::oscillatornode::OscillatorNode;
|
||||
use crate::dom::pannernode::PannerNode;
|
||||
use crate::dom::promise::Promise;
|
||||
|
@ -264,6 +266,10 @@ impl BaseAudioContext {
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub fn channel_count(&self) -> u32 {
|
||||
self.channel_count
|
||||
}
|
||||
}
|
||||
|
||||
impl BaseAudioContextMethods for BaseAudioContext {
|
||||
|
@ -550,6 +556,20 @@ impl BaseAudioContextMethods for BaseAudioContext {
|
|||
// Step 4.
|
||||
promise
|
||||
}
|
||||
|
||||
/// <https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createiirfilter>
|
||||
fn CreateIIRFilter(
|
||||
&self,
|
||||
feedforward: Vec<Finite<f64>>,
|
||||
feedback: Vec<Finite<f64>>,
|
||||
) -> Fallible<DomRoot<IIRFilterNode>> {
|
||||
let opts = IIRFilterOptions {
|
||||
parent: AudioNodeOptions::empty(),
|
||||
feedback,
|
||||
feedforward,
|
||||
};
|
||||
IIRFilterNode::new(self.global().as_window(), self, &opts)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<BaseAudioContextOptions> for AudioContextOptions {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue