Audacity 3.2.0
Functions
anonymous_namespace{MixerSource.cpp} Namespace Reference

Functions

template<typename T , typename F >
std::vector< T > initVector (size_t dim1, const F &f)
 
template<typename T >
std::vector< std::vector< T > > initVector (size_t dim1, size_t dim2)
 
double ComputeWarpFactor (const Envelope &env, double t0, double t1)
 Compute the integral warp factor between two non-warped time points. More...
 

Function Documentation

◆ ComputeWarpFactor()

double anonymous_namespace{MixerSource.cpp}::ComputeWarpFactor ( const Envelope env,
double  t0,
double  t1 
)

Compute the integral warp factor between two non-warped time points.

Calculate the relative length increase of the chosen segment from the original sound. So if this time track has a low value (i.e. makes the sound slower), the NEW warped sound will be longer than the original sound, so the return value of this function is larger.

Parameters
t0The starting time to calculate from
t1The ending time to calculate to
Returns
The relative length increase of the chosen segment from the original sound.

Definition at line 61 of file MixerSource.cpp.

62{
63 return env.AverageOfInverse(t0, t1);
64}
double AverageOfInverse(double t0, double t1) const
Definition: Envelope.cpp:1089

References Envelope::AverageOfInverse().

Referenced by MixerSource::MixVariableRates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initVector() [1/2]

template<typename T , typename F >
std::vector< T > anonymous_namespace{MixerSource.cpp}::initVector ( size_t  dim1,
const F &  f 
)

Definition at line 24 of file MixerSource.cpp.

25{
26 std::vector<T> result( dim1 );
27 for (auto &row : result)
28 f(row);
29 return result;
30}

◆ initVector() [2/2]

template<typename T >
std::vector< std::vector< T > > anonymous_namespace{MixerSource.cpp}::initVector ( size_t  dim1,
size_t  dim2 
)

Definition at line 33 of file MixerSource.cpp.

34{
35 return initVector<std::vector<T>>(dim1,
36 [dim2](auto &row){ row.resize(dim2); });
37}