changeset 456:86624d166f88 outputid-string-in-featureset

Introduce ListResponse type as well
author Chris Cannam
date Mon, 19 Sep 2016 14:10:19 +0100
parents 5c07a86abddd
children 30234a7aaae3
files src/vamp-hostsdk/PluginLoader.cpp vamp-hostsdk/PluginLoader.h vamp-hostsdk/RequestResponse.h
diffstat 3 files changed, 30 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/vamp-hostsdk/PluginLoader.cpp	Mon Sep 19 13:35:56 2016 +0100
+++ b/src/vamp-hostsdk/PluginLoader.cpp	Mon Sep 19 14:10:19 2016 +0100
@@ -61,7 +61,8 @@
     virtual ~Impl();
 
     PluginKeyList listPlugins();
-    PluginStaticDataList listPluginData();
+
+    ListResponse listPluginData();
 
     Plugin *loadPlugin(PluginKey key,
                        float inputSampleRate,
@@ -149,7 +150,7 @@
     return m_impl->listPlugins();
 }
 
-PluginLoader::PluginStaticDataList
+ListResponse
 PluginLoader::listPluginData() 
 {
     return m_impl->listPluginData();
@@ -222,23 +223,24 @@
     return plugins;
 }
 
-PluginLoader::PluginStaticDataList
+ListResponse
 PluginLoader::Impl::listPluginData() 
 {
     PluginKeyList keys = listPlugins();
-    PluginStaticDataList dataList;
+    ListResponse response;
 
     for (PluginKeyList::const_iterator ki = keys.begin(); ki != keys.end(); ++ki) {
         string key = *ki;
 	Plugin *p = loadPlugin(key, 44100, 0);
 	if (p) {
             PluginCategoryHierarchy category = getPluginCategory(key);
-	    dataList.push_back(PluginStaticData::fromPlugin(key, category, p));
+            response.pluginData.push_back
+                (PluginStaticData::fromPlugin(key, category, p));
 	}
         delete p;
     }
 
-    return dataList;
+    return response;
 }
 
 void
--- a/vamp-hostsdk/PluginLoader.h	Mon Sep 19 13:35:56 2016 +0100
+++ b/vamp-hostsdk/PluginLoader.h	Mon Sep 19 14:10:19 2016 +0100
@@ -123,14 +123,6 @@
     typedef std::vector<std::string> PluginCategoryHierarchy;
 
     /**
-     * PluginStaticDataList is a list containing static information
-     * about a set of Vamp plugins.
-     *
-     * \see PluginStaticData, listPluginData()
-     */
-    typedef std::vector<PluginStaticData> PluginStaticDataList;
-    
-    /**
      * Search for all available Vamp plugins, and return a list of
      * them in the order in which they were found.
      */
@@ -141,8 +133,10 @@
      * static data about each plugin in the order in which they were
      * found. This is slower but returns more comprehensive
      * information than listPlugins().
+     *
+     * \see ListResponse, PluginStaticData
      */
-    PluginStaticDataList listPluginData();
+    ListResponse listPluginData();
 
     /**
      * AdapterFlags contains a set of values that may be OR'd together
--- a/vamp-hostsdk/RequestResponse.h	Mon Sep 19 13:35:56 2016 +0100
+++ b/vamp-hostsdk/RequestResponse.h	Mon Sep 19 14:10:19 2016 +0100
@@ -54,6 +54,25 @@
 namespace HostExt {
 
 /**
+ * \class ListResponse RequestResponse.h <vamp-hostsdk/RequestResponse.h>
+ * 
+ * Vamp::HostExt::ListResponse is a structure containing the
+ * information returned by PluginLoader when asked to list static
+ * information about the available plugins.
+ *
+ * \see PluginLoader::listPluginData, PluginStaticData
+ *
+ * \note This class was introduced in version 2.7 of the Vamp plugin
+ * SDK, along with the PluginLoader method that returns this structure.
+ */
+struct ListResponse
+{
+    ListResponse() { } // empty by default
+    
+    std::vector<PluginStaticData> pluginData;
+};
+
+/**
  * \class LoadRequest RequestResponse.h <vamp-hostsdk/RequestResponse.h>
  * 
  * Vamp::HostExt::LoadRequest is a structure containing the