comparison plugin/LADSPAPluginFactory.cpp @ 35:0164c8d3023b

* Rejig project file a bit to do pkg-config detection &c and change some HAVE_* symbol names accordingly * Add selection move/resize/delete * First stubs for add layer / pane commands
author Chris Cannam
date Wed, 01 Mar 2006 18:13:01 +0000
parents 2fb933f88604
children 39ae3dee27b9
comparison
equal deleted inserted replaced
34:aaf73f7309f2 35:0164c8d3023b
25 #include "LADSPAPluginInstance.h" 25 #include "LADSPAPluginInstance.h"
26 #include "PluginIdentifier.h" 26 #include "PluginIdentifier.h"
27 27
28 #include "base/System.h" 28 #include "base/System.h"
29 29
30 #ifdef HAVE_LIBLRDF 30 #ifdef HAVE_LRDF
31 #include "lrdf.h" 31 #include "lrdf.h"
32 #endif // HAVE_LIBLRDF 32 #endif // HAVE_LRDF
33 33
34 34
35 LADSPAPluginFactory::LADSPAPluginFactory() 35 LADSPAPluginFactory::LADSPAPluginFactory()
36 { 36 {
37 } 37 }
451 451
452 return pathList; 452 return pathList;
453 } 453 }
454 454
455 455
456 #ifdef HAVE_LIBLRDF 456 #ifdef HAVE_LRDF
457 std::vector<QString> 457 std::vector<QString>
458 LADSPAPluginFactory::getLRDFPath(QString &baseUri) 458 LADSPAPluginFactory::getLRDFPath(QString &baseUri)
459 { 459 {
460 std::vector<QString> pathList = getPluginPath(); 460 std::vector<QString> pathList = getPluginPath();
461 std::vector<QString> lrdfPaths; 461 std::vector<QString> lrdfPaths;
484 i != pathList.end(); ++i) { 484 i != pathList.end(); ++i) {
485 std::cerr << "[" << i->toStdString() << "] "; 485 std::cerr << "[" << i->toStdString() << "] ";
486 } 486 }
487 std::cerr << std::endl; 487 std::cerr << std::endl;
488 488
489 #ifdef HAVE_LIBLRDF 489 #ifdef HAVE_LRDF
490 // Initialise liblrdf and read the description files 490 // Initialise liblrdf and read the description files
491 // 491 //
492 lrdf_init(); 492 lrdf_init();
493 493
494 QString baseUri; 494 QString baseUri;
507 } 507 }
508 508
509 if (haveSomething) { 509 if (haveSomething) {
510 generateTaxonomy(baseUri + "Plugin", ""); 510 generateTaxonomy(baseUri + "Plugin", "");
511 } 511 }
512 #endif // HAVE_LIBLRDF 512 #endif // HAVE_LRDF
513 513
514 generateFallbackCategories(); 514 generateFallbackCategories();
515 515
516 for (std::vector<QString>::iterator i = pathList.begin(); 516 for (std::vector<QString>::iterator i = pathList.begin();
517 i != pathList.end(); ++i) { 517 i != pathList.end(); ++i) {
521 for (unsigned int j = 0; j < pluginDir.count(); ++j) { 521 for (unsigned int j = 0; j < pluginDir.count(); ++j) {
522 discoverPlugins(QString("%1/%2").arg(*i).arg(pluginDir[j])); 522 discoverPlugins(QString("%1/%2").arg(*i).arg(pluginDir[j]));
523 } 523 }
524 } 524 }
525 525
526 #ifdef HAVE_LIBLRDF 526 #ifdef HAVE_LRDF
527 // Cleanup after the RDF library 527 // Cleanup after the RDF library
528 // 528 //
529 lrdf_cleanup(); 529 lrdf_cleanup();
530 #endif // HAVE_LIBLRDF 530 #endif // HAVE_LRDF
531 } 531 }
532 532
533 void 533 void
534 LADSPAPluginFactory::discoverPlugins(QString soname) 534 LADSPAPluginFactory::discoverPlugins(QString soname)
535 { 535 {
552 const LADSPA_Descriptor *descriptor = 0; 552 const LADSPA_Descriptor *descriptor = 0;
553 553
554 int index = 0; 554 int index = 0;
555 while ((descriptor = fn(index))) { 555 while ((descriptor = fn(index))) {
556 556
557 #ifdef HAVE_LIBLRDF 557 #ifdef HAVE_LRDF
558 char *def_uri = 0; 558 char *def_uri = 0;
559 lrdf_defaults *defs = 0; 559 lrdf_defaults *defs = 0;
560 560
561 QString category = m_taxonomy[descriptor->UniqueID]; 561 QString category = m_taxonomy[descriptor->UniqueID];
562 562
598 } 598 }
599 599
600 ++controlPortNumber; 600 ++controlPortNumber;
601 } 601 }
602 } 602 }
603 #endif // HAVE_LIBLRDF 603 #endif // HAVE_LRDF
604 604
605 QString identifier = PluginIdentifier::createIdentifier 605 QString identifier = PluginIdentifier::createIdentifier
606 ("ladspa", soname, descriptor->Label); 606 ("ladspa", soname, descriptor->Label);
607 m_identifiers.push_back(identifier); 607 m_identifiers.push_back(identifier);
608 608
662 } 662 }
663 663
664 void 664 void
665 LADSPAPluginFactory::generateTaxonomy(QString uri, QString base) 665 LADSPAPluginFactory::generateTaxonomy(QString uri, QString base)
666 { 666 {
667 #ifdef HAVE_LIBLRDF 667 #ifdef HAVE_LRDF
668 lrdf_uris *uris = lrdf_get_instances(uri.toStdString().c_str()); 668 lrdf_uris *uris = lrdf_get_instances(uri.toStdString().c_str());
669 669
670 if (uris != NULL) { 670 if (uris != NULL) {
671 for (int i = 0; i < uris->count; ++i) { 671 for (int i = 0; i < uris->count; ++i) {
672 m_taxonomy[lrdf_get_uid(uris->items[i])] = base; 672 m_taxonomy[lrdf_get_uid(uris->items[i])] = base;