mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-08-14 02:03:39 +00:00
convert to different atem library. Add FTB and DSK
This commit is contained in:
+17
-38
@@ -2,7 +2,7 @@ const { v4: uuid } = require('uuid');
|
||||
const osc = require('osc');
|
||||
const net = require('net');
|
||||
const udp = require('dgram');
|
||||
const Atem = require('atem');
|
||||
const { Atem } = require('atem-connection');
|
||||
const PLUGINS = require('./plugins.js');
|
||||
const VIEW = require('./view.js');
|
||||
const SAVESLOTS = require('./saveSlots.js');
|
||||
@@ -194,45 +194,24 @@ function initDeviceConnection(id) {
|
||||
|
||||
device.send = (data) => {};
|
||||
} else if (plugins[type].config.connectionType === 'atem') {
|
||||
device.connection = new Atem(device.addresses[0]);
|
||||
device.connection.on('connectionStateChange', (state) => {
|
||||
plugins[type].ready(device);
|
||||
device.connection = new Atem({
|
||||
// this gets around the no workers nodejs error
|
||||
disableMultithreaded: true,
|
||||
});
|
||||
device.connection.connect(device.addresses[0]);
|
||||
|
||||
device.connection.on('connected', () => {
|
||||
infoUpdate(device, 'status', 'ok');
|
||||
const msg = {
|
||||
event: 'connectionStateChange',
|
||||
plugins[type].ready(device);
|
||||
});
|
||||
|
||||
device.connection.on('stateChanged', (state, pathToChange) => {
|
||||
device.lastMessage = Date.now();
|
||||
plugins[type].data(device, {
|
||||
pathToChange,
|
||||
state,
|
||||
};
|
||||
plugins[type].data(device, msg);
|
||||
});
|
||||
|
||||
device.connection.on('sourceTally', (sourceID, state) => {
|
||||
const msg = {
|
||||
event: 'sourceTally',
|
||||
sourceID,
|
||||
state,
|
||||
};
|
||||
plugins[type].data(device, msg);
|
||||
});
|
||||
|
||||
device.connection.on('sourceConfiguration', (sourceID, sourceConfiguration) => {
|
||||
const msg = {
|
||||
event: 'sourceConfiguration',
|
||||
sourceID,
|
||||
sourceConfiguration,
|
||||
};
|
||||
plugins[type].data(device, msg);
|
||||
});
|
||||
|
||||
device.connection.on('rawCommand', (cmd) => {
|
||||
const msg = {
|
||||
event: 'rawCommand',
|
||||
cmd,
|
||||
};
|
||||
plugins[type].data(device, msg);
|
||||
});
|
||||
|
||||
device.connection.on('connectionLost', () => {
|
||||
console.log('connection lost');
|
||||
});
|
||||
infoUpdate(device, 'status', 'ok');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user