comparison plugin/PluginPathSetter.h @ 1481:75fe1c1e003f plugin-path-config

Switch to using KnownPlugins as the info source
author Chris Cannam
date Fri, 08 Jun 2018 14:30:33 +0100
parents f52bf66b9096
children
comparison
equal deleted inserted replaced
1480:5ac102155409 1481:75fe1c1e003f
19 #include <QStringList> 19 #include <QStringList>
20 #include <QMutex> 20 #include <QMutex>
21 21
22 #include <map> 22 #include <map>
23 23
24 #include "checker/knownplugins.h"
25
24 class PluginPathSetter 26 class PluginPathSetter
25 { 27 {
26 public: 28 public:
27 /// Text used to identify a plugin type, e.g. "LADSPA", "Vamp" 29 typedef std::pair<KnownPlugins::PluginType,
28 typedef QString PluginTypeLabel; 30 KnownPlugins::BinaryFormat> TypeKey;
31
32 typedef std::vector<TypeKey> TypeKeys;
29 33
30 struct PathConfig { 34 struct PathConfig {
31 QStringList directories; // Actual list of directories arising 35 QStringList directories; // Actual list of directories arising
32 // from user settings, environment 36 // from user settings, environment
33 // variables, and defaults as 37 // variables, and defaults as
37 41
38 bool useEnvVariable; // True if env variable should override 42 bool useEnvVariable; // True if env variable should override
39 // any user settings for this 43 // any user settings for this
40 }; 44 };
41 45
42 typedef std::map<PluginTypeLabel, PathConfig> Paths; 46 typedef std::map<TypeKey, PathConfig> Paths;
43 47
44 /// Update *_PATH environment variables from the settings, on 48 /// Update *_PATH environment variables from the settings, on
45 /// application startup. Must be called exactly once, before any 49 /// application startup. Must be called exactly once, before any
46 /// of the other functions in this class has been called 50 /// of the other functions in this class has been called
47 static void initialiseEnvironmentVariables(); 51 static void initialiseEnvironmentVariables();
68 72
69 private: 73 private:
70 static Paths m_defaultPaths; 74 static Paths m_defaultPaths;
71 static Paths m_environmentPaths; 75 static Paths m_environmentPaths;
72 static std::map<QString, QString> m_originalEnvValues; 76 static std::map<QString, QString> m_originalEnvValues;
77 static TypeKeys m_supportedKeys;
73 static QMutex m_mutex; 78 static QMutex m_mutex;
74 79
75 static Paths getEnvironmentPathsUncached(); 80 static std::vector<TypeKey> getSupportedKeys();
81 static Paths getEnvironmentPathsUncached(const TypeKeys &keys);
82 static QString getSettingTagFor(TypeKey);
76 }; 83 };
77 84
78 #endif 85 #endif