custom-module: expose send and receive shorthands, expose client's address in app event handlers

This commit is contained in:
jean-emmanuel 2019-03-20 09:07:54 +01:00
parent 9dadbf725f
commit e7ec5208e1
4 changed files with 40 additions and 10 deletions

View file

@ -51,10 +51,12 @@ var bindCallbacks = function(callbacks) {
ipc.on('connection', function(client) {
var clientInfos = {address: client.address, id: client.id}
for (let name in callbacks) {
client.on(name, (data)=>{
if (osc.customModule) {
osc.customModuleEventEmitter.emit(name, data, client.id)
osc.customModuleEventEmitter.emit(name, data, clientInfos)
}
callbacks[name](data, client.id)
})