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.

72 lines
2.5KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 7 technical preview.
  4. Copyright (c) 2022 - 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 the technical preview this file cannot be licensed commercially.
  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. void registerDemos_One() noexcept;
  39. void registerDemos_Two() noexcept;
  40. //==============================================================================
  41. // used by child-process demo
  42. bool invokeChildProcessDemo (const String& commandLine);
  43. void registerAllDemos() noexcept;
  44. Component* createIntroDemo();
  45. bool isComponentIntroDemo (Component*) noexcept;
  46. CodeEditorComponent::ColourScheme getDarkColourScheme();
  47. CodeEditorComponent::ColourScheme getLightColourScheme();
  48. //==============================================================================
  49. extern std::unique_ptr<AudioDeviceManager> sharedAudioDeviceManager;
  50. AudioDeviceManager& getSharedAudioDeviceManager (int numInputChannels = -1, int numOutputChannels = -1);
  51. ApplicationCommandManager& getGlobalCommandManager();