annotate widgets/PluginPathConfigurator.h @ 1292:41824255ddf2 plugin-path-config

Plugin review dialog
author Chris Cannam
date Fri, 25 May 2018 13:39:08 +0100
parents b5c71304286e
children 6dd15b5c14f9
rev   line source
Chris@1285 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@1285 2
Chris@1285 3 /*
Chris@1285 4 Sonic Visualiser
Chris@1285 5 An audio file viewer and annotation editor.
Chris@1285 6 Centre for Digital Music, Queen Mary, University of London.
Chris@1285 7
Chris@1285 8 This program is free software; you can redistribute it and/or
Chris@1285 9 modify it under the terms of the GNU General Public License as
Chris@1285 10 published by the Free Software Foundation; either version 2 of the
Chris@1285 11 License, or (at your option) any later version. See the file
Chris@1285 12 COPYING included with this distribution for more information.
Chris@1285 13 */
Chris@1285 14
Chris@1285 15 #ifndef SV_PLUGIN_PATH_CONFIGURATOR_H
Chris@1285 16 #define SV_PLUGIN_PATH_CONFIGURATOR_H
Chris@1285 17
Chris@1285 18 #include <QFrame>
Chris@1285 19 #include <QStringList>
Chris@1285 20
Chris@1286 21 class QLabel;
Chris@1286 22 class QWidget;
Chris@1287 23 class QListWidget;
Chris@1288 24 class QPushButton;
Chris@1288 25 class QGridLayout;
Chris@1289 26 class QComboBox;
Chris@1290 27 class QCheckBox;
Chris@1286 28
Chris@1285 29 class PluginPathConfigurator : public QFrame
Chris@1285 30 {
Chris@1285 31 Q_OBJECT
Chris@1285 32
Chris@1285 33 public:
Chris@1285 34 PluginPathConfigurator(QWidget *parent = 0);
Chris@1285 35 ~PluginPathConfigurator();
Chris@1285 36
Chris@1289 37 // Text used to identify a plugin type to the user.
Chris@1289 38 // e.g. "LADSPA", "Vamp", or potentially transliterations thereof
Chris@1289 39 typedef QString PluginTypeLabel;
Chris@1289 40
Chris@1289 41 struct PathConfig {
Chris@1289 42 QStringList directories;
Chris@1289 43 QString envVariable; // e.g. "LADSPA_PATH" etc
Chris@1290 44 bool useEnvVariable; // true if env variable overrides directories list
Chris@1289 45 };
Chris@1289 46
Chris@1289 47 typedef std::map<PluginTypeLabel, PathConfig> Paths;
Chris@1289 48
Chris@1289 49 void setPaths(Paths paths);
Chris@1289 50 Paths getPaths() const;
Chris@1285 51
Chris@1285 52 signals:
Chris@1289 53 void pathsChanged(const Paths &paths);
Chris@1285 54
Chris@1285 55 private slots:
Chris@1285 56 void upClicked();
Chris@1285 57 void downClicked();
Chris@1291 58 void addClicked();
Chris@1285 59 void deleteClicked();
Chris@1290 60 void resetClicked();
Chris@1289 61 void currentTypeChanged(QString);
Chris@1288 62 void currentLocationChanged(int);
Chris@1290 63 void envOverrideChanged(int);
Chris@1292 64 void seePluginsClicked();
Chris@1285 65
Chris@1285 66 private:
Chris@1285 67 QGridLayout *m_layout;
Chris@1289 68 QLabel *m_header;
Chris@1289 69 QComboBox *m_pluginTypeSelector;
Chris@1287 70 QListWidget *m_list;
Chris@1292 71 QPushButton *m_seePlugins;
Chris@1288 72 QPushButton *m_up;
Chris@1288 73 QPushButton *m_down;
Chris@1291 74 QPushButton *m_add;
Chris@1288 75 QPushButton *m_delete;
Chris@1290 76 QPushButton *m_reset;
Chris@1290 77 QCheckBox *m_envOverride;
Chris@1285 78
Chris@1289 79 Paths m_paths;
Chris@1290 80 Paths m_originalPaths;
Chris@1285 81
Chris@1289 82 void populate();
Chris@1289 83 void populateFor(QString type, int makeCurrent);
Chris@1285 84 };
Chris@1285 85
Chris@1285 86 #endif
Chris@1285 87
Chris@1285 88