diff 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
line wrap: on
line diff
--- a/checker/knownplugins.h	Sun Mar 05 17:15:22 2017 +0000
+++ b/checker/knownplugins.h	Wed Jun 06 13:49:23 2018 +0100
@@ -59,9 +59,7 @@
     KnownPlugins(std::string helperExecutableName,
                  PluginCandidates::LogCallback *cb = 0);
 
-    std::vector<PluginType> getKnownPluginTypes() const {
-        return { VampPlugin, LADSPAPlugin, DSSIPlugin };
-    };
+    std::vector<PluginType> getKnownPluginTypes() const;
     
     std::string getTagFor(PluginType type) const {
         return m_known.at(type).tag;
@@ -71,6 +69,14 @@
         return m_candidates.getCandidateLibrariesFor(getTagFor(type));
     }
 
+    std::string getPathEnvironmentVariableFor(PluginType type) const {
+        return m_known.at(type).variable;
+    }
+    
+    stringlist getPathFor(PluginType type) const {
+        return m_known.at(type).path;
+    }
+
     std::string getHelperExecutableName() const {
         return m_helperExecutableName;
     }
@@ -80,10 +86,12 @@
 private:
     struct TypeRec {
         std::string tag;
+        std::string variable;
         stringlist path;
         std::string descriptor;
     };
-    std::map<PluginType, TypeRec> m_known;
+    typedef std::map<PluginType, TypeRec> Known;
+    Known m_known;
 
     stringlist expandConventionalPath(PluginType type, std::string var);
     std::string getDefaultPath(PluginType type);
@@ -91,7 +99,14 @@
     PluginCandidates m_candidates;
     std::string m_helperExecutableName;
 
-    bool is32bit() const; // true if helper looks to be 32-bit on 64-bit system
+    /** This returns true if the helper has a name ending in "-32". By
+     *  our convention, this means that it is a 32-bit helper found on
+     *  a 64-bit system, so (depending on the OS) we may need to look
+     *  in 32-bit-specific paths. Note that is32bit() is *not* usually
+     *  true on 32-bit systems; it's used specifically to indicate a
+     *  "non-native" 32-bit helper.
+     */
+    bool is32bit() const;
 };
 
 #endif