comparison knownplugins.h @ 4:6f891a9c6434

Make checker with hard-coded knowledge about various plugin types and paths; fix some process management problems
author Chris Cannam
date Wed, 13 Apr 2016 12:00:07 +0100
parents
children 74064d6f5e07
comparison
equal deleted inserted replaced
3:3bae396cf8e0 4:6f891a9c6434
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 #ifndef KNOWN_PLUGINS_H
4 #define KNOWN_PLUGINS_H
5
6 #include "plugincandidates.h"
7
8 #include <string>
9 #include <map>
10 #include <vector>
11
12 class KnownPlugins
13 {
14 typedef std::vector<std::string> stringlist;
15
16 public:
17 enum PluginType {
18 VampPlugin,
19 LADSPAPlugin,
20 DSSIPlugin
21 };
22
23 KnownPlugins();
24
25 std::vector<PluginType> getKnownPluginTypes() const {
26 return { VampPlugin, LADSPAPlugin, DSSIPlugin };
27 };
28
29 std::string getTagFor(PluginType type) const {
30 return m_known.at(type).tag;
31 }
32
33 stringlist getCandidateLibrariesFor(PluginType type) const {
34 return m_candidates.getCandidateLibrariesFor(getTagFor(type));
35 }
36
37 std::string getFailureReport() const;
38
39 private:
40 struct TypeRec {
41 std::string tag;
42 stringlist path;
43 std::string descriptor;
44 };
45 std::map<PluginType, TypeRec> m_known;
46
47 stringlist expandConventionalPath(PluginType type, std::string var);
48 std::string getDefaultPath(PluginType type);
49
50 PluginCandidates m_candidates;
51 };
52
53 #endif