MCPcopy Create free account
hub / github.com/apohl79/audiogridder / processBlockBypassedInternal

Method processBlockBypassedInternal

Server/Source/Processor.cpp:624–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622
623template <typename T>
624void 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
655void Processor::processBlockBypassed(AudioBuffer<float>& buffer) {
656 processBlockBypassedInternal(buffer, m_bypassBufferF);

Callers

nothing calls this directly

Calls 5

getNumSamplesMethod · 0.80
processMethod · 0.80
getNumChannelsMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected