Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant source node DOM #23152

Closed
wants to merge 6 commits into from
Closed

Resolved import errors

  • Loading branch information
hustlerman committed Mar 25, 2019
commit d7177c62b2247c9dc67cb72ce9b898a98a992cd3
@@ -9,13 +9,16 @@ use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
ChannelCountMode, ChannelInterpretation,
};
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::{
self, ConstantSourceOptions,
};
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::window::Window;
use dom_struct::dom_struct;
use servo_media::audio::node::AudioNodeInit;
use servo_media::audio::constant_source_node::ConstantSourceNodeOptions;
use servo_media::audio::constant_source_node::ConstantSourceNodeOptions as ServoMediaConstantSourceOptions;
use servo_media::audio::param::ParamType;
use std::f32;

@@ -34,7 +37,7 @@ impl ConstantSourceNode {
) -> Fallible<ConstantSourceNode> {
let node_options =
options
.parent
//.parent
.unwrap_or(2, ChannelCountMode::Max, ChannelInterpretation::Speakers);
let source_node = AudioScheduledSourceNode::new_inherited(
AudioNodeInit::ConstantSourceNode(options.into()),
@@ -71,7 +74,7 @@ impl ConstantSourceNode {
Ok(reflect_dom_object(
Box::new(node),
window,
OscillatorNodeBinding::Wrap,
ConstantSourceNodeBinding::Wrap,
))
}

@@ -82,4 +85,13 @@ impl ConstantSourceNode {
) -> Fallible<DomRoot<ConstantSourceNode>> {
ConstantSourceNode::new(window, context, options)
}
}
}

impl<'a> From<&'a ConstantSourceOptions> for ServoMediaConstantSourceOptions {
fn from(options: &'a ConstantSourceOptions) -> Self {
Self {
offset: *options.offset,
}
}
}

@@ -254,6 +254,7 @@ pub mod closeevent;
pub mod comment;
pub mod compositionevent;
pub mod console;
pub mod constantsourcenode;
mod create;
pub mod crypto;
pub mod css;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.