diff plugin/FeatureExtractionPluginFactory.cpp @ 1213:8dc7ab20e847 piper

Restore plugin categories
author Chris Cannam
date Mon, 17 Oct 2016 14:55:05 +0100
parents 584b2d7d7cd9
children 77320e522253
line wrap: on
line diff
--- a/plugin/FeatureExtractionPluginFactory.cpp	Mon Oct 17 14:28:43 2016 +0100
+++ b/plugin/FeatureExtractionPluginFactory.cpp	Mon Oct 17 14:55:05 2016 +0100
@@ -16,9 +16,6 @@
 #include "FeatureExtractionPluginFactory.h"
 #include "PluginIdentifier.h"
 
-#include <vamp-hostsdk/PluginHostAdapter.h>
-#include <vamp-hostsdk/PluginWrapper.h>
-
 #include "system/System.h"
 
 #include "PluginScan.h"
@@ -134,9 +131,7 @@
 QString
 FeatureExtractionPluginFactory::getPluginCategory(QString identifier)
 {
-    //!!! (re)implement
-//    return m_taxonomy[identifier];
-    return QString();
+    return m_taxonomy[identifier];
 }
 
 void
@@ -144,5 +139,17 @@
 {
     piper_vamp::ListResponse lr = m_client.listPluginData();
     m_pluginData = lr.available;
+
+    for (const auto &pd: m_pluginData) {
+
+        QString identifier =
+            QString("vamp:") + QString::fromStdString(pd.pluginKey);
+
+        QStringList catlist;
+        for (const auto &cs: pd.category) {
+            catlist.push_back(QString::fromStdString(cs));
+        }
+        m_taxonomy[identifier] = catlist.join(" > ");
+    }
 }