Lock-free vector channel: the writer publishes a block of samples, the view reads the latest block paint-safe. More...
#include <value_source.hpp>
Public Member Functions | |
| ~VectorSource () | |
| void | publish (const float *samples, int count) |
| Publish a block from the writer (audio/host) thread. | |
| VectorFrame | read () |
| Read the latest published block from the reader (UI) thread. | |
| void | note_publish () noexcept |
| Writer (audio/host) thread, from publish(). | |
| std::uint32_t | publish_seq () const noexcept |
| Reader (UI) thread. Changes iff the writer published since the last read. | |
Friends | |
| class | ValueChannelSet |
Lock-free vector channel: the writer publishes a block of samples, the view reads the latest block paint-safe.
Same one-writer/one-reader contract as MeterSource.
Latest-wins, like every channel here: a block the reader never got to is silently replaced. That is correct for a visualization — a scope shows the current state of the signal, not a lossless history of it.
| pulp::dataplane::VectorSource::~VectorSource | ( | ) |
|
inlinenoexceptinherited |
Writer (audio/host) thread, from publish().
Relaxed: the counter orders no other memory, it only has to be monotonic and eventually visible.
| void pulp::dataplane::VectorSource::publish | ( | const float * | samples, |
| int | count ) |
Publish a block from the writer (audio/host) thread.
Alloc-free and non-blocking: a bounded copy into the back buffer. More than VectorFrame::kMaxSamples is truncated rather than rejected, so an oversized block still renders its leading window instead of vanishing.
|
inlinenoexceptinherited |
Reader (UI) thread. Changes iff the writer published since the last read.
| VectorFrame pulp::dataplane::VectorSource::read | ( | ) |
Read the latest published block from the reader (UI) thread.
|
friend |