18 const std::optional<double> &oldTempo,
double newTempo)
20 if (!oldTempo.has_value())
22 const auto ratio = *oldTempo / newTempo;
23 auto& seq = track.
GetSeq();
24 seq.convert_to_beats();
25 const auto b1 = seq.get_dur();
26 seq.convert_to_seconds();
27 const auto newDuration = seq.get_dur() * ratio;
28 seq.stretch_region(0, b1, newDuration);
29 seq.set_real_dur(newDuration);
DEFINE_ATTACHED_VIRTUAL_OVERRIDE(OnNoteTrackProjectTempoChange)
A Track that is used for Midi notes. (Somewhat old code).
For defining overrides of the method.