From e7ec58d5e2f232f702645b3070affdb8fafe5fb5 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 2 Nov 2016 22:47:13 +0100 Subject: [PATCH] osc: use the same args scheme for input and output for consistency (and strip out args' type property before sending to clients) --- app/main/osc.js | 6 +++++- resources/docs/user-guide/cutom-module.md | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/main/osc.js b/app/main/osc.js index 1344ed2d..2fbe10a2 100644 --- a/app/main/osc.js +++ b/app/main/osc.js @@ -12,7 +12,8 @@ var osc = require('osc'), var oscServer = new osc.UDPPort({ localAddress: "0.0.0.0", - localPort: oscInPort + localPort: oscInPort, + metadata: true }); @@ -102,6 +103,9 @@ var oscOutFilter = function(data){ var oscInHandler = function(msg, timetag, info){ var data = oscInFilter({address: msg.address, args: msg.args, host: info.address, port: info.port}) + for (i in data.args) { + data.args[i] = data.args[i].value + } receiveOsc(data) } diff --git a/resources/docs/user-guide/cutom-module.md b/resources/docs/user-guide/cutom-module.md index 96b4d97f..5e77618a 100644 --- a/resources/docs/user-guide/cutom-module.md +++ b/resources/docs/user-guide/cutom-module.md @@ -17,8 +17,13 @@ It must be of the following form: // do what you want + // address = string + // args = array of {value, type} objects + // host = string + // port = integer + // return data if you want the message to be processed - return data + return {address, args, host, port} }, oscOutFilter:function(data){ @@ -27,7 +32,7 @@ It must be of the following form: // same as oscInFilter // return data if you want the message to be and sent - return data + return {address, args, host, port} } }