Mercurial > hg > vamp-plugin-load-checker
comparison checker/knownplugins.h @ 34:6905d8b146f6 plugin-path-config
Toward supporting separate environment variables for 32-bit plugins on a 64-bit system (otherwise we try to load both from the same helpers)
author | Chris Cannam |
---|---|
date | Wed, 06 Jun 2018 13:49:23 +0100 |
parents | 7a20698b4c29 |
children | 4154894d638c |
comparison
equal
deleted
inserted
replaced
33:cf18645ff411 | 34:6905d8b146f6 |
---|---|
57 }; | 57 }; |
58 | 58 |
59 KnownPlugins(std::string helperExecutableName, | 59 KnownPlugins(std::string helperExecutableName, |
60 PluginCandidates::LogCallback *cb = 0); | 60 PluginCandidates::LogCallback *cb = 0); |
61 | 61 |
62 std::vector<PluginType> getKnownPluginTypes() const { | 62 std::vector<PluginType> getKnownPluginTypes() const; |
63 return { VampPlugin, LADSPAPlugin, DSSIPlugin }; | |
64 }; | |
65 | 63 |
66 std::string getTagFor(PluginType type) const { | 64 std::string getTagFor(PluginType type) const { |
67 return m_known.at(type).tag; | 65 return m_known.at(type).tag; |
68 } | 66 } |
69 | 67 |
70 stringlist getCandidateLibrariesFor(PluginType type) const { | 68 stringlist getCandidateLibrariesFor(PluginType type) const { |
71 return m_candidates.getCandidateLibrariesFor(getTagFor(type)); | 69 return m_candidates.getCandidateLibrariesFor(getTagFor(type)); |
70 } | |
71 | |
72 std::string getPathEnvironmentVariableFor(PluginType type) const { | |
73 return m_known.at(type).variable; | |
74 } | |
75 | |
76 stringlist getPathFor(PluginType type) const { | |
77 return m_known.at(type).path; | |
72 } | 78 } |
73 | 79 |
74 std::string getHelperExecutableName() const { | 80 std::string getHelperExecutableName() const { |
75 return m_helperExecutableName; | 81 return m_helperExecutableName; |
76 } | 82 } |
78 std::string getFailureReport() const; | 84 std::string getFailureReport() const; |
79 | 85 |
80 private: | 86 private: |
81 struct TypeRec { | 87 struct TypeRec { |
82 std::string tag; | 88 std::string tag; |
89 std::string variable; | |
83 stringlist path; | 90 stringlist path; |
84 std::string descriptor; | 91 std::string descriptor; |
85 }; | 92 }; |
86 std::map<PluginType, TypeRec> m_known; | 93 typedef std::map<PluginType, TypeRec> Known; |
94 Known m_known; | |
87 | 95 |
88 stringlist expandConventionalPath(PluginType type, std::string var); | 96 stringlist expandConventionalPath(PluginType type, std::string var); |
89 std::string getDefaultPath(PluginType type); | 97 std::string getDefaultPath(PluginType type); |
90 | 98 |
91 PluginCandidates m_candidates; | 99 PluginCandidates m_candidates; |
92 std::string m_helperExecutableName; | 100 std::string m_helperExecutableName; |
93 | 101 |
94 bool is32bit() const; // true if helper looks to be 32-bit on 64-bit system | 102 /** This returns true if the helper has a name ending in "-32". By |
103 * our convention, this means that it is a 32-bit helper found on | |
104 * a 64-bit system, so (depending on the OS) we may need to look | |
105 * in 32-bit-specific paths. Note that is32bit() is *not* usually | |
106 * true on 32-bit systems; it's used specifically to indicate a | |
107 * "non-native" 32-bit helper. | |
108 */ | |
109 bool is32bit() const; | |
95 }; | 110 }; |
96 | 111 |
97 #endif | 112 #endif |