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.

82 lines
2.5KB

  1. /*
  2. ==============================================================================
  3. jucer_GlobalPreferences.h
  4. Created: 22 Jul 2015 11:05:35am
  5. Author: Timur Doumler
  6. ==============================================================================
  7. */
  8. #ifndef JUCER_GLOBALPREFERENCES_H_INCLUDED
  9. #define JUCER_GLOBALPREFERENCES_H_INCLUDED
  10. //==============================================================================
  11. #include "../Project/jucer_DependencyPathPropertyComponent.h"
  12. class GlobalPreferencesTab
  13. {
  14. public:
  15. virtual ~GlobalPreferencesTab() {}
  16. virtual Component* getContent() = 0;
  17. virtual String getName() const noexcept = 0;
  18. };
  19. //==============================================================================
  20. /** This component implements the "Paths" tab in the global preferences window,
  21. which defines the default paths for dependencies like third-party SDKs
  22. for this machine.
  23. */
  24. class PathSettingsTab : public GlobalPreferencesTab,
  25. public Component,
  26. private TextPropertyComponent::Listener
  27. {
  28. public:
  29. PathSettingsTab (DependencyPathOS);
  30. ~PathSettingsTab();
  31. Component* getContent() override;
  32. String getName() const noexcept override;
  33. void resized() override;
  34. static Value& getPathByKey (const String& key, DependencyPathOS);
  35. static String getFallbackPathByKey (const String& key, DependencyPathOS);
  36. static bool checkPathByKey (const String& key, const String& path);
  37. private:
  38. void textPropertyComponentChanged (TextPropertyComponent*) override;
  39. String getKeyForPropertyComponent (TextPropertyComponent*) const;
  40. OwnedArray<TextPropertyComponent> pathComponents;
  41. TextPropertyComponent* vst2PathComponent;
  42. TextPropertyComponent* vst3PathComponent;
  43. TextPropertyComponent* rtasPathComponent;
  44. TextPropertyComponent* aaxPathComponent;
  45. TextPropertyComponent* androidSdkPathComponent;
  46. TextPropertyComponent* androidNdkPathComponent;
  47. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PathSettingsTab)
  48. };
  49. //==============================================================================
  50. class GlobalPreferencesComponent : public TabbedComponent
  51. {
  52. public:
  53. GlobalPreferencesComponent();
  54. private:
  55. OwnedArray<GlobalPreferencesTab> preferenceTabs;
  56. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GlobalPreferencesComponent)
  57. };
  58. #endif // JUCER_GLOBALPREFERENCES_H_INCLUDED