| 622 | |
| 623 | template <typename T> |
| 624 | void Processor::processBlockBypassedInternal(AudioBuffer<T>& buffer, AudioRingBuffer<T>& bypassBuffer) { |
| 625 | traceScope(); |
| 626 | |
| 627 | auto totalNumInputChannels = m_chain.getTotalNumInputChannels(); |
| 628 | auto totalNumOutputChannels = m_chain.getTotalNumOutputChannels(); |
| 629 | |
| 630 | if (totalNumInputChannels > buffer.getNumChannels()) { |
| 631 | logln("buffer has less channels than main input channels"); |
| 632 | totalNumInputChannels = buffer.getNumChannels(); |
| 633 | } |
| 634 | if (totalNumOutputChannels > buffer.getNumChannels()) { |
| 635 | logln("buffer has less channels than main output channels"); |
| 636 | totalNumOutputChannels = buffer.getNumChannels(); |
| 637 | } |
| 638 | |
| 639 | for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i) { |
| 640 | buffer.clear(i, 0, buffer.getNumSamples()); |
| 641 | } |
| 642 | |
| 643 | if (bypassBuffer.getNumChannels() < totalNumOutputChannels) { |
| 644 | logln("bypass buffer has less channels than needed, buffer: " << bypassBuffer.getNumChannels() |
| 645 | << ", needed: " << totalNumOutputChannels); |
| 646 | for (auto i = 0; i < totalNumOutputChannels; ++i) { |
| 647 | buffer.clear(i, 0, buffer.getNumSamples()); |
| 648 | } |
| 649 | return; |
| 650 | } |
| 651 | |
| 652 | bypassBuffer.process(buffer.getArrayOfWritePointers(), buffer.getNumSamples()); |
| 653 | } |
| 654 | |
| 655 | void Processor::processBlockBypassed(AudioBuffer<float>& buffer) { |
| 656 | processBlockBypassedInternal(buffer, m_bypassBufferF); |
nothing calls this directly
no test coverage detected