diff plugin/DSSIPluginFactory.cpp @ 165:5ae5885d6ce3

* Add support for plugin classification using category files. Add separate menus listing plugins by category, maker, and plugin name.
author Chris Cannam
date Thu, 21 Sep 2006 16:43:50 +0000
parents 4b2ea82fd0ed
children 702fc936e6a6
line wrap: on
line diff
--- a/plugin/DSSIPluginFactory.cpp	Thu Sep 21 11:17:19 2006 +0000
+++ b/plugin/DSSIPluginFactory.cpp	Thu Sep 21 16:43:50 2006 +0000
@@ -73,7 +73,7 @@
 	list.push_back(descriptor->Copyright);
 	list.push_back((ddesc->run_synth || ddesc->run_multiple_synths) ? "true" : "false");
 	list.push_back(ddesc->run_multiple_synths ? "true" : "false");
-	list.push_back(m_taxonomy[descriptor->UniqueID]);
+	list.push_back(m_taxonomy[*i]);
 	list.push_back(QString("%1").arg(descriptor->PortCount));
 
 	for (unsigned long p = 0; p < descriptor->PortCount; ++p) {
@@ -301,11 +301,19 @@
         rtd->audioInputPortCount = 0;
         rtd->controlOutputPortCount = 0;
 
+	QString identifier = PluginIdentifier::createIdentifier
+	    ("dssi", soname, ladspaDescriptor->Label);
+
 #ifdef HAVE_LRDF
 	char *def_uri = 0;
 	lrdf_defaults *defs = 0;
 		
-	QString category = m_taxonomy[ladspaDescriptor->UniqueID];
+	QString category = m_taxonomy[identifier];
+
+        if (category == "" && m_lrdfTaxonomy[descriptor->LADSPA_Plugin->UniqueID] != "") {
+            m_taxonomy[identifier] = m_lrdfTaxonomy[descriptor->LADSPA_Plugin->UniqueID];
+            category = m_taxonomy[identifier];
+        }
 
 	if (category == "" && ladspaDescriptor->Name != 0) {
 	    std::string name = ladspaDescriptor->Name;
@@ -316,7 +324,7 @@
 		} else {
 		    category = "VST effects";
 		}
-		m_taxonomy[ladspaDescriptor->UniqueID] = category;
+		m_taxonomy[identifier] = category;
 	    }
 	}
 
@@ -374,8 +382,6 @@
             }
         }
 
-	QString identifier = PluginIdentifier::createIdentifier
-	    ("dssi", soname, ladspaDescriptor->Label);
 	m_identifiers.push_back(identifier);
 
         m_rtDescriptors[identifier] = rtd;