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.

73 lines
2.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCEDEMOHEADER_H_EE664D1A__
  19. #define __JUCEDEMOHEADER_H_EE664D1A__
  20. #include "../JuceLibraryCode/JuceHeader.h"
  21. #include "MainWindow.h"
  22. #include "DemoUtilities.h"
  23. //==============================================================================
  24. /** Static subclasses of this class are created in each of the demo modules, to
  25. register each of the demo types.
  26. */
  27. class JuceDemoTypeBase
  28. {
  29. public:
  30. JuceDemoTypeBase (const String& demoName);
  31. virtual ~JuceDemoTypeBase();
  32. virtual Component* createComponent() = 0;
  33. const String name;
  34. static Array<JuceDemoTypeBase*>& getDemoTypeList();
  35. private:
  36. JUCE_DECLARE_NON_COPYABLE (JuceDemoTypeBase);
  37. };
  38. //==============================================================================
  39. /** A templated subclass of JuceDemoTypeBase to make it easy for our demos
  40. to declare themselves.
  41. */
  42. template <class DemoType>
  43. class JuceDemoType : public JuceDemoTypeBase
  44. {
  45. public:
  46. JuceDemoType (const String& demoName) : JuceDemoTypeBase (demoName)
  47. {}
  48. Component* createComponent() { return new DemoType(); }
  49. private:
  50. JUCE_DECLARE_NON_COPYABLE (JuceDemoType);
  51. };
  52. #endif // __JUCEDEMOHEADER_H_EE664D1A__