Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::dataplane::VectorSource Class Reference

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~VectorSource()

pulp::dataplane::VectorSource::~VectorSource ( )

Member Function Documentation

◆ note_publish()

void pulp::dataplane::PublishCounter::note_publish ( )
inlinenoexceptinherited

Writer (audio/host) thread, from publish().

Relaxed: the counter orders no other memory, it only has to be monotonic and eventually visible.

◆ publish()

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.

◆ publish_seq()

std::uint32_t pulp::dataplane::PublishCounter::publish_seq ( ) const
inlinenoexceptinherited

Reader (UI) thread. Changes iff the writer published since the last read.

◆ read()

VectorFrame pulp::dataplane::VectorSource::read ( )

Read the latest published block from the reader (UI) thread.

◆ ValueChannelSet

friend class ValueChannelSet
friend

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/dataplane/include/pulp/dataplane/value_source.hpp