diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-09-04 02:38:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-04 02:38:08 -0400 |
commit | 81f6ac8f9298c437389a875b12b2de162510d1ef (patch) | |
tree | 00868a2309ecce4fb7a0d0fe4483f431dd335b4f /components/script/dom/oscillatornode.rs | |
parent | 75c0bdaf1b3a26ee8ae50d4cf3fb6b7546d3ccb8 (diff) | |
parent | af5b1c4011c2658fe554b32f1816083da88cd51e (diff) | |
download | servo-81f6ac8f9298c437389a875b12b2de162510d1ef.tar.gz servo-81f6ac8f9298c437389a875b12b2de162510d1ef.zip |
Auto merge of #21591 - Manishearth:channelmergernode, r=ferjm
Implement ChannelMergerNode
partial https://github.com/servo/servo/issues/21558
Haven't yet tested, wanted to get this up as an example for https://github.com/servo/servo/issues/21558
<!-- 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/21591)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/oscillatornode.rs')
-rw-r--r-- | components/script/dom/oscillatornode.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/components/script/dom/oscillatornode.rs b/components/script/dom/oscillatornode.rs index f44fa747f7d..662724c4438 100644 --- a/components/script/dom/oscillatornode.rs +++ b/components/script/dom/oscillatornode.rs @@ -35,7 +35,7 @@ impl OscillatorNode { window: &Window, context: &BaseAudioContext, oscillator_options: &OscillatorOptions, - ) -> OscillatorNode { + ) -> Fallible<OscillatorNode> { let mut node_options = AudioNodeOptions::empty(); node_options.channelCount = Some(2); node_options.channelCountMode = Some(ChannelCountMode::Max); @@ -46,7 +46,7 @@ impl OscillatorNode { &node_options, 0, /* inputs */ 1, /* outputs */ - ); + )?; let node_id = source_node.node().node_id(); let frequency = AudioParam::new( window, @@ -69,12 +69,12 @@ impl OscillatorNode { 440. / 2., ); - OscillatorNode { + Ok(OscillatorNode { source_node, oscillator_type: oscillator_options.type_, frequency: Dom::from_ref(&frequency), detune: Dom::from_ref(&detune), - } + }) } #[allow(unrooted_must_root)] @@ -82,9 +82,9 @@ impl OscillatorNode { window: &Window, context: &BaseAudioContext, options: &OscillatorOptions, - ) -> DomRoot<OscillatorNode> { - let node = OscillatorNode::new_inherited(window, context, options); - reflect_dom_object(Box::new(node), window, OscillatorNodeBinding::Wrap) + ) -> Fallible<DomRoot<OscillatorNode>> { + let node = OscillatorNode::new_inherited(window, context, options)?; + Ok(reflect_dom_object(Box::new(node), window, OscillatorNodeBinding::Wrap)) } pub fn Constructor( @@ -92,7 +92,7 @@ impl OscillatorNode { context: &BaseAudioContext, options: &OscillatorOptions, ) -> Fallible<DomRoot<OscillatorNode>> { - Ok(OscillatorNode::new(window, context, options)) + OscillatorNode::new(window, context, options) } } |