1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-13 08:06:32 +01:00

Add user interface for scrubbing and Experimental.h switches

EXPERIMENTAL_SCRUBBING_BASIC enables middle-click-drag to scrub, or to seek
when shift is down.

EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL adds middle-double-click-drag to
scrub or (with SHIFT down) to seek while keeping the playhead at the midline
of the track display.

EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL allows control wheel to vary the speed
limit, while scrubbing (not seeking).

All three are enabled in this commit.

Also notice the changes to status bar messages and the Mouse Preferences dialog.

Scrubbing works only in Select and Multi tools.
This commit is contained in:
Paul-Licameli
2015-04-17 14:09:35 -04:00
parent f549e335f6
commit 10e35bb6bb
6 changed files with 484 additions and 23 deletions

View File

@@ -272,7 +272,8 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
virtual void DrawIndicator();
/// draws the green line on the tracks to show playback position
/// @param repairOld if true the playback position is not updated/erased, and simply redrawn
virtual void DoDrawIndicator(wxDC & dc, bool repairOld = false);
/// @param indicator if nonnegative, overrides the indicator value obtainable from AudioIO
virtual void DoDrawIndicator(wxDC & dc, bool repairOld = false, double indicator = -1);
virtual void DrawCursor();
virtual void DoDrawCursor(wxDC & dc);
@@ -315,6 +316,17 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
virtual void HandleSelect(wxMouseEvent & event);
virtual void SelectionHandleDrag(wxMouseEvent &event, Track *pTrack);
void StartOrJumpPlayback(wxMouseEvent &event);
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
double FindScrubSpeed(double timeAtMouse) const;
#endif
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
bool MaybeStartScrubbing(wxMouseEvent &event);
bool ContinueScrubbing(wxCoord position, bool maySkip);
bool StopScrubbing();
#endif
virtual void SelectionHandleClick(wxMouseEvent &event,
Track* pTrack, wxRect r);
virtual void StartSelection (int mouseXCoordinate, int trackLeftEdge);
@@ -513,6 +525,7 @@ protected:
const wxRect panelRect, const wxRect clip);
virtual void DrawOutside(Track *t, wxDC *dc, const wxRect rec,
const wxRect trackRect);
void DrawScrubSpeed(wxDC &dc);
virtual void DrawZooming(wxDC* dc, const wxRect clip);
virtual void HighlightFocusedTrack (wxDC* dc, const wxRect r);
@@ -750,7 +763,10 @@ protected:
#ifdef USE_MIDI
IsStretching,
#endif
IsZooming
IsZooming,
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
IsMiddleButtonScrubbing,
#endif
};
enum MouseCaptureEnum mMouseCapture;
@@ -766,6 +782,23 @@ protected:
int mMoveUpThreshold;
int mMoveDownThreshold;
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
bool IsScrubbing();
int mScrubToken;
wxLongLong mScrubStartClockTimeMillis;
wxCoord mScrubStartPosition;
double mMaxScrubSpeed;
int mScrubSpeedDisplayCountdown;
#endif
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
bool mSmoothScrollingScrub;
#endif
#ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
int mLogMaxScrubSpeed;
#endif
wxCursor *mArrowCursor;
wxCursor *mPencilCursor;
wxCursor *mSelectCursor;