| 385 | |
| 386 | template <typename T> |
| 387 | void ProcessorChain::processBlockInternal(AudioBuffer<T>& buffer, MidiBuffer& midiMessages) { |
| 388 | traceScope(); |
| 389 | |
| 390 | int latency = 0; |
| 391 | if (getBusCount(true) > 1 && m_sidechainDisabled) { |
| 392 | auto sidechainBuffer = getBusBuffer(buffer, true, 1); |
| 393 | sidechainBuffer.clear(); |
| 394 | } |
| 395 | |
| 396 | { |
| 397 | std::lock_guard<std::mutex> lock(m_processorsMtx); |
| 398 | TimeTrace::addTracePoint("chain_lock"); |
| 399 | for (auto& proc : m_processors) { |
| 400 | TimeTrace::startGroup(); |
| 401 | int procLatency = 0; |
| 402 | if (proc->processBlock(buffer, midiMessages, procLatency)) { |
| 403 | latency += procLatency; |
| 404 | } |
| 405 | TimeTrace::finishGroup("chain_process: " + proc->getName()); |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | if (latency != getLatencySamples()) { |
| 410 | logln("updating latency samples to " << latency); |
| 411 | setLatencySamples(latency); |
| 412 | TimeTrace::addTracePoint("chain_set_latency"); |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | template <typename T> |
| 417 | void ProcessorChain::preProcessBlocks(Processor* proc) { |
nothing calls this directly
no test coverage detected