custom module: expose app, an event listener for monitoring events (see callbacks.js) (#341)
This commit is contained in:
parent
720ab76860
commit
9368318587
3 changed files with 11 additions and 2 deletions
|
|
@ -10,12 +10,15 @@ var ipc = require('../server').ipc,
|
|||
fs = require('fs'),
|
||||
midi = settings.read('midi') ? require('../midi') : false,
|
||||
oscUDPServer = require('./udp'),
|
||||
oscTCPServer = require('./tcp')
|
||||
oscTCPServer = require('./tcp'),
|
||||
EventEmitter = require('events').EventEmitter
|
||||
|
||||
|
||||
class OscServer {
|
||||
|
||||
constructor(){
|
||||
|
||||
this.customModuleEventEmitter = new EventEmitter()
|
||||
this.customModule = (()=>{
|
||||
|
||||
if (!settings.read('customModule')) return false
|
||||
|
|
@ -33,6 +36,7 @@ class OscServer {
|
|||
console,
|
||||
sendOsc: this.sendOsc.bind(this),
|
||||
receiveOsc: this.receiveOsc.bind(this),
|
||||
app: this.customModuleEventEmitter,
|
||||
setTimeout,
|
||||
clearTimeout,
|
||||
setInterval,
|
||||
|
|
@ -208,7 +212,7 @@ var oscServer = new OscServer()
|
|||
oscServer.init()
|
||||
|
||||
module.exports = {
|
||||
|
||||
server: oscServer,
|
||||
send: function(host,port,address,args,precision) {
|
||||
|
||||
var message = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue