Audacity  3.0.3
Public Member Functions | Private Attributes | List of all members
LinearTimeWarper Class Referencefinal

Linear scaling, initialised by giving two points on the line. More...

#include <TimeWarper.h>

Inheritance diagram for LinearTimeWarper:
[legend]
Collaboration diagram for LinearTimeWarper:
[legend]

Public Member Functions

 LinearTimeWarper (double tBefore0, double tAfter0, double tBefore1, double tAfter1)
 
double Warp (double originalTime) const override
 
- Public Member Functions inherited from TimeWarper
virtual ~TimeWarper ()
 

Private Attributes

double mScale
 
double mShift
 

Detailed Description

Linear scaling, initialised by giving two points on the line.

Definition at line 86 of file TimeWarper.h.

Constructor & Destructor Documentation

◆ LinearTimeWarper()

LinearTimeWarper::LinearTimeWarper ( double  tBefore0,
double  tAfter0,
double  tBefore1,
double  tAfter1 
)
inline

Definition at line 92 of file TimeWarper.h.

94  : mScale((tAfter1 - tAfter0)/(tBefore1 - tBefore0)),
95  mShift(tAfter0 - mScale*tBefore0)
96  { }

Member Function Documentation

◆ Warp()

double LinearTimeWarper::Warp ( double  originalTime) const
overridevirtual

Implements TimeWarper.

Definition at line 37 of file TimeWarper.cpp.

38 {
39  return originalTime*mScale + mShift;
40 }

References mScale, and mShift.

Referenced by LinearInputRateTimeWarper::Warp(), LinearOutputRateTimeWarper::Warp(), LinearInputStretchTimeWarper::Warp(), LinearOutputStretchTimeWarper::Warp(), GeometricInputTimeWarper::Warp(), and GeometricOutputTimeWarper::Warp().

Here is the caller graph for this function:

Member Data Documentation

◆ mScale

double LinearTimeWarper::mScale
private

Definition at line 89 of file TimeWarper.h.

Referenced by Warp().

◆ mShift

double LinearTimeWarper::mShift
private

Definition at line 90 of file TimeWarper.h.

Referenced by Warp().


The documentation for this class was generated from the following files:
LinearTimeWarper::mShift
double mShift
Definition: TimeWarper.h:90
LinearTimeWarper::mScale
double mScale
Definition: TimeWarper.h:89