Audacity 3.2.0
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:
Collaboration diagram for LinearTimeWarper:

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 ()
virtual double Warp (double originalTime) const =0

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 

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

Implements TimeWarper.

Definition at line 36 of file TimeWarper.cpp.

38 return originalTime*mScale + mShift;

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

Definition at line 89 of file TimeWarper.h.

Referenced by Warp().

◆ mShift

double LinearTimeWarper::mShift

Definition at line 90 of file TimeWarper.h.

Referenced by Warp().

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