1
0
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:
Paul-Licameli
2015-04-16 17:35:58 -04:00
parent 2b85d0edb4
commit 5abfd25a34
8 changed files with 256 additions and 109 deletions

View File

@@ -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,