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.3KB

  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. #include <JuceHeader.h>
  15. #include "DemoContentComponent.h"
  16. //==============================================================================
  17. class MainComponent : public Component
  18. {
  19. public:
  20. //==============================================================================
  21. MainComponent();
  22. ~MainComponent() override;
  23. //==============================================================================
  24. void paint (Graphics&) override;
  25. void resized() override;
  26. //==============================================================================
  27. SidePanel& getSidePanel() { return demosPanel; }
  28. //==============================================================================
  29. void homeButtonClicked();
  30. void settingsButtonClicked();
  31. //==============================================================================
  32. StringArray getRenderingEngines() { return renderingEngines; }
  33. int getCurrentRenderingEngine() { return currentRenderingEngineIdx; }
  34. void setRenderingEngine (int index);
  35. private:
  36. void parentHierarchyChanged() override;
  37. void updateRenderingEngine (int index);
  38. //==============================================================================
  39. std::unique_ptr<DemoContentComponent> contentComponent;
  40. SidePanel demosPanel { "Demos", 250, true };
  41. OpenGLContext openGLContext;
  42. ComponentPeer* peer = nullptr;
  43. StringArray renderingEngines;
  44. int currentRenderingEngineIdx = -1;
  45. TextButton showDemosButton { "Browse Demos" };
  46. bool isShowingHeavyweightDemo = false;
  47. int sidePanelWidth = 0;
  48. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainComponent)
  49. };