servo_media_audio/
destination_node.rs1use crate::block::Chunk;
6use crate::node::{AudioNodeEngine, AudioNodeType, BlockInfo, ChannelCountMode, ChannelInfo};
7
8#[derive(AudioNodeCommon)]
9pub(crate) struct DestinationNode {
10 channel_info: ChannelInfo,
11 chunk: Option<Chunk>,
12}
13
14impl DestinationNode {
15 pub fn new(channel_count: u8) -> Self {
16 DestinationNode {
17 channel_info: ChannelInfo {
18 mode: ChannelCountMode::Explicit,
19 count: channel_count,
20 ..Default::default()
21 },
22 chunk: None,
23 }
24 }
25}
26
27impl AudioNodeEngine for DestinationNode {
28 fn node_type(&self) -> AudioNodeType {
29 AudioNodeType::DestinationNode
30 }
31
32 fn process(&mut self, inputs: Chunk, _: &BlockInfo) -> Chunk {
33 self.chunk = Some(inputs);
34 Chunk::default()
35 }
36
37 fn destination_data(&mut self) -> Option<Chunk> {
38 self.chunk.take()
39 }
40
41 fn output_count(&self) -> u32 {
42 0
43 }
44}