From d2749068f145519a6b71dd91ca72961da8f7b52d Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 15 Jan 2018 18:48:44 -0500 Subject: [PATCH] Allow reporting of drop-outs to be turned off by Recording prefs... ... Just in case it turns out to make some false positives. --- src/AudioIO.cpp | 4 +++- src/AudioIO.h | 1 + src/prefs/RecordingPrefs.cpp | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index 479bd234f..5e4257919 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -1867,6 +1867,7 @@ int AudioIO::StartStream(const WaveTrackConstArray &playbackTracks, { mLostSamples = 0; mLostCaptureIntervals.clear(); + mDetectDropouts = gPrefs->Read(wxT("/AudioIO/DetectDropouts"), true); auto cleanup = finally ( [this] { ClearRecordingException(); } ); if( IsBusy() ) @@ -5171,7 +5172,8 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer, // the other thread, executing FillBuffers, isn't consuming fast // enough from mCaptureBuffers; maybe it's CPU-bound, or maybe the // storage device it writes is too slow - if (inputError || len < framesPerBuffer) { + if (gAudioIO->mDetectDropouts && + (inputError || len < framesPerBuffer) ) { // Assume that any good partial buffer should be written leftmost // and zeroes will be padded after; label the zeroes. auto start = gAudioIO->mTime; diff --git a/src/AudioIO.h b/src/AudioIO.h index b1743a9ec..1464a89d4 100644 --- a/src/AudioIO.h +++ b/src/AudioIO.h @@ -798,6 +798,7 @@ private: { if (mRecordingException) wxAtomicDec( mRecordingException ); } std::vector< std::pair > mLostCaptureIntervals; + bool mDetectDropouts{ true }; public: const std::vector< std::pair > &LostCaptureIntervals() diff --git a/src/prefs/RecordingPrefs.cpp b/src/prefs/RecordingPrefs.cpp index 6b1df5669..18384795b 100644 --- a/src/prefs/RecordingPrefs.cpp +++ b/src/prefs/RecordingPrefs.cpp @@ -166,6 +166,9 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) S.TieCheckBox(_("Always record on a new track"), wxT("/GUI/PreferNewTrackRecord"), false); + S.TieCheckBox(_("Detect dropouts"), + wxT("/AudioIO/DetectDropouts"), + true); } S.EndStatic();