Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::dsp::ITimeStretchEngine Class Referenceabstract

Abstract time-stretch engine. More...

#include <src/dsp/timestretch_engine.h>

Inheritance diagram for zrythm::dsp::ITimeStretchEngine:

Public Member Functions

virtual std::string_view id () const =0
 A stable, non-translatable identifier for persistence (settings).
virtual bool supports (StretchOptions::Algorithm algorithm) const =0
 Whether this engine supports the given algorithm.
utils::audio::AudioBuffer stretch (const utils::audio::AudioBuffer &input, const TimeWarpMap &warp, const StretchOptions &options)
 Stretch input according to warp (Non-Virtual Interface).

Detailed Description

Abstract time-stretch engine.

Implementations consume a sample-domain TimeWarpMap and produce a stretched buffer. The engine has no knowledge of tempo maps or warp markers — only the composed source→output mapping — which keeps auto-timestretch and (future) manual warp points sharing the same engine. Add new engines by implementing this interface and adding a case to create_timestretch_engine; callers never name a concrete engine type.

Definition at line 68 of file timestretch_engine.h.

Member Function Documentation

◆ id()

virtual std::string_view zrythm::dsp::ITimeStretchEngine::id ( ) const
nodiscardpure virtual

A stable, non-translatable identifier for persistence (settings).

Implemented in zrythm::dsp::RubberBandTimeStretchEngine.

◆ stretch()

utils::audio::AudioBuffer zrythm::dsp::ITimeStretchEngine::stretch ( const utils::audio::AudioBuffer & input,
const TimeWarpMap & warp,
const StretchOptions & options )
inlinenodiscard

Stretch input according to warp (Non-Virtual Interface).

Validates the preconditions below, then dispatches to stretch_impl.

Precondition
warp.is_valid()
warp.source_length == input.getNumSamples()
supports(options.algorithm)
Returns
A new buffer with exactly warp.output_length frames.
Exceptions
std::invalid_argumentif any precondition is violated.

Definition at line 96 of file timestretch_engine.h.

◆ supports()

virtual bool zrythm::dsp::ITimeStretchEngine::supports ( StretchOptions::Algorithm algorithm) const
nodiscardpure virtual

Whether this engine supports the given algorithm.

Implemented in zrythm::dsp::RubberBandTimeStretchEngine.


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