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

Method applyEffect

hi_scripting/scripting/ScriptProcessorModules.cpp:952–981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

950
951
952void JavascriptMasterEffect::applyEffect(AudioSampleBuffer &b, int startSample, int numSamples)
953{
954 ignoreUnused(startSample);
955
956 if (getActiveNetwork() != nullptr)
957 {
958 getActiveNetwork()->process(b, eventBuffer);
959 return;
960 }
961
962 if (!processBlockCallback->isSnippetEmpty() && lastResult.wasOk())
963 {
964 jassert(startSample == 0);
965 CHECK_AND_LOG_ASSERTION(this, DebugLogger::Location::ScriptFXRendering, startSample == 0, startSample);
966
967 float *l = b.getWritePointer(0, 0);
968 float *r = b.getWritePointer(1, 0);
969
970 if (auto lb = channels[0].getBuffer())
971 lb->referToData(l, numSamples);
972
973 if (auto rb = channels[1].getBuffer())
974 rb->referToData(r, numSamples);
975
976 scriptEngine->setCallbackParameter((int)Callback::processBlock, 0, channelData);
977 scriptEngine->executeCallback((int)Callback::processBlock, &lastResult);
978
979 BACKEND_ONLY(if (!lastResult.wasOk()) debugError(this, lastResult.getErrorMessage()));
980 }
981}
982
983void JavascriptMasterEffect::setBypassed(bool shouldBeBypassed, NotificationType notifyChangeHandler) noexcept
984{

Callers

nothing calls this directly

Calls 11

ignoreUnusedFunction · 0.85
isSnippetEmptyMethod · 0.80
setCallbackParameterMethod · 0.80
ifFunction · 0.50
processMethod · 0.45
wasOkMethod · 0.45
getWritePointerMethod · 0.45
getBufferMethod · 0.45
referToDataMethod · 0.45
executeCallbackMethod · 0.45
getErrorMessageMethod · 0.45

Tested by

no test coverage detected