mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
OscillatorNode detune param
This commit is contained in:
parent
0e92efbb79
commit
93990d437e
2 changed files with 10 additions and 6 deletions
|
@ -26,14 +26,14 @@ use std::f32;
|
|||
use std::rc::Rc;
|
||||
|
||||
audio_param_impl!(Frequency, OscillatorNode, OscillatorNodeMessage, SetFrequency);
|
||||
//XXX audio_param_impl!(Detune, OscillatorNode, OscillatorNodeMessage, SetDetune);
|
||||
audio_param_impl!(Detune, OscillatorNode, OscillatorNodeMessage, SetDetune);
|
||||
|
||||
#[dom_struct]
|
||||
pub struct OscillatorNode {
|
||||
node: AudioScheduledSourceNode,
|
||||
oscillator_type: OscillatorType,
|
||||
frequency: DomRoot<AudioParam>,
|
||||
//XXX detune: DomRoot<AudioParam>,
|
||||
detune: DomRoot<AudioParam>,
|
||||
}
|
||||
|
||||
impl OscillatorNode {
|
||||
|
@ -60,17 +60,17 @@ impl OscillatorNode {
|
|||
Box::new(frequency),
|
||||
AutomationRate::A_rate,
|
||||
440., f32::MIN, f32::MAX);
|
||||
/*XXX let detune = Detune::new(context.audio_context_impl(), node.node_id());
|
||||
let detune = Detune::new(context.audio_context_impl(), node.node_id());
|
||||
let detune = AudioParam::new(window,
|
||||
Box::new(detune),
|
||||
AutomationRate::A_rate,
|
||||
0., -440. / 2., 440. / 2.);*/
|
||||
0., -440. / 2., 440. / 2.);
|
||||
|
||||
OscillatorNode {
|
||||
node,
|
||||
oscillator_type: oscillator_options.type_,
|
||||
frequency,
|
||||
//XXX detune,
|
||||
detune,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,6 +97,10 @@ impl OscillatorNodeMethods for OscillatorNode {
|
|||
fn Frequency(&self) -> DomRoot<AudioParam> {
|
||||
DomRoot::from_ref(&self.frequency)
|
||||
}
|
||||
|
||||
fn Detune(&self) -> DomRoot<AudioParam> {
|
||||
DomRoot::from_ref(&self.detune)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a OscillatorOptions> for ServoMediaOscillatorOptions {
|
||||
|
|
|
@ -28,7 +28,7 @@ interface OscillatorNode : AudioScheduledSourceNode {
|
|||
// attribute OscillatorType type;
|
||||
|
||||
readonly attribute AudioParam frequency;
|
||||
// readonly attribute AudioParam detune;
|
||||
readonly attribute AudioParam detune;
|
||||
|
||||
// void setPeriodicWave (PeriodicWave periodicWave);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue