1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-11 15:16:27 +01:00

Group some TrackPanel fields into a structure

This commit is contained in:
Paul Licameli
2017-05-11 15:44:40 -04:00
parent 655fc9d9dc
commit 2eb6285ddc
2 changed files with 55 additions and 55 deletions

View File

@@ -324,15 +324,18 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
stretchCenter,
stretchRight
};
StretchEnum mStretchMode; // remembers what to drag
bool mStretching; // true between mouse down and mouse up
bool mStretched; // true after drag has pushed state
double mStretchStart; // time of initial mouse position, quantized
// to the nearest beat
double mStretchSel0; // initial sel0 (left) quantized to nearest beat
double mStretchSel1; // initial sel1 (left) quantized to nearest beat
double mStretchLeftBeats; // how many beats from left to cursor
double mStretchRightBeats; // how many beats from cursor to right
struct StretchState {
StretchEnum mMode { stretchCenter }; // remembers what to drag
bool mStretching {}; // true between mouse down and mouse up
bool mStretched {}; // true after drag has pushed state
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
double mLeftBeats {}; // how many beats from left to cursor
double mRightBeats {}; // how many beats from cursor to right
} mStretchState;
virtual bool HitTestStretch(Track *track, const wxRect &rect, const wxMouseEvent & event);
virtual void Stretch(int mouseXCoordinate, int trackLeftEdge, Track *pTrack);
#endif