#include <spectral_mask_processor.hpp>
Public Types | |
| using | Config = SpectralMaskProcessorConfigT<SampleType> |
| using | Layout = SpectralBandLayoutT<SampleType> |
| using | Table = SpectralMaskTableT<SampleType> |
| using | PreMaskStage = SpectralPreMaskStageT<SampleType> |
| using | WetSourceStage = SpectralWetSourceStageT<SampleType> |
| using | EffectiveFrameObserver = void (*)(void*, const Table&, std::uint64_t) noexcept |
Public Member Functions | |
| bool | set_effective_frame_observer (void *context, EffectiveFrameObserver observer) noexcept |
| Install/remove only while the processing owner is stopped. | |
| bool | prepare (const Config &config) |
| Prepare a complete replacement state. | |
| bool | publish_layout (const Layout &layout) |
| Compile and publish one layout from the prepared geometry. | |
| bool | publish_table (const Table &table) |
| Publish a complete immutable table through the shared latest-value three-slot handoff. | |
| bool | set_layout_rt (const Layout &layout) noexcept |
| Stage a layout from the single audio owner. | |
| bool | process (const SampleType *const *input, SampleType *const *output, int num_samples) noexcept |
| Process one prepared planar block. | |
| bool | process_frame (std::complex< SampleType > *const *frames, int num_bins) noexcept |
| Apply the current publication/transition state to one coherent complex frame group. | |
| void | set_pre_mask_stage (PreMaskStage *stage) noexcept |
| Install (or clear, with nullptr) the non-owning pre-mask frame stage. | |
| PreMaskStage * | pre_mask_stage () const noexcept |
| void | set_wet_source_stage (WetSourceStage *stage) noexcept |
| Install (or clear, with nullptr) the non-owning time-domain wet-source stage. | |
| WetSourceStage * | wet_source_stage () const noexcept |
| void | set_mix (SampleType mix) noexcept |
| Audio-thread-safe dry/wet controls. Mix defaults to fully wet. | |
| void | set_mix_ramp_samples (int samples) noexcept |
| void | set_mix_curve (MixCurve curve) noexcept |
| void | reset () noexcept |
| Clear analysis/synthesis, dry-delay, and in-flight interpolation state while preserving the latest adopted mask as the new settled curve. | |
| bool | prepared () const noexcept |
| int | latency_samples () const noexcept |
| int | maximum_tail_samples () const noexcept |
| Conservative flush bound for the fixed-latency WOLA response. | |
| int | num_bins () const noexcept |
| int | channels () const noexcept |
| std::uint64_t | retained_bytes () const noexcept |
| std::uint64_t | active_table_version () const noexcept |
| bool | table_publication_pending () const noexcept |
| using pulp::signal::SpectralMaskProcessorT< SampleType >::Config = SpectralMaskProcessorConfigT<SampleType> |
| using pulp::signal::SpectralMaskProcessorT< SampleType >::EffectiveFrameObserver = void (*)(void*, const Table&, std::uint64_t) noexcept |
| using pulp::signal::SpectralMaskProcessorT< SampleType >::Layout = SpectralBandLayoutT<SampleType> |
| using pulp::signal::SpectralMaskProcessorT< SampleType >::PreMaskStage = SpectralPreMaskStageT<SampleType> |
| using pulp::signal::SpectralMaskProcessorT< SampleType >::Table = SpectralMaskTableT<SampleType> |
| using pulp::signal::SpectralMaskProcessorT< SampleType >::WetSourceStage = SpectralWetSourceStageT<SampleType> |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
Conservative flush bound for the fixed-latency WOLA response.
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscard |
Prepare a complete replacement state.
Failure leaves the prior prepared state intact. This control-thread operation allocates the STFT and dry delay storage; all later audio methods stay within those capacities.
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
Process one prepared planar block.
The dry path is delayed by the exact WOLA latency before mixing, so any mix below 100% cannot leak an early unfiltered signal around an isolation mask.
|
inlinenodiscardnoexcept |
Apply the current publication/transition state to one coherent complex frame group.
This narrow source-independent seam is also usable by a prepared hold, freeze, delay, or resynthesis owner; it must still be called by exactly one audio-side consumer in chronological frame order.
|
inlinenodiscard |
Compile and publish one layout from the prepared geometry.
Compilation and publication are failure-atomic control-thread operations.
|
inlinenodiscard |
Publish a complete immutable table through the shared latest-value three-slot handoff.
One control-side writer and one audio-side reader may operate concurrently.
|
inlinenoexcept |
Clear analysis/synthesis, dry-delay, and in-flight interpolation state while preserving the latest adopted mask as the new settled curve.
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
Install/remove only while the processing owner is stopped.
The observer runs once per successfully processed coherent channel-group frame, after adoption/interpolation and mask application. Its Table reference is borrowed only for that call: copy into bounded prepared storage before returning. It must not allocate, wait, throw, or reenter this processor. The ordinal counts successful frames since prepare/reset, not samples or host callbacks. The caller supplies stream identity and sample chronology. Successful prepare removes the observer; reset preserves it and restarts the ordinal. Failed prepare preserves the entire previous prepared state.
|
inlinenodiscardnoexcept |
Stage a layout from the single audio owner.
The layout is copied into prepared fixed-capacity storage and compiled at the next spectral-frame boundary. This path is deliberately separate from publish_layout(): it never joins the control-side TripleBuffer writer contract and therefore cannot race a UI/state-restore publication.
|
inlinenoexcept |
Audio-thread-safe dry/wet controls. Mix defaults to fully wet.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Install (or clear, with nullptr) the non-owning pre-mask frame stage.
Call from the thread that runs process(), or while it is not running; the stage must outlive its installation. The stage survives prepare() and reset(), and is not applied by process_frame(), whose caller already supplies the frames it wants masked. The dry path is never routed through it.
|
inlinenoexcept |
Install (or clear, with nullptr) the non-owning time-domain wet-source stage.
Same threading, lifetime, and prepare()/reset() rules as set_pre_mask_stage(). The dry path always carries the live input.
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |