Audacity 3.2.0
Typedefs | Functions
TimeTrackEditing.cpp File Reference
#include "Envelope.h"
#include "TempoChange.h"
#include "TimeTrack.h"
Include dependency graph for TimeTrackEditing.cpp:

Go to the source code of this file.

Typedefs

using OnTimeTrackProjectTempoChange = OnProjectTempoChange::Override< TimeTrack >
 

Functions

 DEFINE_ATTACHED_VIRTUAL_OVERRIDE (OnTimeTrackProjectTempoChange)
 

Detailed Description


Audacity: A Digital Audio Editor

PaulLicameli

Definition in file TimeTrackEditing.cpp.

Typedef Documentation

◆ OnTimeTrackProjectTempoChange

Definition at line 15 of file TimeTrackEditing.cpp.

Function Documentation

◆ DEFINE_ATTACHED_VIRTUAL_OVERRIDE()

DEFINE_ATTACHED_VIRTUAL_OVERRIDE ( OnTimeTrackProjectTempoChange  )

Definition at line 16 of file TimeTrackEditing.cpp.

16 {
17 return [](TimeTrack &track,
18 const std::optional<double> &oldTempo, double newTempo)
19 {
20 if (!oldTempo.has_value())
21 return;
22 const auto ratio = *oldTempo / newTempo;
23 track.GetEnvelope()->RescaleTimesBy(ratio);
24 };
25}
void RescaleTimesBy(double ratio)
Definition: Envelope.cpp:871
A kind of Track used to 'warp time'.
Definition: TimeTrack.h:24
BoundedEnvelope * GetEnvelope()
Definition: TimeTrack.h:84

References TimeTrack::GetEnvelope(), and Envelope::RescaleTimesBy().

Here is the call graph for this function: