1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-31 08:58:43 +01:00

Allow for preRoll in start-stream options

This commit is contained in:
Paul Licameli
2018-05-29 09:46:22 -04:00
parent 20f3f76e2f
commit 35c60ac96d
2 changed files with 16 additions and 14 deletions

View File

@@ -123,6 +123,7 @@ struct AudioIOStartStreamOptions
, cutPreviewGapStart(0.0)
, cutPreviewGapLen(0.0)
, pStartTime(NULL)
, preRoll(0.0)
{}
TimeTrack *timeTrack;
@@ -132,6 +133,7 @@ struct AudioIOStartStreamOptions
double cutPreviewGapStart;
double cutPreviewGapLen;
double * pStartTime;
double preRoll;
#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
// Non-null value indicates that scrubbing will happen
@@ -823,7 +825,8 @@ public:
private:
struct RecordingSchedule {
double mLatencyCorrection{};
double mPreRoll{};
double mLatencyCorrection{}; // negative value usually
double mDuration{};
// These are initialized by the main thread, then updated
@@ -831,6 +834,7 @@ private:
double mPosition{};
bool mLatencyCorrected{};
double TotalCorrection() const { return mLatencyCorrection - mPreRoll; }
double ToConsume() const;
double ToDiscard() const;
} mRecordingSchedule{};