Remove node-side digital lib and replace with filmout lib. Still remaining: rename internal uses of "dig" or "digital" to "filmout", including markup on the frontend.
This commit is contained in:
parent
00b26719f6
commit
22187777e7
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/digital/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,iCAA8B;AAE9B,MAAM,OAAO;IAiBZ;;QAEI;IACJ,YAAa,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW;QAnBvE,UAAK,GAAS;YACpB,KAAK,EAAG,CAAC;YACT,MAAM,EAAG,CAAC;YACV,IAAI,EAAG,IAAI;YACX,QAAQ,EAAG,IAAI;YACf,IAAI,EAAG,EAAE;YACT,GAAG,EAAG,IAAI;YACV,OAAO,EAAG,KAAK;SACf,CAAC;QAYD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IACD;;QAEI;IACI,KAAK,CAAC,IAAI;QACjB,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,CAAC,EAAE,KAAK,EAAG,SAAS,EAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;IACD;;QAEI;IACK,MAAM;QACb,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,GA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M,GAAG,MAAM,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAEvB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACtE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,EAAG,IAAI,EAAE,KAAK,EAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5F,CAAC;IACD,KAAK,CAAC,KAAK;IAEX,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW,EAAE,EAAE;IACtF,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC,CAAA"}
|
|
@ -1,11 +1,12 @@
|
|||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const delay_1 = require("delay");
|
||||
class Digital {
|
||||
class FilmOut {
|
||||
/**
|
||||
*
|
||||
**/
|
||||
constructor(display, ffmpeg, ffprobe, ui, light) {
|
||||
this.id = 'filmout';
|
||||
this.state = {
|
||||
frame: 0,
|
||||
frames: 0,
|
||||
|
@ -27,7 +28,7 @@ class Digital {
|
|||
**/
|
||||
async init() {
|
||||
const Log = require('log');
|
||||
this.log = await Log({ label: 'digital' });
|
||||
this.log = await Log({ label: this.id });
|
||||
this.ipc = require('electron').ipcMain;
|
||||
this.listen();
|
||||
}
|
||||
|
@ -35,8 +36,11 @@ class Digital {
|
|||
*
|
||||
**/
|
||||
listen() {
|
||||
this.ipc.on('digital', this.connectDigital.bind(this));
|
||||
this.ipc.on(this.id, this.onConnect.bind(this));
|
||||
this.ipc.on('focus', this.focus.bind(this));
|
||||
this.ipc.on('field', this.field.bind(this));
|
||||
this.ipc.on('meter', this.meter.bind(this));
|
||||
this.ipc.on('filmout_close', this.close.bind(this));
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
@ -89,28 +93,28 @@ class Digital {
|
|||
this.display.hide();
|
||||
}
|
||||
/**
|
||||
* Use a file as the "digital" source on "projector"
|
||||
* Use a video file as a film out source on "projector"
|
||||
*
|
||||
**/
|
||||
async connectDigital(evt, arg) {
|
||||
async onConnect(evt, arg) {
|
||||
let info;
|
||||
let frames = 0;
|
||||
try {
|
||||
info = await this.ffprobe.info(arg.path);
|
||||
}
|
||||
catch (err) {
|
||||
//this.log.error(err, 'DIGITAL', true, true);
|
||||
//this.log.error(err, 'FILMOUT', true, true);
|
||||
this.state.enabled = false;
|
||||
await this.ui.send('digital', { valid: false });
|
||||
await this.ui.send(this.id, { valid: false });
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
frames = await this.ffprobe.frames(arg.path);
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'DIGITAL', true, true);
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
this.state.enabled = false;
|
||||
await this.ui.send('digital', { valid: false });
|
||||
await this.ui.send(this.id, { valid: false });
|
||||
return false;
|
||||
}
|
||||
this.state.frame = 0;
|
||||
|
@ -118,15 +122,49 @@ class Digital {
|
|||
this.state.fileName = arg.fileName;
|
||||
this.state.frames = frames;
|
||||
this.state.info = info;
|
||||
this.log.info(`Opened ${this.state.fileName}`, 'DIGITAL', true, true);
|
||||
this.log.info(`Frames : ${frames}`, 'DIGITAL', true, true);
|
||||
this.log.info(`Opened ${this.state.fileName}`, 'FILMOUT', true, true);
|
||||
this.log.info(`Frames : ${frames}`, 'FILMOUT', true, true);
|
||||
this.state.enabled = true;
|
||||
return await this.ui.send('digital', { valid: true, state: JSON.stringify(this.state) });
|
||||
return await this.ui.send(this.id, { valid: true, state: JSON.stringify(this.state) });
|
||||
}
|
||||
async focus(evt, arg) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.focus();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async field(evt, arg) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.field();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async meter(evt, arg) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.meter();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async close(evt, arg) {
|
||||
try {
|
||||
await this.display.hide();
|
||||
await this.display.close();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
async focus() {
|
||||
}
|
||||
}
|
||||
module.exports = (display, ffmpeg, ffprobe, ui, light) => {
|
||||
return new Digital(display, ffmpeg, ffprobe, ui, light);
|
||||
return new FilmOut(display, ffmpeg, ffprobe, ui, light);
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,252 @@
|
|||
const devices = {};
|
||||
|
||||
devices.init = function () {
|
||||
'use strict';
|
||||
devices.listen();
|
||||
devices.profiles();
|
||||
gui.overlay(true);
|
||||
gui.spinner(true, 'Checking for connected devices...');
|
||||
};
|
||||
devices.profiles = function () {
|
||||
'use strict';
|
||||
const keys = Object.keys(cfg.profiles);
|
||||
const elem = $('#profile')
|
||||
let opt;
|
||||
elem.empty();
|
||||
for (let key of keys) {
|
||||
opt = $('<option>');
|
||||
opt.val(key);
|
||||
opt.text(cfg.profiles[key].label);
|
||||
elem.append(opt);
|
||||
}
|
||||
elem.on('change', (t) => {
|
||||
devices.profile($('#profile').val());
|
||||
});
|
||||
};
|
||||
devices.profile = function (profile) {
|
||||
'use strict';
|
||||
log.info(`Changed configuration profile to "${profile}"`, 'DEVICES', true, true);
|
||||
const p = cfg.profiles[profile];
|
||||
const keys = Object.keys(p);
|
||||
for (let key of keys) {
|
||||
cfg[key] = keys[key]
|
||||
}
|
||||
if (typeof p.light !== 'undefined' && p.light === false) {
|
||||
light.disable();
|
||||
} else {
|
||||
light.enable();
|
||||
}
|
||||
ipcRenderer.send('profile', { profile })
|
||||
};
|
||||
devices.listen = function () {
|
||||
'use strict';
|
||||
ipcRenderer.on('ready', devices.ready);
|
||||
ipcRenderer.on('intval', devices.intvalCb);
|
||||
ipcRenderer.on('digital', devices.digitalCb);
|
||||
};
|
||||
devices.ready = function (event, arg) {
|
||||
'use strict';
|
||||
//console.dir(arg)
|
||||
let opt;
|
||||
let devs = [];
|
||||
let notify = 'Connected to ';
|
||||
let p;
|
||||
gui.spinner(false);
|
||||
gui.overlay(false);
|
||||
for (let i in arg) {
|
||||
devs.push(arg[i].arduino);
|
||||
if (arg[i].arduino && arg[i].arduino !== '/dev/fake') {
|
||||
if (notify === 'Connected to ') {
|
||||
notify += arg[i].arduino + ' '
|
||||
} else {
|
||||
notify += `& ${arg[i].arduino}`
|
||||
}
|
||||
}
|
||||
opt = $('<option>');
|
||||
opt.val(`ARDUINO_${arg[i].arduino}`);
|
||||
opt.text(arg[i].arduino);
|
||||
$(`#${i}_device`).empty();
|
||||
$(`#${i}_device`).append(opt);
|
||||
}
|
||||
if (notify !== 'Connected to ') {
|
||||
gui.notify('DEVICES', notify);
|
||||
} else {
|
||||
gui.notify('DEVICES', 'Connected to mock devices')
|
||||
}
|
||||
if (devs.length > 0) {
|
||||
$('#devices').empty();
|
||||
for (let i of devs) {
|
||||
opt = $('<option>');
|
||||
opt.val(i);
|
||||
opt.text(i);
|
||||
$('#devices').append(opt);
|
||||
}
|
||||
}
|
||||
if (arg && arg.profile) {
|
||||
$('#profile').val(arg.profile)
|
||||
log.info(`Using configuration profile "${arg.profile}"`, 'DEVICES', true, true);
|
||||
p = cfg.profiles[arg.profile];
|
||||
if (typeof p.light !== 'undefined' && p.light === false) {
|
||||
light.disable();
|
||||
} else {
|
||||
light.enable();
|
||||
}
|
||||
//devices.profile(arg.profile)
|
||||
}
|
||||
|
||||
seq.set(0, cfg.cmd.camera_forward);
|
||||
seq.set(1, cfg.cmd.projector_forward);
|
||||
grid.state(0);
|
||||
grid.state(1);
|
||||
seq.stats();
|
||||
|
||||
if (arg.projector_second) {
|
||||
//add second row of projector pads to grid
|
||||
proj.second.enable();
|
||||
}
|
||||
if (arg.camera_second) {
|
||||
//add second row of camera pads to grid
|
||||
cam.second.enable();
|
||||
}
|
||||
return event.returnValue = true;
|
||||
};
|
||||
|
||||
devices.intval = function () {
|
||||
'use strict';
|
||||
const url = $('#intval').val();
|
||||
let proceed = false;
|
||||
let obj = {
|
||||
connect: true,
|
||||
url : url
|
||||
};
|
||||
if ( url !== '' && typeof url !== 'undefined') {
|
||||
proceed = confirm(`Are you sure you want to connect to INTVAL3 @ ${url}?`);
|
||||
} else {
|
||||
alert('Cannot connect to INTVAL3 url as entered.');
|
||||
}
|
||||
|
||||
if (proceed) {
|
||||
gui.overlay(true);
|
||||
gui.spinner(true, `Connecting to INTVAL3 @ ${url}`);
|
||||
ipcRenderer.send('intval', obj);
|
||||
} else {
|
||||
$('#camera_type_arduino').prop('checked', 'checked');
|
||||
$('#intval').removeClass('active');
|
||||
}
|
||||
};
|
||||
|
||||
devices.intvalCb = function (evt, args) {
|
||||
'use strict';
|
||||
let state;
|
||||
gui.spinner(false);
|
||||
gui.overlay(false);
|
||||
if (args.connected && args.connected === true) {
|
||||
//success state
|
||||
state = JSON.parse(args.state);
|
||||
cam.pos = state.counter;
|
||||
cam.dir = state.frame.dir;
|
||||
$('#intval').val(args.url);
|
||||
$('#intval').addClass('active');
|
||||
$('#camera_type_intval').prop('checked', 'checked');
|
||||
gui.notify('DEVICES', `Connected to INTVAL3 @ ${args.url}`)
|
||||
gui.updateState()
|
||||
} else {
|
||||
$('#camera_type_arduino').prop('checked', 'checked');
|
||||
$('#intval').removeClass('active');
|
||||
}
|
||||
};
|
||||
|
||||
devices.digitalSelect = function () {
|
||||
'use strict';
|
||||
const elem = $('#digital');
|
||||
const extensions = ['mpg', 'mpeg', 'mov', 'mkv', 'avi', 'mp4'];
|
||||
dialog.showOpenDialog({
|
||||
title : `Select video or image sequence`,
|
||||
properties : [`openFile`], // openDirectory, multiSelection, openFile
|
||||
defaultPath: 'c:/',
|
||||
filters : [
|
||||
{
|
||||
name: 'All Files',
|
||||
extensions: ['*']
|
||||
},
|
||||
]
|
||||
}, (files) => {
|
||||
let valid = false;
|
||||
console.dir(files)
|
||||
let path = files[0];
|
||||
let displayName;
|
||||
if (path && path !== '') {
|
||||
for (let ext of extensions) {
|
||||
if (path.toLowerCase().indexOf(`.${ext}`) !== -1) {
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
if (!valid) return false;
|
||||
log.info(`Selected video ${path.split('/').pop()}`, 'DIGITAL', true);
|
||||
elem.attr('data-file', path);
|
||||
displayName = path.split('/').pop()
|
||||
elem.val(displayName);
|
||||
$('#video_file').val(displayName);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
devices.digital = function () {
|
||||
'use strict';
|
||||
const elem = $('#digital');
|
||||
const path = elem.attr('data-file');
|
||||
const fileName = elem.val();
|
||||
let proceed = false;
|
||||
let obj = {
|
||||
path,
|
||||
fileName
|
||||
}
|
||||
|
||||
if (path && path !== '') {
|
||||
proceed = confirm(`Are you sure you want to use ${fileName}?`);
|
||||
}
|
||||
|
||||
if (proceed) {
|
||||
gui.overlay(true);
|
||||
gui.spinner(true, `Getting info about ${fileName}`);
|
||||
ipcRenderer.send('digital', obj)
|
||||
} else {
|
||||
$('#projector_type_digital').prop('checked', 'checked');
|
||||
$('#digital').removeClass('active');
|
||||
}
|
||||
};
|
||||
|
||||
devices.digitalCb = function (evt, args) {
|
||||
'use strict';
|
||||
let state;
|
||||
let color = [255,255,255];
|
||||
gui.spinner(false);
|
||||
gui.overlay(false);
|
||||
if (args.valid && args.valid === true) {
|
||||
//success state
|
||||
state = JSON.parse(args.state);
|
||||
$('#digital').addClass('active');
|
||||
$('#projector_type_digital').prop('checked', 'checked');
|
||||
gui.notify('DEVICES', `Using video ${state.fileName}`);
|
||||
|
||||
seq.set(0, 'PF');
|
||||
grid.state(0);
|
||||
|
||||
seq.set(1, 'CF');
|
||||
seq.setLight(1, color);
|
||||
grid.state(1);
|
||||
|
||||
if (light.disabled) {
|
||||
light.enable();
|
||||
}
|
||||
|
||||
$('#seq_loop').val(`${state.frames - 1}`).trigger('change');
|
||||
|
||||
gui.updateState();
|
||||
} else {
|
||||
$('#projector_type_digital').prop('checked', 'checked');
|
||||
$('#digital').removeClass('active');
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = devices;
|
|
@ -41,7 +41,7 @@ let cam2;
|
|||
let proj;
|
||||
let proj2;
|
||||
let light;
|
||||
let dig;
|
||||
let filmout;
|
||||
let dev;
|
||||
let cmd;
|
||||
let seq;
|
||||
|
@ -108,9 +108,9 @@ var init = async function () {
|
|||
}
|
||||
|
||||
light = require('light')(arduino, cfg, mainWindow.webContents)
|
||||
dig = require('digital')(display, ffmpeg, ffprobe, mainWindow.webContents, light)
|
||||
cam = require('cam')(arduino, cfg, mainWindow.webContents, dig)
|
||||
proj = require('proj')(arduino, cfg, mainWindow.webContents, dig)
|
||||
filmout = require('filmout')(display, ffmpeg, ffprobe, mainWindow.webContents, light)
|
||||
cam = require('cam')(arduino, cfg, mainWindow.webContents, filmout)
|
||||
proj = require('proj')(arduino, cfg, mainWindow.webContents, filmout)
|
||||
|
||||
if (dev && dev.connected && dev.connected.camera_second) {
|
||||
cam2 = require('cam')(arduino, cfg, mainWindow.webContents, dig, true)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mcopy-app",
|
||||
"version": "1.4.10",
|
||||
"version": "1.4.11",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1580,9 +1580,6 @@
|
|||
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
|
||||
"dev": true
|
||||
},
|
||||
"digital": {
|
||||
"version": "file:lib/digital"
|
||||
},
|
||||
"display": {
|
||||
"version": "file:lib/display"
|
||||
},
|
||||
|
@ -2501,6 +2498,9 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"filmout": {
|
||||
"version": "file:lib/filmout"
|
||||
},
|
||||
"find-up": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
"cmd": "file:lib/cmd",
|
||||
"delay": "file:lib/delay",
|
||||
"devices": "file:lib/devices",
|
||||
"digital": "file:lib/digital",
|
||||
"filmout": "file:lib/filmout",
|
||||
"display": "file:lib/display",
|
||||
"electron-updater": "^4.0.6",
|
||||
"exec": "file:lib/exec",
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
./node_modules/.bin/tsc ./src/lib/ui/grid.ts --outFile ./lib/ui/grid.js --noImplicitAny --lib ES2017 --lib ES2016 --lib dom -t ES2016
|
||||
./node_modules/.bin/tsc ./src/lib/ui/seq.ts --outFile ./lib/ui/seq.js --noImplicitAny --lib ES2017 --lib ES2016 --lib dom -t ES2016
|
||||
./node_modules/.bin/tsc ./src/lib/ui/digital.ts --outFile ./lib/ui/digital.js --noImplicitAny --lib ES2017 --lib ES2016 --lib dom -t ES2016
|
||||
./node_modules/.bin/tsc ./src/lib/ui/filmout.ts --outFile ./lib/ui/filmout.js --noImplicitAny --lib ES2017 --lib ES2016 --lib dom -t ES2016
|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,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACtE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,EAAG,IAAI,EAAE,KAAK,EAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5F,CAAC;IACD,KAAK,CAAC,KAAK;IAEX,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW,EAAE,EAAE;IACtF,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC,CAAA"}
|
|
@ -1,11 +1,12 @@
|
|||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const delay_1 = require("delay");
|
||||
class Digital {
|
||||
class FilmOut {
|
||||
/**
|
||||
*
|
||||
**/
|
||||
constructor(display, ffmpeg, ffprobe, ui, light) {
|
||||
this.id = 'filmout';
|
||||
this.state = {
|
||||
frame: 0,
|
||||
frames: 0,
|
||||
|
@ -27,7 +28,7 @@ class Digital {
|
|||
**/
|
||||
async init() {
|
||||
const Log = require('log');
|
||||
this.log = await Log({ label: 'digital' });
|
||||
this.log = await Log({ label: this.id });
|
||||
this.ipc = require('electron').ipcMain;
|
||||
this.listen();
|
||||
}
|
||||
|
@ -35,8 +36,11 @@ class Digital {
|
|||
*
|
||||
**/
|
||||
listen() {
|
||||
this.ipc.on('digital', this.connectDigital.bind(this));
|
||||
this.ipc.on(this.id, this.onConnect.bind(this));
|
||||
this.ipc.on('focus', this.focus.bind(this));
|
||||
this.ipc.on('field', this.field.bind(this));
|
||||
this.ipc.on('meter', this.meter.bind(this));
|
||||
this.ipc.on('filmout_close', this.close.bind(this));
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
@ -89,28 +93,28 @@ class Digital {
|
|||
this.display.hide();
|
||||
}
|
||||
/**
|
||||
* Use a file as the "digital" source on "projector"
|
||||
* Use a video file as a film out source on "projector"
|
||||
*
|
||||
**/
|
||||
async connectDigital(evt, arg) {
|
||||
async onConnect(evt, arg) {
|
||||
let info;
|
||||
let frames = 0;
|
||||
try {
|
||||
info = await this.ffprobe.info(arg.path);
|
||||
}
|
||||
catch (err) {
|
||||
//this.log.error(err, 'DIGITAL', true, true);
|
||||
//this.log.error(err, 'FILMOUT', true, true);
|
||||
this.state.enabled = false;
|
||||
await this.ui.send('digital', { valid: false });
|
||||
await this.ui.send(this.id, { valid: false });
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
frames = await this.ffprobe.frames(arg.path);
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'DIGITAL', true, true);
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
this.state.enabled = false;
|
||||
await this.ui.send('digital', { valid: false });
|
||||
await this.ui.send(this.id, { valid: false });
|
||||
return false;
|
||||
}
|
||||
this.state.frame = 0;
|
||||
|
@ -118,15 +122,49 @@ class Digital {
|
|||
this.state.fileName = arg.fileName;
|
||||
this.state.frames = frames;
|
||||
this.state.info = info;
|
||||
this.log.info(`Opened ${this.state.fileName}`, 'DIGITAL', true, true);
|
||||
this.log.info(`Frames : ${frames}`, 'DIGITAL', true, true);
|
||||
this.log.info(`Opened ${this.state.fileName}`, 'FILMOUT', true, true);
|
||||
this.log.info(`Frames : ${frames}`, 'FILMOUT', true, true);
|
||||
this.state.enabled = true;
|
||||
return await this.ui.send('digital', { valid: true, state: JSON.stringify(this.state) });
|
||||
return await this.ui.send(this.id, { valid: true, state: JSON.stringify(this.state) });
|
||||
}
|
||||
async focus(evt, arg) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.focus();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async field(evt, arg) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.field();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async meter(evt, arg) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.meter();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async close(evt, arg) {
|
||||
try {
|
||||
await this.display.hide();
|
||||
await this.display.close();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
async focus() {
|
||||
}
|
||||
}
|
||||
module.exports = (display, ffmpeg, ffprobe, ui, light) => {
|
||||
return new Digital(display, ffmpeg, ffprobe, ui, light);
|
||||
return new FilmOut(display, ffmpeg, ffprobe, ui, light);
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mcopy-cli",
|
||||
"version": "1.3.5",
|
||||
"version": "1.4.11",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1025,9 +1025,6 @@
|
|||
"kuler": "1.0.x"
|
||||
}
|
||||
},
|
||||
"digital": {
|
||||
"version": "file:lib/digital"
|
||||
},
|
||||
"dir-glob": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz",
|
||||
|
@ -1324,6 +1321,9 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"filmout": {
|
||||
"version": "file:lib/filmout"
|
||||
},
|
||||
"for-in": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
"delay": "file:../app/lib/delay",
|
||||
"device": "file:lib/device",
|
||||
"devices": "file:lib/devices",
|
||||
"digital": "file:lib/digital",
|
||||
"filmout": "file:lib/filmout",
|
||||
"display": "file:lib/display",
|
||||
"exec": "file:lib/exec",
|
||||
"exit": "file:lib/exit",
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/digital/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,iCAA8B;AAE9B,MAAM,OAAO;IAiBZ;;QAEI;IACJ,YAAa,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW;QAnBvE,UAAK,GAAS;YACpB,KAAK,EAAG,CAAC;YACT,MAAM,EAAG,CAAC;YACV,IAAI,EAAG,IAAI;YACX,QAAQ,EAAG,IAAI;YACf,IAAI,EAAG,EAAE;YACT,GAAG,EAAG,IAAI;YACV,OAAO,EAAG,KAAK;SACf,CAAC;QAYD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IACD;;QAEI;IACI,KAAK,CAAC,IAAI;QACjB,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,CAAC,EAAE,KAAK,EAAG,SAAS,EAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,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AED,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAEvB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACtE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,EAAG,IAAI,EAAE,KAAK,EAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5F,CAAC;IACD,KAAK,CAAC,KAAK;IAEX,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,OAAa,EAAE,MAAY,EAAE,OAAa,EAAE,EAAQ,EAAE,KAAW,EAAE,EAAE;IACtF,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC,CAAA"}
|
|
@ -1,11 +1,12 @@
|
|||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const delay_1 = require("delay");
|
||||
class Digital {
|
||||
class FilmOut {
|
||||
/**
|
||||
*
|
||||
**/
|
||||
constructor(display, ffmpeg, ffprobe, ui, light) {
|
||||
this.id = 'filmout';
|
||||
this.state = {
|
||||
frame: 0,
|
||||
frames: 0,
|
||||
|
@ -27,7 +28,7 @@ class Digital {
|
|||
**/
|
||||
async init() {
|
||||
const Log = require('log');
|
||||
this.log = await Log({ label: 'digital' });
|
||||
this.log = await Log({ label: this.id });
|
||||
this.ipc = require('electron').ipcMain;
|
||||
this.listen();
|
||||
}
|
||||
|
@ -35,8 +36,11 @@ class Digital {
|
|||
*
|
||||
**/
|
||||
listen() {
|
||||
this.ipc.on('digital', this.connectDigital.bind(this));
|
||||
this.ipc.on(this.id, this.onConnect.bind(this));
|
||||
this.ipc.on('focus', this.focus.bind(this));
|
||||
this.ipc.on('field', this.field.bind(this));
|
||||
this.ipc.on('meter', this.meter.bind(this));
|
||||
this.ipc.on('filmout_close', this.close.bind(this));
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
@ -89,28 +93,28 @@ class Digital {
|
|||
this.display.hide();
|
||||
}
|
||||
/**
|
||||
* Use a file as the "digital" source on "projector"
|
||||
* Use a video file as a film out source on "projector"
|
||||
*
|
||||
**/
|
||||
async connectDigital(evt, arg) {
|
||||
async onConnect(evt, arg) {
|
||||
let info;
|
||||
let frames = 0;
|
||||
try {
|
||||
info = await this.ffprobe.info(arg.path);
|
||||
}
|
||||
catch (err) {
|
||||
//this.log.error(err, 'DIGITAL', true, true);
|
||||
//this.log.error(err, 'FILMOUT', true, true);
|
||||
this.state.enabled = false;
|
||||
await this.ui.send('digital', { valid: false });
|
||||
await this.ui.send(this.id, { valid: false });
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
frames = await this.ffprobe.frames(arg.path);
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'DIGITAL', true, true);
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
this.state.enabled = false;
|
||||
await this.ui.send('digital', { valid: false });
|
||||
await this.ui.send(this.id, { valid: false });
|
||||
return false;
|
||||
}
|
||||
this.state.frame = 0;
|
||||
|
@ -118,15 +122,49 @@ class Digital {
|
|||
this.state.fileName = arg.fileName;
|
||||
this.state.frames = frames;
|
||||
this.state.info = info;
|
||||
this.log.info(`Opened ${this.state.fileName}`, 'DIGITAL', true, true);
|
||||
this.log.info(`Frames : ${frames}`, 'DIGITAL', true, true);
|
||||
this.log.info(`Opened ${this.state.fileName}`, 'FILMOUT', true, true);
|
||||
this.log.info(`Frames : ${frames}`, 'FILMOUT', true, true);
|
||||
this.state.enabled = true;
|
||||
return await this.ui.send('digital', { valid: true, state: JSON.stringify(this.state) });
|
||||
return await this.ui.send(this.id, { valid: true, state: JSON.stringify(this.state) });
|
||||
}
|
||||
async focus(evt, arg) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.focus();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async field(evt, arg) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.field();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async meter(evt, arg) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.meter();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async close(evt, arg) {
|
||||
try {
|
||||
await this.display.hide();
|
||||
await this.display.close();
|
||||
}
|
||||
catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
async focus() {
|
||||
}
|
||||
}
|
||||
module.exports = (display, ffmpeg, ffprobe, ui, light) => {
|
||||
return new Digital(display, ffmpeg, ffprobe, ui, light);
|
||||
return new FilmOut(display, ffmpeg, ffprobe, ui, light);
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,8 @@
|
|||
|
||||
import { delay } from 'delay';
|
||||
|
||||
class Digital {
|
||||
class FilmOut {
|
||||
private id : string = 'filmout';
|
||||
public state : any = {
|
||||
frame : 0,
|
||||
frames : 0,
|
||||
|
@ -35,7 +36,7 @@ class Digital {
|
|||
**/
|
||||
private async init () {
|
||||
const Log = require('log');
|
||||
this.log = await Log({ label : 'digital'});
|
||||
this.log = await Log({ label : this.id });
|
||||
this.ipc = require('electron').ipcMain;
|
||||
this.listen();
|
||||
}
|
||||
|
@ -43,8 +44,11 @@ class Digital {
|
|||
*
|
||||
**/
|
||||
private listen () {
|
||||
this.ipc.on('digital', this.connectDigital.bind(this));
|
||||
this.ipc.on(this.id, this.onConnect.bind(this));
|
||||
this.ipc.on('focus', this.focus.bind(this));
|
||||
this.ipc.on('field', this.field.bind(this));
|
||||
this.ipc.on('meter', this.meter.bind(this));
|
||||
this.ipc.on('filmout_close', this.close.bind(this));
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
@ -95,27 +99,27 @@ class Digital {
|
|||
this.display.hide();
|
||||
}
|
||||
/**
|
||||
* Use a file as the "digital" source on "projector"
|
||||
* Use a video file as a film out source on "projector"
|
||||
*
|
||||
**/
|
||||
async connectDigital (evt : any, arg : any) {
|
||||
async onConnect (evt : any, arg : any) {
|
||||
let info;
|
||||
let frames = 0;
|
||||
|
||||
try {
|
||||
info = await this.ffprobe.info(arg.path);
|
||||
} catch (err) {
|
||||
//this.log.error(err, 'DIGITAL', true, true);
|
||||
//this.log.error(err, 'FILMOUT', true, true);
|
||||
this.state.enabled = false;
|
||||
await this.ui.send('digital', { valid : false });
|
||||
await this.ui.send(this.id, { valid : false });
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
frames = await this.ffprobe.frames(arg.path);
|
||||
} catch (err) {
|
||||
this.log.error(err, 'DIGITAL', true, true);
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
this.state.enabled = false;
|
||||
await this.ui.send('digital', { valid : false });
|
||||
await this.ui.send(this.id, { valid : false });
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -125,16 +129,45 @@ class Digital {
|
|||
this.state.frames = frames;
|
||||
this.state.info = info;
|
||||
|
||||
this.log.info(`Opened ${this.state.fileName}`, 'DIGITAL', true, true);
|
||||
this.log.info(`Frames : ${frames}`, 'DIGITAL', true, true);
|
||||
this.log.info(`Opened ${this.state.fileName}`, 'FILMOUT', true, true);
|
||||
this.log.info(`Frames : ${frames}`, 'FILMOUT', true, true);
|
||||
this.state.enabled = true;
|
||||
return await this.ui.send('digital', { valid : true, state : JSON.stringify(this.state) });
|
||||
return await this.ui.send(this.id, { valid : true, state : JSON.stringify(this.state) });
|
||||
}
|
||||
async focus (evt : any, arg : any) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.focus();
|
||||
} catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async field (evt : any, arg : any) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.field();
|
||||
} catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async meter (evt : any, arg : any) {
|
||||
try {
|
||||
await this.display.open();
|
||||
await this.display.meter();
|
||||
} catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
}
|
||||
async close (evt : any, arg : any) {
|
||||
try {
|
||||
await this.display.hide();
|
||||
await this.display.close();
|
||||
} catch (err) {
|
||||
this.log.error(err, 'FILMOUT', true, true);
|
||||
}
|
||||
async focus () {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = (display : any, ffmpeg : any, ffprobe : any, ui : any, light : any) => {
|
||||
return new Digital(display, ffmpeg, ffprobe, ui, light);
|
||||
return new FilmOut(display, ffmpeg, ffprobe, ui, light);
|
||||
}
|
Loading…
Reference in New Issue