MCPcopy Create free account
hub / github.com/DBraun/DawDreamer / processBlock

Method processBlock

Source/ProcessorBase.cpp:234–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234void ProcessorBase::processBlock(juce::AudioSampleBuffer& buffer,
235 juce::MidiBuffer&) {
236 if (!m_recordEnable) {
237 return;
238 }
239 auto posInfo = getPlayHead()->getPosition();
240 const bool isRecording = posInfo->getIsRecording();
241 if (!isRecording) {
242 return;
243 }
244
245 const int numberChannels = myRecordBuffer.getNumChannels();
246 int numSamplesToCopy =
247 std::min(buffer.getNumSamples(), myRecordBuffer.getNumSamples() -
248 int(*posInfo->getTimeInSamples()));
249 int writePos = int(*posInfo->getTimeInSamples());
250
251 for (int chan = 0; chan < numberChannels; chan++) {
252 // Write the sample to the engine's history for the correct channel.
253 myRecordBuffer.copyFrom(chan, writePos, buffer.getReadPointer(chan),
254 numSamplesToCopy);
255 }
256}
257
258py::array_t<float> ProcessorBase::bufferToPyArray(
259 juce::AudioSampleBuffer& buffer) {

Callers 1

renderMethod · 0.45

Calls 8

minFunction · 0.85
getIsRecordingMethod · 0.80
getTimeInSamplesMethod · 0.80
getReadPointerMethod · 0.80
getPositionMethod · 0.45
getNumChannelsMethod · 0.45
getNumSamplesMethod · 0.45
copyFromMethod · 0.45

Tested by

no test coverage detected