1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-20 23:51:18 +01:00

Changing NoteTrack height, keep # of piano keys (roughly) constant...

This fix is imperfect, but quick and easy
This commit is contained in:
Paul Licameli
2017-07-19 14:44:42 -04:00
parent c45adf6fc1
commit 8279adc797
3 changed files with 15 additions and 1 deletions

View File

@@ -210,6 +210,18 @@ double NoteTrack::GetEndTime() const
return GetStartTime() + GetSeq().get_real_dur();
}
void NoteTrack::SetHeight(int h)
{
auto oldHeight = GetHeight();
Track::SetHeight(h);
Zoom(
wxRect{ 0, 0, 1, h }, // only height matters
h - 1, // preserve bottom note
(float)h / std::max(1, oldHeight),
false
);
}
void NoteTrack::WarpAndTransposeNotes(double t0, double t1,
const TimeWarper &warper,