dmx-flok/dmx.js
Sebastian Wiedenroth 39ed74ddc0 basic web interface
2012-09-08 14:43:04 +02:00

25 lines
No EOL
586 B
JavaScript

var events = require('events')
, web = require('./web.js')
, setup = require('./setup.js').setup
, devices = require('./devices.js').devices
;
var dmx = new events.EventEmitter();
dmx.setup = setup;
dmx.devices = devices;
dmx.drivers = {};
dmx.update = function(universe, update) {
dmx.drivers[universe].update(update);
dmx.emit('update', universe, update);
}
for(var universe in setup.universes) {
dmx.drivers[universe] = require('./drivers/' + setup.universes[universe].output.driver + '.js').init(setup.universes[universe].output.device);
}
web.init(dmx);