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:
@@ -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:
|
||||
//
|
||||
|
Reference in New Issue
Block a user