diff json/VampJson.h @ 32:2d97883d20df

Wire up a couple of server actions
author Chris Cannam <c.cannam@qmul.ac.uk>
date Tue, 24 May 2016 17:17:03 +0100
parents 5b9690d18241
children 54676b4e224e
line wrap: on
line diff
--- a/json/VampJson.h	Tue May 24 16:30:01 2016 +0100
+++ b/json/VampJson.h	Tue May 24 17:17:03 2016 +0100
@@ -689,15 +689,16 @@
 
         if (!j.has_shape({
                     { "pluginKey", json11::Json::STRING },
-                    { "inputSampleRate", json11::Json::NUMBER },
-                    { "adapterFlags", json11::Json::ARRAY } }, err)) {
+                    { "inputSampleRate", json11::Json::NUMBER } }, err)) {
             throw Failure("malformed load request: " + err);
         }
     
         Vamp::HostExt::LoadRequest req;
         req.pluginKey = j["pluginKey"].string_value();
         req.inputSampleRate = j["inputSampleRate"].number_value();
-        req.adapterFlags = toAdapterFlags(j["adapterFlags"]);
+        if (!j["adapterFlags"].is_null()) {
+            req.adapterFlags = toAdapterFlags(j["adapterFlags"]);
+        }
         return req;
     }