changeset 120:bc6c2a090268

Unify request/response types and make common with capnp types
author Chris Cannam <c.cannam@qmul.ac.uk>
date Mon, 23 May 2016 16:09:05 +0100
parents 3e5bf8b59c72
children eb08485be9f0 6839d4ab952a
files examples/request.json examples/response.json schema/request.json schema/response.json
diffstat 4 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/examples/request.json	Wed May 18 16:34:08 2016 +0100
+++ b/examples/request.json	Mon May 23 16:09:05 2016 +0100
@@ -1,2 +1,2 @@
-{"verb": "load", "content": {"key":"vamp-example-plugins:percussiononsets","inputSampleRate":44100,"adapterFlags":["AdaptInputDomain","AdaptBufferSize"]}}
+{"type": "load", "content": {"pluginKey":"vamp-example-plugins:percussiononsets","inputSampleRate":44100,"adapterFlags":["AdaptInputDomain","AdaptBufferSize"]}}
 
--- a/examples/response.json	Wed May 18 16:34:08 2016 +0100
+++ b/examples/response.json	Mon May 23 16:09:05 2016 +0100
@@ -1,1 +1,1 @@
-{"success": true, "response": {"pluginHandle":12345,"staticData":{"basic": {"description": "Detect percussive note onsets by identifying broadband energy rises", "identifier": "percussiononsets", "name": "Simple Percussion Onset Detector"}, "basicOutputInfo": [{"description": "Percussive note onset locations", "identifier": "onsets", "name": "Onsets"}, {"description": "Broadband energy rise detection function", "identifier": "detectionfunction", "name": "Detection Function"}], "category": ["Time", "Onsets"], "copyright": "Code copyright 2006 Queen Mary, University of London, after Dan Barry et al 2005.  Freely redistributable (BSD license)", "inputDomain": "FrequencyDomain", "key": "vamp-example-plugins:percussiononsets", "maker": "Vamp SDK Example Plugins", "maxChannelCount": 1, "minChannelCount": 1, "parameters": [{"basic": {"description": "Energy rise within a frequency bin necessary to count toward broadband total", "identifier": "threshold", "name": "Energy rise threshold"}, "defaultValue": 3, "extents": {"max": 20, "min": 0}, "unit": "dB", "valueNames": []}, {"basic": {"description": "Sensitivity of peak detector applied to broadband detection function", "identifier": "sensitivity", "name": "Sensitivity"}, "defaultValue": 40, "extents": {"max": 100, "min": 0}, "unit": "%", "valueNames": []}], "programs": [], "version": 2},"defaultConfiguration":{"blockSize": 512, "channelCount": 2, "parameterValues": {"sensitivity": 40, "threshold": 3}, "stepSize": 1024}},"errorText":"I like weevils."}
+{"type": "load", "success": true, "content": {"pluginHandle":12345,"staticData":{"basic": {"description": "Detect percussive note onsets by identifying broadband energy rises", "identifier": "percussiononsets", "name": "Simple Percussion Onset Detector"}, "basicOutputInfo": [{"description": "Percussive note onset locations", "identifier": "onsets", "name": "Onsets"}, {"description": "Broadband energy rise detection function", "identifier": "detectionfunction", "name": "Detection Function"}], "category": ["Time", "Onsets"], "copyright": "Code copyright 2006 Queen Mary, University of London, after Dan Barry et al 2005.  Freely redistributable (BSD license)", "inputDomain": "FrequencyDomain", "pluginKey": "vamp-example-plugins:percussiononsets", "maker": "Vamp SDK Example Plugins", "maxChannelCount": 1, "minChannelCount": 1, "parameters": [{"basic": {"description": "Energy rise within a frequency bin necessary to count toward broadband total", "identifier": "threshold", "name": "Energy rise threshold"}, "defaultValue": 3, "extents": {"max": 20, "min": 0}, "unit": "dB", "valueNames": []}, {"basic": {"description": "Sensitivity of peak detector applied to broadband detection function", "identifier": "sensitivity", "name": "Sensitivity"}, "defaultValue": 40, "extents": {"max": 100, "min": 0}, "unit": "%", "valueNames": []}], "programs": [], "pluginVersion": 2},"defaultConfiguration":{"blockSize": 512, "channelCount": 2, "parameterValues": {"sensitivity": 40, "threshold": 3}, "stepSize": 1024}},"errorText":"I like weevils."}
--- a/schema/request.json	Wed May 18 16:34:08 2016 +0100
+++ b/schema/request.json	Mon May 23 16:09:05 2016 +0100
@@ -4,14 +4,14 @@
     "description": "schema for a simple serialised request",
     "type": "object",
     "properties": {
-	"verb": {
+	"type": {
 	    "type": "string"
 	},
 	"content": {
 	    "type": "object"
 	}
     },
-    "required": [ "verb" ],
+    "required": [ "type" ],
     "additionalProperties": false
 }
 
--- a/schema/response.json	Wed May 18 16:34:08 2016 +0100
+++ b/schema/response.json	Mon May 23 16:09:05 2016 +0100
@@ -4,17 +4,20 @@
     "description": "schema for a success or failure response to a request",
     "type": "object",
     "properties": {
+	"type": {
+	    "type": "string"
+	},
 	"success": {
 	    "type": "boolean"
 	},
-	"response": {
-	    "type": "object"
-	},
 	"errorText": {
 	    "type": "string"
+	},
+	"content": {
+	    "type": "object"
 	}
     },
-    "required": [ "success" ],
+    "required": [ "type", "success" ],
     "additionalProperties": false
 }