comparison plugin/LADSPAPluginFactory.cpp @ 1885:1adbeb52d761

Make some debug output less obvious
author Chris Cannam
date Fri, 14 Aug 2020 10:42:37 +0100
parents 5f8fbbde08ff
children
comparison
equal deleted inserted replaced
1884:bdab3a921d5d 1885:1adbeb52d761
79 i != m_identifiers.end(); ++i) { 79 i != m_identifiers.end(); ++i) {
80 80
81 const LADSPA_Descriptor *descriptor = getLADSPADescriptor(*i); 81 const LADSPA_Descriptor *descriptor = getLADSPADescriptor(*i);
82 82
83 if (!descriptor) { 83 if (!descriptor) {
84 cerr << "WARNING: LADSPAPluginFactory::enumeratePlugins: couldn't get descriptor for identifier " << *i << endl; 84 SVCERR << "WARNING: LADSPAPluginFactory::enumeratePlugins: couldn't get descriptor for identifier " << *i << endl;
85 continue; 85 continue;
86 } 86 }
87 87
88 list.push_back(*i); 88 list.push_back(*i);
89 list.push_back(descriptor->Name); 89 list.push_back(descriptor->Name);
93 list.push_back(descriptor->Copyright); 93 list.push_back(descriptor->Copyright);
94 list.push_back("false"); // is synth 94 list.push_back("false"); // is synth
95 list.push_back("false"); // is grouped 95 list.push_back("false"); // is grouped
96 96
97 if (m_taxonomy.find(*i) != m_taxonomy.end() && m_taxonomy[*i] != "") { 97 if (m_taxonomy.find(*i) != m_taxonomy.end() && m_taxonomy[*i] != "") {
98 // cerr << "LADSPAPluginFactory: cat for " << *i << " found in taxonomy as " << m_taxonomy[descriptor->UniqueID] << endl; 98 // SVCERR << "LADSPAPluginFactory: cat for " << *i << " found in taxonomy as " << m_taxonomy[descriptor->UniqueID] << endl;
99 list.push_back(m_taxonomy[*i]); 99 list.push_back(m_taxonomy[*i]);
100 } else { 100 } else {
101 list.push_back(""); 101 list.push_back("");
102 // cerr << "LADSPAPluginFactory: cat for " << *i << " not found (despite having " << m_fallbackCategories.size() << " fallbacks)" << endl; 102 // SVCERR << "LADSPAPluginFactory: cat for " << *i << " not found (despite having " << m_fallbackCategories.size() << " fallbacks)" << endl;
103 103
104 } 104 }
105 105
106 list.push_back(QString("%1").arg(descriptor->PortCount)); 106 list.push_back(QString("%1").arg(descriptor->PortCount));
107 107
616 616
617 for (size_t i = 0; i < lrdfPaths.size(); ++i) { 617 for (size_t i = 0; i < lrdfPaths.size(); ++i) {
618 QDir dir(lrdfPaths[i], "*.rdf;*.rdfs"); 618 QDir dir(lrdfPaths[i], "*.rdf;*.rdfs");
619 for (unsigned int j = 0; j < dir.count(); ++j) { 619 for (unsigned int j = 0; j < dir.count(); ++j) {
620 if (!lrdf_read_file(QString("file:" + lrdfPaths[i] + "/" + dir[j]).toStdString().c_str())) { 620 if (!lrdf_read_file(QString("file:" + lrdfPaths[i] + "/" + dir[j]).toStdString().c_str())) {
621 // cerr << "LADSPAPluginFactory: read RDF file " << (lrdfPaths[i] + "/" + dir[j]) << endl; 621 // SVCERR << "LADSPAPluginFactory: read RDF file " << (lrdfPaths[i] + "/" + dir[j]) << endl;
622 haveSomething = true; 622 haveSomething = true;
623 } 623 }
624 } 624 }
625 } 625 }
626 626
643 LADSPAPluginFactory::discoverPluginsFrom(QString soname) 643 LADSPAPluginFactory::discoverPluginsFrom(QString soname)
644 { 644 {
645 void *libraryHandle = DLOPEN(soname, RTLD_LAZY); 645 void *libraryHandle = DLOPEN(soname, RTLD_LAZY);
646 646
647 if (!libraryHandle) { 647 if (!libraryHandle) {
648 cerr << "WARNING: LADSPAPluginFactory::discoverPlugins: couldn't load plugin library " 648 SVCERR << "WARNING: LADSPAPluginFactory::discoverPlugins: couldn't load plugin library "
649 << soname << " - " << DLERROR() << endl; 649 << soname << " - " << DLERROR() << endl;
650 return; 650 return;
651 } 651 }
652 652
653 LADSPA_Descriptor_Function fn = (LADSPA_Descriptor_Function) 653 LADSPA_Descriptor_Function fn = (LADSPA_Descriptor_Function)
654 DLSYM(libraryHandle, "ladspa_descriptor"); 654 DLSYM(libraryHandle, "ladspa_descriptor");
655 655
656 if (!fn) { 656 if (!fn) {
657 cerr << "WARNING: LADSPAPluginFactory::discoverPlugins: No descriptor function in " << soname << endl; 657 SVCERR << "WARNING: LADSPAPluginFactory::discoverPlugins: No descriptor function in " << soname << endl;
658 return; 658 return;
659 } 659 }
660 660
661 const LADSPA_Descriptor *descriptor = nullptr; 661 const LADSPA_Descriptor *descriptor = nullptr;
662 662
682 char *def_uri = nullptr; 682 char *def_uri = nullptr;
683 lrdf_defaults *defs = nullptr; 683 lrdf_defaults *defs = nullptr;
684 684
685 if (m_lrdfTaxonomy[descriptor->UniqueID] != "") { 685 if (m_lrdfTaxonomy[descriptor->UniqueID] != "") {
686 m_taxonomy[identifier] = m_lrdfTaxonomy[descriptor->UniqueID]; 686 m_taxonomy[identifier] = m_lrdfTaxonomy[descriptor->UniqueID];
687 // cerr << "set id \"" << identifier << "\" to cat \"" << m_taxonomy[identifier] << "\" from LRDF" << endl; 687 // SVCERR << "set id \"" << identifier << "\" to cat \"" << m_taxonomy[identifier] << "\" from LRDF" << endl;
688 // cout << identifier << "::" << m_taxonomy[identifier] << endl; 688 // cout << identifier << "::" << m_taxonomy[identifier] << endl;
689 } 689 }
690 690
691 QString category = m_taxonomy[identifier]; 691 QString category = m_taxonomy[identifier];
692 692
699 } 699 }
700 } 700 }
701 701
702 rtd.category = category.toStdString(); 702 rtd.category = category.toStdString();
703 703
704 // cerr << "Plugin id is " << descriptor->UniqueID 704 // SVCERR << "Plugin id is " << descriptor->UniqueID
705 // << ", category is \"" << (category ? category : QString("(none)")) 705 // << ", category is \"" << (category ? category : QString("(none)"))
706 // << "\", name is " << descriptor->Name 706 // << "\", name is " << descriptor->Name
707 // << ", label is " << descriptor->Label 707 // << ", label is " << descriptor->Label
708 // << endl; 708 // << endl;
709 709
720 720
721 if (def_uri && defs) { 721 if (def_uri && defs) {
722 722
723 for (unsigned int j = 0; j < defs->count; j++) { 723 for (unsigned int j = 0; j < defs->count; j++) {
724 if (defs->items[j].pid == controlPortNumber) { 724 if (defs->items[j].pid == controlPortNumber) {
725 // cerr << "Default for this port (" << defs->items[j].pid << ", " << defs->items[j].label << ") is " << defs->items[j].value << "; applying this to port number " << i << " with name " << descriptor->PortNames[i] << endl; 725 // SVCERR << "Default for this port (" << defs->items[j].pid << ", " << defs->items[j].label << ") is " << defs->items[j].value << "; applying this to port number " << i << " with name " << descriptor->PortNames[i] << endl;
726 m_portDefaults[descriptor->UniqueID][i] = 726 m_portDefaults[descriptor->UniqueID][i] =
727 defs->items[j].value; 727 defs->items[j].value;
728 } 728 }
729 } 729 }
730 } 730 }
763 763
764 ++index; 764 ++index;
765 } 765 }
766 766
767 if (DLCLOSE(libraryHandle) != 0) { 767 if (DLCLOSE(libraryHandle) != 0) {
768 cerr << "WARNING: LADSPAPluginFactory::discoverPlugins - can't unload " << libraryHandle << endl; 768 SVCERR << "WARNING: LADSPAPluginFactory::discoverPlugins - can't unload " << libraryHandle << endl;
769 return; 769 return;
770 } 770 }
771 } 771 }
772 772
773 void 773 void