1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-19 06:07:42 +02:00

Redoing Steve's: Fix play from click position when Quick Play Loop in selection.

Minus the unnecessary change to ControlToolBar.cpp.
This commit is contained in:
Steve Daulton 2015-04-20 03:04:47 +00:00 committed by Paul-Licameli
parent d8cabc14e5
commit cefd21325e
3 changed files with 17 additions and 1 deletions

View File

@ -1767,6 +1767,20 @@ int AudioIO::StartStream(WaveTrackArray playbackTracks,
AILASetStartTime();
#endif
if (options.pStartTime)
{
// Calculate the new time position
mTime = std::max(mT0, std::min(mT1, *options.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;
}
#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
delete mScrubQueue;
if (scrubbing)

View File

@ -84,6 +84,7 @@ struct AudioIOStartStreamOptions
, playLooped(false)
, cutPreviewGapStart(0.0)
, cutPreviewGapLen(0.0)
, pStartTime(NULL)
#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
, scrubDelay(0.0)
, maxScrubSpeed(1.0)
@ -97,6 +98,7 @@ struct AudioIOStartStreamOptions
bool playLooped;
double cutPreviewGapStart;
double cutPreviewGapLen;
double * pStartTime;
#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
// Positive value indicates that scrubbing will happen

View File

@ -2043,7 +2043,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
AudioIOStartStreamOptions options(mProject->GetDefaultPlayOptions());
options.playLooped = (loopEnabled && evt.ShiftDown());
// options.pStartTime = &mPlayRegionStart;
options.pStartTime = &mPlayRegionStart;
ctb->PlayPlayRegion((SelectedRegion(start, end)),
options,
evt.ControlDown(),