1 /* 2 ============================================================================== 3 4 This file is part of the JUCE library. 5 Copyright (c) 2020 - Raw Material Software Limited 6 7 JUCE is an open source library subject to commercial or open-source 8 licensing. 9 10 By using JUCE, you agree to the terms of both the JUCE 6 End-User License 11 Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). 12 13 End User License Agreement: www.juce.com/juce-6-licence 14 Privacy Policy: www.juce.com/juce-privacy-policy 15 16 Or: You may also use this code under the terms of the GPL v3 (see 17 www.gnu.org/licenses). 18 19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER 20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE 21 DISCLAIMED. 22 23 ============================================================================== 24 */ 25 26 #pragma once 27 28 29 //============================================================================== 30 #define FILE_EXT .h 31 32 #define EXPAND(x) x 33 #define CREATE_FILEPATH(DemoName, category) JUCE_STRINGIFY(EXPAND(category)/EXPAND(DemoName)EXPAND(FILE_EXT)) 34 35 #define REGISTER_DEMO(DemoName, category, heavyweight) JUCEDemos::registerDemo ([] { return new DemoName(); }, CREATE_FILEPATH(DemoName, category), JUCE_STRINGIFY (category), heavyweight); 36 37 //============================================================================== 38 struct JUCEDemos 39 { 40 struct FileAndCallback 41 { 42 File demoFile; 43 std::function<Component*()> callback; 44 bool isHeavyweight; 45 }; 46 47 struct DemoCategory 48 { 49 String name; 50 std::vector<FileAndCallback> demos; 51 }; 52 53 static std::vector<DemoCategory>& getCategories(); 54 static DemoCategory& getCategory (const String& name); 55 56 static void registerDemo (std::function<Component*()> constructorCallback, const String& filePath, const String& category, bool isHeavyweight); 57 static File findExamplesDirectoryFromExecutable (File exec); 58 }; 59 60 void registerDemos_One() noexcept; 61 void registerDemos_Two() noexcept; 62 63 //============================================================================== 64 // used by child-process demo 65 bool invokeChildProcessDemo (const String& commandLine); 66 void registerAllDemos() noexcept; 67 68 Component* createIntroDemo(); 69 bool isComponentIntroDemo (Component*) noexcept; 70 71 CodeEditorComponent::ColourScheme getDarkColourScheme(); 72 CodeEditorComponent::ColourScheme getLightColourScheme(); 73 74 //============================================================================== 75 extern std::unique_ptr<AudioDeviceManager> sharedAudioDeviceManager; 76 77 AudioDeviceManager& getSharedAudioDeviceManager (int numInputChannels = -1, int numOutputChannels = -1); 78