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

Method run

hi_scripting/scripting/api/ScriptingApiObjects.cpp:6998–7061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6996}
6997
6998void ScriptingObjects::ScriptBackgroundTask::ChildProcessData::run()
6999{
7000 if (args.isEmpty())
7001 {
7002 debugError(dynamic_cast<Processor*>(parent.getScriptProcessor()), "no args");
7003 return;
7004 }
7005
7006 childProcess.start(args, ChildProcess::StreamFlags::wantStdErr | ChildProcess::StreamFlags::wantStdOut);
7007
7008 var a[3];
7009
7010 a[0] = &parent;
7011 a[1] = false;
7012
7013 String currentLine;
7014
7015 while (childProcess.isRunning())
7016 {
7017 if (parent.shouldAbort())
7018 {
7019 childProcess.kill();
7020 break;
7021 }
7022
7023 char newChar;
7024
7025 auto numBytesRead = childProcess.readProcessOutput(&newChar, 1);
7026
7027 if (numBytesRead == 1)
7028 {
7029 currentLine << newChar;
7030
7031 if (newChar == '\n' || newChar == '\r')
7032 {
7033 if (currentLine.trim().isNotEmpty())
7034 {
7035 a[2] = var(currentLine);
7036 callLog(a);
7037 }
7038
7039 currentLine = {};
7040
7041 parent.wait(10);
7042 }
7043 }
7044
7045 parent.wait(1);
7046 }
7047
7048 currentLine << childProcess.readAllProcessOutput();
7049
7050 if (!currentLine.isEmpty())
7051 {
7052 a[2] = var(currentLine);
7053 callLog(a);
7054 }
7055

Callers

nothing calls this directly

Calls 15

varFunction · 0.85
killMethod · 0.80
readProcessOutputMethod · 0.80
readAllProcessOutputMethod · 0.80
setPreloadFlagMethod · 0.80
getMainController_Method · 0.80
clearPreloadFlagMethod · 0.80
startMethod · 0.65
isEmptyMethod · 0.45
getScriptProcessorMethod · 0.45
isRunningMethod · 0.45
shouldAbortMethod · 0.45

Tested by

no test coverage detected