diff plugin/FeatureExtractionPluginFactory.cpp @ 78:c983dda79f72

* Replace crash with warning when a transform could not be automatically re-run * More sensible default paths for Vamp plugin lookup (at least on Linux and OS/X) * A start to making the y coords for time value layers etc align * Set sensible y coords for text labels in time instant and value layers
author Chris Cannam
date Thu, 13 Apr 2006 18:29:10 +0000
parents e9b8b51f6326
children 9e027aa5b5c3
line wrap: on
line diff
--- a/plugin/FeatureExtractionPluginFactory.cpp	Wed Apr 12 09:59:40 2006 +0000
+++ b/plugin/FeatureExtractionPluginFactory.cpp	Thu Apr 13 18:29:10 2006 +0000
@@ -58,22 +58,26 @@
     std::vector<QString> path;
     std::string envPath;
 
-    char *cpath = getenv("Vamp_PATH");
+    char *cpath = getenv("VAMP_PATH");
     if (cpath) envPath = cpath;
 
     if (envPath == "") {
-        //!!! system dependent
-        envPath = "/usr/local/lib/vamp:/usr/lib/vamp";
+        envPath = DEFAULT_VAMP_PATH;
         char *chome = getenv("HOME");
         if (chome) {
-            envPath = std::string(chome) + "/vamp:" +
-                std::string(chome) + "/.vamp:" + envPath;
+            std::string home(chome);
+            int f;
+            while ((f = envPath.find("$HOME")) >= 0 && f < envPath.length()) {
+                envPath.replace(f, 5, home);
+            }
         }
     }
 
+    std::cerr << "VAMP path is: \"" << envPath << "\"" << std::endl;
+
     std::string::size_type index = 0, newindex = 0;
 
-    while ((newindex = envPath.find(':', index)) < envPath.size()) {
+    while ((newindex = envPath.find(PATH_SEPARATOR, index)) < envPath.size()) {
 	path.push_back(envPath.substr(index, newindex - index).c_str());
 	index = newindex + 1;
     }