MCPcopy Create free account
hub / github.com/VCVRack/Rack / processBuffer

Method processBuffer

src/audio.cpp:33–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void Device::processBuffer(const float* input, int inputStride, float* output, int outputStride, int frames) {
34 // Zero output since Ports might not write to all elements, or no Ports exist
35 std::fill_n(output, frames * outputStride, 0.f);
36
37 std::lock_guard<std::mutex> lock(processMutex);
38 for (Port* port : subscribed) {
39 // Setting the thread context should probably be the responsibility of Port, but because processInput() etc are overridden, this is the only good place for it.
40 contextSet(port->context);
41 port->processInput(input + port->inputOffset, inputStride, frames);
42 }
43 for (Port* port : subscribed) {
44 contextSet(port->context);
45 port->processBuffer(input + port->inputOffset, inputStride, output + port->outputOffset, outputStride, frames);
46 }
47 for (Port* port : subscribed) {
48 contextSet(port->context);
49 port->processOutput(output + port->outputOffset, outputStride, frames);
50 }
51}
52
53void Device::onStartStream() {
54 for (Port* port : subscribed) {

Callers 1

rtAudioCallbackMethod · 0.45

Calls 3

contextSetFunction · 0.85
processInputMethod · 0.45
processOutputMethod · 0.45

Tested by

no test coverage detected