Struct hexodsp::shared_feedback::SharedFeedbackReader
source · [−]pub struct SharedFeedbackReader {
buffer: Arc<Vec<AtomicFloat>>,
read_ptr: usize,
delay_sample_count: usize,
}
Expand description
A reader for the SharedFeedback buffer, used to implement the FbRd
DSP node.
Multiple readers are okay, and you can even read from the buffer across the threads. It is sound to read from another thread. But keep in mind, that this is not a ring buffer and you will get partially written buffer contents. There is also only a per sample reading API, that means without the current sample rate you will not know how many samples the 3.14ms buffer is big.
Fields
buffer: Arc<Vec<AtomicFloat>>
read_ptr: usize
delay_sample_count: usize
Implementations
pub fn new(sfb: &SharedFeedback) -> Self
sourcepub fn read(&mut self) -> f32
pub fn read(&mut self) -> f32
Read the next sample from the buffer. Wraps around after some internal buffer
size (that is consistent with the SharedFeedback buffer size). Used by FbRd
DSP node
to do it’s functionality.
Trait Implementations
sourcefn clone(&self) -> SharedFeedbackReader
fn clone(&self) -> SharedFeedbackReader
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations
Blanket Implementations
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more