mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Support backwards play, a requirement for scrubbing
Uncomment the line at the top of ControlToolBar::PlayPlayRegion to play everything backwards and test it It even works correctly with a time track
This commit is contained in:
@@ -92,6 +92,24 @@ void ClearSamples(samplePtr src, sampleFormat format,
|
||||
memset(src + start*size, 0, len*size);
|
||||
}
|
||||
|
||||
void ReverseSamples(samplePtr src, sampleFormat format,
|
||||
int start, int len)
|
||||
{
|
||||
int size = SAMPLE_SIZE(format);
|
||||
samplePtr first = src + start * size;
|
||||
samplePtr last = src + (start + len - 1) * size;
|
||||
enum { fixedSize = SAMPLE_SIZE(floatSample) };
|
||||
wxASSERT(size <= fixedSize);
|
||||
char temp[fixedSize];
|
||||
while (first < last) {
|
||||
memcpy(temp, first, size);
|
||||
memcpy(first, last, size);
|
||||
memcpy(last, temp, size);
|
||||
first += size;
|
||||
last -= size;
|
||||
}
|
||||
}
|
||||
|
||||
void CopySamples(samplePtr src, sampleFormat srcFormat,
|
||||
samplePtr dst, sampleFormat dstFormat,
|
||||
unsigned int len,
|
||||
|
||||
Reference in New Issue
Block a user