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.

615 lines
30KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. #pragma once
  14. #include "../Application/UserAccount/jucer_LicenseController.h"
  15. #include "Modules/jucer_AvailableModulesList.h"
  16. class ProjectExporter;
  17. class LibraryModule;
  18. class EnabledModulesList;
  19. class CompileEngineSettings;
  20. namespace ProjectMessages
  21. {
  22. namespace Ids
  23. {
  24. #define DECLARE_ID(name) static const Identifier name (#name)
  25. DECLARE_ID (projectMessages);
  26. DECLARE_ID (incompatibleLicense);
  27. DECLARE_ID (cppStandard);
  28. DECLARE_ID (moduleNotFound);
  29. DECLARE_ID (jucePath);
  30. DECLARE_ID (jucerFileModified);
  31. DECLARE_ID (missingModuleDependencies);
  32. DECLARE_ID (oldProjucer);
  33. DECLARE_ID (newVersionAvailable);
  34. DECLARE_ID (notification);
  35. DECLARE_ID (warning);
  36. DECLARE_ID (isVisible);
  37. #undef DECLARE_ID
  38. }
  39. inline Identifier getTypeForMessage (const Identifier& message)
  40. {
  41. if (message == Ids::incompatibleLicense || message == Ids::cppStandard || message == Ids::moduleNotFound
  42. || message == Ids::jucePath || message == Ids::jucerFileModified || message == Ids::missingModuleDependencies
  43. || message == Ids::oldProjucer)
  44. {
  45. return Ids::warning;
  46. }
  47. if (message == Ids::newVersionAvailable)
  48. {
  49. return Ids::notification;
  50. }
  51. jassertfalse;
  52. return {};
  53. }
  54. inline String getTitleForMessage (const Identifier& message)
  55. {
  56. if (message == Ids::incompatibleLicense) return "Incompatible License and Splash Screen Setting";
  57. if (message == Ids::cppStandard) return "C++ Standard";
  58. if (message == Ids::moduleNotFound) return "Module Not Found";
  59. if (message == Ids::jucePath) return "JUCE Path";
  60. if (message == Ids::jucerFileModified) return "Project File Modified";
  61. if (message == Ids::missingModuleDependencies) return "Missing Module Dependencies";
  62. if (message == Ids::oldProjucer) return "Projucer Out of Date";
  63. if (message == Ids::newVersionAvailable) return "New Version Available";
  64. jassertfalse;
  65. return {};
  66. }
  67. inline String getDescriptionForMessage (const Identifier& message)
  68. {
  69. if (message == Ids::incompatibleLicense) return "Save and export is disabled.";
  70. if (message == Ids::cppStandard) return "Module(s) have a higher C++ standard requirement than the project.";
  71. if (message == Ids::moduleNotFound) return "Module(s) could not be found at the specified paths.";
  72. if (message == Ids::jucePath) return "The path to your JUCE folder is incorrect.";
  73. if (message == Ids::jucerFileModified) return "The .jucer file has been modified since the last save.";
  74. if (message == Ids::missingModuleDependencies) return "Module(s) have missing dependencies.";
  75. if (message == Ids::oldProjucer) return "The version of the Projucer you are using is out of date.";
  76. if (message == Ids::newVersionAvailable) return "A new version of JUCE is available to download.";
  77. jassertfalse;
  78. return {};
  79. }
  80. using MessageAction = std::pair<String, std::function<void()>>;
  81. }
  82. //==============================================================================
  83. class Project : public FileBasedDocument,
  84. public ValueTree::Listener,
  85. private LicenseController::LicenseStateListener,
  86. private ChangeListener,
  87. private AvailableModulesList::Listener
  88. {
  89. public:
  90. //==============================================================================
  91. Project (const File&);
  92. ~Project() override;
  93. //==============================================================================
  94. String getDocumentTitle() override;
  95. Result loadDocument (const File& file) override;
  96. Result saveDocument (const File& file) override;
  97. Result saveProject (ProjectExporter* exporterToSave = nullptr);
  98. Result saveResourcesOnly();
  99. Result openProjectInIDE (ProjectExporter& exporterToOpen, bool saveFirst);
  100. File getLastDocumentOpened() override;
  101. void setLastDocumentOpened (const File& file) override;
  102. void setTitle (const String& newTitle);
  103. //==============================================================================
  104. File getProjectFolder() const { return getFile().getParentDirectory(); }
  105. File getGeneratedCodeFolder() const { return getFile().getSiblingFile ("JuceLibraryCode"); }
  106. File getSourceFilesFolder() const { return getProjectFolder().getChildFile ("Source"); }
  107. File getLocalModulesFolder() const { return getGeneratedCodeFolder().getChildFile ("modules"); }
  108. File getLocalModuleFolder (const String& moduleID) const { return getLocalModulesFolder().getChildFile (moduleID); }
  109. File getAppIncludeFile() const { return getGeneratedCodeFolder().getChildFile (getJuceSourceHFilename()); }
  110. File getBinaryDataCppFile (int index) const;
  111. File getBinaryDataHeaderFile() const { return getBinaryDataCppFile (0).withFileExtension (".h"); }
  112. static String getAppConfigFilename() { return "AppConfig.h"; }
  113. static String getPluginDefinesFilename() { return "JucePluginDefines.h"; }
  114. static String getJuceSourceHFilename() { return "JuceHeader.h"; }
  115. //==============================================================================
  116. template <class FileType>
  117. bool shouldBeAddedToBinaryResourcesByDefault (const FileType& file)
  118. {
  119. return ! file.hasFileExtension (sourceOrHeaderFileExtensions);
  120. }
  121. File resolveFilename (String filename) const;
  122. String getRelativePathForFile (const File& file) const;
  123. //==============================================================================
  124. // Creates editors for the project settings
  125. void createPropertyEditors (PropertyListBuilder&);
  126. //==============================================================================
  127. ValueTree getProjectRoot() const { return projectRoot; }
  128. Value getProjectValue (const Identifier& name) { return projectRoot.getPropertyAsValue (name, getUndoManagerFor (projectRoot)); }
  129. var getProjectVar (const Identifier& name) const { return projectRoot.getProperty (name); }
  130. const build_tools::ProjectType& getProjectType() const;
  131. String getProjectTypeString() const { return projectTypeValue.get(); }
  132. void setProjectType (const String& newProjectType) { projectTypeValue = newProjectType; }
  133. String getProjectNameString() const { return projectNameValue.get(); }
  134. String getProjectFilenameRootString() { return File::createLegalFileName (getDocumentTitle()); }
  135. String getProjectUIDString() const { return projectUIDValue.get(); }
  136. String getProjectLineFeed() const { return projectLineFeedValue.get(); }
  137. String getVersionString() const { return versionValue.get(); }
  138. String getVersionAsHex() const { return build_tools::getVersionAsHex (getVersionString()); }
  139. int getVersionAsHexInteger() const { return build_tools::getVersionAsHexInteger (getVersionString()); }
  140. void setProjectVersion (const String& newVersion) { versionValue = newVersion; }
  141. String getBundleIdentifierString() const { return bundleIdentifierValue.get(); }
  142. String getDefaultBundleIdentifierString() const;
  143. String getDefaultAAXIdentifierString() const { return getDefaultBundleIdentifierString(); }
  144. String getDefaultPluginManufacturerString() const;
  145. String getCompanyNameString() const { return companyNameValue.get(); }
  146. String getCompanyCopyrightString() const { return companyCopyrightValue.get(); }
  147. String getCompanyWebsiteString() const { return companyWebsiteValue.get(); }
  148. String getCompanyEmailString() const { return companyEmailValue.get(); }
  149. String getHeaderSearchPathsString() const { return headerSearchPathsValue.get(); }
  150. StringPairArray getPreprocessorDefs() const { return parsedPreprocessorDefs; }
  151. int getMaxBinaryFileSize() const { return maxBinaryFileSizeValue.get(); }
  152. bool shouldIncludeBinaryInJuceHeader() const { return includeBinaryDataInJuceHeaderValue.get(); }
  153. String getBinaryDataNamespaceString() const { return binaryDataNamespaceValue.get(); }
  154. bool shouldDisplaySplashScreen() const { return displaySplashScreenValue.get(); }
  155. String getSplashScreenColourString() const { return splashScreenColourValue.get(); }
  156. static StringArray getCppStandardStrings() { return { "C++11", "C++14", "C++17", "Use Latest" }; }
  157. static Array<var> getCppStandardVars() { return { "11", "14", "17", "latest" }; }
  158. String getCppStandardString() const { return cppStandardValue.get(); }
  159. StringArray getCompilerFlagSchemes() const;
  160. void addCompilerFlagScheme (const String&);
  161. void removeCompilerFlagScheme (const String&);
  162. String getPostExportShellCommandPosixString() const { return postExportShellCommandPosixValue.get(); }
  163. String getPostExportShellCommandWinString() const { return postExportShellCommandWinValue.get(); }
  164. bool shouldUseAppConfig() const { return useAppConfigValue.get(); }
  165. bool shouldAddUsingNamespaceToJuceHeader() const { return addUsingNamespaceToJuceHeader.get(); }
  166. //==============================================================================
  167. String getPluginNameString() const { return pluginNameValue.get(); }
  168. String getPluginDescriptionString() const { return pluginDescriptionValue.get();}
  169. String getPluginManufacturerString() const { return pluginManufacturerValue.get(); }
  170. String getPluginManufacturerCodeString() const { return pluginManufacturerCodeValue.get(); }
  171. String getPluginCodeString() const { return pluginCodeValue.get(); }
  172. String getPluginChannelConfigsString() const { return pluginChannelConfigsValue.get(); }
  173. String getAAXIdentifierString() const { return pluginAAXIdentifierValue.get(); }
  174. String getPluginAUExportPrefixString() const { return pluginAUExportPrefixValue.get(); }
  175. String getVSTNumMIDIInputsString() const { return pluginVSTNumMidiInputsValue.get(); }
  176. String getVSTNumMIDIOutputsString() const { return pluginVSTNumMidiOutputsValue.get(); }
  177. static bool checkMultiChoiceVar (const ValueWithDefault& valueToCheck, Identifier idToCheck) noexcept
  178. {
  179. if (! valueToCheck.get().isArray())
  180. return false;
  181. auto v = valueToCheck.get();
  182. if (auto* varArray = v.getArray())
  183. return varArray->contains (idToCheck.toString());
  184. return false;
  185. }
  186. bool isAudioPluginProject() const { return getProjectType().isAudioPlugin(); }
  187. bool shouldBuildVST() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildVST); }
  188. bool shouldBuildVST3() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildVST3); }
  189. bool shouldBuildAU() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildAU); }
  190. bool shouldBuildAUv3() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildAUv3); }
  191. bool shouldBuildRTAS() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildRTAS); }
  192. bool shouldBuildAAX() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildAAX); }
  193. bool shouldBuildStandalonePlugin() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildStandalone); }
  194. bool shouldBuildUnityPlugin() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildUnity); }
  195. bool shouldEnableIAA() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::enableIAA); }
  196. bool isPluginSynth() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginIsSynth); }
  197. bool pluginWantsMidiInput() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginWantsMidiIn); }
  198. bool pluginProducesMidiOutput() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginProducesMidiOut); }
  199. bool isPluginMidiEffect() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginIsMidiEffectPlugin); }
  200. bool pluginEditorNeedsKeyFocus() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginEditorRequiresKeys); }
  201. bool isPluginRTASBypassDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginRTASDisableBypass); }
  202. bool isPluginRTASMultiMonoDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginRTASDisableMultiMono); }
  203. bool isPluginAAXBypassDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginAAXDisableBypass); }
  204. bool isPluginAAXMultiMonoDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginAAXDisableMultiMono); }
  205. static StringArray getAllAUMainTypeStrings() noexcept;
  206. static Array<var> getAllAUMainTypeVars() noexcept;
  207. Array<var> getDefaultAUMainTypes() const noexcept;
  208. static StringArray getAllVSTCategoryStrings() noexcept;
  209. Array<var> getDefaultVSTCategories() const noexcept;
  210. static StringArray getAllVST3CategoryStrings() noexcept;
  211. Array<var> getDefaultVST3Categories() const noexcept;
  212. static StringArray getAllAAXCategoryStrings() noexcept;
  213. static Array<var> getAllAAXCategoryVars() noexcept;
  214. Array<var> getDefaultAAXCategories() const noexcept;
  215. static StringArray getAllRTASCategoryStrings() noexcept;
  216. static Array<var> getAllRTASCategoryVars() noexcept;
  217. Array<var> getDefaultRTASCategories() const noexcept;
  218. String getAUMainTypeString() const noexcept;
  219. bool isAUSandBoxSafe() const noexcept;
  220. String getVSTCategoryString() const noexcept;
  221. String getVST3CategoryString() const noexcept;
  222. int getAAXCategory() const noexcept;
  223. int getRTASCategory() const noexcept;
  224. String getIAATypeCode() const;
  225. String getIAAPluginName() const;
  226. String getUnityScriptName() const { return addUnityPluginPrefixIfNecessary (getProjectNameString()) + "_UnityScript.cs"; }
  227. static String addUnityPluginPrefixIfNecessary (const String& name)
  228. {
  229. if (! name.startsWithIgnoreCase ("audioplugin"))
  230. return "audioplugin_" + name;
  231. return name;
  232. }
  233. //==============================================================================
  234. bool isAUPluginHost();
  235. bool isVSTPluginHost();
  236. bool isVST3PluginHost();
  237. //==============================================================================
  238. bool shouldBuildTargetType (
  239. build_tools::ProjectType::Target::Type targetType) const noexcept;
  240. static build_tools::ProjectType::Target::Type getTargetTypeFromFilePath (const File& file, bool returnSharedTargetIfNoValidSuffix);
  241. //==============================================================================
  242. void updateDeprecatedProjectSettingsInteractively();
  243. StringPairArray getAudioPluginFlags() const;
  244. //==============================================================================
  245. class Item
  246. {
  247. public:
  248. //==============================================================================
  249. Item (Project& project, const ValueTree& itemNode, bool isModuleCode);
  250. Item (const Item& other);
  251. static Item createGroup (Project& project, const String& name, const String& uid, bool isModuleCode);
  252. void initialiseMissingProperties();
  253. //==============================================================================
  254. bool isValid() const { return state.isValid(); }
  255. bool operator== (const Item& other) const { return state == other.state && &project == &other.project; }
  256. bool operator!= (const Item& other) const { return ! operator== (other); }
  257. //==============================================================================
  258. bool isFile() const;
  259. bool isGroup() const;
  260. bool isMainGroup() const;
  261. bool isImageFile() const;
  262. String getID() const;
  263. void setID (const String& newID);
  264. Item findItemWithID (const String& targetId) const; // (recursive search)
  265. String getImageFileID() const;
  266. std::unique_ptr<Drawable> loadAsImageFile() const;
  267. //==============================================================================
  268. Value getNameValue();
  269. String getName() const;
  270. File getFile() const;
  271. String getFilePath() const;
  272. void setFile (const File& file);
  273. void setFile (const build_tools::RelativePath& file);
  274. File determineGroupFolder() const;
  275. bool renameFile (const File& newFile);
  276. bool shouldBeAddedToTargetProject() const;
  277. bool shouldBeAddedToTargetExporter (const ProjectExporter&) const;
  278. bool shouldBeCompiled() const;
  279. Value getShouldCompileValue();
  280. bool shouldBeAddedToBinaryResources() const;
  281. Value getShouldAddToBinaryResourcesValue();
  282. bool shouldBeAddedToXcodeResources() const;
  283. Value getShouldAddToXcodeResourcesValue();
  284. Value getShouldInhibitWarningsValue();
  285. bool shouldInhibitWarnings() const;
  286. bool isModuleCode() const;
  287. Value getCompilerFlagSchemeValue();
  288. String getCompilerFlagSchemeString() const;
  289. void setCompilerFlagScheme (const String&);
  290. void clearCurrentCompilerFlagScheme();
  291. //==============================================================================
  292. bool canContain (const Item& child) const;
  293. int getNumChildren() const { return state.getNumChildren(); }
  294. Item getChild (int index) const { return Item (project, state.getChild (index), belongsToModule); }
  295. Item addNewSubGroup (const String& name, int insertIndex);
  296. Item getOrCreateSubGroup (const String& name);
  297. void addChild (const Item& newChild, int insertIndex);
  298. bool addFileAtIndex (const File& file, int insertIndex, bool shouldCompile);
  299. bool addFileRetainingSortOrder (const File& file, bool shouldCompile);
  300. void addFileUnchecked (const File& file, int insertIndex, bool shouldCompile);
  301. bool addRelativeFile (const build_tools::RelativePath& file, int insertIndex, bool shouldCompile);
  302. void removeItemFromProject();
  303. void sortAlphabetically (bool keepGroupsAtStart, bool recursive);
  304. Item findItemForFile (const File& file) const;
  305. bool containsChildForFile (const build_tools::RelativePath& file) const;
  306. Item getParent() const;
  307. Item createCopy();
  308. UndoManager* getUndoManager() const { return project.getUndoManagerFor (state); }
  309. Icon getIcon (bool isOpen = false) const;
  310. bool isIconCrossedOut() const;
  311. bool needsSaving() const noexcept;
  312. Project& project;
  313. ValueTree state;
  314. private:
  315. Item& operator= (const Item&);
  316. bool belongsToModule;
  317. };
  318. Item getMainGroup();
  319. void findAllImageItems (OwnedArray<Item>& items);
  320. //==============================================================================
  321. ValueTree getExporters();
  322. int getNumExporters();
  323. ProjectExporter* createExporter (int index);
  324. void addNewExporter (const String& exporterName);
  325. void createExporterForCurrentPlatform();
  326. struct ExporterIterator
  327. {
  328. ExporterIterator (Project& project);
  329. ~ExporterIterator();
  330. bool next();
  331. ProjectExporter& operator*() const { return *exporter; }
  332. ProjectExporter* operator->() const { return exporter.get(); }
  333. std::unique_ptr<ProjectExporter> exporter;
  334. int index;
  335. private:
  336. Project& project;
  337. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ExporterIterator)
  338. };
  339. //==============================================================================
  340. struct ConfigFlag
  341. {
  342. String symbol, description, sourceModuleID;
  343. ValueWithDefault value;
  344. };
  345. ValueWithDefault getConfigFlag (const String& name);
  346. bool isConfigFlagEnabled (const String& name, bool defaultIsEnabled = false) const;
  347. //==============================================================================
  348. EnabledModulesList& getEnabledModules();
  349. AvailableModulesList& getExporterPathsModulesList() { return exporterPathsModulesList; }
  350. void rescanExporterPathModules (bool async = false);
  351. std::pair<String, File> getModuleWithID (const String&);
  352. //==============================================================================
  353. String getFileTemplate (const String& templateName);
  354. //==============================================================================
  355. PropertiesFile& getStoredProperties() const;
  356. //==============================================================================
  357. void valueTreePropertyChanged (ValueTree&, const Identifier&) override;
  358. void valueTreeChildAdded (ValueTree&, ValueTree&) override;
  359. void valueTreeChildRemoved (ValueTree&, ValueTree&, int) override;
  360. void valueTreeChildOrderChanged (ValueTree&, int, int) override;
  361. //==============================================================================
  362. UndoManager* getUndoManagerFor (const ValueTree&) const { return nullptr; }
  363. UndoManager* getUndoManager() const { return nullptr; }
  364. //==============================================================================
  365. static const char* projectFileExtension;
  366. //==============================================================================
  367. bool updateCachedFileState();
  368. void writeProjectFile();
  369. //==============================================================================
  370. String getUniqueTargetFolderSuffixForExporter (const String& exporterName, const String& baseTargetFolder);
  371. //==============================================================================
  372. bool isCurrentlySaving() const noexcept { return isSaving; }
  373. bool isTemporaryProject() const noexcept { return tempDirectory != File(); }
  374. File getTemporaryDirectory() const noexcept { return tempDirectory; }
  375. void setTemporaryDirectory (const File&) noexcept;
  376. //==============================================================================
  377. CompileEngineSettings& getCompileEngineSettings() { return *compileEngineSettings; }
  378. //==============================================================================
  379. ValueTree getProjectMessages() const { return projectMessages; }
  380. void addProjectMessage (const Identifier& messageToAdd, std::vector<ProjectMessages::MessageAction>&& messageActions);
  381. void removeProjectMessage (const Identifier& messageToRemove);
  382. std::vector<ProjectMessages::MessageAction> getMessageActions (const Identifier& message);
  383. //==============================================================================
  384. bool hasIncompatibleLicenseTypeAndSplashScreenSetting() const;
  385. bool isSaveAndExportDisabled() const;
  386. private:
  387. //==============================================================================
  388. struct ProjectFileModificationPoller : private Timer
  389. {
  390. ProjectFileModificationPoller (Project& p);
  391. private:
  392. void timerCallback() override;
  393. void reset();
  394. void resaveProject();
  395. void reloadProjectFromDisk();
  396. Project& project;
  397. bool showingWarning = false;
  398. };
  399. //==============================================================================
  400. ValueTree projectRoot { Ids::JUCERPROJECT };
  401. ValueWithDefault projectNameValue, projectUIDValue, projectLineFeedValue, projectTypeValue, versionValue, bundleIdentifierValue, companyNameValue,
  402. companyCopyrightValue, companyWebsiteValue, companyEmailValue, displaySplashScreenValue, splashScreenColourValue, cppStandardValue,
  403. headerSearchPathsValue, preprocessorDefsValue, userNotesValue, maxBinaryFileSizeValue, includeBinaryDataInJuceHeaderValue, binaryDataNamespaceValue,
  404. compilerFlagSchemesValue, postExportShellCommandPosixValue, postExportShellCommandWinValue, useAppConfigValue, addUsingNamespaceToJuceHeader;
  405. ValueWithDefault pluginFormatsValue, pluginNameValue, pluginDescriptionValue, pluginManufacturerValue, pluginManufacturerCodeValue,
  406. pluginCodeValue, pluginChannelConfigsValue, pluginCharacteristicsValue, pluginAUExportPrefixValue, pluginAAXIdentifierValue,
  407. pluginAUMainTypeValue, pluginAUSandboxSafeValue, pluginRTASCategoryValue, pluginVSTCategoryValue, pluginVST3CategoryValue, pluginAAXCategoryValue,
  408. pluginVSTNumMidiInputsValue, pluginVSTNumMidiOutputsValue;
  409. //==============================================================================
  410. std::unique_ptr<CompileEngineSettings> compileEngineSettings;
  411. std::unique_ptr<EnabledModulesList> enabledModulesList;
  412. AvailableModulesList exporterPathsModulesList;
  413. //==============================================================================
  414. void updateDeprecatedProjectSettings();
  415. //==============================================================================
  416. bool shouldWriteLegacyPluginFormatSettings = false;
  417. bool shouldWriteLegacyPluginCharacteristicsSettings = false;
  418. static Array<Identifier> getLegacyPluginFormatIdentifiers() noexcept;
  419. static Array<Identifier> getLegacyPluginCharacteristicsIdentifiers() noexcept;
  420. void writeLegacyPluginFormatSettings();
  421. void writeLegacyPluginCharacteristicsSettings();
  422. void coalescePluginFormatValues();
  423. void coalescePluginCharacteristicsValues();
  424. void updatePluginCategories();
  425. //==============================================================================
  426. File tempDirectory;
  427. std::pair<Time, String> cachedFileState;
  428. void saveAndMoveTemporaryProject (bool openInIDE);
  429. String serialiseProjectXml (std::unique_ptr<XmlElement>) const;
  430. //==============================================================================
  431. friend class Item;
  432. bool isSaving = false;
  433. StringPairArray parsedPreprocessorDefs;
  434. //==============================================================================
  435. void initialiseProjectValues();
  436. void initialiseMainGroup();
  437. void initialiseAudioPluginValues();
  438. bool setCppVersionFromOldExporterSettings();
  439. void createAudioPluginPropertyEditors (PropertyListBuilder& props);
  440. //==============================================================================
  441. void updateTitleDependencies();
  442. void updateCompanyNameDependencies();
  443. void updateProjectSettings();
  444. ValueTree getConfigurations() const;
  445. ValueTree getConfigNode();
  446. void updateOldStyleConfigList();
  447. void moveOldPropertyFromProjectToAllExporters (Identifier name);
  448. void removeDefunctExporters();
  449. void updateOldModulePaths();
  450. //==============================================================================
  451. void licenseStateChanged() override;
  452. void changeListenerCallback (ChangeBroadcaster*) override;
  453. void availableModulesChanged (AvailableModulesList*) override;
  454. void updateLicenseWarning();
  455. void updateJUCEPathWarning();
  456. void updateModuleWarnings();
  457. void updateCppStandardWarning (bool showWarning);
  458. void updateMissingModuleDependenciesWarning (bool showWarning);
  459. void updateOldProjucerWarning (bool showWarning);
  460. void updateModuleNotFoundWarning (bool showWarning);
  461. ValueTree projectMessages { ProjectMessages::Ids::projectMessages, {},
  462. { { ProjectMessages::Ids::notification, {} }, { ProjectMessages::Ids::warning, {} } } };
  463. std::map<Identifier, std::vector<ProjectMessages::MessageAction>> messageActions;
  464. ProjectFileModificationPoller fileModificationPoller { *this };
  465. //==============================================================================
  466. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Project)
  467. };