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.

635 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 ProjectSaver;
  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. enum class Async { no, yes };
  88. //==============================================================================
  89. class Project : public FileBasedDocument,
  90. private ValueTree::Listener,
  91. private LicenseController::LicenseStateListener,
  92. private ChangeListener,
  93. private AvailableModulesList::Listener
  94. {
  95. public:
  96. //==============================================================================
  97. Project (const File&);
  98. ~Project() override;
  99. //==============================================================================
  100. String getDocumentTitle() override;
  101. Result loadDocument (const File& file) override;
  102. Result saveDocument (const File& file) override;
  103. void saveDocumentAsync (const File& file, std::function<void (Result)> callback) override;
  104. void saveProject (Async, ProjectExporter* exporterToSave, std::function<void (Result)> onCompletion);
  105. void saveAndMoveTemporaryProject (bool openInIDE);
  106. Result saveResourcesOnly();
  107. void openProjectInIDE (ProjectExporter& exporterToOpen);
  108. File getLastDocumentOpened() override;
  109. void setLastDocumentOpened (const File& file) override;
  110. void setTitle (const String& newTitle);
  111. //==============================================================================
  112. File getProjectFolder() const { return getFile().getParentDirectory(); }
  113. File getGeneratedCodeFolder() const { return getFile().getSiblingFile ("JuceLibraryCode"); }
  114. File getSourceFilesFolder() const { return getProjectFolder().getChildFile ("Source"); }
  115. File getLocalModulesFolder() const { return getGeneratedCodeFolder().getChildFile ("modules"); }
  116. File getLocalModuleFolder (const String& moduleID) const { return getLocalModulesFolder().getChildFile (moduleID); }
  117. File getAppIncludeFile() const { return getGeneratedCodeFolder().getChildFile (getJuceSourceHFilename()); }
  118. File getBinaryDataCppFile (int index) const;
  119. File getBinaryDataHeaderFile() const { return getBinaryDataCppFile (0).withFileExtension (".h"); }
  120. static String getAppConfigFilename() { return "AppConfig.h"; }
  121. static String getPluginDefinesFilename() { return "JucePluginDefines.h"; }
  122. static String getJuceSourceHFilename() { return "JuceHeader.h"; }
  123. //==============================================================================
  124. template <class FileType>
  125. bool shouldBeAddedToBinaryResourcesByDefault (const FileType& file)
  126. {
  127. return ! file.hasFileExtension (sourceOrHeaderFileExtensions);
  128. }
  129. File resolveFilename (String filename) const;
  130. String getRelativePathForFile (const File& file) const;
  131. //==============================================================================
  132. // Creates editors for the project settings
  133. void createPropertyEditors (PropertyListBuilder&);
  134. //==============================================================================
  135. ValueTree getProjectRoot() const { return projectRoot; }
  136. Value getProjectValue (const Identifier& name) { return projectRoot.getPropertyAsValue (name, getUndoManagerFor (projectRoot)); }
  137. var getProjectVar (const Identifier& name) const { return projectRoot.getProperty (name); }
  138. const build_tools::ProjectType& getProjectType() const;
  139. String getProjectTypeString() const { return projectTypeValue.get(); }
  140. void setProjectType (const String& newProjectType) { projectTypeValue = newProjectType; }
  141. String getProjectNameString() const { return projectNameValue.get(); }
  142. String getProjectFilenameRootString() { return File::createLegalFileName (getDocumentTitle()); }
  143. String getProjectUIDString() const { return projectUIDValue.get(); }
  144. String getProjectLineFeed() const { return projectLineFeedValue.get(); }
  145. String getVersionString() const { return versionValue.get(); }
  146. String getVersionAsHex() const { return build_tools::getVersionAsHex (getVersionString()); }
  147. int getVersionAsHexInteger() const { return build_tools::getVersionAsHexInteger (getVersionString()); }
  148. void setProjectVersion (const String& newVersion) { versionValue = newVersion; }
  149. String getBundleIdentifierString() const { return bundleIdentifierValue.get(); }
  150. String getDefaultBundleIdentifierString() const;
  151. String getDefaultAAXIdentifierString() const { return getDefaultBundleIdentifierString(); }
  152. String getDefaultPluginManufacturerString() const;
  153. String getCompanyNameString() const { return companyNameValue.get(); }
  154. String getCompanyCopyrightString() const { return companyCopyrightValue.get(); }
  155. String getCompanyWebsiteString() const { return companyWebsiteValue.get(); }
  156. String getCompanyEmailString() const { return companyEmailValue.get(); }
  157. String getHeaderSearchPathsString() const { return headerSearchPathsValue.get(); }
  158. StringPairArray getPreprocessorDefs() const { return parsedPreprocessorDefs; }
  159. int getMaxBinaryFileSize() const { return maxBinaryFileSizeValue.get(); }
  160. bool shouldIncludeBinaryInJuceHeader() const { return includeBinaryDataInJuceHeaderValue.get(); }
  161. String getBinaryDataNamespaceString() const { return binaryDataNamespaceValue.get(); }
  162. bool shouldDisplaySplashScreen() const { return displaySplashScreenValue.get(); }
  163. String getSplashScreenColourString() const { return splashScreenColourValue.get(); }
  164. static StringArray getCppStandardStrings() { return { "C++14", "C++17", "C++20", "Use Latest" }; }
  165. static Array<var> getCppStandardVars() { return { "14", "17", "20", "latest" }; }
  166. static String getLatestNumberedCppStandardString()
  167. {
  168. auto cppStandardVars = getCppStandardVars();
  169. return cppStandardVars[cppStandardVars.size() - 2];
  170. }
  171. String getCppStandardString() const { return cppStandardValue.get(); }
  172. StringArray getCompilerFlagSchemes() const;
  173. void addCompilerFlagScheme (const String&);
  174. void removeCompilerFlagScheme (const String&);
  175. String getPostExportShellCommandPosixString() const { return postExportShellCommandPosixValue.get(); }
  176. String getPostExportShellCommandWinString() const { return postExportShellCommandWinValue.get(); }
  177. bool shouldUseAppConfig() const { return useAppConfigValue.get(); }
  178. bool shouldAddUsingNamespaceToJuceHeader() const { return addUsingNamespaceToJuceHeader.get(); }
  179. //==============================================================================
  180. String getPluginNameString() const { return pluginNameValue.get(); }
  181. String getPluginDescriptionString() const { return pluginDescriptionValue.get();}
  182. String getPluginManufacturerString() const { return pluginManufacturerValue.get(); }
  183. String getPluginManufacturerCodeString() const { return pluginManufacturerCodeValue.get(); }
  184. String getPluginCodeString() const { return pluginCodeValue.get(); }
  185. String getPluginChannelConfigsString() const { return pluginChannelConfigsValue.get(); }
  186. String getAAXIdentifierString() const { return pluginAAXIdentifierValue.get(); }
  187. String getPluginAUExportPrefixString() const { return pluginAUExportPrefixValue.get(); }
  188. String getVSTNumMIDIInputsString() const { return pluginVSTNumMidiInputsValue.get(); }
  189. String getVSTNumMIDIOutputsString() const { return pluginVSTNumMidiOutputsValue.get(); }
  190. static bool checkMultiChoiceVar (const ValueWithDefault& valueToCheck, Identifier idToCheck) noexcept
  191. {
  192. if (! valueToCheck.get().isArray())
  193. return false;
  194. auto v = valueToCheck.get();
  195. if (auto* varArray = v.getArray())
  196. return varArray->contains (idToCheck.toString());
  197. return false;
  198. }
  199. bool isAudioPluginProject() const { return getProjectType().isAudioPlugin(); }
  200. bool shouldBuildVST() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildVST); }
  201. bool shouldBuildVST3() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildVST3); }
  202. bool shouldBuildAU() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildAU); }
  203. bool shouldBuildAUv3() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildAUv3); }
  204. bool shouldBuildRTAS() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildRTAS); }
  205. bool shouldBuildAAX() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildAAX); }
  206. bool shouldBuildStandalonePlugin() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildStandalone); }
  207. bool shouldBuildUnityPlugin() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::buildUnity); }
  208. bool shouldEnableIAA() const { return isAudioPluginProject() && checkMultiChoiceVar (pluginFormatsValue, Ids::enableIAA); }
  209. bool isPluginSynth() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginIsSynth); }
  210. bool pluginWantsMidiInput() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginWantsMidiIn); }
  211. bool pluginProducesMidiOutput() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginProducesMidiOut); }
  212. bool isPluginMidiEffect() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginIsMidiEffectPlugin); }
  213. bool pluginEditorNeedsKeyFocus() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginEditorRequiresKeys); }
  214. bool isPluginRTASBypassDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginRTASDisableBypass); }
  215. bool isPluginRTASMultiMonoDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginRTASDisableMultiMono); }
  216. bool isPluginAAXBypassDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginAAXDisableBypass); }
  217. bool isPluginAAXMultiMonoDisabled() const { return checkMultiChoiceVar (pluginCharacteristicsValue, Ids::pluginAAXDisableMultiMono); }
  218. static StringArray getAllAUMainTypeStrings() noexcept;
  219. static Array<var> getAllAUMainTypeVars() noexcept;
  220. Array<var> getDefaultAUMainTypes() const noexcept;
  221. static StringArray getAllVSTCategoryStrings() noexcept;
  222. Array<var> getDefaultVSTCategories() const noexcept;
  223. static StringArray getAllVST3CategoryStrings() noexcept;
  224. Array<var> getDefaultVST3Categories() const noexcept;
  225. static StringArray getAllAAXCategoryStrings() noexcept;
  226. static Array<var> getAllAAXCategoryVars() noexcept;
  227. Array<var> getDefaultAAXCategories() const noexcept;
  228. static StringArray getAllRTASCategoryStrings() noexcept;
  229. static Array<var> getAllRTASCategoryVars() noexcept;
  230. Array<var> getDefaultRTASCategories() const noexcept;
  231. String getAUMainTypeString() const noexcept;
  232. bool isAUSandBoxSafe() const noexcept;
  233. String getVSTCategoryString() const noexcept;
  234. String getVST3CategoryString() const noexcept;
  235. int getAAXCategory() const noexcept;
  236. int getRTASCategory() const noexcept;
  237. String getIAATypeCode() const;
  238. String getIAAPluginName() const;
  239. String getUnityScriptName() const { return addUnityPluginPrefixIfNecessary (getProjectNameString()) + "_UnityScript.cs"; }
  240. static String addUnityPluginPrefixIfNecessary (const String& name)
  241. {
  242. if (! name.startsWithIgnoreCase ("audioplugin"))
  243. return "audioplugin_" + name;
  244. return name;
  245. }
  246. //==============================================================================
  247. bool isAUPluginHost();
  248. bool isVSTPluginHost();
  249. bool isVST3PluginHost();
  250. //==============================================================================
  251. bool shouldBuildTargetType (build_tools::ProjectType::Target::Type targetType) const noexcept;
  252. static build_tools::ProjectType::Target::Type getTargetTypeFromFilePath (const File& file, bool returnSharedTargetIfNoValidSuffix);
  253. //==============================================================================
  254. void updateDeprecatedProjectSettingsInteractively();
  255. StringPairArray getAppConfigDefs();
  256. StringPairArray getAudioPluginFlags() const;
  257. //==============================================================================
  258. class Item
  259. {
  260. public:
  261. //==============================================================================
  262. Item (Project& project, const ValueTree& itemNode, bool isModuleCode);
  263. Item (const Item& other);
  264. static Item createGroup (Project& project, const String& name, const String& uid, bool isModuleCode);
  265. void initialiseMissingProperties();
  266. //==============================================================================
  267. bool isValid() const { return state.isValid(); }
  268. bool operator== (const Item& other) const { return state == other.state && &project == &other.project; }
  269. bool operator!= (const Item& other) const { return ! operator== (other); }
  270. //==============================================================================
  271. bool isFile() const;
  272. bool isGroup() const;
  273. bool isMainGroup() const;
  274. bool isImageFile() const;
  275. bool isSourceFile() const;
  276. String getID() const;
  277. void setID (const String& newID);
  278. Item findItemWithID (const String& targetId) const; // (recursive search)
  279. String getImageFileID() const;
  280. std::unique_ptr<Drawable> loadAsImageFile() const;
  281. //==============================================================================
  282. Value getNameValue();
  283. String getName() const;
  284. File getFile() const;
  285. String getFilePath() const;
  286. void setFile (const File& file);
  287. void setFile (const build_tools::RelativePath& file);
  288. File determineGroupFolder() const;
  289. bool renameFile (const File& newFile);
  290. bool shouldBeAddedToTargetProject() const;
  291. bool shouldBeAddedToTargetExporter (const ProjectExporter&) const;
  292. bool shouldBeCompiled() const;
  293. Value getShouldCompileValue();
  294. bool shouldBeAddedToBinaryResources() const;
  295. Value getShouldAddToBinaryResourcesValue();
  296. bool shouldBeAddedToXcodeResources() const;
  297. Value getShouldAddToXcodeResourcesValue();
  298. Value getShouldInhibitWarningsValue();
  299. bool shouldInhibitWarnings() const;
  300. bool isModuleCode() const;
  301. Value getShouldSkipPCHValue();
  302. bool shouldSkipPCH() const;
  303. Value getCompilerFlagSchemeValue();
  304. String getCompilerFlagSchemeString() const;
  305. void setCompilerFlagScheme (const String&);
  306. void clearCurrentCompilerFlagScheme();
  307. //==============================================================================
  308. bool canContain (const Item& child) const;
  309. int getNumChildren() const { return state.getNumChildren(); }
  310. Item getChild (int index) const { return Item (project, state.getChild (index), belongsToModule); }
  311. Item addNewSubGroup (const String& name, int insertIndex);
  312. Item getOrCreateSubGroup (const String& name);
  313. void addChild (const Item& newChild, int insertIndex);
  314. bool addFileAtIndex (const File& file, int insertIndex, bool shouldCompile);
  315. bool addFileRetainingSortOrder (const File& file, bool shouldCompile);
  316. void addFileUnchecked (const File& file, int insertIndex, bool shouldCompile);
  317. bool addRelativeFile (const build_tools::RelativePath& file, int insertIndex, bool shouldCompile);
  318. void removeItemFromProject();
  319. void sortAlphabetically (bool keepGroupsAtStart, bool recursive);
  320. Item findItemForFile (const File& file) const;
  321. bool containsChildForFile (const build_tools::RelativePath& file) const;
  322. Item getParent() const;
  323. Item createCopy();
  324. UndoManager* getUndoManager() const { return project.getUndoManagerFor (state); }
  325. Icon getIcon (bool isOpen = false) const;
  326. bool isIconCrossedOut() const;
  327. bool needsSaving() const noexcept;
  328. Project& project;
  329. ValueTree state;
  330. private:
  331. Item& operator= (const Item&);
  332. bool belongsToModule;
  333. };
  334. Item getMainGroup();
  335. void findAllImageItems (OwnedArray<Item>& items);
  336. //==============================================================================
  337. ValueTree getExporters();
  338. int getNumExporters();
  339. std::unique_ptr<ProjectExporter> createExporter (int index);
  340. void addNewExporter (const Identifier& exporterIdentifier);
  341. void createExporterForCurrentPlatform();
  342. struct ExporterIterator
  343. {
  344. ExporterIterator (Project& project);
  345. bool next();
  346. ProjectExporter& operator*() const { return *exporter; }
  347. ProjectExporter* operator->() const { return exporter.get(); }
  348. std::unique_ptr<ProjectExporter> exporter;
  349. int index;
  350. private:
  351. Project& project;
  352. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ExporterIterator)
  353. };
  354. //==============================================================================
  355. struct ConfigFlag
  356. {
  357. String symbol, description, sourceModuleID;
  358. ValueWithDefault value;
  359. };
  360. ValueWithDefault getConfigFlag (const String& name);
  361. bool isConfigFlagEnabled (const String& name, bool defaultIsEnabled = false) const;
  362. //==============================================================================
  363. EnabledModulesList& getEnabledModules();
  364. AvailableModulesList& getExporterPathsModulesList() { return exporterPathsModulesList; }
  365. void rescanExporterPathModules (bool async = false);
  366. std::pair<String, File> getModuleWithID (const String&);
  367. //==============================================================================
  368. PropertiesFile& getStoredProperties() const;
  369. //==============================================================================
  370. UndoManager* getUndoManagerFor (const ValueTree&) const { return nullptr; }
  371. UndoManager* getUndoManager() const { return nullptr; }
  372. //==============================================================================
  373. static const char* projectFileExtension;
  374. //==============================================================================
  375. bool updateCachedFileState();
  376. String getCachedFileStateContent() const noexcept { return cachedFileState.second; }
  377. String serialiseProjectXml (std::unique_ptr<XmlElement>) const;
  378. //==============================================================================
  379. String getUniqueTargetFolderSuffixForExporter (const Identifier& exporterIdentifier, const String& baseTargetFolder);
  380. //==============================================================================
  381. bool isCurrentlySaving() const noexcept { return saver != nullptr; }
  382. bool isTemporaryProject() const noexcept { return tempDirectory != File(); }
  383. File getTemporaryDirectory() const noexcept { return tempDirectory; }
  384. void setTemporaryDirectory (const File&) noexcept;
  385. //==============================================================================
  386. ValueTree getProjectMessages() const { return projectMessages; }
  387. void addProjectMessage (const Identifier& messageToAdd, std::vector<ProjectMessages::MessageAction>&& messageActions);
  388. void removeProjectMessage (const Identifier& messageToRemove);
  389. std::vector<ProjectMessages::MessageAction> getMessageActions (const Identifier& message);
  390. //==============================================================================
  391. bool hasIncompatibleLicenseTypeAndSplashScreenSetting() const;
  392. bool isFileModificationCheckPending() const;
  393. bool isSaveAndExportDisabled() const;
  394. private:
  395. //==============================================================================
  396. void valueTreePropertyChanged (ValueTree&, const Identifier&) override;
  397. void valueTreeChildAdded (ValueTree&, ValueTree&) override;
  398. void valueTreeChildRemoved (ValueTree&, ValueTree&, int) override;
  399. void valueTreeChildOrderChanged (ValueTree&, int, int) override;
  400. //==============================================================================
  401. struct ProjectFileModificationPoller : private Timer
  402. {
  403. ProjectFileModificationPoller (Project& p);
  404. bool isCheckPending() const noexcept { return pending; }
  405. private:
  406. void timerCallback() override;
  407. void reset();
  408. void resaveProject();
  409. void reloadProjectFromDisk();
  410. Project& project;
  411. bool pending = false;
  412. };
  413. //==============================================================================
  414. ValueTree projectRoot { Ids::JUCERPROJECT };
  415. ValueWithDefault projectNameValue, projectUIDValue, projectLineFeedValue, projectTypeValue, versionValue, bundleIdentifierValue, companyNameValue,
  416. companyCopyrightValue, companyWebsiteValue, companyEmailValue, displaySplashScreenValue, splashScreenColourValue, cppStandardValue,
  417. headerSearchPathsValue, preprocessorDefsValue, userNotesValue, maxBinaryFileSizeValue, includeBinaryDataInJuceHeaderValue, binaryDataNamespaceValue,
  418. compilerFlagSchemesValue, postExportShellCommandPosixValue, postExportShellCommandWinValue, useAppConfigValue, addUsingNamespaceToJuceHeader;
  419. ValueWithDefault pluginFormatsValue, pluginNameValue, pluginDescriptionValue, pluginManufacturerValue, pluginManufacturerCodeValue,
  420. pluginCodeValue, pluginChannelConfigsValue, pluginCharacteristicsValue, pluginAUExportPrefixValue, pluginAAXIdentifierValue,
  421. pluginAUMainTypeValue, pluginAUSandboxSafeValue, pluginRTASCategoryValue, pluginVSTCategoryValue, pluginVST3CategoryValue, pluginAAXCategoryValue,
  422. pluginVSTNumMidiInputsValue, pluginVSTNumMidiOutputsValue;
  423. //==============================================================================
  424. std::unique_ptr<EnabledModulesList> enabledModulesList;
  425. AvailableModulesList exporterPathsModulesList;
  426. //==============================================================================
  427. void updateDeprecatedProjectSettings();
  428. //==============================================================================
  429. bool shouldWriteLegacyPluginFormatSettings = false;
  430. bool shouldWriteLegacyPluginCharacteristicsSettings = false;
  431. static Array<Identifier> getLegacyPluginFormatIdentifiers() noexcept;
  432. static Array<Identifier> getLegacyPluginCharacteristicsIdentifiers() noexcept;
  433. void writeLegacyPluginFormatSettings();
  434. void writeLegacyPluginCharacteristicsSettings();
  435. void coalescePluginFormatValues();
  436. void coalescePluginCharacteristicsValues();
  437. void updatePluginCategories();
  438. //==============================================================================
  439. File tempDirectory;
  440. std::pair<Time, String> cachedFileState;
  441. //==============================================================================
  442. friend class Item;
  443. StringPairArray parsedPreprocessorDefs;
  444. //==============================================================================
  445. void initialiseProjectValues();
  446. void initialiseMainGroup();
  447. void initialiseAudioPluginValues();
  448. bool setCppVersionFromOldExporterSettings();
  449. void createAudioPluginPropertyEditors (PropertyListBuilder& props);
  450. //==============================================================================
  451. void updateTitleDependencies();
  452. void updateCompanyNameDependencies();
  453. void updateProjectSettings();
  454. ValueTree getConfigurations() const;
  455. ValueTree getConfigNode();
  456. void updateOldStyleConfigList();
  457. void moveOldPropertyFromProjectToAllExporters (Identifier name);
  458. void removeDefunctExporters();
  459. void updateOldModulePaths();
  460. //==============================================================================
  461. void licenseStateChanged() override;
  462. void changeListenerCallback (ChangeBroadcaster*) override;
  463. void availableModulesChanged (AvailableModulesList*) override;
  464. void updateLicenseWarning();
  465. void updateJUCEPathWarning();
  466. void updateModuleWarnings();
  467. void updateExporterWarnings();
  468. void updateCppStandardWarning (bool showWarning);
  469. void updateMissingModuleDependenciesWarning (bool showWarning);
  470. void updateOldProjucerWarning (bool showWarning);
  471. void updateCLionWarning (bool showWarning);
  472. void updateModuleNotFoundWarning (bool showWarning);
  473. ValueTree projectMessages { ProjectMessages::Ids::projectMessages, {},
  474. { { ProjectMessages::Ids::notification, {} }, { ProjectMessages::Ids::warning, {} } } };
  475. std::map<Identifier, std::vector<ProjectMessages::MessageAction>> messageActions;
  476. ProjectFileModificationPoller fileModificationPoller { *this };
  477. std::unique_ptr<FileChooser> chooser;
  478. std::unique_ptr<ProjectSaver> saver;
  479. //==============================================================================
  480. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Project)
  481. JUCE_DECLARE_WEAK_REFERENCEABLE (Project)
  482. };