Lock-free meter channel: the host publishes a MeterFrame from the audio/host thread; the view reads the latest frame paint-safe. More...
#include <value_source.hpp>
Public Member Functions | |
| ~MeterSource () | |
| void | publish (const MeterFrame &frame) |
| Publish the latest reading. | |
| MeterFrame | read () |
| Read the latest published reading. | |
| 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 meter channel: the host publishes a MeterFrame from the audio/host thread; the view reads the latest frame paint-safe.
Exactly one writer and one reader thread (the TripleBuffer contract).
| pulp::dataplane::MeterSource::~MeterSource | ( | ) |
|
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::MeterSource::publish | ( | const MeterFrame & | frame | ) |
Publish the latest reading.
Call from the writer (audio/host) thread. Alloc-free and non-blocking — a fixed-size copy into the back buffer.
|
inlinenoexceptinherited |
Reader (UI) thread. Changes iff the writer published since the last read.
| MeterFrame pulp::dataplane::MeterSource::read | ( | ) |
Read the latest published reading.
Call from the reader (UI) thread. Returns by value so the caller never holds a reference into the buffer.
|
friend |