Mercurial > hg > vamp-plugin-load-checker
comparison checker/knownplugins.h @ 8:25e00373f597
Much renaming to ease inclusion into another project
author | Chris Cannam |
---|---|
date | Thu, 14 Apr 2016 16:52:19 +0100 |
parents | knownplugins.h@61dbb18f2369 |
children | c80c55cabfcd |
comparison
equal
deleted
inserted
replaced
7:846464771d06 | 8:25e00373f597 |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
2 /* | |
3 Copyright (c) 2016 Queen Mary, University of London | |
4 | |
5 Permission is hereby granted, free of charge, to any person | |
6 obtaining a copy of this software and associated documentation | |
7 files (the "Software"), to deal in the Software without | |
8 restriction, including without limitation the rights to use, copy, | |
9 modify, merge, publish, distribute, sublicense, and/or sell copies | |
10 of the Software, and to permit persons to whom the Software is | |
11 furnished to do so, subject to the following conditions: | |
12 | |
13 The above copyright notice and this permission notice shall be | |
14 included in all copies or substantial portions of the Software. | |
15 | |
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
17 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
18 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
19 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | |
20 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | |
21 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
23 | |
24 Except as contained in this notice, the names of the Centre for | |
25 Digital Music and Queen Mary, University of London shall not be | |
26 used in advertising or otherwise to promote the sale, use or other | |
27 dealings in this Software without prior written authorization. | |
28 */ | |
29 | |
30 #ifndef KNOWN_PLUGINS_H | |
31 #define KNOWN_PLUGINS_H | |
32 | |
33 #include "plugincandidates.h" | |
34 | |
35 #include <string> | |
36 #include <map> | |
37 #include <vector> | |
38 | |
39 class KnownPlugins | |
40 { | |
41 typedef std::vector<std::string> stringlist; | |
42 | |
43 public: | |
44 enum PluginType { | |
45 VampPlugin, | |
46 LADSPAPlugin, | |
47 DSSIPlugin | |
48 }; | |
49 | |
50 KnownPlugins(std::string helperExecutableName, | |
51 PluginCandidates::LogCallback *cb = 0); | |
52 | |
53 std::vector<PluginType> getKnownPluginTypes() const { | |
54 return { VampPlugin, LADSPAPlugin, DSSIPlugin }; | |
55 }; | |
56 | |
57 std::string getTagFor(PluginType type) const { | |
58 return m_known.at(type).tag; | |
59 } | |
60 | |
61 stringlist getCandidateLibrariesFor(PluginType type) const { | |
62 return m_candidates.getCandidateLibrariesFor(getTagFor(type)); | |
63 } | |
64 | |
65 std::string getFailureReport() const; | |
66 | |
67 private: | |
68 struct TypeRec { | |
69 std::string tag; | |
70 stringlist path; | |
71 std::string descriptor; | |
72 }; | |
73 std::map<PluginType, TypeRec> m_known; | |
74 | |
75 stringlist expandConventionalPath(PluginType type, std::string var); | |
76 std::string getDefaultPath(PluginType type); | |
77 | |
78 PluginCandidates m_candidates; | |
79 }; | |
80 | |
81 #endif |