本文整理汇总了C++中CBuffer::Accumulate方法的典型用法代码示例。如果您正苦于以下问题:C++ CBuffer::Accumulate方法的具体用法?C++ CBuffer::Accumulate怎么用?C++ CBuffer::Accumulate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBuffer
的用法示例。
在下文中一共展示了CBuffer::Accumulate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Process
//.........这里部分代码省略.........
// Don't keep old peaks (if there) when amp is changing
mbKillDecay = true;
mpDSPTools->Mul(pfData, pfMul, iSamples);
/*
// Apply and collect 8 aligned
while (pfData < pfDataStopAlign8) {
// Apply amp and collect meter value
fTest = *pfData++ *= *pfMul++; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //1
fTest = *pfData++ *= *pfMul++; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //2
fTest = *pfData++ *= *pfMul++; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //3
fTest = *pfData++ *= *pfMul++; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //4
fTest = *pfData++ *= *pfMul++; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //5
fTest = *pfData++ *= *pfMul++; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //6
fTest = *pfData++ *= *pfMul++; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //7
fTest = *pfData++ *= *pfMul++; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //8
}
// Apply and collect remainder
while (pfData < pfDataStop) {
// Apply amp and collect meter value
fTest = *pfData++ *= *pfMul++; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //1
}
*/
}
else {
// Out-amp factor is the same for all samples - just multiply
tfloat fOutAmp = pDezipper->GetCurrent();
// Keep old peaks (if not yet read) because amp isn't changing
//fPeak = mafPeakVolumes[iChannel];
if ((fOutAmp < 0.99999) || (fOutAmp > 1.00001)) {
mpDSPTools->Mul(pfData, fOutAmp, iSamples);
/*
// Apply and collect 8 aligned
while (pfData < pfDataStopAlign8) {
// Apply amp and collect meter value
fTest = *pfData++ *= fOutAmp; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //1
fTest = *pfData++ *= fOutAmp; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //2
fTest = *pfData++ *= fOutAmp; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //3
fTest = *pfData++ *= fOutAmp; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //4
fTest = *pfData++ *= fOutAmp; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //5
fTest = *pfData++ *= fOutAmp; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //6
fTest = *pfData++ *= fOutAmp; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //7
fTest = *pfData++ *= fOutAmp; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //8
}
// Apply and collect remainder
while (pfData < pfDataStop) {
// Apply amp and collect meter value
fTest = *pfData++ *= fOutAmp; fTest = fabsf(fTest); if (fTest > fPeak) fPeak = fTest; //1
}
*/
}
else {
/*
// No output amplification - just collect meter values
// Collect alligned to 8
while (pfData < pfDataStopAlign8) {
// Collect meter value
fTest = fabsf(*pfData++); if (fTest > fPeak) fPeak = fTest; //1
fTest = fabsf(*pfData++); if (fTest > fPeak) fPeak = fTest; //2
fTest = fabsf(*pfData++); if (fTest > fPeak) fPeak = fTest; //3
fTest = fabsf(*pfData++); if (fTest > fPeak) fPeak = fTest; //4
fTest = fabsf(*pfData++); if (fTest > fPeak) fPeak = fTest; //5
fTest = fabsf(*pfData++); if (fTest > fPeak) fPeak = fTest; //6
fTest = fabsf(*pfData++); if (fTest > fPeak) fPeak = fTest; //7
fTest = fabsf(*pfData++); if (fTest > fPeak) fPeak = fTest; //8
}
// Collect any remainder
while (pfData < pfDataStop) {
// Collect meter value
fTest = fabsf(*pfData++); if (fTest > fPeak) fPeak = fTest; //1
}
*/
}
}
//mafPeakVolumes[iChannel] = fPeak;
}
tint32 iAUX;
for (iAUX = 0; iAUX < 2; iAUX++) {
if (mpfAUXVolume[iAUX] != 0) {
CBuffer* pBufferAUX = mppAUXes[iAUX]->GetBuffer();
// *pBufferAUX += *mpBuffer;
pBufferAUX->Accumulate(*mpBuffer, mpfAUXVolume[iAUX]);
}
}
// Maybe do down or up mix for destination
mpBuffer->SetChannels(miDestinationNumberOfChannels);
muiSongPos += iSamples;
} // Process