mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-04 14:39:08 +02:00
Fix Windows build differently
This commit is contained in:
parent
781de82d02
commit
b5e410d987
@ -448,7 +448,7 @@ sampleCount Mixer::MixVariableRates(int *channelFlags, WaveTrackCache &cache,
|
|||||||
memmove(queue, &queue[*queueStart], (*queueLen) * sampleSize);
|
memmove(queue, &queue[*queueStart], (*queueLen) * sampleSize);
|
||||||
*queueStart = 0;
|
*queueStart = 0;
|
||||||
|
|
||||||
const auto getLen = limitSampleBufferSize(
|
auto getLen = limitSampleBufferSize(
|
||||||
mQueueMaxLen - *queueLen,
|
mQueueMaxLen - *queueLen,
|
||||||
backwards ? *pos - endPos : endPos - *pos
|
backwards ? *pos - endPos : endPos - *pos
|
||||||
);
|
);
|
||||||
@ -476,7 +476,7 @@ sampleCount Mixer::MixVariableRates(int *channelFlags, WaveTrackCache &cache,
|
|||||||
*pos += getLen;
|
*pos += getLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto i = 0; i < getLen; i++) {
|
for (decltype(getLen) i = 0; i < getLen; i++) {
|
||||||
queue[(*queueLen) + i] *= mEnvValues[i];
|
queue[(*queueLen) + i] *= mEnvValues[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -848,12 +848,12 @@ double VoiceKey::TestEnergy (WaveTrack & t, sampleCount start, sampleCount len)
|
|||||||
while(len > 0)
|
while(len > 0)
|
||||||
{
|
{
|
||||||
//Figure out how much to grab
|
//Figure out how much to grab
|
||||||
const auto block = limitSampleBufferSize ( t.GetBestBlockSize(s), len );
|
auto block = limitSampleBufferSize ( t.GetBestBlockSize(s), len );
|
||||||
|
|
||||||
t.Get((samplePtr)buffer,floatSample, s,block); //grab the block;
|
t.Get((samplePtr)buffer,floatSample, s,block); //grab the block;
|
||||||
|
|
||||||
//Now, go through the block and calculate energy
|
//Now, go through the block and calculate energy
|
||||||
for(auto i = 0; i< block; i++)
|
for(decltype(block) i = 0; i< block; i++)
|
||||||
{
|
{
|
||||||
sum += buffer[i]*buffer[i];
|
sum += buffer[i]*buffer[i];
|
||||||
}
|
}
|
||||||
@ -891,7 +891,7 @@ double VoiceKey::TestSignChanges(WaveTrack & t, sampleCount start, sampleCount l
|
|||||||
|
|
||||||
while(len > 0) {
|
while(len > 0) {
|
||||||
//Figure out how much to grab
|
//Figure out how much to grab
|
||||||
const auto block = limitSampleBufferSize ( t.GetBestBlockSize(s), len );
|
auto block = limitSampleBufferSize ( t.GetBestBlockSize(s), len );
|
||||||
|
|
||||||
t.Get((samplePtr)buffer,floatSample, s,block); //grab the block;
|
t.Get((samplePtr)buffer,floatSample, s,block); //grab the block;
|
||||||
|
|
||||||
@ -903,7 +903,7 @@ double VoiceKey::TestSignChanges(WaveTrack & t, sampleCount start, sampleCount l
|
|||||||
|
|
||||||
//Now, go through the block and calculate zero crossings
|
//Now, go through the block and calculate zero crossings
|
||||||
|
|
||||||
for(auto i = 0; i< block; i++)
|
for(decltype(block) i = 0; i< block; i++)
|
||||||
{
|
{
|
||||||
if( sgn(buffer[i]) != currentsign)
|
if( sgn(buffer[i]) != currentsign)
|
||||||
{
|
{
|
||||||
@ -948,7 +948,7 @@ double VoiceKey::TestDirectionChanges(WaveTrack & t, sampleCount start, sampleCo
|
|||||||
|
|
||||||
while(len > 0) {
|
while(len > 0) {
|
||||||
//Figure out how much to grab
|
//Figure out how much to grab
|
||||||
const auto block = limitSampleBufferSize ( t.GetBestBlockSize(s), len );
|
auto block = limitSampleBufferSize ( t.GetBestBlockSize(s), len );
|
||||||
|
|
||||||
t.Get((samplePtr)buffer,floatSample, s,block); //grab the block;
|
t.Get((samplePtr)buffer,floatSample, s,block); //grab the block;
|
||||||
|
|
||||||
@ -960,7 +960,7 @@ double VoiceKey::TestDirectionChanges(WaveTrack & t, sampleCount start, sampleCo
|
|||||||
//Now, go through the block and calculate zero crossings
|
//Now, go through the block and calculate zero crossings
|
||||||
|
|
||||||
|
|
||||||
for(auto i = 0; i< block; i++){
|
for(decltype(block) i = 0; i< block; i++){
|
||||||
|
|
||||||
if( sgn(buffer[i]-lastval) != lastdirection) {
|
if( sgn(buffer[i]-lastval) != lastdirection) {
|
||||||
directionchanges++;
|
directionchanges++;
|
||||||
|
@ -1459,11 +1459,11 @@ bool WaveTrack::Disjoin(double t0, double t1)
|
|||||||
sampleCount len = ( end - start );
|
sampleCount len = ( end - start );
|
||||||
for( sampleCount done = 0; done < len; done += maxAtOnce )
|
for( sampleCount done = 0; done < len; done += maxAtOnce )
|
||||||
{
|
{
|
||||||
const auto numSamples = limitSampleBufferSize( maxAtOnce, len - done );
|
auto numSamples = limitSampleBufferSize( maxAtOnce, len - done );
|
||||||
|
|
||||||
clip->GetSamples( ( samplePtr )buffer, floatSample, start + done,
|
clip->GetSamples( ( samplePtr )buffer, floatSample, start + done,
|
||||||
numSamples );
|
numSamples );
|
||||||
for( auto i = 0; i < numSamples; i++ )
|
for( decltype(numSamples) i = 0; i < numSamples; i++ )
|
||||||
{
|
{
|
||||||
sampleCount curSamplePos = start + done + i;
|
sampleCount curSamplePos = start + done + i;
|
||||||
|
|
||||||
|
@ -110,13 +110,13 @@ bool CompareAudioCommand::Apply(CommandExecutionContext context)
|
|||||||
while (position < s1)
|
while (position < s1)
|
||||||
{
|
{
|
||||||
// Get a block of data into the buffers
|
// Get a block of data into the buffers
|
||||||
const auto block = limitSampleBufferSize(
|
auto block = limitSampleBufferSize(
|
||||||
mTrack0->GetBestBlockSize(position), s1 - position
|
mTrack0->GetBestBlockSize(position), s1 - position
|
||||||
);
|
);
|
||||||
mTrack0->Get((samplePtr)buff0, floatSample, position, block);
|
mTrack0->Get((samplePtr)buff0, floatSample, position, block);
|
||||||
mTrack1->Get((samplePtr)buff1, floatSample, position, block);
|
mTrack1->Get((samplePtr)buff1, floatSample, position, block);
|
||||||
|
|
||||||
for (auto buffPos = 0; buffPos < block; ++buffPos)
|
for (decltype(block) buffPos = 0; buffPos < block; ++buffPos)
|
||||||
{
|
{
|
||||||
if (CompareSample(buff0[buffPos], buff1[buffPos]) > errorThreshold)
|
if (CompareSample(buff0[buffPos], buff1[buffPos]) > errorThreshold)
|
||||||
{
|
{
|
||||||
|
@ -229,13 +229,13 @@ bool EffectReverse::ProcessOneClip(int count, WaveTrack *track,
|
|||||||
sampleCount originalLen = (sampleCount)originalEnd-originalStart;
|
sampleCount originalLen = (sampleCount)originalEnd-originalStart;
|
||||||
|
|
||||||
while (len > 1) {
|
while (len > 1) {
|
||||||
const auto block =
|
auto block =
|
||||||
limitSampleBufferSize( track->GetBestBlockSize(first), len / 2 );
|
limitSampleBufferSize( track->GetBestBlockSize(first), len / 2 );
|
||||||
second = first + (len - block);
|
second = first + (len - block);
|
||||||
|
|
||||||
track->Get((samplePtr)buffer1, floatSample, first, block);
|
track->Get((samplePtr)buffer1, floatSample, first, block);
|
||||||
track->Get((samplePtr)buffer2, floatSample, second, block);
|
track->Get((samplePtr)buffer2, floatSample, second, block);
|
||||||
for (auto i = 0; i < block; i++) {
|
for (decltype(block) i = 0; i < block; i++) {
|
||||||
tmp = buffer1[i];
|
tmp = buffer1[i];
|
||||||
buffer1[i] = buffer2[block-i-1];
|
buffer1[i] = buffer2[block-i-1];
|
||||||
buffer2[block-i-1] = tmp;
|
buffer2[block-i-1] = tmp;
|
||||||
|
@ -98,7 +98,7 @@ long resampleCB(void *cb_data, SBSMSFrame *data)
|
|||||||
{
|
{
|
||||||
ResampleBuf *r = (ResampleBuf*) cb_data;
|
ResampleBuf *r = (ResampleBuf*) cb_data;
|
||||||
|
|
||||||
const auto blockSize = limitSampleBufferSize(
|
auto blockSize = limitSampleBufferSize(
|
||||||
r->leftTrack->GetBestBlockSize(r->offset),
|
r->leftTrack->GetBestBlockSize(r->offset),
|
||||||
r->end - r->offset
|
r->end - r->offset
|
||||||
);
|
);
|
||||||
@ -108,7 +108,7 @@ long resampleCB(void *cb_data, SBSMSFrame *data)
|
|||||||
r->rightTrack->Get((samplePtr)(r->rightBuffer), floatSample, r->offset, blockSize);
|
r->rightTrack->Get((samplePtr)(r->rightBuffer), floatSample, r->offset, blockSize);
|
||||||
|
|
||||||
// convert to sbsms audio format
|
// convert to sbsms audio format
|
||||||
for(auto i=0; i<blockSize; i++) {
|
for(decltype(blockSize) i=0; i<blockSize; i++) {
|
||||||
r->buf[i][0] = r->leftBuffer[i];
|
r->buf[i][0] = r->leftBuffer[i];
|
||||||
r->buf[i][1] = r->rightBuffer[i];
|
r->buf[i][1] = r->rightBuffer[i];
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,7 @@ bool EffectSoundTouch::ProcessStereo(WaveTrack* leftTrack, WaveTrack* rightTrack
|
|||||||
while (sourceSampleCount < end) {
|
while (sourceSampleCount < end) {
|
||||||
//Get a block of samples (smaller than the size of the buffer)
|
//Get a block of samples (smaller than the size of the buffer)
|
||||||
//Adjust the block size if it is the final block in the track
|
//Adjust the block size if it is the final block in the track
|
||||||
const auto blockSize = limitSampleBufferSize(
|
auto blockSize = limitSampleBufferSize(
|
||||||
leftTrack->GetBestBlockSize(sourceSampleCount),
|
leftTrack->GetBestBlockSize(sourceSampleCount),
|
||||||
end - sourceSampleCount
|
end - sourceSampleCount
|
||||||
);
|
);
|
||||||
@ -291,7 +291,7 @@ bool EffectSoundTouch::ProcessStereo(WaveTrack* leftTrack, WaveTrack* rightTrack
|
|||||||
rightTrack->Get((samplePtr)(rightBuffer), floatSample, sourceSampleCount, blockSize);
|
rightTrack->Get((samplePtr)(rightBuffer), floatSample, sourceSampleCount, blockSize);
|
||||||
|
|
||||||
// Interleave into soundTouchBuffer.
|
// Interleave into soundTouchBuffer.
|
||||||
for (auto index = 0; index < blockSize; index++) {
|
for (decltype(blockSize) index = 0; index < blockSize; index++) {
|
||||||
soundTouchBuffer[index*2] = leftBuffer[index];
|
soundTouchBuffer[index*2] = leftBuffer[index];
|
||||||
soundTouchBuffer[(index*2)+1] = rightBuffer[index];
|
soundTouchBuffer[(index*2)+1] = rightBuffer[index];
|
||||||
}
|
}
|
||||||
|
@ -144,8 +144,8 @@ bool EffectStereoToMono::ProcessOne(int count)
|
|||||||
while (index < mEnd) {
|
while (index < mEnd) {
|
||||||
bResult &= mLeftTrack->Get((samplePtr)leftBuffer, floatSample, index, idealBlockLen);
|
bResult &= mLeftTrack->Get((samplePtr)leftBuffer, floatSample, index, idealBlockLen);
|
||||||
bResult &= mRightTrack->Get((samplePtr)rightBuffer, floatSample, index, idealBlockLen);
|
bResult &= mRightTrack->Get((samplePtr)rightBuffer, floatSample, index, idealBlockLen);
|
||||||
const auto limit = limitSampleBufferSize( idealBlockLen, mEnd - index );
|
auto limit = limitSampleBufferSize( idealBlockLen, mEnd - index );
|
||||||
for (auto i = 0; i < limit; ++i) {
|
for (decltype(limit) i = 0; i < limit; ++i) {
|
||||||
index++;
|
index++;
|
||||||
curLeftFrame = leftBuffer[i];
|
curLeftFrame = leftBuffer[i];
|
||||||
curRightFrame = rightBuffer[i];
|
curRightFrame = rightBuffer[i];
|
||||||
|
@ -624,13 +624,13 @@ bool EffectTruncSilence::Analyze(RegionList& silenceList,
|
|||||||
// End of optimization
|
// End of optimization
|
||||||
|
|
||||||
// Limit size of current block if we've reached the end
|
// Limit size of current block if we've reached the end
|
||||||
const auto count = limitSampleBufferSize( blockLen, end - *index );
|
auto count = limitSampleBufferSize( blockLen, end - *index );
|
||||||
|
|
||||||
// Fill buffer
|
// Fill buffer
|
||||||
wt->Get((samplePtr)(buffer), floatSample, *index, count);
|
wt->Get((samplePtr)(buffer), floatSample, *index, count);
|
||||||
|
|
||||||
// Look for silenceList in current block
|
// Look for silenceList in current block
|
||||||
for (auto i = 0; i < count; ++i) {
|
for (decltype(count) i = 0; i < count; ++i) {
|
||||||
if (inputLength && ((outLength >= previewLen) || (outLength > wt->TimeToLongSamples(*minInputLength)))) {
|
if (inputLength && ((outLength >= previewLen) || (outLength > wt->TimeToLongSamples(*minInputLength)))) {
|
||||||
*inputLength = wt->LongSamplesToTime(*index + i) - wt->LongSamplesToTime(start);
|
*inputLength = wt->LongSamplesToTime(*index + i) - wt->LongSamplesToTime(start);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user