1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 06:01:13 +02:00

Alert user to drop-outs during recording...

1) When the program detects this, insert zeroes into the recording to keep the
other good parts synchronized.

2) When recording stops, a message box alerts the user, and a label track is
added showing the lost parts, labelled with consecutive numbers.

3) A menu item visible in alpha builds only is added to Tools, to simulate
recording errors at random times and test the reporting feature.
This commit is contained in:
Paul Licameli
2018-01-15 14:48:39 -05:00
parent 4ef8da8f16
commit 9777d3e880
8 changed files with 121 additions and 10 deletions

View File

@@ -75,6 +75,27 @@ size_t RingBuffer::Put(samplePtr buffer, sampleFormat format,
return copied;
}
size_t RingBuffer::Clear(sampleFormat format, size_t samplesToClear)
{
samplesToClear = std::min( samplesToClear, AvailForPut() );
size_t cleared = 0;
auto pos = mEnd;
while(samplesToClear) {
auto block = std::min( samplesToClear, mBufferSize - pos );
ClearSamples(mBuffer.ptr(), format, pos, block);
pos = (pos + block) % mBufferSize;
samplesToClear -= block;
cleared += block;
}
mEnd = pos;
return cleared;
}
//
// For the reader only:
//