1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-11 23:26:28 +01:00

Make MIDI track stretch path-independent

This commit is contained in:
Paul Licameli
2017-05-11 13:41:26 -04:00
parent 9fb7185ea4
commit 90eb4ec142
4 changed files with 95 additions and 76 deletions

View File

@@ -326,11 +326,13 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
};
struct StretchState {
StretchEnum mMode { stretchCenter }; // remembers what to drag
using QuantizedTimeAndBeat = std::pair< double, double >;
bool mStretching {}; // true between mouse down and mouse up
double mStart {}; // time of initial mouse position, quantized
// to the nearest beat
double mSel0 {}; // initial sel0 (left) quantized to nearest beat
double mSel1 {}; // initial sel1 (left) quantized to nearest beat
QuantizedTimeAndBeat mBeatCenter { 0, 0 };
QuantizedTimeAndBeat mBeat0 { 0, 0 };
QuantizedTimeAndBeat mBeat1 { 0, 0 };
double mLeftBeats {}; // how many beats from left to cursor
double mRightBeats {}; // how many beats from cursor to right
} mStretchState;