mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement DOM APIs for ChannelSplitterNode
This commit is contained in:
parent
4ac5b8a3ae
commit
ff0cf9e93a
16 changed files with 186 additions and 133 deletions
|
@ -241,6 +241,9 @@ impl AudioNodeMethods for AudioNode {
|
|||
return Err(Error::InvalidState);
|
||||
}
|
||||
},
|
||||
EventTargetTypeId::AudioNode(AudioNodeTypeId::ChannelSplitterNode) => {
|
||||
return Err(Error::InvalidState);
|
||||
},
|
||||
// XXX We do not support any of the other AudioNodes with
|
||||
// constraints yet. Add more cases here as we add support
|
||||
// for new AudioNodes.
|
||||
|
@ -284,6 +287,9 @@ impl AudioNodeMethods for AudioNode {
|
|||
return Err(Error::InvalidState);
|
||||
}
|
||||
},
|
||||
EventTargetTypeId::AudioNode(AudioNodeTypeId::ChannelSplitterNode) => {
|
||||
return Err(Error::InvalidState);
|
||||
},
|
||||
// XXX We do not support any of the other AudioNodes with
|
||||
// constraints yet. Add more cases here as we add support
|
||||
// for new AudioNodes.
|
||||
|
@ -301,14 +307,22 @@ impl AudioNodeMethods for AudioNode {
|
|||
}
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#dom-audionode-channelinterpretation
|
||||
fn SetChannelInterpretation(&self, value: ChannelInterpretation) {
|
||||
fn SetChannelInterpretation(&self, value: ChannelInterpretation) -> ErrorResult {
|
||||
// Channel interpretation mode has no effect for nodes with no inputs.
|
||||
if self.number_of_inputs == 0 {
|
||||
return;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
match self.upcast::<EventTarget>().type_id() {
|
||||
EventTargetTypeId::AudioNode(AudioNodeTypeId::ChannelSplitterNode) => {
|
||||
return Err(Error::InvalidState);
|
||||
},
|
||||
_ => (),
|
||||
};
|
||||
|
||||
self.channel_interpretation.set(value);
|
||||
self.message(AudioNodeMessage::SetChannelInterpretation(value.into()));
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue