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.

71 lines
1.9KB

  1. #pragma once
  2. #include <JuceHeader.h>
  3. #include "UIUtils.h"
  4. #include "ScanConfiguration.hpp"
  5. class CustomPathsList : public juce::Component {
  6. public:
  7. CustomPathsList(juce::FileSearchPath& customPaths);
  8. ~CustomPathsList();
  9. void resized() override;
  10. void mouseDown(const juce::MouseEvent& event) override;
  11. int getRequiredHeight() const;
  12. void rebuild();
  13. private:
  14. juce::FileSearchPath& _customPaths;
  15. std::vector<std::unique_ptr<juce::Label>> _customPathsLabels;
  16. };
  17. class FormatConfigureComponent : public juce::Component {
  18. public:
  19. FormatConfigureComponent(juce::AudioPluginFormat* format,
  20. bool& defaultPathsEnabled,
  21. juce::FileSearchPath& customPaths);
  22. ~FormatConfigureComponent();
  23. void resized() override;
  24. private:
  25. UIUtils::ToggleButtonLookAndFeel _toggleButtonLookAndFeel;
  26. UIUtils::StaticButtonLookAndFeel _staticButtonLookAndFeel;
  27. std::unique_ptr<juce::TextButton> _defaultPathsButton;
  28. std::unique_ptr<juce::Label> _defaultPathsListLabel;
  29. std::unique_ptr<juce::TextButton> _customPathsButton;
  30. std::unique_ptr<CustomPathsList> _customPathsListComponent;
  31. std::unique_ptr<juce::FileChooser> _fileChooser;
  32. };
  33. class ConfigurePopover : public juce::Component {
  34. public:
  35. ConfigurePopover(ScanConfiguration& config, std::function<void()> onCloseCallback);
  36. ~ConfigurePopover();
  37. void resized() override;
  38. void paint(juce::Graphics& g) override;
  39. void mouseEnter(const juce::MouseEvent &event) override;
  40. void mouseExit(const juce::MouseEvent &event) override;
  41. private:
  42. std::function<void()> _onCloseCallback;
  43. UIUtils::StaticButtonLookAndFeel _buttonLookAndFeel;
  44. std::unique_ptr<FormatConfigureComponent> _vstConfigure;
  45. std::unique_ptr<FormatConfigureComponent> _vst3Configure;
  46. std::unique_ptr<juce::TextButton> _okButton;
  47. std::unique_ptr<juce::Label> _tooltipLabel;
  48. };