diff --git a/src/Experimental.h b/src/Experimental.h index d69528842..d5f93f9df 100644 --- a/src/Experimental.h +++ b/src/Experimental.h @@ -173,7 +173,6 @@ // The following enable parts of the scrubbing user interface. #define EXPERIMENTAL_SCRUBBING_BASIC #ifdef EXPERIMENTAL_SCRUBBING_BASIC - #define EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL #define EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL #endif #endif diff --git a/src/Project.cpp b/src/Project.cpp index 02e85036c..487378388 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -5364,7 +5364,6 @@ void AudacityProject::PlaybackScroller::OnTimer(wxCommandEvent &event) // Let other listeners get the notification event.Skip(); -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL if (mActive && mProject->IsAudioActive()) { // Pan the view, so that we center the play indicator. @@ -5382,5 +5381,4 @@ void AudacityProject::PlaybackScroller::OnTimer(wxCommandEvent &event) viewInfo.h = std::max(0.0, viewInfo.h); trackPanel->Refresh(false); } -#endif } diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index f78c09c22..ce36069d1 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -5472,12 +5472,9 @@ void TrackPanel::HandleWheelRotation(wxMouseEvent & event) (event.m_wheelDelta > 0 ? (double)event.m_wheelDelta : 120.0); if (event.ShiftDown() -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL // Don't pan during smooth scrolling. That would conflict with keeping // the play indicator centered. - && !GetProject()->GetScrubber().IsScrollScrubbing() -#endif - ) + && !GetProject()->GetScrubber().IsScrollScrubbing()) { // MM: Scroll left/right when used with Shift key down mListener->TP_ScrollWindow( @@ -5506,15 +5503,12 @@ void TrackPanel::HandleWheelRotation(wxMouseEvent & event) // Time corresponding to mouse position wxCoord xx; double center_h; -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL if (GetProject()->GetScrubber().IsScrollScrubbing()) { // Expand or contract about the center, ignoring mouse position center_h = mViewInfo->h + (GetScreenEndTime() - mViewInfo->h) / 2.0; xx = mViewInfo->TimeToPosition(center_h, trackLeftEdge); } - else -#endif - { + else { xx = event.m_x; center_h = mViewInfo->PositionToTime(xx, trackLeftEdge); } diff --git a/src/tracks/ui/Scrubbing.cpp b/src/tracks/ui/Scrubbing.cpp index a0ba72711..19306230f 100644 --- a/src/tracks/ui/Scrubbing.cpp +++ b/src/tracks/ui/Scrubbing.cpp @@ -188,11 +188,7 @@ namespace { void Scrubber::MarkScrubStart( // Assume xx is relative to the left edge of TrackPanel! - wxCoord xx -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL - , bool smoothScrolling -#endif - , bool alwaysSeeking + wxCoord xx, bool smoothScrolling, bool alwaysSeeking ) { UncheckAllMenuItems(); @@ -200,9 +196,7 @@ void Scrubber::MarkScrubStart( // Don't actually start scrubbing, but collect some information // needed for the decision to start scrubbing later when handling // drag events. -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL mSmoothScrollingScrub = smoothScrolling; -#endif mAlwaysSeeking = alwaysSeeking; ControlToolBar * const ctb = mProject->GetControlToolBar(); @@ -350,15 +344,13 @@ void Scrubber::ContinueScrubbing() // Cause OnTimer() to suppress the speed display mScrubSpeedDisplayCountdown = 1; -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL if (mSmoothScrollingScrub) { const double speed = FindScrubSpeed(seek, time); result = gAudioIO->EnqueueScrubBySignedSpeed(speed, mMaxScrubSpeed, seek); } else -#endif result = gAudioIO->EnqueueScrubByPosition - (time, seek ? 1.0 : mMaxScrubSpeed, seek); + (time, seek ? 1.0 : mMaxScrubSpeed, seek); } if (result) @@ -366,12 +358,9 @@ void Scrubber::ContinueScrubbing() // else, if seek requested, try again at a later time when we might // enqueue a long enough stutter -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL if (mSmoothScrollingScrub) ; - else -#endif - { + else { if (mScrubSpeedDisplayCountdown > 0) --mScrubSpeedDisplayCountdown; } @@ -404,9 +393,7 @@ bool Scrubber::IsScrubbing() const else { const_cast(*this).mScrubToken = -1; const_cast(*this).mScrubStartPosition = -1; -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL const_cast(*this).mSmoothScrollingScrub = false; -#endif return false; } } @@ -417,10 +404,8 @@ bool Scrubber::ShouldDrawScrubSpeed() mScrubHasFocus && ( // Draw for (non-scroll) scrub, sometimes, but never for seek (!PollIsSeeking() && mScrubSpeedDisplayCountdown > 0) -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL // Draw always for scroll-scrub and for scroll-seek || mSmoothScrollingScrub -#endif ); } @@ -442,9 +427,7 @@ void Scrubber::HandleScrollWheel(int steps) newSpeed <= AudioIO::GetMaxScrubSpeed()) { mLogMaxScrubSpeed = newLogMaxScrubSpeed; mMaxScrubSpeed = newSpeed; -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL if (!mSmoothScrollingScrub) -#endif // Show the speed for one second mScrubSpeedDisplayCountdown = kOneSecondCountdown + 1; } @@ -539,11 +522,9 @@ void ScrubbingOverlay::Draw(OverlayPanel &, wxDC &dc) // (b) Error alerts // So they were changed to 'orange' and 'lime'. static const wxColour clrNoScroll(215, 162, 0), clrScroll(0, 204, 153); -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL if (scrubber.IsScrollScrubbing()) dc.SetTextForeground(clrScroll); else -#endif dc.SetTextForeground(clrNoScroll); dc.DrawText(mLastScrubSpeedText, mLastScrubRect.GetX(), mLastScrubRect.GetY()); @@ -598,23 +579,17 @@ void ScrubbingOverlay::OnTimer(wxCommandEvent &event) // Find the text const double maxScrubSpeed = GetScrubber().GetMaxScrubSpeed(); const double speed = -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL scrubber.IsScrollScrubbing() ? scrubber.FindScrubSpeed (seeking, mProject->GetViewInfo().PositionToTime(position.x, trackPanel->GetLeftOffset())) - : -#endif - maxScrubSpeed; + : maxScrubSpeed; const wxChar *format = -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL scrubber.IsScrollScrubbing() ? seeking ? wxT("%+.2fX") : wxT("%+.2f") - : -#endif - wxT("%.2f"); + : wxT("%.2f"); mNextScrubSpeedText = wxString::Format(format, speed); diff --git a/src/tracks/ui/Scrubbing.h b/src/tracks/ui/Scrubbing.h index b813ca7e4..c8d405758 100644 --- a/src/tracks/ui/Scrubbing.h +++ b/src/tracks/ui/Scrubbing.h @@ -29,11 +29,8 @@ public: // Assume xx is relative to the left edge of TrackPanel! void MarkScrubStart( - wxCoord xx -#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL - , bool smoothScrolling -#endif - , bool alwaysSeeking // if false, can switch seeking or scrubbing + wxCoord xx, bool smoothScrolling, + bool alwaysSeeking // if false, can switch seeking or scrubbing // by mouse button state );