Skip to content

Commit

Permalink
fixup! fixup! refactor: Convert Enginemixer to unique_ptr instead or …
Browse files Browse the repository at this point in the history
…owning* and move to initializer list
  • Loading branch information
Swiftb0y committed Aug 14, 2024
1 parent 2084153 commit d3c2011
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/engine/enginemixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,20 +320,19 @@ void EngineMixer::processChannels(int iBufferSize) {
}

// Now that the list is built and ordered, do the processing.
std::for_each(m_activeChannels.cbegin() + activeChannelsStartIndex,
m_activeChannels.cend(),
[this, iBufferSize](ChannelInfo* pChannelInfo) {
auto& pChannel = pChannelInfo->m_pChannel;
DEBUG_ASSERT(pChannelInfo->m_pBuffer.size() >= iBufferSize);
pChannel->process(pChannelInfo->m_pBuffer.data(), iBufferSize);

// Collect metadata for effects
if (m_pEngineEffectsManager) {
GroupFeatureState features;
pChannel->collectFeatures(&features);
pChannelInfo->m_features = features;
}
});
for (int i = activeChannelsStartIndex; i < m_activeChannels.size(); ++i) {
ChannelInfo* pChannelInfo = m_activeChannels[i];
auto& pChannel = pChannelInfo->m_pChannel;
DEBUG_ASSERT(pChannelInfo->m_pBuffer.size() >= iBufferSize);
pChannel->process(pChannelInfo->m_pBuffer.data(), iBufferSize);

// Collect metadata for effects
if (m_pEngineEffectsManager) {
GroupFeatureState features;
pChannel->collectFeatures(&features);
pChannelInfo->m_features = features;
}
}
// Do internal sync lock post-processing before the other
// channels.
// Note, because we call this on the internal clock first,
Expand Down

0 comments on commit d3c2011

Please sign in to comment.