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. | |
Central visualization bridge: a fixed multichannel audio tap plus a caller-driven, non-RT analyzer and lock-free latest-value publication.
Thread model:
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.
|
inline |
Configure all visualization subsystems.
Call only while fully quiescent, before the audio producer and poll/snapshot consumers start.
|
inline |
|
inline |
|
inline |
|
inline |
Cheap snapshot-only read. Never drains audio or performs FFT work.
|
inline |
Cheap snapshot-only waveform read. Never calls 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.
|
noexcept |
Process audio from the audio callback.
Allocation-free after configure: meters and copies into fixed SPSC storage; never performs an FFT.
| channels | Array of channel buffer pointers. |
| num_channels | Number of channels. |
| num_samples | Samples per channel in this block. |
|
inline |
Read the latest multi-channel meter data.
|
inline |
|
inline |
|
inline |
|
inline |