Skip to content

Commit

Permalink
Merge pull request #1736 from daschuer/lp1779559
Browse files Browse the repository at this point in the history
32 Sampler fix
  • Loading branch information
daschuer authored Jul 5, 2018
2 parents 565acee + 254fda2 commit f75f9b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions scripts/generate_sample_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def write(data, depth=0):
write('} else {', depth=1)
write('ScopedTimer t("EngineMaster::applyEffects%(inplace)sAndMixChannels_Over32active");' %
{'inplace': 'InPlace' if inplace else ''}, depth=2)
if inplace:
write('SampleUtil::clear(pOutput, iBufferSize);', depth=2)
write('for (int i = 0; i < activeChannels->size(); ++i) {', depth=2)
write('EngineMaster::ChannelInfo* pChannelInfo = activeChannels->at(i);', depth=3)

Expand All @@ -136,9 +138,7 @@ def write(data, depth=0):
write('CSAMPLE* pBuffer = pChannelInfo->m_pBuffer;', depth=3)
if inplace:
write('pEngineEffectsManager->processPostFaderInPlace(pChannelInfo->m_handle, outputHandle, pBuffer, iBufferSize, iSampleRate, pChannelInfo->m_features, oldGain, newGain);' % {'j': j}, depth=3)
write('for (unsigned int i = 0; i < iBufferSize; ++i) {', depth=3)
write('pOutput[i] += pBuffer[i];', depth=4)
write('}', depth=3)
write('SampleUtil::add(pOutput, pBuffer, iBufferSize);', depth=3)
else:
write('pEngineEffectsManager->processPostFaderAndMix(pChannelInfo->m_handle, outputHandle, pBuffer, pOutput, iBufferSize, iSampleRate, pChannelInfo->m_features, oldGain, newGain);' % {'j': j}, depth=3)

Expand Down
5 changes: 2 additions & 3 deletions src/engine/channelmixer_autogen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14244,6 +14244,7 @@ void ChannelMixer::applyEffectsInPlaceAndMixChannels(const EngineMaster::GainCal
}
} else {
ScopedTimer t("EngineMaster::applyEffectsInPlaceAndMixChannels_Over32active");
SampleUtil::clear(pOutput, iBufferSize);
for (int i = 0; i < activeChannels->size(); ++i) {
EngineMaster::ChannelInfo* pChannelInfo = activeChannels->at(i);
const int channelIndex = pChannelInfo->m_index;
Expand All @@ -14259,9 +14260,7 @@ void ChannelMixer::applyEffectsInPlaceAndMixChannels(const EngineMaster::GainCal
gainCache.m_gain = newGain;
CSAMPLE* pBuffer = pChannelInfo->m_pBuffer;
pEngineEffectsManager->processPostFaderInPlace(pChannelInfo->m_handle, outputHandle, pBuffer, iBufferSize, iSampleRate, pChannelInfo->m_features, oldGain, newGain);
for (unsigned int i = 0; i < iBufferSize; ++i) {
pOutput[i] += pBuffer[i];
}
SampleUtil::add(pOutput, pBuffer, iBufferSize);
}
}
}

0 comments on commit f75f9b8

Please sign in to comment.