osc: receive osc bundles

This commit is contained in:
jean-emmanuel 2016-11-02 09:44:13 +01:00
parent 4552bd6657
commit a8bbb02c67
2 changed files with 9 additions and 4 deletions

View file

@ -4,7 +4,8 @@
- main
- **new** `-c / --custom-module` switch allowing user to define custom osc filtering fonctions
- `address` is now used everywhere instead of `path` to describe osc address to avoid confusion. Session files using the old `path` option for widgets are still supported.
- `address` is now used everywhere instead of `path` to describe osc address to avoid confusion. Session files using the old `path` option for widgets are still supported.
- **osc bundles** are properly received (subsequent messages are processed separately with a delay if the timetag is set)
## 0.9.2

View file

@ -101,9 +101,13 @@ var oscOutFilter = function(data){
}
oscServer.on('message', function (msg, bundle, info) {
var data = oscInFilter({address: msg.address, args: msg.args, host: info.address, port: info.port})
receiveOsc(data)
oscServer.on('message', function (msg, timetag, info) {
var delay = timetag? Math.max(0,timetag.native - Date.now()) : 0,
timer = delay ? setTimeout : setImmediate
setTimeout(()=>{
var data = oscInFilter({address: msg.address, args: msg.args, host: info.address, port: info.port})
receiveOsc(data)
}, delay)
})
oscServer.on('error', function (error) {