| @@ -605,7 +605,7 @@ void ProjucerApplication::createExamplesPopupMenu (PopupMenu& menu) noexcept | |||||
| } | } | ||||
| } | } | ||||
| Array<File> ProjucerApplication::getSortedExampleDirectories() const noexcept | |||||
| Array<File> ProjucerApplication::getSortedExampleDirectories() noexcept | |||||
| { | { | ||||
| Array<File> exampleDirectories; | Array<File> exampleDirectories; | ||||
| @@ -662,6 +662,16 @@ bool ProjucerApplication::findWindowAndOpenPIP (const File& pip) | |||||
| return false; | return false; | ||||
| } | } | ||||
| File ProjucerApplication::getJUCEExamplesDirectoryPathFromGlobal() noexcept | |||||
| { | |||||
| auto globalPath = getAppSettings().getStoredPath (Ids::jucePath).toString(); | |||||
| if (globalPath.isNotEmpty()) | |||||
| return File (globalPath).getChildFile ("examples"); | |||||
| return {}; | |||||
| } | |||||
| void ProjucerApplication::findAndLaunchExample (int selectedIndex) | void ProjucerApplication::findAndLaunchExample (int selectedIndex) | ||||
| { | { | ||||
| File example; | File example; | ||||
| @@ -689,7 +699,7 @@ void ProjucerApplication::findAndLaunchExample (int selectedIndex) | |||||
| Analytics::getInstance()->logEvent ("Example Opened", data, ProjucerAnalyticsEvent::exampleEvent); | Analytics::getInstance()->logEvent ("Example Opened", data, ProjucerAnalyticsEvent::exampleEvent); | ||||
| } | } | ||||
| File ProjucerApplication::findDemoRunnerExecutable() const noexcept | |||||
| File ProjucerApplication::findDemoRunnerExecutable() noexcept | |||||
| { | { | ||||
| auto buildsPath = getJUCEExamplesDirectoryPathFromGlobal().getChildFile ("DemoRunner").getChildFile ("Builds"); | auto buildsPath = getJUCEExamplesDirectoryPathFromGlobal().getChildFile ("DemoRunner").getChildFile ("Builds"); | ||||
| @@ -751,7 +761,7 @@ File ProjucerApplication::findDemoRunnerExecutable() const noexcept | |||||
| return {}; | return {}; | ||||
| } | } | ||||
| File ProjucerApplication::findDemoRunnerProject() const noexcept | |||||
| File ProjucerApplication::findDemoRunnerProject() noexcept | |||||
| { | { | ||||
| auto buildsPath = getJUCEExamplesDirectoryPathFromGlobal().getChildFile ("DemoRunner").getChildFile ("Builds"); | auto buildsPath = getJUCEExamplesDirectoryPathFromGlobal().getChildFile ("DemoRunner").getChildFile ("Builds"); | ||||
| @@ -177,14 +177,15 @@ private: | |||||
| void deleteTemporaryFiles() const noexcept; | void deleteTemporaryFiles() const noexcept; | ||||
| void createExamplesPopupMenu (PopupMenu&) noexcept; | void createExamplesPopupMenu (PopupMenu&) noexcept; | ||||
| Array<File> getSortedExampleDirectories() const noexcept; | |||||
| Array<File> getSortedExampleDirectories() noexcept; | |||||
| Array<File> getSortedExampleFilesInDirectory (const File&) const noexcept; | Array<File> getSortedExampleFilesInDirectory (const File&) const noexcept; | ||||
| bool findWindowAndOpenPIP (const File&); | bool findWindowAndOpenPIP (const File&); | ||||
| File getJUCEExamplesDirectoryPathFromGlobal() noexcept; | |||||
| void findAndLaunchExample (int); | void findAndLaunchExample (int); | ||||
| File findDemoRunnerExecutable() const noexcept; | |||||
| File findDemoRunnerProject() const noexcept; | |||||
| File findDemoRunnerExecutable() noexcept; | |||||
| File findDemoRunnerProject() noexcept; | |||||
| void launchDemoRunner(); | void launchDemoRunner(); | ||||
| int numExamples = 0; | int numExamples = 0; | ||||
| @@ -403,16 +403,6 @@ bool isPIPFile (const File& file) noexcept | |||||
| return false; | return false; | ||||
| } | } | ||||
| File getJUCEExamplesDirectoryPathFromGlobal() noexcept | |||||
| { | |||||
| auto globalPath = getAppSettings().getStoredPath (Ids::jucePath).toString(); | |||||
| if (globalPath.isNotEmpty()) | |||||
| return File (getAppSettings().getStoredPath (Ids::jucePath).toString()).getChildFile ("examples"); | |||||
| return {}; | |||||
| } | |||||
| bool isValidJUCEExamplesDirectory (const File& directory) noexcept | bool isValidJUCEExamplesDirectory (const File& directory) noexcept | ||||
| { | { | ||||
| if (! directory.exists() || ! directory.isDirectory() || ! directory.containsSubDirectories()) | if (! directory.exists() || ! directory.isDirectory() || ! directory.containsSubDirectories()) | ||||
| @@ -68,7 +68,6 @@ StringArray getModulesRequiredForAudioProcessor() noexcept; | |||||
| bool isPIPFile (const File&) noexcept; | bool isPIPFile (const File&) noexcept; | ||||
| File getJUCEExamplesDirectoryPathFromGlobal() noexcept; | |||||
| bool isValidJUCEExamplesDirectory (const File&) noexcept; | bool isValidJUCEExamplesDirectory (const File&) noexcept; | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -395,12 +395,12 @@ Result PIPGenerator::setProjectSettings (ValueTree& jucerTree) | |||||
| if (useLocalCopy && isJUCEExample (pipFile)) | if (useLocalCopy && isJUCEExample (pipFile)) | ||||
| { | { | ||||
| auto examplesDirectory = getJUCEExamplesDirectoryPathFromGlobal(); | |||||
| auto juceDir = getAppSettings().getStoredPath (Ids::jucePath).toString(); | |||||
| if (isValidJUCEExamplesDirectory (examplesDirectory)) | |||||
| if (juceDir.isNotEmpty() && isValidJUCEExamplesDirectory (File (juceDir).getChildFile ("examples"))) | |||||
| { | { | ||||
| defines += ((defines.isEmpty() ? "" : " ") + String ("PIP_JUCE_EXAMPLES_DIRECTORY=") | defines += ((defines.isEmpty() ? "" : " ") + String ("PIP_JUCE_EXAMPLES_DIRECTORY=") | ||||
| + Base64::toBase64 (examplesDirectory.getFullPathName())); | |||||
| + Base64::toBase64 (File (juceDir).getChildFile ("examples").getFullPathName())); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||