Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
RegionTimeWarper Class Referencefinal

No change before the specified region; during the region, warp according to the given warper; after the region, constant shift so as to match at the end of the warped region. More...

#include <TimeWarper.h>

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

Public Member Functions

 RegionTimeWarper (double tStart, double tEnd, std::unique_ptr< TimeWarper > &&warper)
 
virtual ~RegionTimeWarper ()
 
double Warp (double originalTime) const override
 
- Public Member Functions inherited from TimeWarper
virtual ~TimeWarper ()
 
virtual double Warp (double originalTime) const =0
 

Private Attributes

std::unique_ptr< TimeWarpermWarper
 
double mTStart
 
double mTEnd
 
double mOffset
 

Detailed Description

No change before the specified region; during the region, warp according to the given warper; after the region, constant shift so as to match at the end of the warped region.

Definition at line 191 of file TimeWarper.h.

Constructor & Destructor Documentation

◆ RegionTimeWarper()

RegionTimeWarper::RegionTimeWarper ( double  tStart,
double  tEnd,
std::unique_ptr< TimeWarper > &&  warper 
)
inline

Definition at line 199 of file TimeWarper.h.

200 : mWarper(std::move(warper)), mTStart(tStart), mTEnd(tEnd),
201 mOffset(mWarper->Warp(mTEnd)-mTEnd)
202 { }
std::unique_ptr< TimeWarper > mWarper
Definition: TimeWarper.h:194

◆ ~RegionTimeWarper()

virtual RegionTimeWarper::~RegionTimeWarper ( )
inlinevirtual

Definition at line 203 of file TimeWarper.h.

203{}

Member Function Documentation

◆ Warp()

double RegionTimeWarper::Warp ( double  originalTime) const
inlineoverridevirtual

Implements TimeWarper.

Definition at line 204 of file TimeWarper.h.

205 {
206 if (originalTime < mTStart)
207 {
208 return originalTime;
209 } else if (originalTime < mTEnd)
210 {
211 return mWarper->Warp(originalTime);
212 } else
213 {
214 return mOffset + originalTime;
215 }
216 }

Member Data Documentation

◆ mOffset

double RegionTimeWarper::mOffset
private

Definition at line 197 of file TimeWarper.h.

◆ mTEnd

double RegionTimeWarper::mTEnd
private

Definition at line 196 of file TimeWarper.h.

◆ mTStart

double RegionTimeWarper::mTStart
private

Definition at line 195 of file TimeWarper.h.

◆ mWarper

std::unique_ptr<TimeWarper> RegionTimeWarper::mWarper
private

Definition at line 194 of file TimeWarper.h.


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