Mercurial > hg > svcore
comparison 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 |
comparison
equal
deleted
inserted
replaced
164:da3701a3953e | 165:5ae5885d6ce3 |
---|---|
71 list.push_back(descriptor->Label); | 71 list.push_back(descriptor->Label); |
72 list.push_back(descriptor->Maker); | 72 list.push_back(descriptor->Maker); |
73 list.push_back(descriptor->Copyright); | 73 list.push_back(descriptor->Copyright); |
74 list.push_back((ddesc->run_synth || ddesc->run_multiple_synths) ? "true" : "false"); | 74 list.push_back((ddesc->run_synth || ddesc->run_multiple_synths) ? "true" : "false"); |
75 list.push_back(ddesc->run_multiple_synths ? "true" : "false"); | 75 list.push_back(ddesc->run_multiple_synths ? "true" : "false"); |
76 list.push_back(m_taxonomy[descriptor->UniqueID]); | 76 list.push_back(m_taxonomy[*i]); |
77 list.push_back(QString("%1").arg(descriptor->PortCount)); | 77 list.push_back(QString("%1").arg(descriptor->PortCount)); |
78 | 78 |
79 for (unsigned long p = 0; p < descriptor->PortCount; ++p) { | 79 for (unsigned long p = 0; p < descriptor->PortCount; ++p) { |
80 | 80 |
81 int type = 0; | 81 int type = 0; |
299 descriptor->run_multiple_synths); | 299 descriptor->run_multiple_synths); |
300 rtd->parameterCount = 0; | 300 rtd->parameterCount = 0; |
301 rtd->audioInputPortCount = 0; | 301 rtd->audioInputPortCount = 0; |
302 rtd->controlOutputPortCount = 0; | 302 rtd->controlOutputPortCount = 0; |
303 | 303 |
304 QString identifier = PluginIdentifier::createIdentifier | |
305 ("dssi", soname, ladspaDescriptor->Label); | |
306 | |
304 #ifdef HAVE_LRDF | 307 #ifdef HAVE_LRDF |
305 char *def_uri = 0; | 308 char *def_uri = 0; |
306 lrdf_defaults *defs = 0; | 309 lrdf_defaults *defs = 0; |
307 | 310 |
308 QString category = m_taxonomy[ladspaDescriptor->UniqueID]; | 311 QString category = m_taxonomy[identifier]; |
312 | |
313 if (category == "" && m_lrdfTaxonomy[descriptor->LADSPA_Plugin->UniqueID] != "") { | |
314 m_taxonomy[identifier] = m_lrdfTaxonomy[descriptor->LADSPA_Plugin->UniqueID]; | |
315 category = m_taxonomy[identifier]; | |
316 } | |
309 | 317 |
310 if (category == "" && ladspaDescriptor->Name != 0) { | 318 if (category == "" && ladspaDescriptor->Name != 0) { |
311 std::string name = ladspaDescriptor->Name; | 319 std::string name = ladspaDescriptor->Name; |
312 if (name.length() > 4 && | 320 if (name.length() > 4 && |
313 name.substr(name.length() - 4) == " VST") { | 321 name.substr(name.length() - 4) == " VST") { |
314 if (descriptor->run_synth || descriptor->run_multiple_synths) { | 322 if (descriptor->run_synth || descriptor->run_multiple_synths) { |
315 category = "VST instruments"; | 323 category = "VST instruments"; |
316 } else { | 324 } else { |
317 category = "VST effects"; | 325 category = "VST effects"; |
318 } | 326 } |
319 m_taxonomy[ladspaDescriptor->UniqueID] = category; | 327 m_taxonomy[identifier] = category; |
320 } | 328 } |
321 } | 329 } |
322 | 330 |
323 rtd->category = category.toStdString(); | 331 rtd->category = category.toStdString(); |
324 | 332 |
372 ++rtd->audioInputPortCount; | 380 ++rtd->audioInputPortCount; |
373 } | 381 } |
374 } | 382 } |
375 } | 383 } |
376 | 384 |
377 QString identifier = PluginIdentifier::createIdentifier | |
378 ("dssi", soname, ladspaDescriptor->Label); | |
379 m_identifiers.push_back(identifier); | 385 m_identifiers.push_back(identifier); |
380 | 386 |
381 m_rtDescriptors[identifier] = rtd; | 387 m_rtDescriptors[identifier] = rtd; |
382 | 388 |
383 ++index; | 389 ++index; |