changeset 1213:8dc7ab20e847 piper

Restore plugin categories
author Chris Cannam
date Mon, 17 Oct 2016 14:55:05 +0100
parents f80773b5ec96
children 77320e522253
files plugin/FeatureExtractionPluginFactory.cpp plugin/FeatureExtractionPluginFactory.h
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
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(" > ");
+    }
 }
 
--- a/plugin/FeatureExtractionPluginFactory.h	Mon Oct 17 14:28:43 2016 +0100
+++ b/plugin/FeatureExtractionPluginFactory.h	Mon Oct 17 14:55:05 2016 +0100
@@ -59,6 +59,7 @@
 
     QMutex m_mutex;
     std::vector<piper_vamp::PluginStaticData> m_pluginData;
+    std::map<QString, QString> m_taxonomy;
     void populate();
 };