diff widgets/PluginPathConfigurator.h @ 1289:ed04d3666d33 plugin-path-config

Toward more than one plugin type in this widget
author Chris Cannam
date Mon, 21 May 2018 16:15:36 +0100
parents 4683b6ffb76a
children 050eca637c19
line wrap: on
line diff
--- a/widgets/PluginPathConfigurator.h	Tue May 15 15:25:04 2018 +0100
+++ b/widgets/PluginPathConfigurator.h	Mon May 21 16:15:36 2018 +0100
@@ -23,6 +23,7 @@
 class QListWidget;
 class QPushButton;
 class QGridLayout;
+class QComboBox;
 
 class PluginPathConfigurator : public QFrame
 {
@@ -32,29 +33,43 @@
     PluginPathConfigurator(QWidget *parent = 0);
     ~PluginPathConfigurator();
 
-    void setPath(QStringList directories, QString envVariable);
-    QStringList getPath() const;
+    // Text used to identify a plugin type to the user.
+    // e.g. "LADSPA", "Vamp", or potentially transliterations thereof
+    typedef QString PluginTypeLabel;
+
+    struct PathConfig {
+        QStringList directories;
+        QString envVariable; // e.g. "LADSPA_PATH" etc
+    };
+
+    typedef std::map<PluginTypeLabel, PathConfig> Paths;
+    
+    void setPaths(Paths paths);
+    Paths getPaths() const;
 
 signals:
-    void pathChanged(QStringList);
+    void pathsChanged(const Paths &paths);
 
 private slots:
     void upClicked();
     void downClicked();
     void deleteClicked();
+    void currentTypeChanged(QString);
     void currentLocationChanged(int);
     
 private:
     QGridLayout *m_layout;
+    QLabel *m_header;
+    QComboBox *m_pluginTypeSelector;
     QListWidget *m_list;
     QPushButton *m_up;
     QPushButton *m_down;
     QPushButton *m_delete;
 
-    QStringList m_path;
-    QString m_var;
+    Paths m_paths;
     
-    void populate(int makeCurrent = 0);
+    void populate();
+    void populateFor(QString type, int makeCurrent);
 };
 
 #endif