Expand description
An atom containg a series of other atoms.
This atom is just like a sequence, only without time stamps: It contains multiple arbitrary atoms which you can either iterate through or write in sequence.
§Example
use lv2_core::prelude::*;
use lv2_atom::prelude::*;
use lv2_atom::tuple::{TupleIterator, TupleWriter};
#[derive(PortCollection)]
struct MyPorts {
input: InputPort<AtomPort>,
output: OutputPort<AtomPort>,
}
fn run(ports: &mut MyPorts, urids: &AtomURIDCollection) {
let input: TupleIterator = ports.input.read(urids.tuple, ()).unwrap();
let mut output: TupleWriter = ports.output.init(urids.tuple, ()).unwrap();
for atom in input {
if let Some(integer) = atom.read(urids.int, ()) {
output.init(urids.int, integer * 2).unwrap();
} else {
output.init(urids.int, -1).unwrap();
}
}
}
§Specification
Structs§
- Tuple
- An atom containing a series of other atoms.
- Tuple
Iterator - An iterator over all atoms in a tuple.
- Tuple
Writer - The writing handle to add atoms to a tuple.