The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

716 lines
25KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. #pragma once
  20. #include "jucer_ResourceFile.h"
  21. #include "../Project/jucer_Module.h"
  22. #include "jucer_ProjectExporter.h"
  23. //==============================================================================
  24. class ProjectSaver
  25. {
  26. public:
  27. ProjectSaver (Project& p, const File& file)
  28. : project (p),
  29. projectFile (file),
  30. generatedCodeFolder (project.getGeneratedCodeFolder()),
  31. generatedFilesGroup (Project::Item::createGroup (project, getJuceCodeGroupName(), "__generatedcode__", true))
  32. {
  33. generatedFilesGroup.setID (getGeneratedGroupID());
  34. }
  35. struct SaveThread : public ThreadWithProgressWindow
  36. {
  37. public:
  38. SaveThread (ProjectSaver& ps, bool wait, const String& exp)
  39. : ThreadWithProgressWindow ("Saving...", true, false),
  40. saver (ps),
  41. shouldWaitAfterSaving (wait),
  42. specifiedExporterToSave (exp)
  43. {}
  44. void run() override
  45. {
  46. setProgress (-1);
  47. result = saver.save (false, shouldWaitAfterSaving, specifiedExporterToSave);
  48. }
  49. ProjectSaver& saver;
  50. Result result = Result::ok();
  51. bool shouldWaitAfterSaving;
  52. String specifiedExporterToSave;
  53. JUCE_DECLARE_NON_COPYABLE (SaveThread)
  54. };
  55. Result save (bool showProgressBox, bool waitAfterSaving, const String& specifiedExporterToSave)
  56. {
  57. if (showProgressBox)
  58. {
  59. SaveThread thread (*this, waitAfterSaving, specifiedExporterToSave);
  60. thread.runThread();
  61. return thread.result;
  62. }
  63. auto appConfigUserContent = loadUserContentFromAppConfig();
  64. auto oldFile = project.getFile();
  65. project.setFile (projectFile);
  66. OwnedArray<LibraryModule> modules;
  67. project.getModules().createRequiredModules (modules);
  68. checkModuleValidity (modules);
  69. if (errors.size() == 0)
  70. {
  71. writeMainProjectFile();
  72. project.updateModificationTime();
  73. auto projectRootHash = project.getProjectRoot().toXmlString().hashCode();
  74. if (project.getProjectType().isAudioPlugin())
  75. writePluginCharacteristicsFile();
  76. writeAppConfigFile (modules, appConfigUserContent);
  77. writeBinaryDataFiles();
  78. writeAppHeader (modules);
  79. writeModuleCppWrappers (modules);
  80. writeProjects (modules, specifiedExporterToSave, ! showProgressBox);
  81. // if the project root has changed after writing the other files then re-save it
  82. if (project.getProjectRoot().toXmlString().hashCode() != projectRootHash)
  83. {
  84. writeMainProjectFile();
  85. project.updateModificationTime();
  86. }
  87. if (generatedCodeFolder.exists())
  88. writeReadmeFile();
  89. }
  90. if (generatedCodeFolder.exists())
  91. deleteUnwantedFilesIn (generatedCodeFolder);
  92. if (errors.size() > 0)
  93. {
  94. project.setFile (oldFile);
  95. return Result::fail (errors[0]);
  96. }
  97. // Workaround for a bug where Xcode thinks the project is invalid if opened immedietely
  98. // after writing
  99. if (waitAfterSaving)
  100. Thread::sleep (2000);
  101. return Result::ok();
  102. }
  103. Result saveResourcesOnly()
  104. {
  105. writeBinaryDataFiles();
  106. if (errors.size() > 0)
  107. return Result::fail (errors[0]);
  108. return Result::ok();
  109. }
  110. Result saveContentNeededForLiveBuild()
  111. {
  112. OwnedArray<LibraryModule> modules;
  113. project.getModules().createRequiredModules (modules);
  114. checkModuleValidity (modules);
  115. if (errors.size() == 0)
  116. {
  117. if (project.getProjectType().isAudioPlugin())
  118. writePluginCharacteristicsFile();
  119. writeAppConfigFile (modules, loadUserContentFromAppConfig());
  120. writeBinaryDataFiles();
  121. writeAppHeader (modules);
  122. writeModuleCppWrappers (modules);
  123. return Result::ok();
  124. }
  125. return Result::fail (errors[0]);
  126. }
  127. Project::Item saveGeneratedFile (const String& filePath, const MemoryOutputStream& newData)
  128. {
  129. if (! generatedCodeFolder.createDirectory())
  130. {
  131. addError ("Couldn't create folder: " + generatedCodeFolder.getFullPathName());
  132. return Project::Item (project, ValueTree(), false);
  133. }
  134. auto file = generatedCodeFolder.getChildFile (filePath);
  135. if (replaceFileIfDifferent (file, newData))
  136. return addFileToGeneratedGroup (file);
  137. return { project, {}, true };
  138. }
  139. Project::Item addFileToGeneratedGroup (const File& file)
  140. {
  141. auto item = generatedFilesGroup.findItemForFile (file);
  142. if (item.isValid())
  143. return item;
  144. generatedFilesGroup.addFileAtIndex (file, -1, true);
  145. return generatedFilesGroup.findItemForFile (file);
  146. }
  147. void setExtraAppConfigFileContent (const String& content)
  148. {
  149. extraAppConfigContent = content;
  150. }
  151. static void writeAutoGenWarningComment (OutputStream& out)
  152. {
  153. out << "/*" << newLine << newLine
  154. << " IMPORTANT! This file is auto-generated each time you save your" << newLine
  155. << " project - if you alter its contents, your changes may be overwritten!" << newLine
  156. << newLine;
  157. }
  158. static const char* getGeneratedGroupID() noexcept { return "__jucelibfiles"; }
  159. Project::Item& getGeneratedCodeGroup() { return generatedFilesGroup; }
  160. static String getJuceCodeGroupName() { return "JUCE Library Code"; }
  161. File getGeneratedCodeFolder() const { return generatedCodeFolder; }
  162. bool replaceFileIfDifferent (const File& f, const MemoryOutputStream& newData)
  163. {
  164. filesCreated.add (f);
  165. if (! FileHelpers::overwriteFileWithNewDataIfDifferent (f, newData))
  166. {
  167. addError ("Can't write to file: " + f.getFullPathName());
  168. return false;
  169. }
  170. return true;
  171. }
  172. static bool shouldFolderBeIgnoredWhenCopying (const File& f)
  173. {
  174. return f.getFileName() == ".git" || f.getFileName() == ".svn" || f.getFileName() == ".cvs";
  175. }
  176. bool copyFolder (const File& source, const File& dest)
  177. {
  178. if (source.isDirectory() && dest.createDirectory())
  179. {
  180. for (auto& f : source.findChildFiles (File::findFiles, false))
  181. {
  182. auto target = dest.getChildFile (f.getFileName());
  183. filesCreated.add (target);
  184. if (! f.copyFileTo (target))
  185. return false;
  186. }
  187. for (auto& f : source.findChildFiles (File::findDirectories, false))
  188. if (! shouldFolderBeIgnoredWhenCopying (f))
  189. if (! copyFolder (f, dest.getChildFile (f.getFileName())))
  190. return false;
  191. return true;
  192. }
  193. return false;
  194. }
  195. Project& project;
  196. SortedSet<File> filesCreated;
  197. private:
  198. const File projectFile, generatedCodeFolder;
  199. Project::Item generatedFilesGroup;
  200. String extraAppConfigContent;
  201. StringArray errors;
  202. CriticalSection errorLock;
  203. File appConfigFile;
  204. bool hasBinaryData = false;
  205. // Recursively clears out any files in a folder that we didn't create, but avoids
  206. // any folders containing hidden files that might be used by version-control systems.
  207. bool deleteUnwantedFilesIn (const File& parent)
  208. {
  209. bool folderIsNowEmpty = true;
  210. DirectoryIterator i (parent, false, "*", File::findFilesAndDirectories);
  211. Array<File> filesToDelete;
  212. bool isFolder;
  213. while (i.next (&isFolder, nullptr, nullptr, nullptr, nullptr, nullptr))
  214. {
  215. auto f = i.getFile();
  216. if (filesCreated.contains (f) || shouldFileBeKept (f.getFileName()))
  217. {
  218. folderIsNowEmpty = false;
  219. }
  220. else if (isFolder)
  221. {
  222. if (deleteUnwantedFilesIn (f))
  223. filesToDelete.add (f);
  224. else
  225. folderIsNowEmpty = false;
  226. }
  227. else
  228. {
  229. filesToDelete.add (f);
  230. }
  231. }
  232. for (int j = filesToDelete.size(); --j >= 0;)
  233. filesToDelete.getReference(j).deleteRecursively();
  234. return folderIsNowEmpty;
  235. }
  236. static bool shouldFileBeKept (const String& filename)
  237. {
  238. static const char* filesToKeep[] = { ".svn", ".cvs", "CMakeLists.txt" };
  239. for (int i = 0; i < numElementsInArray (filesToKeep); ++i)
  240. if (filename == filesToKeep[i])
  241. return true;
  242. return false;
  243. }
  244. void writeMainProjectFile()
  245. {
  246. std::unique_ptr<XmlElement> xml (project.getProjectRoot().createXml());
  247. jassert (xml != nullptr);
  248. if (xml != nullptr)
  249. {
  250. MemoryOutputStream mo;
  251. xml->writeToStream (mo, String());
  252. replaceFileIfDifferent (projectFile, mo);
  253. }
  254. }
  255. static int findLongestModuleName (const OwnedArray<LibraryModule>& modules)
  256. {
  257. int longest = 0;
  258. for (int i = modules.size(); --i >= 0;)
  259. longest = jmax (longest, modules.getUnchecked(i)->getID().length());
  260. return longest;
  261. }
  262. File getAppConfigFile() const { return generatedCodeFolder.getChildFile (project.getAppConfigFilename()); }
  263. String loadUserContentFromAppConfig() const
  264. {
  265. StringArray userContent;
  266. bool foundCodeSection = false;
  267. auto lines = StringArray::fromLines (getAppConfigFile().loadFileAsString());
  268. for (int i = 0; i < lines.size(); ++i)
  269. {
  270. if (lines[i].contains ("[BEGIN_USER_CODE_SECTION]"))
  271. {
  272. for (int j = i + 1; j < lines.size() && ! lines[j].contains ("[END_USER_CODE_SECTION]"); ++j)
  273. userContent.add (lines[j]);
  274. foundCodeSection = true;
  275. break;
  276. }
  277. }
  278. if (! foundCodeSection)
  279. {
  280. userContent.add ({});
  281. userContent.add ("// (You can add your own code in this section, and the Projucer will not overwrite it)");
  282. userContent.add ({});
  283. }
  284. return userContent.joinIntoString (newLine) + newLine;
  285. }
  286. void checkModuleValidity (OwnedArray<LibraryModule>& modules)
  287. {
  288. if (project.getNumExporters() == 0)
  289. {
  290. addError ("No exporters found!\n"
  291. "Please add an exporter before saving.");
  292. return;
  293. }
  294. for (LibraryModule** moduleIter = modules.begin(); moduleIter != modules.end(); ++moduleIter)
  295. {
  296. if (auto* module = *moduleIter)
  297. {
  298. if (! module->isValid())
  299. {
  300. addError ("At least one of your JUCE module paths is invalid!\n"
  301. "Please go to the Modules settings page and ensure each path points to the correct JUCE modules folder.");
  302. return;
  303. }
  304. if (project.getModules().getExtraDependenciesNeeded (module->getID()).size() > 0)
  305. {
  306. addError ("At least one of your modules has missing dependencies!\n"
  307. "Please go to the settings page of the highlighted modules and add the required dependencies.");
  308. return;
  309. }
  310. }
  311. else
  312. {
  313. // this should never happen!
  314. jassertfalse;
  315. }
  316. }
  317. }
  318. void writeAppConfig (MemoryOutputStream& out, const OwnedArray<LibraryModule>& modules, const String& userContent)
  319. {
  320. writeAutoGenWarningComment (out);
  321. out << " There's a section below where you can add your own custom code safely, and the" << newLine
  322. << " Projucer will preserve the contents of that block, but the best way to change" << newLine
  323. << " any of these definitions is by using the Projucer's project settings." << newLine
  324. << newLine
  325. << " Any commented-out settings will assume their default values." << newLine
  326. << newLine
  327. << "*/" << newLine
  328. << newLine;
  329. out << "#pragma once" << newLine
  330. << newLine
  331. << "//==============================================================================" << newLine
  332. << "// [BEGIN_USER_CODE_SECTION]" << newLine
  333. << userContent
  334. << "// [END_USER_CODE_SECTION]" << newLine;
  335. out << newLine
  336. << "/*" << newLine
  337. << " ==============================================================================" << newLine
  338. << newLine
  339. << " In accordance with the terms of the JUCE 5 End-Use License Agreement, the" << newLine
  340. << " JUCE Code in SECTION A cannot be removed, changed or otherwise rendered" << newLine
  341. << " ineffective unless you have a JUCE Indie or Pro license, or are using JUCE" << newLine
  342. << " under the GPL v3 license." << newLine
  343. << newLine
  344. << " End User License Agreement: www.juce.com/juce-5-licence" << newLine
  345. << newLine
  346. << " ==============================================================================" << newLine
  347. << "*/" << newLine
  348. << newLine
  349. << "// BEGIN SECTION A" << newLine
  350. << newLine
  351. << "#ifndef JUCE_DISPLAY_SPLASH_SCREEN" << newLine
  352. << " #define JUCE_DISPLAY_SPLASH_SCREEN " << (project.shouldDisplaySplashScreen() ? "1" : "0") << newLine
  353. << "#endif" << newLine << newLine
  354. << "#ifndef JUCE_REPORT_APP_USAGE" << newLine
  355. << " #define JUCE_REPORT_APP_USAGE " << (project.shouldReportAppUsage() ? "1" : "0") << newLine
  356. << "#endif" << newLine
  357. << newLine
  358. << "// END SECTION A" << newLine
  359. << newLine
  360. << "#define JUCE_USE_DARK_SPLASH_SCREEN " << (project.getSplashScreenColourString() == "Dark" ? "1" : "0") << newLine;
  361. out << newLine
  362. << "//==============================================================================" << newLine;
  363. auto longestName = findLongestModuleName (modules);
  364. for (int k = 0; k < modules.size(); ++k)
  365. {
  366. auto* m = modules.getUnchecked(k);
  367. out << "#define JUCE_MODULE_AVAILABLE_" << m->getID()
  368. << String::repeatedString (" ", longestName + 5 - m->getID().length()) << " 1" << newLine;
  369. }
  370. out << newLine << "#define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED 1" << newLine;
  371. for (int j = 0; j < modules.size(); ++j)
  372. {
  373. auto* m = modules.getUnchecked(j);
  374. OwnedArray<Project::ConfigFlag> flags;
  375. m->getConfigFlags (project, flags);
  376. if (flags.size() > 0)
  377. {
  378. out << newLine
  379. << "//==============================================================================" << newLine
  380. << "// " << m->getID() << " flags:" << newLine;
  381. for (auto* flag : flags)
  382. {
  383. out << newLine
  384. << "#ifndef " << flag->symbol
  385. << newLine
  386. << (flag->value.isUsingDefault() ? " //#define " : " #define ") << flag->symbol << " " << (flag->value.get() ? "1" : "0")
  387. << newLine
  388. << "#endif"
  389. << newLine;
  390. }
  391. }
  392. }
  393. {
  394. int isStandaloneApplication = 1;
  395. auto& type = project.getProjectType();
  396. if (type.isAudioPlugin() || type.isDynamicLibrary())
  397. isStandaloneApplication = 0;
  398. out << "//==============================================================================" << newLine
  399. << "#ifndef JUCE_STANDALONE_APPLICATION" << newLine
  400. << " #if defined(JucePlugin_Name) && defined(JucePlugin_Build_Standalone)" << newLine
  401. << " #define JUCE_STANDALONE_APPLICATION JucePlugin_Build_Standalone" << newLine
  402. << " #else" << newLine
  403. << " #define JUCE_STANDALONE_APPLICATION " << isStandaloneApplication << newLine
  404. << " #endif" << newLine
  405. << "#endif" << newLine;
  406. }
  407. if (extraAppConfigContent.isNotEmpty())
  408. out << newLine << extraAppConfigContent.trimEnd() << newLine;
  409. }
  410. void writeAppConfigFile (const OwnedArray<LibraryModule>& modules, const String& userContent)
  411. {
  412. appConfigFile = getAppConfigFile();
  413. MemoryOutputStream mem;
  414. writeAppConfig (mem, modules, userContent);
  415. saveGeneratedFile (project.getAppConfigFilename(), mem);
  416. }
  417. void writeAppHeader (MemoryOutputStream& out, const OwnedArray<LibraryModule>& modules)
  418. {
  419. writeAutoGenWarningComment (out);
  420. out << " This is the header file that your files should include in order to get all the" << newLine
  421. << " JUCE library headers. You should avoid including the JUCE headers directly in" << newLine
  422. << " your own source files, because that wouldn't pick up the correct configuration" << newLine
  423. << " options for your app." << newLine
  424. << newLine
  425. << "*/" << newLine << newLine;
  426. out << "#pragma once" << newLine << newLine;
  427. if (appConfigFile.exists())
  428. out << CodeHelpers::createIncludeStatement (project.getAppConfigFilename()) << newLine;
  429. if (modules.size() > 0)
  430. {
  431. out << newLine;
  432. for (int i = 0; i < modules.size(); ++i)
  433. modules.getUnchecked(i)->writeIncludes (*this, out);
  434. out << newLine;
  435. }
  436. if (hasBinaryData && project.shouldIncludeBinaryInJuceHeader())
  437. out << CodeHelpers::createIncludeStatement (project.getBinaryDataHeaderFile(), appConfigFile) << newLine;
  438. out << newLine
  439. << "#if ! DONT_SET_USING_JUCE_NAMESPACE" << newLine
  440. << " // If your code uses a lot of JUCE classes, then this will obviously save you" << newLine
  441. << " // a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE." << newLine
  442. << " using namespace juce;" << newLine
  443. << "#endif" << newLine
  444. << newLine
  445. << "#if ! JUCE_DONT_DECLARE_PROJECTINFO" << newLine
  446. << "namespace ProjectInfo" << newLine
  447. << "{" << newLine
  448. << " const char* const projectName = " << CppTokeniserFunctions::addEscapeChars (project.getProjectNameString()).quoted() << ";" << newLine
  449. << " const char* const versionString = " << CppTokeniserFunctions::addEscapeChars (project.getVersionString()).quoted() << ";" << newLine
  450. << " const int versionNumber = " << project.getVersionAsHex() << ";" << newLine
  451. << "}" << newLine
  452. << "#endif" << newLine;
  453. }
  454. void writeAppHeader (const OwnedArray<LibraryModule>& modules)
  455. {
  456. MemoryOutputStream mem;
  457. writeAppHeader (mem, modules);
  458. saveGeneratedFile (project.getJuceSourceHFilename(), mem);
  459. }
  460. void writeModuleCppWrappers (const OwnedArray<LibraryModule>& modules)
  461. {
  462. for (auto* module : modules)
  463. {
  464. for (auto& cu : module->getAllCompileUnits())
  465. {
  466. MemoryOutputStream mem;
  467. writeAutoGenWarningComment (mem);
  468. mem << "*/" << newLine
  469. << newLine
  470. << "#include " << project.getAppConfigFilename().quoted() << newLine
  471. << "#include <";
  472. if (cu.file.getFileExtension() != ".r") // .r files are included without the path
  473. mem << module->getID() << "/";
  474. mem << cu.file.getFileName() << ">" << newLine;
  475. replaceFileIfDifferent (generatedCodeFolder.getChildFile (cu.getFilenameForProxyFile()), mem);
  476. }
  477. }
  478. }
  479. void writeBinaryDataFiles()
  480. {
  481. auto binaryDataH = project.getBinaryDataHeaderFile();
  482. ResourceFile resourceFile (project);
  483. if (resourceFile.getNumFiles() > 0)
  484. {
  485. auto dataNamespace = project.getBinaryDataNamespaceString().trim();
  486. if (dataNamespace.isEmpty())
  487. dataNamespace = "BinaryData";
  488. resourceFile.setClassName (dataNamespace);
  489. Array<File> binaryDataFiles;
  490. auto maxSize = project.getMaxBinaryFileSize();
  491. if (maxSize <= 0)
  492. maxSize = 10 * 1024 * 1024;
  493. auto r = resourceFile.write (binaryDataFiles, maxSize);
  494. if (r.wasOk())
  495. {
  496. hasBinaryData = true;
  497. for (int i = 0; i < binaryDataFiles.size(); ++i)
  498. {
  499. auto& f = binaryDataFiles.getReference(i);
  500. filesCreated.add (f);
  501. generatedFilesGroup.addFileRetainingSortOrder (f, ! f.hasFileExtension (".h"));
  502. }
  503. }
  504. else
  505. {
  506. addError (r.getErrorMessage());
  507. }
  508. }
  509. else
  510. {
  511. for (int i = 20; --i >= 0;)
  512. project.getBinaryDataCppFile (i).deleteFile();
  513. binaryDataH.deleteFile();
  514. }
  515. }
  516. void writeReadmeFile()
  517. {
  518. MemoryOutputStream out;
  519. out << newLine
  520. << " Important Note!!" << newLine
  521. << " ================" << newLine
  522. << newLine
  523. << "The purpose of this folder is to contain files that are auto-generated by the Projucer," << newLine
  524. << "and ALL files in this folder will be mercilessly DELETED and completely re-written whenever" << newLine
  525. << "the Projucer saves your project." << newLine
  526. << newLine
  527. << "Therefore, it's a bad idea to make any manual changes to the files in here, or to" << newLine
  528. << "put any of your own files in here if you don't want to lose them. (Of course you may choose" << newLine
  529. << "to add the folder's contents to your version-control system so that you can re-merge your own" << newLine
  530. << "modifications after the Projucer has saved its changes)." << newLine;
  531. replaceFileIfDifferent (generatedCodeFolder.getChildFile ("ReadMe.txt"), out);
  532. }
  533. void addError (const String& message)
  534. {
  535. const ScopedLock sl (errorLock);
  536. errors.add (message);
  537. }
  538. void writePluginCharacteristicsFile();
  539. void writeProjects (const OwnedArray<LibraryModule>&, const String&, bool);
  540. void saveExporter (ProjectExporter* exporter, const OwnedArray<LibraryModule>& modules)
  541. {
  542. try
  543. {
  544. exporter->create (modules);
  545. if (! exporter->isCLion())
  546. std::cout << "Finished saving: " << exporter->getName() << std::endl;
  547. }
  548. catch (ProjectExporter::SaveError& error)
  549. {
  550. addError (error.message);
  551. }
  552. }
  553. class ExporterJob : public ThreadPoolJob
  554. {
  555. public:
  556. ExporterJob (ProjectSaver& ps, ProjectExporter* pe,
  557. const OwnedArray<LibraryModule>& moduleList)
  558. : ThreadPoolJob ("export"),
  559. owner (ps), exporter (pe), modules (moduleList)
  560. {
  561. }
  562. JobStatus runJob() override
  563. {
  564. owner.saveExporter (exporter.get(), modules);
  565. return jobHasFinished;
  566. }
  567. private:
  568. ProjectSaver& owner;
  569. std::unique_ptr<ProjectExporter> exporter;
  570. const OwnedArray<LibraryModule>& modules;
  571. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ExporterJob)
  572. };
  573. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectSaver)
  574. };