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

Method killVoicesAndCall

hi_scripting/scripting/api/ScriptingApiObjects.cpp:6945–6973  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6943}
6944
6945bool ScriptingObjects::ScriptBackgroundTask::killVoicesAndCall(var loadingFunction)
6946{
6947 if (HiseJavascriptEngine::isJavascriptFunction(loadingFunction))
6948 {
6949 stopThread(timeOut);
6950 currentTask = WeakCallbackHolder(getScriptProcessor(), this, loadingFunction, 0);
6951 currentTask.incRefCount();
6952 currentTask.addAsSource(this, "backgroundFunction");
6953
6954 WeakReference<ScriptBackgroundTask> safeThis(this);
6955
6956 auto f = [safeThis](Processor* p)
6957 {
6958 if (safeThis != nullptr)
6959 {
6960 auto r = safeThis->currentTask.callSync(nullptr, 0, nullptr);
6961
6962 if (!r.wasOk())
6963 debugError(p, r.getErrorMessage());
6964 }
6965
6966 return SafeFunctionCall::OK;
6967 };
6968
6969 return getScriptProcessor()->getMainController_()->getKillStateHandler().killVoicesAndCall(dynamic_cast<Processor*>(getScriptProcessor()), f, MainController::KillStateHandler::TargetThread::SampleLoadingThread);
6970 }
6971
6972 return false;
6973}
6974
6975ScriptingObjects::ScriptBackgroundTask::ChildProcessData::ChildProcessData(ScriptBackgroundTask& parent_, const String& command_, const var& args_, const var& pf) :
6976 processLogFunction(parent_.getScriptProcessor(), &parent_, pf, 3),

Callers 1

extractZipFileMethod · 0.45

Calls 7

WeakCallbackHolderClass · 0.85
incRefCountMethod · 0.80
getMainController_Method · 0.80
addAsSourceMethod · 0.45
callSyncMethod · 0.45
wasOkMethod · 0.45
getErrorMessageMethod · 0.45

Tested by

no test coverage detected