From 21fd4ab3748682dca0c6ac5306544b24b5b278a9 Mon Sep 17 00:00:00 2001 From: Paul-Licameli Date: Tue, 14 Apr 2015 19:10:33 -0400 Subject: [PATCH] Remove the unsuccessful scrubbing experiment of 2.0.6. --- src/AudioIO.cpp | 16 +----- src/Experimental.h | 3 -- src/TrackPanel.cpp | 123 --------------------------------------------- src/TrackPanel.h | 9 ---- 4 files changed, 1 insertion(+), 150 deletions(-) diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index 2f37eb14a..67116ccf7 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -1154,7 +1154,7 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, bool playLooped /* = false */, double cutPreviewGapStart /* = 0.0 */, double cutPreviewGapLen, /* = 0.0 */ - const double *pStartTime /* = 0 */) + const double * /* pStartTime */ /* = 0 */) { if( IsBusy() ) return 0; @@ -1411,20 +1411,6 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks, AILASetStartTime(); #endif - if (pStartTime) - { - // Calculate the new time position - mTime = std::max(mT0, std::min(mT1, *pStartTime)); - // Reset mixer positions for all playback tracks - unsigned numMixers = mPlaybackTracks.GetCount(); - for (unsigned ii = 0; ii < numMixers; ++ii) - mPlaybackMixers[ii]->Reposition(mTime); - if(mTimeTrack) - mWarpedTime = mTimeTrack->ComputeWarpedLength(mT0, mTime); - else - mWarpedTime = mTime - mT0; - } - // We signal the audio thread to call FillBuffers, to prime the RingBuffers // so that they will have data in them when the stream starts. Having the // audio thread call FillBuffers here makes the code more predictable, since diff --git a/src/Experimental.h b/src/Experimental.h index b86b7682d..19c5e3644 100644 --- a/src/Experimental.h +++ b/src/Experimental.h @@ -107,9 +107,6 @@ // Paul Licameli (PRL) 5 Oct 2014 #define EXPERIMENTAL_SPECTRAL_EDITING -// Paul Licameli (PRL) 29 Nov 2014 -// #define EXPERIMENTAL_SCRUBBING - // Paul Licameli (PRL) 29 Nov 2014 // #define EXPERIMENTAL_IMPROVED_SEEKING diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 0d7743c9f..cdc98ba93 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -585,12 +585,6 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id, mSelStartValid = false; mSelStart = 0; -#ifdef EXPERIMENTAL_SCRUBBING - mScrubbing = false; - mLastScrubTime = 0; - mLastScrubPosition = 0; -#endif - mInitialTrackSelection = new std::vector; } @@ -1004,32 +998,6 @@ void TrackPanel::OnTimer() (p->mLastPlayMode == loopedPlay)); } -#ifdef EXPERIMENTAL_SCRUBBING - if (mScrubbing - && - gAudioIO->IsStreamActive(GetProject()->GetAudioIOToken())) - { - if (gAudioIO->GetLastPlaybackTime() < mLastScrubTime) { - // Allow some audio catch up - } - else { - wxMouseState state(::wxGetMouseState()); - wxCoord xx = state.GetX(); - ScreenToClient(&xx, NULL); - double leadPosition = PositionToTime(xx, GetLeftOffset()); - if (mLastScrubPosition != leadPosition) { - wxLongLong clockTime = ::wxGetLocalTimeMillis(); - double lagPosition = gAudioIO->GetStreamTime(); - - gAudioIO->SeekStream(leadPosition - lagPosition); - - mLastScrubPosition = leadPosition; - mLastScrubTime = clockTime; - } - } - } -#endif - // Check whether we were playing or recording, but the stream has stopped. if (p->GetAudioIOToken()>0 && !gAudioIO->IsStreamActive(p->GetAudioIOToken())) @@ -2054,52 +2022,6 @@ void TrackPanel::HandleSelect(wxMouseEvent & event) } } else if (event.LeftUp() || event.RightUp()) { -#ifdef EXPERIMENTAL_SCRUBBING - if(mScrubbing) { - if (gAudioIO->IsBusy()) { - AudacityProject *p = GetActiveProject(); - if (p) { - ControlToolBar * ctb = p->GetControlToolBar(); - ctb->StopPlaying(); - } - } - - if (mAdjustSelectionEdges) { - if (event.ShiftDown()) { - // Adjust time selection as if shift-left click at end - const double selend = PositionToTime(event.m_x, GetLeftOffset()); - SelectionBoundary boundary = ChooseTimeBoundary(selend, false); - switch (boundary) - { - case SBLeft: - mViewInfo->selectedRegion.setT0(selend); - break; - case SBRight: - mViewInfo->selectedRegion.setT1(selend); - break; - default: - wxASSERT(false); - } - UpdateSelectionDisplay(); - } - else { - // Adjust time selection as if left click - StartSelection(event.m_x, r.x); - DisplaySelection(); - } - } - - mScrubbing = false; - } - else if (event.CmdDown()) { - // A control-click will set just the indicator to the clicked spot, - // and turn playback on -- but delayed until button up, - // and only if no intervening drag - StartOrJumpPlayback(event); - } - // Don't return yet -#endif - if (mSnapManager) { delete mSnapManager; mSnapManager = NULL; @@ -2214,31 +2136,6 @@ void TrackPanel::StartOrJumpPlayback(wxMouseEvent &event) } -#ifdef EXPERIMENTAL_SCRUBBING -void TrackPanel::StartScrubbing(double position) -{ - AudacityProject *p = GetActiveProject(); - if (p && - // Should I make a bigger tolerance than zero? - mLastScrubPosition != position) { - ControlToolBar * ctb = p->GetControlToolBar(); - bool busy = gAudioIO->IsBusy(); - double maxTime = p->GetTracks()->GetEndTime(); - - if (busy) - ctb->StopPlaying(); - - ctb->PlayPlayRegion(0, maxTime, false, false, - 0, - &position); - mScrubbing = true; - mLastScrubPosition = position; - mLastScrubTime = ::wxGetLocalTimeMillis(); - } -} -#endif - - /// This method gets called when we're handling selection /// and the mouse was just clicked. void TrackPanel::SelectionHandleClick(wxMouseEvent & event, @@ -2297,11 +2194,6 @@ void TrackPanel::SelectionHandleClick(wxMouseEvent & event, if (event.ShiftDown() -#ifdef EXPERIMENTAL_SCRUBBING - // Ctrl prevails over Shift with scrubbing enabled - && !event.CmdDown() -#endif - #ifdef USE_MIDI && !stretch #endif @@ -2369,17 +2261,10 @@ void TrackPanel::SelectionHandleClick(wxMouseEvent & event, && !stretch #endif ) { -#ifdef EXPERIMENTAL_SCRUBBING - // With scrubbing enabled, playback happens on button up, not down, - // and only if we do not start a scrub in the interim. - mScrubbing = false; - mLastScrubPosition = PositionToTime(event.m_x, GetLeftOffset()); -#else StartOrJumpPlayback(event); // Not starting a drag SetCapturedTrack(NULL, IsUncaptured); -#endif return; } @@ -3130,15 +3015,7 @@ void TrackPanel::SelectionHandleDrag(wxMouseEvent & event, Track *clickedTrack) return; if (event.CmdDown()) { -#ifdef EXPERIMENTAL_SCRUBBING - if (!mScrubbing) { - double position = PositionToTime(event.m_x, GetLeftOffset()); - StartScrubbing(position); - } - else -#else // Ctrl-drag has no meaning, fuhggeddaboudit -#endif return; } diff --git a/src/TrackPanel.h b/src/TrackPanel.h index a14f7d1c3..e21c38e0a 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -313,9 +313,6 @@ 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 - void StartScrubbing(double position); -#endif virtual void SelectionHandleClick(wxMouseEvent &event, Track* pTrack, wxRect r); virtual void StartSelection (int mouseXCoordinate, int trackLeftEdge); @@ -764,12 +761,6 @@ protected: int mMoveUpThreshold; int mMoveDownThreshold; -#ifdef EXPERIMENTAL_SCRUBBING - bool mScrubbing; - wxLongLong mLastScrubTime; // milliseconds - double mLastScrubPosition; -#endif - wxCursor *mArrowCursor; wxCursor *mPencilCursor; wxCursor *mSelectCursor;