Mercurial > hg > svcore
comparison plugin/NativeVampPluginFactory.cpp @ 1429:48e9f538e6e9
Untabify
author | Chris Cannam |
---|---|
date | Thu, 01 Mar 2018 18:02:22 +0000 |
parents | d45a16c232bd |
children | 91bb68146dfc |
comparison
equal
deleted
inserted
replaced
1428:87ae75da6527 | 1429:48e9f538e6e9 |
---|---|
229 #endif | 229 #endif |
230 | 230 |
231 return file; | 231 return file; |
232 } | 232 } |
233 | 233 |
234 for (unsigned int j = 0; j < dir.count(); ++j) { | 234 for (unsigned int j = 0; j < dir.count(); ++j) { |
235 file = dir.filePath(dir[j]); | 235 file = dir.filePath(dir[j]); |
236 if (QFileInfo(file).baseName() == QFileInfo(soname).baseName()) { | 236 if (QFileInfo(file).baseName() == QFileInfo(soname).baseName()) { |
237 | 237 |
238 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE | 238 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE |
239 cerr << "NativeVampPluginFactory::findPluginFile: " | 239 cerr << "NativeVampPluginFactory::findPluginFile: " |
302 PluginIdentifier::parseIdentifier(identifier, type, soname, label); | 302 PluginIdentifier::parseIdentifier(identifier, type, soname, label); |
303 if (type != "vamp") { | 303 if (type != "vamp") { |
304 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE | 304 #ifdef DEBUG_PLUGIN_SCAN_AND_INSTANTIATE |
305 cerr << "NativeVampPluginFactory::instantiatePlugin: Wrong factory for plugin type " << type << endl; | 305 cerr << "NativeVampPluginFactory::instantiatePlugin: Wrong factory for plugin type " << type << endl; |
306 #endif | 306 #endif |
307 return 0; | 307 return 0; |
308 } | 308 } |
309 | 309 |
310 QString found = findPluginFile(soname); | 310 QString found = findPluginFile(soname); |
311 | 311 |
312 if (found == "") { | 312 if (found == "") { |
397 { | 397 { |
398 vector<QString> pluginPath = getPluginPath(); | 398 vector<QString> pluginPath = getPluginPath(); |
399 vector<QString> path; | 399 vector<QString> path; |
400 | 400 |
401 for (size_t i = 0; i < pluginPath.size(); ++i) { | 401 for (size_t i = 0; i < pluginPath.size(); ++i) { |
402 if (pluginPath[i].contains("/lib/")) { | 402 if (pluginPath[i].contains("/lib/")) { |
403 QString p(pluginPath[i]); | 403 QString p(pluginPath[i]); |
404 path.push_back(p); | 404 path.push_back(p); |
405 p.replace("/lib/", "/share/"); | 405 p.replace("/lib/", "/share/"); |
406 path.push_back(p); | 406 path.push_back(p); |
407 } | 407 } |
408 path.push_back(pluginPath[i]); | 408 path.push_back(pluginPath[i]); |
409 } | 409 } |
410 | 410 |
411 for (size_t i = 0; i < path.size(); ++i) { | 411 for (size_t i = 0; i < path.size(); ++i) { |
412 | 412 |
413 QDir dir(path[i], "*.cat"); | 413 QDir dir(path[i], "*.cat"); |
414 | 414 |
415 // SVDEBUG << "LADSPAPluginFactory::generateFallbackCategories: directory " << path[i] << " has " << dir.count() << " .cat files" << endl; | 415 // SVDEBUG << "LADSPAPluginFactory::generateFallbackCategories: directory " << path[i] << " has " << dir.count() << " .cat files" << endl; |
416 for (unsigned int j = 0; j < dir.count(); ++j) { | 416 for (unsigned int j = 0; j < dir.count(); ++j) { |
417 | 417 |
418 QFile file(path[i] + "/" + dir[j]); | 418 QFile file(path[i] + "/" + dir[j]); |
419 | 419 |
420 // SVDEBUG << "LADSPAPluginFactory::generateFallbackCategories: about to open " << (path[i]+ "/" + dir[j]) << endl; | 420 // SVDEBUG << "LADSPAPluginFactory::generateFallbackCategories: about to open " << (path[i]+ "/" + dir[j]) << endl; |
421 | 421 |
422 if (file.open(QIODevice::ReadOnly)) { | 422 if (file.open(QIODevice::ReadOnly)) { |
423 // cerr << "...opened" << endl; | 423 // cerr << "...opened" << endl; |
424 QTextStream stream(&file); | 424 QTextStream stream(&file); |
425 QString line; | 425 QString line; |
426 | 426 |
427 while (!stream.atEnd()) { | 427 while (!stream.atEnd()) { |
428 line = stream.readLine(); | 428 line = stream.readLine(); |
429 // cerr << "line is: \"" << line << "\"" << endl; | 429 // cerr << "line is: \"" << line << "\"" << endl; |
430 QString id = PluginIdentifier::canonicalise | 430 QString id = PluginIdentifier::canonicalise |
431 (line.section("::", 0, 0)); | 431 (line.section("::", 0, 0)); |
432 QString cat = line.section("::", 1, 1); | 432 QString cat = line.section("::", 1, 1); |
433 m_taxonomy[id] = cat; | 433 m_taxonomy[id] = cat; |
434 // cerr << "NativeVampPluginFactory: set id \"" << id << "\" to cat \"" << cat << "\"" << endl; | 434 // cerr << "NativeVampPluginFactory: set id \"" << id << "\" to cat \"" << cat << "\"" << endl; |
435 } | 435 } |
436 } | 436 } |
437 } | 437 } |
438 } | 438 } |
439 } | 439 } |
440 | 440 |
441 piper_vamp::PluginStaticData | 441 piper_vamp::PluginStaticData |
442 NativeVampPluginFactory::getPluginStaticData(QString identifier) | 442 NativeVampPluginFactory::getPluginStaticData(QString identifier) |