Starting to support arrays and tuples for inout
This commit is contained in:
@ -1,19 +1,24 @@
|
||||
use std::{fmt::Display, fs::File, io::Write};
|
||||
use std::fmt::Display;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
use oxydsp_dsp::blocks::{math::basic::Adder, utilities::iter::IterSource};
|
||||
use oxydsp_flowgraph::{
|
||||
BlockIO,
|
||||
block::{Block, BlockResult},
|
||||
edge::{In, PopIterable},
|
||||
flowgraph,
|
||||
graph::FlowGraph,
|
||||
};
|
||||
use oxydsp_dsp::blocks::math::basic::Adder;
|
||||
use oxydsp_dsp::blocks::utilities::iter::IterSource;
|
||||
use oxydsp_flowgraph::BlockIO;
|
||||
use oxydsp_flowgraph::block::Block;
|
||||
use oxydsp_flowgraph::block::BlockResult;
|
||||
use oxydsp_flowgraph::edge::In;
|
||||
use oxydsp_flowgraph::edge::PopIter;
|
||||
use oxydsp_flowgraph::edge::PopIterable;
|
||||
use oxydsp_flowgraph::flowgraph;
|
||||
use oxydsp_flowgraph::graph::FlowGraph;
|
||||
use oxydsp_flowgraph::stream::StreamReader;
|
||||
|
||||
#[derive(BlockIO)]
|
||||
//#[derive(BlockIO)]
|
||||
pub struct Printer<T: 'static>
|
||||
{
|
||||
#[input]
|
||||
input: In<T>,
|
||||
//#[input]
|
||||
input: [In<T>; 3],
|
||||
|
||||
n: usize,
|
||||
}
|
||||
@ -22,7 +27,8 @@ impl<T: 'static> Printer<T>
|
||||
{
|
||||
pub fn new(input: In<T>) -> Self
|
||||
{
|
||||
Self { input, n: 0 }
|
||||
todo!()
|
||||
//Self { input, n: 0 }
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,7 +38,12 @@ where
|
||||
{
|
||||
fn work(&mut self) -> oxydsp_flowgraph::block::BlockResult
|
||||
{
|
||||
for x in self.input.pop_iter()
|
||||
let mut k: Vec<_> = self.input.iter_mut().map(|x| x.read()).collect();
|
||||
|
||||
k[0].pop();
|
||||
k[1].next();
|
||||
|
||||
for x in self.input[0].pop_iter()
|
||||
{
|
||||
if self.n.is_multiple_of(2usize.pow(20))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user