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
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Implemented ConstantSourceNode Methods

  • Loading branch information
hustlerman committed Apr 1, 2019
commit 56d2c13520f963d0ef4dde8895f46ec7f4c3188e
@@ -38,6 +38,7 @@ use crate::dom::channelsplitternode::ChannelSplitterNode;
use crate::dom::domexception::{DOMErrorName, DOMException};
use crate::dom::eventtarget::EventTarget;
use crate::dom::gainnode::GainNode;
//use crate::dom::constantsourcenode::ConstantSourceNode;
use crate::dom::oscillatornode::OscillatorNode;
use crate::dom::pannernode::PannerNode;
use crate::dom::promise::Promise;
@@ -354,6 +355,10 @@ impl BaseAudioContextMethods for BaseAudioContext {
&BiquadFilterOptions::empty(),
)
}

/// fn CreateConstantSource(&self) -> Fallible<DomRoot<ConstantSourceNode>> {
/// ConstantSourceNode::new( &self.global().as_window(), &self, &ConstantSourceOptions::empty())
///}

/// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createchannelmerger
fn CreateChannelMerger(&self, count: u32) -> Fallible<DomRoot<ChannelMergerNode>> {
@@ -9,6 +9,7 @@ use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
ChannelCountMode, ChannelInterpretation,
};
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::ConstantSourceNodeMethods;
use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::{
self, ConstantSourceOptions,
};
@@ -37,7 +38,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()),
@@ -87,6 +88,12 @@ impl ConstantSourceNode {
}
}

impl ConstantSourceNodeMethods for ConstantSourceNode {
fn Offset(&self) -> DomRoot<AudioParam> {
DomRoot::from_ref(&self.offset)
}
}

impl<'a> From<&'a ConstantSourceOptions> for ServoMediaConstantSourceOptions {
fn from(options: &'a ConstantSourceOptions) -> Self {
Self {
@@ -6,7 +6,7 @@
* https://webaudio.github.io/web-audio-api/#ConstantSourceNode
*/

dictionary ConstantSourceOptions {
dictionary ConstantSourceOptions: AudioNodeOptions {
float offset = 1;
};

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.