mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 08:39:46 +02:00
Scrub options don't need starting time
This commit is contained in:
parent
bd88a0e481
commit
ba52753ff7
@ -524,11 +524,10 @@ constexpr size_t TimeQueueGrainSize = 2000;
|
||||
|
||||
struct AudioIO::ScrubState
|
||||
{
|
||||
ScrubState(double t0, wxLongLong startClockMillis,
|
||||
ScrubState(double t0,
|
||||
double rate,
|
||||
const ScrubbingOptions &options)
|
||||
: mRate(rate)
|
||||
, mLastScrubTimeMillis(startClockMillis)
|
||||
, mStartTime( t0 )
|
||||
{
|
||||
const double t1 = options.bySpeed ? 1.0 : t0;
|
||||
@ -800,7 +799,7 @@ private:
|
||||
std::atomic<bool> mStopped { false };
|
||||
Data mData;
|
||||
const double mRate;
|
||||
wxLongLong mLastScrubTimeMillis;
|
||||
wxLongLong mLastScrubTimeMillis{ ::wxGetLocalTimeMillis() };
|
||||
struct Message {
|
||||
double end;
|
||||
ScrubbingOptions options;
|
||||
@ -1958,7 +1957,6 @@ int AudioIO::StartStream(const TransportTracks &tracks,
|
||||
mScrubState =
|
||||
std::make_unique<ScrubState>(
|
||||
mPlaybackSchedule.mT0,
|
||||
scrubOptions.startClockTimeMillis,
|
||||
mRate,
|
||||
scrubOptions);
|
||||
mScrubDuration = 0;
|
||||
|
@ -297,7 +297,6 @@ void Scrubber::MarkScrubStart(
|
||||
|
||||
mScrubStartPosition = xx;
|
||||
ctb->UpdateStatusBar(mProject);
|
||||
mOptions.startClockTimeMillis = ::wxGetLocalTimeMillis();
|
||||
mCancelled = false;
|
||||
}
|
||||
|
||||
@ -424,7 +423,7 @@ bool Scrubber::MaybeStartScrubbing(wxCoord xx)
|
||||
}
|
||||
else
|
||||
// Wait to test again
|
||||
mOptions.startClockTimeMillis = ::wxGetLocalTimeMillis();
|
||||
;
|
||||
|
||||
if (IsScrubbing()) {
|
||||
mLastScrubPosition = xx;
|
||||
@ -462,7 +461,6 @@ bool Scrubber::StartSpeedPlay(double speed, double time0, double time1)
|
||||
AudioIOStartStreamOptions options(mProject->GetSpeedPlayOptions());
|
||||
options.pScrubbingOptions = &mOptions;
|
||||
options.timeTrack = NULL;
|
||||
mOptions.startClockTimeMillis = ::wxGetLocalTimeMillis();
|
||||
mOptions.delay = (ScrubPollInterval_ms * 0.9 / 1000.0);
|
||||
mOptions.minSpeed = speed -0.01;
|
||||
mOptions.maxSpeed = speed +0.01;
|
||||
|
@ -58,10 +58,6 @@ struct ScrubbingOptions {
|
||||
// this is the minimum amount of playback allowed at the maximum speed:
|
||||
double minStutterTime {};
|
||||
|
||||
// Scrubbing needs the time of start of the mouse movement that began
|
||||
// the scrub:
|
||||
wxLongLong startClockTimeMillis { -1 };
|
||||
|
||||
static double MaxAllowedScrubSpeed()
|
||||
{ return 32.0; } // Is five octaves enough for your amusement?
|
||||
static double MinAllowedScrubSpeed()
|
||||
|
Loading…
x
Reference in New Issue
Block a user