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.

629 lines
31KB

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