mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
BaseAudioContext.CreateGain()
This commit is contained in:
parent
02c39eb9ef
commit
0e92efbb79
2 changed files with 11 additions and 1 deletions
|
@ -8,6 +8,7 @@ use dom::bindings::codegen::Bindings::AudioNodeBinding::AudioNodeOptions;
|
||||||
use dom::bindings::codegen::Bindings::AudioNodeBinding::{ChannelCountMode, ChannelInterpretation};
|
use dom::bindings::codegen::Bindings::AudioNodeBinding::{ChannelCountMode, ChannelInterpretation};
|
||||||
use dom::bindings::codegen::Bindings::BaseAudioContextBinding::BaseAudioContextMethods;
|
use dom::bindings::codegen::Bindings::BaseAudioContextBinding::BaseAudioContextMethods;
|
||||||
use dom::bindings::codegen::Bindings::BaseAudioContextBinding::AudioContextState;
|
use dom::bindings::codegen::Bindings::BaseAudioContextBinding::AudioContextState;
|
||||||
|
use dom::bindings::codegen::Bindings::GainNodeBinding::GainOptions;
|
||||||
use dom::bindings::codegen::Bindings::OscillatorNodeBinding::OscillatorOptions;
|
use dom::bindings::codegen::Bindings::OscillatorNodeBinding::OscillatorOptions;
|
||||||
use dom::bindings::error::{Error, ErrorResult};
|
use dom::bindings::error::{Error, ErrorResult};
|
||||||
use dom::bindings::inheritance::Castable;
|
use dom::bindings::inheritance::Castable;
|
||||||
|
@ -16,6 +17,7 @@ use dom::bindings::refcounted::Trusted;
|
||||||
use dom::bindings::reflector::DomObject;
|
use dom::bindings::reflector::DomObject;
|
||||||
use dom::bindings::root::DomRoot;
|
use dom::bindings::root::DomRoot;
|
||||||
use dom::eventtarget::EventTarget;
|
use dom::eventtarget::EventTarget;
|
||||||
|
use dom::gainnode::GainNode;
|
||||||
use dom::globalscope::GlobalScope;
|
use dom::globalscope::GlobalScope;
|
||||||
use dom::oscillatornode::OscillatorNode;
|
use dom::oscillatornode::OscillatorNode;
|
||||||
use dom::promise::Promise;
|
use dom::promise::Promise;
|
||||||
|
@ -267,6 +269,14 @@ impl BaseAudioContextMethods for BaseAudioContext {
|
||||||
let options = unsafe { OscillatorOptions::empty(window.get_cx()) };
|
let options = unsafe { OscillatorOptions::empty(window.get_cx()) };
|
||||||
OscillatorNode::new(&window, &self, &options)
|
OscillatorNode::new(&window, &self, &options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unsafe_code)]
|
||||||
|
fn CreateGain(&self) -> DomRoot<GainNode> {
|
||||||
|
let global = self.global();
|
||||||
|
let window = global.as_window();
|
||||||
|
let options = unsafe { GainOptions::empty(window.get_cx()) };
|
||||||
|
GainNode::new(&window, &self, &options)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<ProcessingState> for AudioContextState {
|
impl From<ProcessingState> for AudioContextState {
|
||||||
|
|
|
@ -36,7 +36,7 @@ interface BaseAudioContext : EventTarget {
|
||||||
// optional unsigned long numberOfInputChannels = 2,
|
// optional unsigned long numberOfInputChannels = 2,
|
||||||
// optional unsigned long numberOfOutputChannels = 2);
|
// optional unsigned long numberOfOutputChannels = 2);
|
||||||
// AnalyserNode createAnalyser();
|
// AnalyserNode createAnalyser();
|
||||||
// GainNode createGain();
|
GainNode createGain();
|
||||||
// DelayNode createDelay(optional double maxDelayTime = 1);
|
// DelayNode createDelay(optional double maxDelayTime = 1);
|
||||||
// BiquadFilterNode createBiquadFilter();
|
// BiquadFilterNode createBiquadFilter();
|
||||||
// IIRFilterNode createIIRFilter(sequence<double> feedforward,
|
// IIRFilterNode createIIRFilter(sequence<double> feedforward,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue