DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::OfflineStereoGenerator< T > Class Template Referencefinal

Offline processed-copy stereo generation with a one-width control. More...

#include <OfflineStereoGenerator.h>

Classes

struct  CacheResult
 
class  DeltaCache
 Certificate for caller-owned, mono-double canonical delta storage. Width and exclusions are deliberately absent from the cache key: they apply at composition. Source PCM/format/clock and all generation settings are bound. renderCached verifies both complete PCM streams before publication. This object owns metadata only; it never keeps pointers to host audio. More...
 
struct  Options
 
class  Plan
 Owned controls/exclusions bound to a complete source fingerprint. More...
 
struct  PlanResult
 
struct  Report
 
struct  Result
 

Public Types

enum class  Reason : std::uint8_t {
  Ready , Generated , ZeroWidth , NoSignal ,
  AllExcluded
}
 
using GenerationOptions = StereoGenerator< double >::Options
 

Public Member Functions

PlanResult analyze (OfflineAudioSource< T > &source, const Options &options={}, const OfflineJobOptions &jobOptions={}) const
 Scans the complete source once for provenance/peak; no feature map is built.
 
PlanResult makePlan (OfflineAudioSource< T > &source, const typename OfflineEnergyAnalyzer< T >::Analysis &analysis, const Options &options={}, const OfflineJobOptions &jobOptions={}) const
 Reuses a complete energy analysis; render still verifies source PCM.
 
PlanResult replan (OfflineAudioSource< T > &source, const Plan &previous, const Options &options, const OfflineJobOptions &jobOptions={}) const
 Changes controls/exclusions without another scan; render verifies the source.
 
Result render (OfflineAudioSource< T > &source, const Plan &plan, OfflineAudioSink< T > &sink, const OfflineJobOptions &jobOptions={}) const
 Generates and composes stereo, verifying rounded output before commit.
 
CacheResult buildDeltaCache (OfflineAudioSource< T > &source, const Plan &plan, OfflineAudioSink< double > &sink, const OfflineJobOptions &jobOptions={}) const
 Writes a canonical unit-width delta to a transactional host sink. Exclusions and requested width do not affect this cache. Audio storage is host-owned and excluded from the worker budget, like any sink callback. A certificate is returned only after the delta sink commits successfully.
 
Result renderCached (OfflineAudioSource< T > &source, const Plan &plan, OfflineAudioSource< double > &delta, const DeltaCache &cache, OfflineAudioSink< T > &sink, const OfflineJobOptions &jobOptions={}) const
 Composes verified source/delta PCM with new width/exclusions in O(frames). Both streams are verified even for neutral jobs. A changed source, clock, generation setting or cache content rejects the entire provisional output.
 
template<int MaxChannels>
Result run (const AudioBuffer< T, MaxChannels > &input, AudioBuffer< T, MaxChannels > &output, double sampleRate, const Options &options={}, const OfflineJobOptions &job={}) const
 Owning render; failure preserves output, including in-place and mono duplication.
 

Detailed Description

template<FloatType T>
class dspark::OfflineStereoGenerator< T >

Offline processed-copy stereo generation with a one-width control.

Definition at line 41 of file OfflineStereoGenerator.h.

Member Typedef Documentation

◆ GenerationOptions

template<FloatType T>
using dspark::OfflineStereoGenerator< T >::GenerationOptions = StereoGenerator<double>::Options

Definition at line 44 of file OfflineStereoGenerator.h.

Member Enumeration Documentation

◆ Reason

template<FloatType T>
enum class dspark::OfflineStereoGenerator::Reason : std::uint8_t
strong
Enumerator
Ready 
Generated 
ZeroWidth 
NoSignal 
AllExcluded 

Definition at line 53 of file OfflineStereoGenerator.h.

Member Function Documentation

◆ analyze()

template<FloatType T>
PlanResult dspark::OfflineStereoGenerator< T >::analyze ( OfflineAudioSource< T > &  source,
const Options &  options = {},
const OfflineJobOptions &  jobOptions = {} 
) const
inline

Scans the complete source once for provenance/peak; no feature map is built.

Definition at line 199 of file OfflineStereoGenerator.h.

◆ buildDeltaCache()

template<FloatType T>
CacheResult dspark::OfflineStereoGenerator< T >::buildDeltaCache ( OfflineAudioSource< T > &  source,
const Plan &  plan,
OfflineAudioSink< double > &  sink,
const OfflineJobOptions &  jobOptions = {} 
) const
inline

Writes a canonical unit-width delta to a transactional host sink. Exclusions and requested width do not affect this cache. Audio storage is host-owned and excluded from the worker budget, like any sink callback. A certificate is returned only after the delta sink commits successfully.

Definition at line 287 of file OfflineStereoGenerator.h.

◆ makePlan()

template<FloatType T>
PlanResult dspark::OfflineStereoGenerator< T >::makePlan ( OfflineAudioSource< T > &  source,
const typename OfflineEnergyAnalyzer< T >::Analysis &  analysis,
const Options &  options = {},
const OfflineJobOptions &  jobOptions = {} 
) const
inline

Reuses a complete energy analysis; render still verifies source PCM.

Definition at line 225 of file OfflineStereoGenerator.h.

◆ render()

template<FloatType T>
Result dspark::OfflineStereoGenerator< T >::render ( OfflineAudioSource< T > &  source,
const Plan &  plan,
OfflineAudioSink< T > &  sink,
const OfflineJobOptions &  jobOptions = {} 
) const
inline

Generates and composes stereo, verifying rounded output before commit.

Definition at line 275 of file OfflineStereoGenerator.h.

◆ renderCached()

template<FloatType T>
Result dspark::OfflineStereoGenerator< T >::renderCached ( OfflineAudioSource< T > &  source,
const Plan &  plan,
OfflineAudioSource< double > &  delta,
const DeltaCache &  cache,
OfflineAudioSink< T > &  sink,
const OfflineJobOptions &  jobOptions = {} 
) const
inline

Composes verified source/delta PCM with new width/exclusions in O(frames). Both streams are verified even for neutral jobs. A changed source, clock, generation setting or cache content rejects the entire provisional output.

Definition at line 351 of file OfflineStereoGenerator.h.

◆ replan()

template<FloatType T>
PlanResult dspark::OfflineStereoGenerator< T >::replan ( OfflineAudioSource< T > &  source,
const Plan &  previous,
const Options &  options,
const OfflineJobOptions &  jobOptions = {} 
) const
inline

Changes controls/exclusions without another scan; render verifies the source.

Definition at line 250 of file OfflineStereoGenerator.h.

◆ run()

template<FloatType T>
template<int MaxChannels>
Result dspark::OfflineStereoGenerator< T >::run ( const AudioBuffer< T, MaxChannels > &  input,
AudioBuffer< T, MaxChannels > &  output,
double  sampleRate,
const Options &  options = {},
const OfflineJobOptions &  job = {} 
) const
inline

Owning render; failure preserves output, including in-place and mono duplication.

Definition at line 361 of file OfflineStereoGenerator.h.


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