comparison 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
comparison
equal deleted inserted replaced
77:2beca8ddcdc3 78:c983dda79f72
56 FeatureExtractionPluginFactory::getPluginPath() 56 FeatureExtractionPluginFactory::getPluginPath()
57 { 57 {
58 std::vector<QString> path; 58 std::vector<QString> path;
59 std::string envPath; 59 std::string envPath;
60 60
61 char *cpath = getenv("Vamp_PATH"); 61 char *cpath = getenv("VAMP_PATH");
62 if (cpath) envPath = cpath; 62 if (cpath) envPath = cpath;
63 63
64 if (envPath == "") { 64 if (envPath == "") {
65 //!!! system dependent 65 envPath = DEFAULT_VAMP_PATH;
66 envPath = "/usr/local/lib/vamp:/usr/lib/vamp";
67 char *chome = getenv("HOME"); 66 char *chome = getenv("HOME");
68 if (chome) { 67 if (chome) {
69 envPath = std::string(chome) + "/vamp:" + 68 std::string home(chome);
70 std::string(chome) + "/.vamp:" + envPath; 69 int f;
71 } 70 while ((f = envPath.find("$HOME")) >= 0 && f < envPath.length()) {
72 } 71 envPath.replace(f, 5, home);
72 }
73 }
74 }
75
76 std::cerr << "VAMP path is: \"" << envPath << "\"" << std::endl;
73 77
74 std::string::size_type index = 0, newindex = 0; 78 std::string::size_type index = 0, newindex = 0;
75 79
76 while ((newindex = envPath.find(':', index)) < envPath.size()) { 80 while ((newindex = envPath.find(PATH_SEPARATOR, index)) < envPath.size()) {
77 path.push_back(envPath.substr(index, newindex - index).c_str()); 81 path.push_back(envPath.substr(index, newindex - index).c_str());
78 index = newindex + 1; 82 index = newindex + 1;
79 } 83 }
80 84
81 path.push_back(envPath.substr(index).c_str()); 85 path.push_back(envPath.substr(index).c_str());