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

Method stuffAfterCompilation

hi_scripting/scripting/ScriptProcessor.cpp:2137–2200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2135}
2136
2137void JavascriptProcessor::stuffAfterCompilation(const SnippetResult& result)
2138{
2139
2140
2141 mainController->getScriptComponentEditBroadcaster()->clearSelection(sendNotification);
2142
2143 if (lastCompileWasOK && lastOptimisationReport.isNotEmpty())
2144 {
2145 debugToConsole(dynamic_cast<Processor*>(this), lastOptimisationReport);
2146
2147 String x;
2148 mergeCallbacksToScript(x);
2149 }
2150
2151 mainController->checkAndAbortMessageThreadOperation();
2152
2153#if USE_BACKEND
2154 if (isConnectedToExternalFile())
2155 {
2156 auto shouldSave = (bool)GET_HISE_SETTING(dynamic_cast<Processor*>(this), HiseSettings::Scripting::SaveConnectedFilesOnCompile);
2157
2158 if (shouldSave)
2159 {
2160 String x;
2161 mergeCallbacksToScript(x);
2162
2163 const File f = GET_PROJECT_HANDLER(dynamic_cast<const Processor*>(this)).getFilePath(connectedFileReference, ProjectHandler::SubDirectories::Scripts);
2164
2165 f.replaceWithText(x);
2166 }
2167 }
2168#endif
2169
2170
2171 clearFileWatchers();
2172
2173 const int numFiles = scriptEngine->getNumIncludedFiles();
2174
2175 for (int i = 0; i < numFiles; i++)
2176 {
2177 mainController->checkAndAbortMessageThreadOperation();
2178
2179 addFileWatcher(scriptEngine->getIncludedFile(i));
2180 setFileResult(scriptEngine->getIncludedFile(i), scriptEngine->getIncludedFileResult(i));
2181 }
2182
2183 const String fileName = ApiHelpers::getFileNameFromErrorMessage(result.r.getErrorMessage());
2184
2185 if (fileName.isNotEmpty())
2186 {
2187 for (int i = 0; i < getNumWatchedFiles(); i++)
2188 {
2189 mainController->checkAndAbortMessageThreadOperation();
2190
2191 if (getWatchedFile(i).getFileName() == fileName)
2192 {
2193 setFileResult(getWatchedFile(i), result.r);
2194 }

Callers 1

compileScriptMethod · 0.80

Calls 12

clearSelectionMethod · 0.80
replaceWithTextMethod · 0.80
getNumIncludedFilesMethod · 0.80
getIncludedFileMethod · 0.80
getIncludedFileResultMethod · 0.80
isNotEmptyMethod · 0.45
getFilePathMethod · 0.45
getErrorMessageMethod · 0.45
getFileNameMethod · 0.45

Tested by

no test coverage detected