mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Cleanups for future script crate split (#35987)
* script: Avoid direct impl blocks on generated dicts and unions. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Remove references to codegen-specific import module. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix tidy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
3ecd1c0699
commit
d35da38a2f
43 changed files with 211 additions and 146 deletions
|
@ -7,7 +7,8 @@ use js::rust::HandleObject;
|
|||
use servo_media::audio::channel_node::ChannelNodeOptions;
|
||||
use servo_media::audio::node::AudioNodeInit;
|
||||
|
||||
use crate::dom::audionode::{AudioNode, MAX_CHANNEL_COUNT};
|
||||
use crate::conversions::Convert;
|
||||
use crate::dom::audionode::{AudioNode, AudioNodeOptionsHelper, MAX_CHANNEL_COUNT};
|
||||
use crate::dom::baseaudiocontext::BaseAudioContext;
|
||||
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
|
||||
ChannelCountMode, ChannelInterpretation,
|
||||
|
@ -47,12 +48,13 @@ impl ChannelMergerNode {
|
|||
return Err(Error::IndexSize);
|
||||
}
|
||||
|
||||
let num_inputs = options.numberOfInputs;
|
||||
let node = AudioNode::new_inherited(
|
||||
AudioNodeInit::ChannelMergerNode(options.into()),
|
||||
AudioNodeInit::ChannelMergerNode(options.convert()),
|
||||
context,
|
||||
node_options,
|
||||
options.numberOfInputs, // inputs
|
||||
1, // outputs
|
||||
num_inputs, // inputs
|
||||
1, // outputs
|
||||
)?;
|
||||
Ok(ChannelMergerNode { node })
|
||||
}
|
||||
|
@ -97,10 +99,10 @@ impl ChannelMergerNodeMethods<crate::DomTypeHolder> for ChannelMergerNode {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a ChannelMergerOptions> for ChannelNodeOptions {
|
||||
fn from(options: &'a ChannelMergerOptions) -> Self {
|
||||
Self {
|
||||
channels: options.numberOfInputs as u8,
|
||||
impl Convert<ChannelNodeOptions> for ChannelMergerOptions {
|
||||
fn convert(self) -> ChannelNodeOptions {
|
||||
ChannelNodeOptions {
|
||||
channels: self.numberOfInputs as u8,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue