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.

68 lines
2.4KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. #pragma once
  14. //==============================================================================
  15. #define FILE_EXT .h
  16. #define EXPAND(x) x
  17. #define CREATE_FILEPATH(DemoName, category) JUCE_STRINGIFY(EXPAND(category)/EXPAND(DemoName)EXPAND(FILE_EXT))
  18. #define REGISTER_DEMO(DemoName, category, heavyweight) JUCEDemos::registerDemo ([] { return new DemoName(); }, CREATE_FILEPATH(DemoName, category), JUCE_STRINGIFY (category), heavyweight);
  19. //==============================================================================
  20. struct JUCEDemos
  21. {
  22. struct FileAndCallback
  23. {
  24. File demoFile;
  25. std::function<Component*()> callback;
  26. bool isHeavyweight;
  27. };
  28. struct DemoCategory
  29. {
  30. String name;
  31. std::vector<FileAndCallback> demos;
  32. };
  33. static std::vector<DemoCategory>& getCategories();
  34. static DemoCategory& getCategory (const String& name);
  35. static void registerDemo (std::function<Component*()> constructorCallback, const String& filePath, const String& category, bool isHeavyweight);
  36. static File findExamplesDirectoryFromExecutable (File exec);
  37. };
  38. //==============================================================================
  39. // used by child-process demo
  40. bool invokeChildProcessDemo (const String& commandLine);
  41. void registerAllDemos() noexcept;
  42. Component* createIntroDemo();
  43. bool isComponentIntroDemo (Component*) noexcept;
  44. CodeEditorComponent::ColourScheme getDarkColourScheme();
  45. CodeEditorComponent::ColourScheme getLightColourScheme();
  46. //==============================================================================
  47. extern std::unique_ptr<AudioDeviceManager> sharedAudioDeviceManager;
  48. AudioDeviceManager& getSharedAudioDeviceManager (int numInputChannels = -1, int numOutputChannels = -1);