annotate widgets/PluginPathConfigurator.h @ 1291:b5c71304286e plugin-path-config

Add "Add"
author Chris Cannam
date Wed, 23 May 2018 16:24:35 +0100
parents 050eca637c19
children 41824255ddf2
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@1285 64
Chris@1285 65 private:
Chris@1285 66 QGridLayout *m_layout;
Chris@1289 67 QLabel *m_header;
Chris@1289 68 QComboBox *m_pluginTypeSelector;
Chris@1287 69 QListWidget *m_list;
Chris@1288 70 QPushButton *m_up;
Chris@1288 71 QPushButton *m_down;
Chris@1291 72 QPushButton *m_add;
Chris@1288 73 QPushButton *m_delete;
Chris@1290 74 QPushButton *m_reset;
Chris@1290 75 QCheckBox *m_envOverride;
Chris@1285 76
Chris@1289 77 Paths m_paths;
Chris@1290 78 Paths m_originalPaths;
Chris@1285 79
Chris@1289 80 void populate();
Chris@1289 81 void populateFor(QString type, int makeCurrent);
Chris@1285 82 };
Chris@1285 83
Chris@1285 84 #endif
Chris@1285 85
Chris@1285 86