comparison plugin/FeatureExtractionPluginFactory.cpp @ 186:06ad01f3e553

* Add system-specific LADSPA and DSSI plugin paths (for OS/X and Windows) * Add ability to open more than one audio file at once from the command line * Add plugin input source selection (with some caveats) * Show name of file being decoded in Ogg/mp3 decode progress dialog
author Chris Cannam
date Thu, 12 Oct 2006 14:56:28 +0000
parents 5ae5885d6ce3
children 91fdc752e540
comparison
equal deleted inserted replaced
185:d5052b5fea9c 186:06ad01f3e553
56 std::vector<QString> 56 std::vector<QString>
57 FeatureExtractionPluginFactory::getPluginPath() 57 FeatureExtractionPluginFactory::getPluginPath()
58 { 58 {
59 if (!m_pluginPath.empty()) return m_pluginPath; 59 if (!m_pluginPath.empty()) return m_pluginPath;
60 60
61 std::vector<QString> path; 61 std::vector<std::string> p = Vamp::PluginHostAdapter::getPluginPath();
62 std::string envPath; 62 for (size_t i = 0; i < p.size(); ++i) m_pluginPath.push_back(p[i].c_str());
63 63 return m_pluginPath;
64 char *cpath = getenv("VAMP_PATH");
65 if (cpath) envPath = cpath;
66
67 if (envPath == "") {
68 envPath = DEFAULT_VAMP_PATH;
69 char *chome = getenv("HOME");
70 if (chome) {
71 std::string home(chome);
72 int f;
73 while ((f = envPath.find("$HOME")) >= 0 && f < envPath.length()) {
74 envPath.replace(f, 5, home);
75 }
76 }
77 #ifdef Q_WS_WIN32
78 char *cpfiles = getenv("ProgramFiles");
79 if (!cpfiles) cpfiles = "C:\\Program Files";
80 std::string pfiles(cpfiles);
81 int f;
82 while ((f = envPath.find("%ProgramFiles%")) >= 0 && f < envPath.length()) {
83 envPath.replace(f, 14, pfiles);
84 }
85 #endif
86 }
87
88 std::cerr << "VAMP path is: \"" << envPath << "\"" << std::endl;
89
90 std::string::size_type index = 0, newindex = 0;
91
92 while ((newindex = envPath.find(PATH_SEPARATOR, index)) < envPath.size()) {
93 path.push_back(envPath.substr(index, newindex - index).c_str());
94 index = newindex + 1;
95 }
96
97 path.push_back(envPath.substr(index).c_str());
98
99 m_pluginPath = path;
100 return path;
101 } 64 }
102 65
103 std::vector<QString> 66 std::vector<QString>
104 FeatureExtractionPluginFactory::getAllPluginIdentifiers() 67 FeatureExtractionPluginFactory::getAllPluginIdentifiers()
105 { 68 {