diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-09-18 18:59:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-18 18:59:07 -0400 |
commit | a02c43dc67d01c92d184b6a01b4011088b1940c0 (patch) | |
tree | 7eb5d8ce6fa4219b838c9e4c193c532424690f2b /components/script/dom/baseaudiocontext.rs | |
parent | 97dc06c3052fdc61c512215d02118266efdf388e (diff) | |
parent | cc32e12d0a78298a4ce9621bec376296eee32a2b (diff) | |
download | servo-a02c43dc67d01c92d184b6a01b4011088b1940c0.tar.gz servo-a02c43dc67d01c92d184b6a01b4011088b1940c0.zip |
Auto merge of #21712 - Manishearth:analysernode, r=ferjm
Implement AnalyserNode
<s>Needs https://github.com/servo/media/pull/127 to land (and a dependency
update)</s>
r? @ferjm
realtimeanalyser-fft-scaling.html, the test that actually checks for some level of FFT correctness, sadly doesn't work since we don't process nodes not connected to the destination.
However I locally fixed the test to work differently and it passed. We'll fix the processing model eventually.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21712)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/baseaudiocontext.rs')
-rw-r--r-- | components/script/dom/baseaudiocontext.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/dom/baseaudiocontext.rs b/components/script/dom/baseaudiocontext.rs index dbd821b64fe..514a51f113b 100644 --- a/components/script/dom/baseaudiocontext.rs +++ b/components/script/dom/baseaudiocontext.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use dom::analysernode::AnalyserNode; use dom::audiobuffer::AudioBuffer; use dom::audiobuffersourcenode::AudioBufferSourceNode; use dom::audiodestinationnode::AudioDestinationNode; @@ -9,6 +10,7 @@ use dom::audiolistener::AudioListener; use dom::audionode::MAX_CHANNEL_COUNT; use dom::bindings::callback::ExceptionHandling; use dom::bindings::cell::DomRefCell; +use dom::bindings::codegen::Bindings::AnalyserNodeBinding::AnalyserOptions; use dom::bindings::codegen::Bindings::AudioBufferSourceNodeBinding::AudioBufferSourceOptions; use dom::bindings::codegen::Bindings::AudioNodeBinding::{ChannelCountMode, ChannelInterpretation}; use dom::bindings::codegen::Bindings::AudioNodeBinding::AudioNodeOptions; @@ -337,6 +339,11 @@ impl BaseAudioContextMethods for BaseAudioContext { PannerNode::new(&self.global().as_window(), &self, &PannerOptions::empty()) } + /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createanalyser + fn CreateAnalyser(&self) -> Fallible<DomRoot<AnalyserNode>> { + AnalyserNode::new(&self.global().as_window(), &self, &AnalyserOptions::empty()) + } + /// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createchannelmerger fn CreateChannelMerger(&self, count: u32) -> Fallible<DomRoot<ChannelMergerNode>> { let mut opts = ChannelMergerOptions::empty(); |