MCPcopy Create free account
hub / github.com/andrewreeman/SpectralSuite / processBlock

Method processBlock

shared/SpectralAudioPlugin.cpp:268–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268void SpectralAudioPlugin::processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiBuffer)
269{
270 if (m_fftSwitcher.isBusy() || m_audioProcessorInteractor->isPreparingToPlay()) {
271 m_internalBufferReadWriteIndex = 0;
272 return;
273 }
274
275 if (m_fftSizeChoiceAdapter.shouldChangeFftSize()) {
276 m_fftSwitcher.switchFftSize();
277 return;
278 }
279
280 if(m_fftOverlapsChoiceAdapter.shouldChangeFftOverlaps()) {
281 m_fftSwitcher.switchOverlapCount();
282 return;
283 }
284
285 if(m_fftStyleChoiceAdapter.shouldChangeFftStyle()) {
286 m_fftSwitcher.switchFftStyle();
287 return;
288 }
289
290 if(m_fftWindowChoiceAdapter.shouldChangeFftWindow()) {
291 m_fftSwitcher.switchWindowType();
292 return;
293 }
294
295 if(!midiBuffer.isEmpty()) {
296 m_audioProcessorInteractor->receivedMidi(midiBuffer);
297 }
298
299 const int hopSize = m_audioProcessorInteractor->getHopSize();
300 const int numChannels = buffer.getNumChannels();
301 auto audio = buffer.getArrayOfWritePointers();
302 int numSamples = buffer.getNumSamples();
303 int ioVSTBuffers = 0;
304
305 while (numSamples--) {
306 if (m_internalBufferReadWriteIndex >= hopSize) {
307 m_internalBufferReadWriteIndex = 0;
308 emptyOutputs();
309 m_audioProcessorInteractor->process(this, &m_input, &m_output);
310 }
311
312 for (size_t channel = 0; channel < static_cast<size_t>(numChannels); channel++)
313 {
314 m_input[channel][static_cast<size_t>(m_internalBufferReadWriteIndex)] = audio[channel][ioVSTBuffers];
315 audio[channel][ioVSTBuffers] = m_output[channel][static_cast<size_t>(m_internalBufferReadWriteIndex)];
316 }
317
318 ioVSTBuffers++;
319 m_internalBufferReadWriteIndex++;
320 }
321}
322
323bool SpectralAudioPlugin::hasEditor() const
324{

Callers

nothing calls this directly

Calls 14

isBusyMethod · 0.80
shouldChangeFftSizeMethod · 0.80
shouldChangeFftStyleMethod · 0.80
shouldChangeFftWindowMethod · 0.80
switchWindowTypeMethod · 0.80
isPreparingToPlayMethod · 0.45
switchFftSizeMethod · 0.45
switchOverlapCountMethod · 0.45
switchFftStyleMethod · 0.45
isEmptyMethod · 0.45
receivedMidiMethod · 0.45

Tested by

no test coverage detected