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

Central visualization bridge: a fixed multichannel audio tap plus a caller-driven, non-RT analyzer and lock-free latest-value publication. More...

#include <visualization_bridge.hpp>

Public Member Functions

 VisualizationBridge ()=default
void configure (const VisualizationConfig &config)
 Configure all visualization subsystems.
void process (const float *const *channels, int num_channels, int num_samples) noexcept
 Process audio from the audio callback.
bool poll ()
 Consume at most the captured frame count visible at entry and publish the latest spectrum/waveform.
const SpectrumData & peek_spectrum ()
 Cheap snapshot-only read. Never drains audio or performs FFT work.
const SpectrumData & read_spectrum ()
 Legacy snapshot-read name retained for compile compatibility.
const signal::MultiChannelMeterData & read_meter ()
 Read the latest multi-channel meter data.
const WaveformData & peek_waveform ()
 Cheap snapshot-only waveform read. Never calls poll().
const WaveformData & read_waveform ()
 Legacy snapshot-read name retained for compile compatibility.
int fft_size () const
int num_bins () const
int num_channels () const
float sample_rate () const
void reset ()
 Reset all internal state after playback stops.

Detailed Description

Central visualization bridge: a fixed multichannel audio tap plus a caller-driven, non-RT analyzer and lock-free latest-value publication.

Thread model:

  • Audio thread: calls process() from the audio callback (no allocation)
  • Exactly one UI thread owns poll() and all snapshot reads

The bridge owns the STFT processor and multi-channel meter internally. No external STFT or meter instances needed. configure() and reset() require full quiescence: neither process(), poll(), nor snapshot reads may be active while either lifecycle method runs.

Constructor & Destructor Documentation

◆ VisualizationBridge()

Member Function Documentation

◆ configure()

Configure all visualization subsystems.

Call only while fully quiescent, before the audio producer and poll/snapshot consumers start.

◆ fft_size()

◆ num_bins()

◆ num_channels()

◆ peek_spectrum()

Cheap snapshot-only read. Never drains audio or performs FFT work.

◆ peek_waveform()

Cheap snapshot-only waveform read. Never calls poll().

◆ poll()

Consume at most the captured frame count visible at entry and publish the latest spectrum/waveform.

This bounded call is the only FFT path and must run on the one UI thread that owns the bridge's snapshot reads.

◆ process()

void pulp::dataplane::VisualizationBridge::process ( const float *const * channels,
int num_channels,
int num_samples )
noexcept

Process audio from the audio callback.

Allocation-free after configure: meters and copies into fixed SPSC storage; never performs an FFT.

Parameters
channelsArray of channel buffer pointers.
num_channelsNumber of channels.
num_samplesSamples per channel in this block.

◆ read_meter()

Read the latest multi-channel meter data.

◆ read_spectrum()

Legacy snapshot-read name retained for compile compatibility.

Because process() no longer performs FFT analysis or snapshot publication, callers must now schedule poll() explicitly on the sole UI owner first.

◆ read_waveform()

Legacy snapshot-read name retained for compile compatibility.

Because process() no longer performs waveform assembly or snapshot publication, callers must now schedule poll() explicitly on the sole UI owner first.

◆ reset()

Reset all internal state after playback stops.

Requires full quiescence: no concurrent process(), poll(), or snapshot read calls.

◆ sample_rate()


The documentation for this class was generated from the following file: