Mercurial > hg > piper-cpp
changeset 42:91f5c92d3bf7
Some JSON fixes and a quick test program
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Tue, 23 Aug 2016 12:04:49 +0100 |
parents | 10ac36b7198a |
children | 62c17e143aba |
files | test/test-vampipe-server.sh utilities/vampipe-convert.cpp |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/test/test-vampipe-server.sh Tue Aug 23 11:17:01 2016 +0100 +++ b/test/test-vampipe-server.sh Tue Aug 23 12:04:49 2016 +0100 @@ -3,7 +3,7 @@ ( bin/vampipe-convert request -i json -o capnp | VAMP_PATH=./vamp-plugin-sdk/examples bin/vampipe-server | bin/vampipe-convert response -i capnp -o json ) <<EOF -{"type":"list","content": {}} +{"type":"list"} {"type":"load","content": {"pluginKey":"vamp-example-plugins:percussiononsets","inputSampleRate":44100,"adapterFlags":["AdaptInputDomain","AdaptBufferSize"]}} {"type":"configure","content":{"pluginHandle":1,"configuration":{"blockSize": 8, "channelCount": 1, "parameterValues": {"sensitivity": 40, "threshold": 3}, "stepSize": 8}}} {"type":"process","content": {"pluginHandle": 1, "processInput": { "timestamp": {"s": 0, "n": 0}, "inputBuffers": [{"values": [1,2,3,4,5,6,7,8]}]}}}
--- a/utilities/vampipe-convert.cpp Tue Aug 23 11:17:01 2016 +0100 +++ b/utilities/vampipe-convert.cpp Tue Aug 23 12:04:49 2016 +0100 @@ -47,7 +47,7 @@ if (!j["type"].is_string()) { throw VampJson::Failure("string expected for type field"); } - if (!j["content"].is_object()) { + if (!j["content"].is_null() && !j["content"].is_object()) { throw VampJson::Failure("object expected for content field"); } return j;