Stream rework, qpsk example, splitter/merger

This commit is contained in:
2026-04-12 00:46:41 +02:00
parent 87921968b4
commit dad09cddcf
17 changed files with 474 additions and 142 deletions

View File

@ -0,0 +1,8 @@
[package]
name = "simple"
version = "0.1.0"
edition = "2024"
[dependencies]
oxydsp-flowgraph = {path = "../../oxydsp-flowgraph/"}
oxydsp-dsp = {path = "../../oxydsp-dsp/"}

View File

@ -0,0 +1,31 @@
use std::time::Duration;
use oxydsp_dsp::blocks::utilities::adapters::NullSink;
use oxydsp_dsp::blocks::utilities::adapters::Scan;
use oxydsp_dsp::blocks::utilities::channels::RxSource;
use oxydsp_flowgraph::flowgraph;
fn main()
{
let (tx, rx) = std::sync::mpsc::channel();
let (rx_source, numbers) = RxSource::new(rx);
let (inspect, numbers) = Scan::new(numbers, 0, |state, x: usize| {
if x.is_multiple_of(100)
{
println!("{}", x);
}
x
});
let null_sink = NullSink::new(numbers);
let graph = flowgraph![rx_source, inspect, null_sink];
std::thread::spawn(move || {
let mut x = 0usize;
loop
{
let _ = tx.send(x);
x += 1;
}
});
graph.run(1).join();
}