2012-09-08 12:43:04 +00:00
|
|
|
var events = require('events')
|
|
|
|
, web = require('./web.js')
|
|
|
|
, setup = require('./setup.js').setup
|
|
|
|
, devices = require('./devices.js').devices
|
|
|
|
;
|
|
|
|
|
2012-09-01 12:17:39 +00:00
|
|
|
|
2012-09-08 12:43:04 +00:00
|
|
|
var dmx = new events.EventEmitter();
|
2012-09-01 12:17:39 +00:00
|
|
|
|
2012-09-08 12:43:04 +00:00
|
|
|
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);
|