Audacity 3.2.0
TimeTrackEditing.cpp
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 @file TimeTrackEditing.cpp
7
8 PaulLicameli
9
10**********************************************************************/
11#include "Envelope.h"
12#include "TempoChange.h"
13#include "TimeTrack.h"
14
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}
DEFINE_ATTACHED_VIRTUAL_OVERRIDE(OnTimeTrackProjectTempoChange)
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
For defining overrides of the method.