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

Method updateLatencyBuffers

Server/Source/Processor.cpp:781–811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

779}
780
781void Processor::updateLatencyBuffers(int newLatency) {
782 traceScope();
783 if (m_lastKnownLatency != newLatency) {
784 m_lastKnownLatency = newLatency;
785
786 int channels = getTotalNumOutputChannels();
787 logln("updating latency buffers of " << getName() << " to " << m_lastKnownLatency << " samples and " << channels
788 << " channels");
789 m_bypassBufferF.resize(channels, m_lastKnownLatency * 2);
790 m_bypassBufferF.clear();
791 m_bypassBufferF.setReadOffset(m_lastKnownLatency);
792 m_bypassBufferD.resize(channels, m_lastKnownLatency * 2);
793 m_bypassBufferD.clear();
794 m_bypassBufferD.setReadOffset(m_lastKnownLatency);
795
796 if (m_channels > 1) {
797 for (int ch = 0; ch < m_channels; ch++) {
798 if (auto& b = m_multiMonoBypassBuffersF[(size_t)ch]) {
799 b->resize(1, m_lastKnownLatency * 2);
800 b->clear();
801 b->setReadOffset(m_lastKnownLatency);
802 }
803 if (auto& b = m_multiMonoBypassBuffersD[(size_t)ch]) {
804 b->resize(1, m_lastKnownLatency * 2);
805 b->clear();
806 b->setReadOffset(m_lastKnownLatency);
807 }
808 }
809 }
810 }
811}
812
813void Processor::enableAllBuses() {
814 traceScope();

Callers

nothing calls this directly

Calls 3

resizeMethod · 0.80
setReadOffsetMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected