MCPcopy Create free account
hub / github.com/christophhart/HISE / prepareToPlay

Method prepareToPlay

hi_scripting/scripting/scriptnode/api/DspNetwork.cpp:578–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578void DspNetwork::prepareToPlay(double sampleRate, double blockSize)
579{
580 runPostInitFunctions();
581
582 if (sampleRate > 0.0)
583 {
584 SimpleReadWriteLock::ScopedWriteLock sl(getConnectionLock(), isInitialised());
585
586 try
587 {
588 originalSampleRate = sampleRate;
589
590 currentSpecs.sampleRate = sampleRate;
591 currentSpecs.blockSize = (int)blockSize;
592
593 if(currentSpecs.numChannels == 0)
594 return;
595
596 if (auto rootNode = getRootNode())
597 {
598 currentSpecs.voiceIndex = getPolyHandler();
599
600 getRootNode()->prepare(currentSpecs);
601
602 runPostInitFunctions();
603
604 getRootNode()->reset();
605
606 if (projectNodeHolder.isActive())
607 projectNodeHolder.prepare(currentSpecs);
608 }
609
610 initialised = true;
611 }
612 catch (String& )
613 {
614 jassertfalse;
615 }
616 }
617}
618
619void DspNetwork::processBlock(var pData)
620{

Callers 3

prepareMethod · 0.45
prepareTestMethod · 0.45
setNetworkMethod · 0.45

Calls 4

isInitialisedFunction · 0.85
prepareMethod · 0.45
resetMethod · 0.45
isActiveMethod · 0.45

Tested by 1

prepareTestMethod · 0.36