Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator > Class Template Reference

Aligns N already-processed paths to the largest declared intrinsic latency. More...

#include <path_latency_aligner.hpp>

Public Member Functions

 PathLatencyAlignerT (const Allocator &allocator=Allocator{})
bool prepare (std::size_t paths, std::size_t channels, std::size_t max_latency_samples, std::size_t max_block_size)
bool configure_latencies (std::span< const std::size_t > latencies) noexcept
void reset () noexcept
std::size_t reported_latency_samples () const noexcept
std::size_t path_latency_samples (std::size_t path) const noexcept
std::size_t compensation_delay_samples (std::size_t path) const noexcept
std::size_t path_count () const noexcept
std::size_t channel_count () const noexcept
std::size_t retained_samples () const noexcept
bool process (const SampleType *const *inputs, std::size_t input_count, SampleType *const *outputs, std::size_t output_count, std::size_t frames) noexcept

Static Public Attributes

static constexpr std::size_t max_paths = MaxPaths
static constexpr std::size_t max_channels = MaxChannels

Detailed Description

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
class pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >

Aligns N already-processed paths to the largest declared intrinsic latency.

prepare() allocates bounded ring storage on the control thread. Latency changes are control-thread operations: configure_latencies() validates the whole set atomically and hard-resets history, preventing mixed-delay audio. process() is allocation-free and reports the exact maximum path latency.

Layout is path-major then channel-major. Each output may exactly alias its corresponding input; cross-path/channel aliasing is rejected. Samples and non-finite values are delayed unchanged.

Constructor & Destructor Documentation

◆ PathLatencyAlignerT()

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::PathLatencyAlignerT ( const Allocator & allocator = Allocator{})
inlineexplicit

Member Function Documentation

◆ channel_count()

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
std::size_t pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::channel_count ( ) const
inlinenoexcept

◆ compensation_delay_samples()

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
std::size_t pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::compensation_delay_samples ( std::size_t path) const
inlinenoexcept

◆ configure_latencies()

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
bool pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::configure_latencies ( std::span< const std::size_t > latencies)
inlinenoexcept

◆ path_count()

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
std::size_t pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::path_count ( ) const
inlinenoexcept

◆ path_latency_samples()

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
std::size_t pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::path_latency_samples ( std::size_t path) const
inlinenoexcept

◆ prepare()

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
bool pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::prepare ( std::size_t paths,
std::size_t channels,
std::size_t max_latency_samples,
std::size_t max_block_size )
inline

◆ process()

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
bool pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::process ( const SampleType *const * inputs,
std::size_t input_count,
SampleType *const * outputs,
std::size_t output_count,
std::size_t frames )
inlinenoexcept

◆ reported_latency_samples()

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
std::size_t pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::reported_latency_samples ( ) const
inlinenoexcept

◆ reset()

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
void pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::reset ( )
inlinenoexcept

◆ retained_samples()

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
std::size_t pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::retained_samples ( ) const
inlinenoexcept

Member Data Documentation

◆ max_channels

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
std::size_t pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::max_channels = MaxChannels
staticconstexpr

◆ max_paths

template<typename SampleType = float, std::size_t MaxPaths = 16, std::size_t MaxChannels = 8, typename Allocator = std::allocator<SampleType>>
std::size_t pulp::signal::PathLatencyAlignerT< SampleType, MaxPaths, MaxChannels, Allocator >::max_paths = MaxPaths
staticconstexpr

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