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.

621 lines
30KB

  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 (newVersionAvailable);
  39. DECLARE_ID (notification);
  40. DECLARE_ID (warning);
  41. DECLARE_ID (isVisible);
  42. #undef DECLARE_ID
  43. }
  44. inline Identifier getTypeForMessage (const Identifier& message)
  45. {
  46. if (message == Ids::incompatibleLicense || message == Ids::cppStandard || message == Ids::moduleNotFound
  47. || message == Ids::jucePath || message == Ids::jucerFileModified || message == Ids::missingModuleDependencies
  48. || message == Ids::oldProjucer)
  49. {
  50. return Ids::warning;
  51. }
  52. if (message == Ids::newVersionAvailable)
  53. {
  54. return Ids::notification;
  55. }
  56. jassertfalse;
  57. return {};
  58. }
  59. inline String getTitleForMessage (const Identifier& message)
  60. {
  61. if (message == Ids::incompatibleLicense) return "Incompatible License and Splash Screen Setting";
  62. if (message == Ids::cppStandard) return "C++ Standard";
  63. if (message == Ids::moduleNotFound) return "Module Not Found";
  64. if (message == Ids::jucePath) return "JUCE Path";
  65. if (message == Ids::jucerFileModified) return "Project File Modified";
  66. if (message == Ids::missingModuleDependencies) return "Missing Module Dependencies";
  67. if (message == Ids::oldProjucer) return "Projucer Out of Date";
  68. if (message == Ids::newVersionAvailable) return "New Version Available";
  69. jassertfalse;
  70. return {};
  71. }
  72. inline String getDescriptionForMessage (const Identifier& message)
  73. {
  74. if (message == Ids::incompatibleLicense) return "Save and export is disabled.";
  75. if (message == Ids::cppStandard) return "Module(s) have a higher C++ standard requirement than the project.";
  76. if (message == Ids::moduleNotFound) return "Module(s) could not be found at the specified paths.";
  77. if (message == Ids::jucePath) return "The path to your JUCE folder is incorrect.";
  78. if (message == Ids::jucerFileModified) return "The .jucer file has been modified since the last save.";
  79. if (message == Ids::missingModuleDependencies) return "Module(s) have missing dependencies.";
  80. if (message == Ids::oldProjucer) return "The version of the Projucer you are using is out of date.";
  81. if (message == Ids::newVersionAvailable) return "A new version of JUCE is available to download.";
  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 (
  244. build_tools::ProjectType::Target::Type targetType) const noexcept;
  245. static build_tools::ProjectType::Target::Type getTargetTypeFromFilePath (const File& file, bool returnSharedTargetIfNoValidSuffix);
  246. //==============================================================================
  247. void updateDeprecatedProjectSettingsInteractively();
  248. StringPairArray getAppConfigDefs();
  249. StringPairArray getAudioPluginFlags() const;
  250. //==============================================================================
  251. class Item
  252. {
  253. public:
  254. //==============================================================================
  255. Item (Project& project, const ValueTree& itemNode, bool isModuleCode);
  256. Item (const Item& other);
  257. static Item createGroup (Project& project, const String& name, const String& uid, bool isModuleCode);
  258. void initialiseMissingProperties();
  259. //==============================================================================
  260. bool isValid() const { return state.isValid(); }
  261. bool operator== (const Item& other) const { return state == other.state && &project == &other.project; }
  262. bool operator!= (const Item& other) const { return ! operator== (other); }
  263. //==============================================================================
  264. bool isFile() const;
  265. bool isGroup() const;
  266. bool isMainGroup() const;
  267. bool isImageFile() 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 getCompilerFlagSchemeValue();
  294. String getCompilerFlagSchemeString() const;
  295. void setCompilerFlagScheme (const String&);
  296. void clearCurrentCompilerFlagScheme();
  297. //==============================================================================
  298. bool canContain (const Item& child) const;
  299. int getNumChildren() const { return state.getNumChildren(); }
  300. Item getChild (int index) const { return Item (project, state.getChild (index), belongsToModule); }
  301. Item addNewSubGroup (const String& name, int insertIndex);
  302. Item getOrCreateSubGroup (const String& name);
  303. void addChild (const Item& newChild, int insertIndex);
  304. bool addFileAtIndex (const File& file, int insertIndex, bool shouldCompile);
  305. bool addFileRetainingSortOrder (const File& file, bool shouldCompile);
  306. void addFileUnchecked (const File& file, int insertIndex, bool shouldCompile);
  307. bool addRelativeFile (const build_tools::RelativePath& file, int insertIndex, bool shouldCompile);
  308. void removeItemFromProject();
  309. void sortAlphabetically (bool keepGroupsAtStart, bool recursive);
  310. Item findItemForFile (const File& file) const;
  311. bool containsChildForFile (const build_tools::RelativePath& file) const;
  312. Item getParent() const;
  313. Item createCopy();
  314. UndoManager* getUndoManager() const { return project.getUndoManagerFor (state); }
  315. Icon getIcon (bool isOpen = false) const;
  316. bool isIconCrossedOut() const;
  317. bool needsSaving() const noexcept;
  318. Project& project;
  319. ValueTree state;
  320. private:
  321. Item& operator= (const Item&);
  322. bool belongsToModule;
  323. };
  324. Item getMainGroup();
  325. void findAllImageItems (OwnedArray<Item>& items);
  326. //==============================================================================
  327. ValueTree getExporters();
  328. int getNumExporters();
  329. std::unique_ptr<ProjectExporter> createExporter (int index);
  330. void addNewExporter (const Identifier& exporterIdentifier);
  331. void createExporterForCurrentPlatform();
  332. struct ExporterIterator
  333. {
  334. ExporterIterator (Project& project);
  335. ~ExporterIterator();
  336. bool next();
  337. ProjectExporter& operator*() const { return *exporter; }
  338. ProjectExporter* operator->() const { return exporter.get(); }
  339. std::unique_ptr<ProjectExporter> exporter;
  340. int index;
  341. private:
  342. Project& project;
  343. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ExporterIterator)
  344. };
  345. //==============================================================================
  346. struct ConfigFlag
  347. {
  348. String symbol, description, sourceModuleID;
  349. ValueWithDefault value;
  350. };
  351. ValueWithDefault getConfigFlag (const String& name);
  352. bool isConfigFlagEnabled (const String& name, bool defaultIsEnabled = false) const;
  353. //==============================================================================
  354. EnabledModulesList& getEnabledModules();
  355. AvailableModulesList& getExporterPathsModulesList() { return exporterPathsModulesList; }
  356. void rescanExporterPathModules (bool async = false);
  357. std::pair<String, File> getModuleWithID (const String&);
  358. //==============================================================================
  359. PropertiesFile& getStoredProperties() const;
  360. //==============================================================================
  361. UndoManager* getUndoManagerFor (const ValueTree&) const { return nullptr; }
  362. UndoManager* getUndoManager() const { return nullptr; }
  363. //==============================================================================
  364. static const char* projectFileExtension;
  365. //==============================================================================
  366. bool updateCachedFileState();
  367. String getCachedFileStateContent() const noexcept { return cachedFileState.second; }
  368. String serialiseProjectXml (std::unique_ptr<XmlElement>) const;
  369. //==============================================================================
  370. String getUniqueTargetFolderSuffixForExporter (const Identifier& exporterIdentifier, 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. void valueTreePropertyChanged (ValueTree&, const Identifier&) override;
  389. void valueTreeChildAdded (ValueTree&, ValueTree&) override;
  390. void valueTreeChildRemoved (ValueTree&, ValueTree&, int) override;
  391. void valueTreeChildOrderChanged (ValueTree&, int, int) override;
  392. //==============================================================================
  393. struct ProjectFileModificationPoller : private Timer
  394. {
  395. ProjectFileModificationPoller (Project& p);
  396. private:
  397. void timerCallback() override;
  398. void reset();
  399. void resaveProject();
  400. void reloadProjectFromDisk();
  401. Project& project;
  402. bool showingWarning = false;
  403. };
  404. //==============================================================================
  405. ValueTree projectRoot { Ids::JUCERPROJECT };
  406. ValueWithDefault projectNameValue, projectUIDValue, projectLineFeedValue, projectTypeValue, versionValue, bundleIdentifierValue, companyNameValue,
  407. companyCopyrightValue, companyWebsiteValue, companyEmailValue, displaySplashScreenValue, splashScreenColourValue, cppStandardValue,
  408. headerSearchPathsValue, preprocessorDefsValue, userNotesValue, maxBinaryFileSizeValue, includeBinaryDataInJuceHeaderValue, binaryDataNamespaceValue,
  409. compilerFlagSchemesValue, postExportShellCommandPosixValue, postExportShellCommandWinValue, useAppConfigValue, addUsingNamespaceToJuceHeader;
  410. ValueWithDefault pluginFormatsValue, pluginNameValue, pluginDescriptionValue, pluginManufacturerValue, pluginManufacturerCodeValue,
  411. pluginCodeValue, pluginChannelConfigsValue, pluginCharacteristicsValue, pluginAUExportPrefixValue, pluginAAXIdentifierValue,
  412. pluginAUMainTypeValue, pluginAUSandboxSafeValue, pluginRTASCategoryValue, pluginVSTCategoryValue, pluginVST3CategoryValue, pluginAAXCategoryValue,
  413. pluginVSTNumMidiInputsValue, pluginVSTNumMidiOutputsValue;
  414. //==============================================================================
  415. std::unique_ptr<CompileEngineSettings> compileEngineSettings;
  416. std::unique_ptr<EnabledModulesList> enabledModulesList;
  417. AvailableModulesList exporterPathsModulesList;
  418. //==============================================================================
  419. void updateDeprecatedProjectSettings();
  420. //==============================================================================
  421. bool shouldWriteLegacyPluginFormatSettings = false;
  422. bool shouldWriteLegacyPluginCharacteristicsSettings = false;
  423. static Array<Identifier> getLegacyPluginFormatIdentifiers() noexcept;
  424. static Array<Identifier> getLegacyPluginCharacteristicsIdentifiers() noexcept;
  425. void writeLegacyPluginFormatSettings();
  426. void writeLegacyPluginCharacteristicsSettings();
  427. void coalescePluginFormatValues();
  428. void coalescePluginCharacteristicsValues();
  429. void updatePluginCategories();
  430. //==============================================================================
  431. File tempDirectory;
  432. std::pair<Time, String> cachedFileState;
  433. void saveAndMoveTemporaryProject (bool openInIDE);
  434. //==============================================================================
  435. friend class Item;
  436. bool isSaving = false;
  437. StringPairArray parsedPreprocessorDefs;
  438. //==============================================================================
  439. void initialiseProjectValues();
  440. void initialiseMainGroup();
  441. void initialiseAudioPluginValues();
  442. bool setCppVersionFromOldExporterSettings();
  443. void createAudioPluginPropertyEditors (PropertyListBuilder& props);
  444. //==============================================================================
  445. void updateTitleDependencies();
  446. void updateCompanyNameDependencies();
  447. void updateProjectSettings();
  448. ValueTree getConfigurations() const;
  449. ValueTree getConfigNode();
  450. void updateOldStyleConfigList();
  451. void moveOldPropertyFromProjectToAllExporters (Identifier name);
  452. void removeDefunctExporters();
  453. void updateOldModulePaths();
  454. //==============================================================================
  455. void licenseStateChanged() override;
  456. void changeListenerCallback (ChangeBroadcaster*) override;
  457. void availableModulesChanged (AvailableModulesList*) override;
  458. void updateLicenseWarning();
  459. void updateJUCEPathWarning();
  460. void updateModuleWarnings();
  461. void updateCppStandardWarning (bool showWarning);
  462. void updateMissingModuleDependenciesWarning (bool showWarning);
  463. void updateOldProjucerWarning (bool showWarning);
  464. void updateModuleNotFoundWarning (bool showWarning);
  465. ValueTree projectMessages { ProjectMessages::Ids::projectMessages, {},
  466. { { ProjectMessages::Ids::notification, {} }, { ProjectMessages::Ids::warning, {} } } };
  467. std::map<Identifier, std::vector<ProjectMessages::MessageAction>> messageActions;
  468. ProjectFileModificationPoller fileModificationPoller { *this };
  469. //==============================================================================
  470. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Project)
  471. };