diff vamp-server/simple-server.cpp @ 133:74a7c2a8d6b6

Merge from branch listargs
author Chris Cannam <c.cannam@qmul.ac.uk>
date Fri, 04 Nov 2016 10:43:49 +0000
parents b37530377d6e
children 9da826f812cb
line wrap: on
line diff
--- a/vamp-server/simple-server.cpp	Fri Oct 28 14:31:58 2016 +0100
+++ b/vamp-server/simple-server.cpp	Fri Nov 04 10:43:49 2016 +0000
@@ -218,7 +218,7 @@
     switch (rr.type) {
 
     case RRType::List:
-        VampJson::toRpcRequest_List(j, err); // type check only
+        rr.listRequest = VampJson::toRpcRequest_List(j, err);
         break;
     case RRType::Load:
         rr.loadRequest = VampJson::toRpcRequest_Load(j, err);
@@ -315,7 +315,7 @@
     switch (rr.type) {
 
     case RRType::List:
-        VampnProto::readRpcRequest_List(reader); // type check only
+        VampnProto::readRpcRequest_List(rr.listRequest, reader);
         break;
     case RRType::Load:
         VampnProto::readRpcRequest_Load(rr.loadRequest, reader);
@@ -396,16 +396,21 @@
     switch (request.type) {
 
     case RRType::List:
-        response.listResponse = LoaderRequests().listPluginData();
+        response.listResponse =
+            LoaderRequests().listPluginData(request.listRequest);
         response.success = true;
         break;
 
     case RRType::Load:
-        response.loadResponse = LoaderRequests().loadPlugin(request.loadRequest);
+        response.loadResponse =
+            LoaderRequests().loadPlugin(request.loadRequest);
         if (response.loadResponse.plugin != nullptr) {
             mapper.addPlugin(response.loadResponse.plugin);
             if (debug) {
-                cerr << "piper-vamp-server " << pid << ": loaded plugin, handle = " << mapper.pluginToHandle(response.loadResponse.plugin) << endl;
+                cerr << "piper-vamp-server " << pid
+                     << ": loaded plugin, handle = "
+                     << mapper.pluginToHandle(response.loadResponse.plugin)
+                     << endl;
             }
             response.success = true;
         }