#ifndef PluginSearchPathEditor_hpp #define PluginSearchPathEditor_hpp #include #include #include #include struct SearchPathSettings { SearchPathSettings() : useVstDefaultSearchPaths(true), useVst3DefaultSearchPaths(true) { } std::unique_ptr toXml() const; void fromXml(juce::XmlElement* elem); bool useVstDefaultSearchPaths; bool useVst3DefaultSearchPaths; std::vector vstSearchPaths; std::vector vst3SearchPaths; }; class SearchPathListModel; class PluginSearchPathEditor final : public juce::DocumentWindow { public: PluginSearchPathEditor(SearchPathSettings & settings, std::function closedHandler, std::function settingsEditedHandler); ~PluginSearchPathEditor(); void closeButtonPressed() override; void edited(); private: std::function closedHandler; std::function settingsEditedHandler; SearchPathSettings & settings; friend class PluginSearchPathEditorContent; }; class SearchPathEditorWidget final : public juce::Component, public juce::Button::Listener { public: SearchPathEditorWidget(std::vector & paths, std::function edited); ~SearchPathEditorWidget(); void resized() override; void buttonClicked(juce::Button *b) override; private: std::vector & paths; std::function edited; std::unique_ptr listModel; juce::ListBox listBox; juce::TextButton addButton, removeButton; std::unique_ptr fileChooser; }; class PluginSearchPathEditorContent final : public juce::Component, public juce::Button::Listener { public: PluginSearchPathEditorContent(PluginSearchPathEditor & editor); ~PluginSearchPathEditorContent(); void resized() override; void edited(); void buttonClicked(juce::Button *b) override; private: PluginSearchPathEditor & editor; juce::Label l_vst, l_vst3; juce::ToggleButton d_vst, d_vst3; SearchPathEditorWidget e_vst, e_vst3; }; #endif /* PluginSearchPathEditor_hpp */