comparison plugin/FeatureExtractionPluginFactory.cpp @ 117:c30728d5625c sv1-v0.9rc1

* Make vertical scale alignment modes work in note layer as well as time-value layer, and several significant fixes to it * Make it possible to draw notes properly on the note layer * Show units (and frequencies etc in note layer's case) in the time-value and note layer description boxes * Minor fix to item edit dialog layout * Some minor menu rearrangement * Comment out a lot of debug output * Add SV website and reference URLs to Help menu, and add code to (attempt to) open them in the user's preferred browser
author Chris Cannam
date Fri, 12 May 2006 14:40:43 +0000
parents b2067aff8cd6
children 4b2ea82fd0ed
comparison
equal deleted inserted replaced
116:a08718723b20 117:c30728d5625c
53 } 53 }
54 54
55 std::vector<QString> 55 std::vector<QString>
56 FeatureExtractionPluginFactory::getPluginPath() 56 FeatureExtractionPluginFactory::getPluginPath()
57 { 57 {
58 if (!m_pluginPath.empty()) return m_pluginPath;
59
58 std::vector<QString> path; 60 std::vector<QString> path;
59 std::string envPath; 61 std::string envPath;
60 62
61 char *cpath = getenv("VAMP_PATH"); 63 char *cpath = getenv("VAMP_PATH");
62 if (cpath) envPath = cpath; 64 if (cpath) envPath = cpath;
91 index = newindex + 1; 93 index = newindex + 1;
92 } 94 }
93 95
94 path.push_back(envPath.substr(index).c_str()); 96 path.push_back(envPath.substr(index).c_str());
95 97
98 m_pluginPath = path;
96 return path; 99 return path;
97 } 100 }
98 101
99 std::vector<QString> 102 std::vector<QString>
100 FeatureExtractionPluginFactory::getAllPluginIdentifiers() 103 FeatureExtractionPluginFactory::getAllPluginIdentifiers()
121 std::vector<QString> rv; 124 std::vector<QString> rv;
122 std::vector<QString> path = getPluginPath(); 125 std::vector<QString> path = getPluginPath();
123 126
124 for (std::vector<QString>::iterator i = path.begin(); i != path.end(); ++i) { 127 for (std::vector<QString>::iterator i = path.begin(); i != path.end(); ++i) {
125 128
126 std::cerr << "FeatureExtractionPluginFactory::getPluginIdentifiers: scanning directory " << i->toStdString() << std::endl; 129 // std::cerr << "FeatureExtractionPluginFactory::getPluginIdentifiers: scanning directory " << i->toStdString() << std::endl;
127 130
128 QDir pluginDir(*i, PLUGIN_GLOB, 131 QDir pluginDir(*i, PLUGIN_GLOB,
129 QDir::Name | QDir::IgnoreCase, 132 QDir::Name | QDir::IgnoreCase,
130 QDir::Files | QDir::Readable); 133 QDir::Files | QDir::Readable);
131 134
238 241
239 QString found = findPluginFile(soname); 242 QString found = findPluginFile(soname);
240 243
241 if (found == "") { 244 if (found == "") {
242 std::cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Failed to find library file " << soname.toStdString() << std::endl; 245 std::cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Failed to find library file " << soname.toStdString() << std::endl;
246 return 0;
243 } else if (found != soname) { 247 } else if (found != soname) {
244 std::cerr << "FeatureExtractionPluginFactory::instantiatePlugin: WARNING: Given library name was " << soname.toStdString() << ", found at " << found.toStdString() << std::endl; 248 // std::cerr << "FeatureExtractionPluginFactory::instantiatePlugin: WARNING: Given library name was " << soname.toStdString() << ", found at " << found.toStdString() << std::endl;
249 // std::cerr << soname.toStdString() << " -> " << found.toStdString() << std::endl;
245 } 250 }
246 251
247 soname = found; 252 soname = found;
248 253
249 void *libraryHandle = DLOPEN(soname, RTLD_LAZY); 254 void *libraryHandle = DLOPEN(soname, RTLD_LAZY);
271 goto done; 276 goto done;
272 } 277 }
273 278
274 rv = new Vamp::PluginHostAdapter(descriptor, inputSampleRate); 279 rv = new Vamp::PluginHostAdapter(descriptor, inputSampleRate);
275 280
276 std::cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Constructed Vamp plugin, rv is " << rv << std::endl; 281 // std::cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Constructed Vamp plugin, rv is " << rv << std::endl;
277 282
278 //!!! need to dlclose() when plugins from a given library are unloaded 283 //!!! need to dlclose() when plugins from a given library are unloaded
279 284
280 done: 285 done:
281 if (!rv) { 286 if (!rv) {