1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-05 14:18:53 +02:00

Fix Windows build differently

This commit is contained in:
Paul Licameli 2016-08-24 12:13:53 -04:00
parent 781de82d02
commit b5e410d987
9 changed files with 22 additions and 22 deletions

View File

@ -448,7 +448,7 @@ sampleCount Mixer::MixVariableRates(int *channelFlags, WaveTrackCache &cache,
memmove(queue, &queue[*queueStart], (*queueLen) * sampleSize);
*queueStart = 0;
const auto getLen = limitSampleBufferSize(
auto getLen = limitSampleBufferSize(
mQueueMaxLen - *queueLen,
backwards ? *pos - endPos : endPos - *pos
);
@ -476,7 +476,7 @@ sampleCount Mixer::MixVariableRates(int *channelFlags, WaveTrackCache &cache,
*pos += getLen;
}
for (auto i = 0; i < getLen; i++) {
for (decltype(getLen) i = 0; i < getLen; i++) {
queue[(*queueLen) + i] *= mEnvValues[i];
}

View File

@ -848,12 +848,12 @@ double VoiceKey::TestEnergy (WaveTrack & t, sampleCount start, sampleCount len)
while(len > 0)
{
//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;
//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];
}
@ -891,7 +891,7 @@ double VoiceKey::TestSignChanges(WaveTrack & t, sampleCount start, sampleCount l
while(len > 0) {
//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;
@ -903,7 +903,7 @@ double VoiceKey::TestSignChanges(WaveTrack & t, sampleCount start, sampleCount l
//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)
{
@ -948,7 +948,7 @@ double VoiceKey::TestDirectionChanges(WaveTrack & t, sampleCount start, sampleCo
while(len > 0) {
//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;
@ -960,7 +960,7 @@ double VoiceKey::TestDirectionChanges(WaveTrack & t, sampleCount start, sampleCo
//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) {
directionchanges++;

View File

@ -1459,11 +1459,11 @@ bool WaveTrack::Disjoin(double t0, double t1)
sampleCount len = ( end - start );
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,
numSamples );
for( auto i = 0; i < numSamples; i++ )
for( decltype(numSamples) i = 0; i < numSamples; i++ )
{
sampleCount curSamplePos = start + done + i;

View File

@ -110,13 +110,13 @@ bool CompareAudioCommand::Apply(CommandExecutionContext context)
while (position < s1)
{
// Get a block of data into the buffers
const auto block = limitSampleBufferSize(
auto block = limitSampleBufferSize(
mTrack0->GetBestBlockSize(position), s1 - position
);
mTrack0->Get((samplePtr)buff0, 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)
{

View File

@ -229,13 +229,13 @@ bool EffectReverse::ProcessOneClip(int count, WaveTrack *track,
sampleCount originalLen = (sampleCount)originalEnd-originalStart;
while (len > 1) {
const auto block =
auto block =
limitSampleBufferSize( track->GetBestBlockSize(first), len / 2 );
second = first + (len - block);
track->Get((samplePtr)buffer1, floatSample, first, 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];
buffer1[i] = buffer2[block-i-1];
buffer2[block-i-1] = tmp;

View File

@ -98,7 +98,7 @@ long resampleCB(void *cb_data, SBSMSFrame *data)
{
ResampleBuf *r = (ResampleBuf*) cb_data;
const auto blockSize = limitSampleBufferSize(
auto blockSize = limitSampleBufferSize(
r->leftTrack->GetBestBlockSize(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);
// 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][1] = r->rightBuffer[i];
}

View File

@ -281,7 +281,7 @@ bool EffectSoundTouch::ProcessStereo(WaveTrack* leftTrack, WaveTrack* rightTrack
while (sourceSampleCount < end) {
//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
const auto blockSize = limitSampleBufferSize(
auto blockSize = limitSampleBufferSize(
leftTrack->GetBestBlockSize(sourceSampleCount),
end - sourceSampleCount
);
@ -291,7 +291,7 @@ bool EffectSoundTouch::ProcessStereo(WaveTrack* leftTrack, WaveTrack* rightTrack
rightTrack->Get((samplePtr)(rightBuffer), floatSample, sourceSampleCount, blockSize);
// 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)+1] = rightBuffer[index];
}

View File

@ -144,8 +144,8 @@ bool EffectStereoToMono::ProcessOne(int count)
while (index < mEnd) {
bResult &= mLeftTrack->Get((samplePtr)leftBuffer, floatSample, index, idealBlockLen);
bResult &= mRightTrack->Get((samplePtr)rightBuffer, floatSample, index, idealBlockLen);
const auto limit = limitSampleBufferSize( idealBlockLen, mEnd - index );
for (auto i = 0; i < limit; ++i) {
auto limit = limitSampleBufferSize( idealBlockLen, mEnd - index );
for (decltype(limit) i = 0; i < limit; ++i) {
index++;
curLeftFrame = leftBuffer[i];
curRightFrame = rightBuffer[i];

View File

@ -624,13 +624,13 @@ bool EffectTruncSilence::Analyze(RegionList& silenceList,
// End of optimization
// 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
wt->Get((samplePtr)(buffer), floatSample, *index, count);
// 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)))) {
*inputLength = wt->LongSamplesToTime(*index + i) - wt->LongSamplesToTime(start);
break;