# HG changeset patch # User Chris Cannam # Date 1464016145 -3600 # Node ID 44dc11ffa560e146b0c09d28ae679770632dcada # Parent 6ec1a5e877489d00e5d63a0fca5ee1be7d1e4cb0 Unify request/response types and make common with capnp types diff -r 6ec1a5e87748 -r 44dc11ffa560 examples/request.json --- 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"]}} diff -r 6ec1a5e87748 -r 44dc11ffa560 examples/response.json --- 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."} diff -r 6ec1a5e87748 -r 44dc11ffa560 schema/request.json --- 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 } diff -r 6ec1a5e87748 -r 44dc11ffa560 schema/response.json --- 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 }