Filmout display monitor size with stats
This commit is contained in:
parent
ddfc46a48f
commit
872b46d4a5
117
app/css/app.css
117
app/css/app.css
|
@ -739,13 +739,84 @@ button:focus {
|
|||
background: black;
|
||||
color: #fff;
|
||||
}
|
||||
#video input[type=text],
|
||||
#video select {
|
||||
display: block;
|
||||
border-radius: 5px;
|
||||
border: 2px solid #fff;
|
||||
text-align: center;
|
||||
background: transparent;
|
||||
color: #fff;
|
||||
padding: 8px 0;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
font-size: 21px;
|
||||
min-width: 300px;
|
||||
}
|
||||
#video input[type=text] span,
|
||||
#video select span {
|
||||
display: block;
|
||||
font-size: 16px;
|
||||
font-weight: 200;
|
||||
}
|
||||
#video input[type=text]:active,
|
||||
#video select:active,
|
||||
#video input[type=text] .active,
|
||||
#video select .active {
|
||||
background: #fff;
|
||||
color: #272b30;
|
||||
outline: none;
|
||||
}
|
||||
#video input[type=text]:focus,
|
||||
#video select:focus {
|
||||
outline: none;
|
||||
}
|
||||
#video input[type=text].active,
|
||||
#video select.active {
|
||||
border-color: #DAE035;
|
||||
color: #DAE035;
|
||||
}
|
||||
#video button,
|
||||
#video select {
|
||||
padding: 9px 16px 8px;
|
||||
}
|
||||
#path_bar {
|
||||
padding: 5px;
|
||||
height: 50px;
|
||||
}
|
||||
#path_bar input {
|
||||
float: left;
|
||||
}
|
||||
#path_bar button {
|
||||
float: left;
|
||||
margin-left: 5px;
|
||||
}
|
||||
#path_bar select {
|
||||
line-height: 41px;
|
||||
height: 41px;
|
||||
margin-right: 5px;
|
||||
float: right;
|
||||
}
|
||||
#filmout_monitor {
|
||||
display: none;
|
||||
border: 2px solid white;
|
||||
box-sizing: border-box;
|
||||
height: 360px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#filmout_monitor.on {
|
||||
display: block;
|
||||
}
|
||||
#filmout_preview_wrap {
|
||||
background: #000;
|
||||
width: 100%;
|
||||
height: 360px;
|
||||
}
|
||||
#filmout {
|
||||
height: 400px;
|
||||
min-height: 400px;
|
||||
height: 360px;
|
||||
min-height: 360px;
|
||||
width: auto;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
|
@ -754,6 +825,48 @@ button:focus {
|
|||
#filmout .on {
|
||||
opacity: 1;
|
||||
}
|
||||
#filmout_position_wrap {
|
||||
padding-top: 5px;
|
||||
height: 50px;
|
||||
}
|
||||
#filmout_position_wrap input {
|
||||
margin-right: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
#filmout_position_wrap button,
|
||||
#filmout_position_wrap input {
|
||||
float: left;
|
||||
}
|
||||
#filmout_position_wrap > div {
|
||||
width: 400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#filmout_functions {
|
||||
padding-top: 5px;
|
||||
}
|
||||
#filmout_functions > div {
|
||||
width: 400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#filmout_stats_video,
|
||||
#filmout_stats_monitor {
|
||||
width: 150px;
|
||||
position: absolute;
|
||||
padding: 10px 5px;
|
||||
text-align: center;
|
||||
}
|
||||
#filmout_stats_video h3,
|
||||
#filmout_stats_monitor h3 {
|
||||
font-size: 20px;
|
||||
margin: 16px 0 3px;
|
||||
text-align: center;
|
||||
}
|
||||
#filmout_stats_video {
|
||||
left: 5px;
|
||||
}
|
||||
#filmout_stats_monitor {
|
||||
right: 5px;
|
||||
}
|
||||
#screens {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
|
|
@ -346,24 +346,44 @@
|
|||
<div>
|
||||
<div>
|
||||
<div id="path_bar">
|
||||
<input id="filmout_file" type="text" onclick="devices.digitalSelect();" readonly />
|
||||
<button>Use Video</butto>
|
||||
<input id="filmout_file" type="text" onclick="filmout.selectFile();" readonly />
|
||||
<button onclick="$('#projector_type_digital').click();">USE VIDEO</button>
|
||||
<select id="filmout_displays"></select>
|
||||
</div>
|
||||
|
||||
<div id="filmout_preview_wrap">
|
||||
<div id="filmout_monitor">
|
||||
<img src="#" id="filmout">
|
||||
</div>
|
||||
</div>
|
||||
<div id="filmout_stats">
|
||||
<div id="filmout_stats_video">
|
||||
<h3>Video</h3>
|
||||
<div id="filmout_stats_video_name"></div>
|
||||
<div id="filmout_stats_video_size"></div>
|
||||
<div id="filmout_stats_video_frames"></div>
|
||||
</div>
|
||||
<div id="filmout_stats_monitor">
|
||||
<h3>Monitor</h3>
|
||||
<div id="filmout_stats_monitor_size"></div>
|
||||
<div id="filmout_stats_monitor_aspect"></div>
|
||||
<div id="filmout_stats_monitor_scale"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="filmout_position_wrap">
|
||||
<button id="filmout_rewind"><</button>
|
||||
<input id="filmout_position" class="count" type="text" value="00001"/>
|
||||
<button id="filmout_advance">></button>
|
||||
<div>
|
||||
<button id="filmout_rewind" title="Rewind 1 Frame"><</button>
|
||||
<input id="filmout_position" class="count" type="text" value="00000"/>
|
||||
<button id="filmout_advance" title="Advance 1 Frame">></button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="filmout_functions">
|
||||
<button id="filmout_preview">PREVIEW</button>
|
||||
<button id="filmout_meter">METER</button>
|
||||
<button id="filmout_focus">FOCUS</button>
|
||||
<button id="filmout_field">FIELD GUIDE</button>
|
||||
<div>
|
||||
<button id="filmout_preview">PREVIEW</button>
|
||||
<button id="filmout_meter">METER</button>
|
||||
<button id="filmout_focus">FOCUS</button>
|
||||
<button id="filmout_field">FIELD GUIDE</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -385,8 +405,8 @@
|
|||
<input type="radio" id="projector_type_arduino" name="projector_type" value="arduino" checked="checked" />
|
||||
</div>
|
||||
<div class="spacer">
|
||||
<input type="text" id="digital" name="digital" placeholder="Digital file" onclick="devices.digitalSelect();" data-file="" readonly />
|
||||
<input type="radio" id="projector_type" name="projector_type" value="video" onclick="devices.digital();" />
|
||||
<input type="text" id="digital" name="digital" placeholder="Digital file" onclick="filmout.selectFile();" data-file="" readonly />
|
||||
<input type="radio" id="projector_type_digital" name="projector_type" value="video" onclick="filmout.useFile();" />
|
||||
</div>
|
||||
<div>
|
||||
<h4>Camera</h4>
|
||||
|
|
|
@ -2516,7 +2516,7 @@ async function init () {
|
|||
mse.console.init();
|
||||
|
||||
devices.init();
|
||||
//filmout.init();
|
||||
filmout.init();
|
||||
light.init();
|
||||
proj.init();
|
||||
cam.init();
|
||||
|
|
|
@ -1,16 +1,58 @@
|
|||
#video{
|
||||
input[type=text],select{
|
||||
.button();
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
font-size: 21px;
|
||||
min-width: 300px;
|
||||
&.active{
|
||||
border-color: @SELECTED;
|
||||
color: @SELECTED;
|
||||
}
|
||||
}
|
||||
button, select {
|
||||
padding: 9px 16px 8px;
|
||||
}
|
||||
}
|
||||
|
||||
#path_bar{
|
||||
|
||||
padding: 5px;
|
||||
height: 50px;
|
||||
input{
|
||||
float: left;
|
||||
}
|
||||
button{
|
||||
float: left;
|
||||
margin-left: 5px;
|
||||
}
|
||||
select{
|
||||
line-height: 41px;
|
||||
height: 41px;
|
||||
margin-right: 5px;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
#filmout_file {
|
||||
|
||||
}
|
||||
#filmout_monitor{
|
||||
display: none;
|
||||
border: 2px solid white;
|
||||
box-sizing: border-box;
|
||||
height: 360px;
|
||||
margin: 0 auto;
|
||||
&.on{
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
#filmout_preview_wrap {
|
||||
background: #000;
|
||||
width: 100%;
|
||||
height: 360px;
|
||||
}
|
||||
#filmout {
|
||||
height: 400px;
|
||||
min-height: 400px;
|
||||
height: 360px;
|
||||
min-height: 360px;
|
||||
width: auto;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
|
@ -18,4 +60,49 @@
|
|||
& .on {
|
||||
opacity: 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
#filmout_position_wrap{
|
||||
padding-top: 5px;
|
||||
height: 50px;
|
||||
input{
|
||||
margin-right: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
button, input{
|
||||
float: left;
|
||||
}
|
||||
> div{
|
||||
width: 400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
#filmout_functions{
|
||||
padding-top: 5px;
|
||||
> div{
|
||||
width: 400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
#filmout_stats_video,
|
||||
#filmout_stats_monitor{
|
||||
width: 150px;
|
||||
position: absolute;
|
||||
//background: grey;
|
||||
padding: 10px 5px;
|
||||
text-align: center;
|
||||
h3{
|
||||
font-size: 20px;
|
||||
margin: 16px 0 3px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
#filmout_stats_video{
|
||||
left: 5px;
|
||||
}
|
||||
#filmout_stats_monitor{
|
||||
right: 5px;
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -58,6 +58,7 @@ async function frame(state, light) {
|
|||
}
|
||||
if (output2 && output2.stdout)
|
||||
console.log(`"${output2.stdout}"`);
|
||||
return tmpoutput;
|
||||
}
|
||||
async function frames(video, obj) {
|
||||
let tmppath = TMPDIR;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,+BAA4B;AAC5B,uCAA0D;AAC1D,+BAA4B;AAI5B,IAAI,MAAM,GAAS,EAAE,CAAC;AACtB,IAAI,MAAe,CAAC;AAEpB,SAAS,YAAY,CAAE,CAAU;IAChC,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;IAC1B,IAAI,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QACjC,GAAG,GAAG,GAAG,GAAG,GAAG,CAA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AM,CAAC,WAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;aAClC;YAAC,OAAO,GAAG,EAAE;gBACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACnB;QACF,CAAC,CAAC,CAAC;KACH;AACF,CAAC;AAED,KAAK,UAAU,QAAQ;IACtB,IAAI,UAAU,CAAC;IACf,IAAI;QACH,UAAU,GAAG,MAAM,iBAAM,CAAC,MAAM,CAAC,CAAC;KAClC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;KACjD;IAED,IAAI,CAAC,UAAU,EAAE;QAChB,IAAI;YACH,MAAM,gBAAK,CAAC,MAAM,CAAC,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,kBAAkB,MAAM,EAAE,CAAC,CAAC;SACxC;QAAC,OAAO,GAAG,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;SAC7C;KACD;IACD,IAAI;QACH,MAAM,QAAQ,EAAE,CAAC;KACjB;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACnB;AACF,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,MAAM,GAAG,GAAG,CAAC;IACb,MAAM,GAAG,WAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAE3C,QAAQ,EAAE,CAAC;IAEX,OAAO;QACN,MAAM;QACN,KAAK;QACL,KAAK;QACL,QAAQ;KACR,CAAA;AACF,CAAC,CAAA"}
|
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path_1 = require("path");
|
||||
const exec_1 = require("exec");
|
||||
//const spawn = require('spawn');
|
||||
//const exit = require('exit');
|
||||
|
@ -50,7 +51,9 @@ async function info(video) {
|
|||
return json;
|
||||
}
|
||||
async function frames(video) {
|
||||
let cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
const ext = path_1.extname(video.toLowerCase());
|
||||
let cmd = `ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
let backup_cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
let fileExists;
|
||||
let raw;
|
||||
let frames;
|
||||
|
@ -67,6 +70,9 @@ async function frames(video) {
|
|||
console.error(new Error(`File ${video} does not exist`));
|
||||
return false;
|
||||
}
|
||||
if (ext === '.mkv') {
|
||||
cmd = backup_cmd;
|
||||
}
|
||||
try {
|
||||
console.log(cmd);
|
||||
raw = await exec_1.exec(cmd);
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffprobe/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,uCAAkC;AAClC,+BAA4B;AAC5B,iCAAiC;AACjC,+BAA+B;AAE/B,IAAI,MAAM,GAAG,EAAE,CAAC;AAEhB,KAAK,UAAU,IAAI,CAAE,KAAc;IAClC,IAAI,GAAG,GAAG,mEAAmE,KAAK,GAAG,CAAA;IACrF,IAAI,UAAU,CAAC;IACf,IAAI,GAAG,CAAC;IACR,IAAI,IAAI,CAAC;IACT,IAAI,GAAG,CAAC;IAER,IAAI;QACH,UAAU,GAAG,MAAM,iBAAM,CAAC,KAAK,CAAC,CAAC;KACjC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;KACpB;IACD,IAAI,CAAC,UAAU,EAAE;QAChB,iDAAiD;QACjD,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,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C;IAC5J,IAAI,UAAU,CAAC;IACf,IAAI,GAAG,CAAC;IACR,IAAI,MAAM,CAAC;IAEX,IAAI;QACH,UAAU,GAAG,MAAM,iBAAM,CAAC,KAAK,CAAC,CAAC;KACjC;IAAC,OAAO,GAAG,EAAE;QACb,sBAAsB;QACtB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,KAAK,CAAA;KACZ;IACD,IAAI,CAAC,UAAU,EAAE;QAChB,iDAAiD;QACjD,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,iBAAiB,CAAC,CAAC,CAAC;QACzD,OAAO,KAAK,CAAC;KACb;IAED,IAAI,GAAG,KAAK,MAAM,EAAE;QACnB,GAAG,GAAG,UAAU,CAAC;KACjB;IACD,IAAI;QACH,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,GAAG,MAAM,WAAI,CAAC,GAAG,CAAC,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,KAAK,CAAC;KACb;IAED,IAAI;QACH,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;KAC7B;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,GAAG,CAAC,MAAM,CAAC;KAClB;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,GAAG,CAAE,GAAS;IACtB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,MAAM,GAAG,GAAG,CAAC;IACb,OAAO;QACN,IAAI;QACJ,MAAM;KACN,CAAA;AACF,CAAC,CAAA"}
|
|
@ -13,37 +13,53 @@ const exec_1 = require("exec");
|
|||
**/
|
||||
async function dependencies(platform) {
|
||||
let obj = {};
|
||||
let ffoutput;
|
||||
let imoutput;
|
||||
let eogoutput;
|
||||
try {
|
||||
await exec_1.exec('ffmpeg -h');
|
||||
obj.ffmpeg = 'ffmpeg';
|
||||
ffoutput = await exec_1.exec('which ffmpeg');
|
||||
}
|
||||
catch (err) {
|
||||
//return exit('ffmpeg is not installed', 3);
|
||||
return console.error('ffmpeg is not installed', err);
|
||||
console.error('ffmpeg is not installed', err);
|
||||
}
|
||||
if (!ffoutput || ffoutput.stdout.trim() === '') {
|
||||
console.error('ffmpeg is not installed');
|
||||
}
|
||||
else {
|
||||
obj.ffmpeg = ffoutput.stdout.trim();
|
||||
}
|
||||
try {
|
||||
await exec_1.exec('convert -h');
|
||||
obj.convert = 'convert';
|
||||
imoutput = await exec_1.exec('which convert');
|
||||
}
|
||||
catch (err) {
|
||||
//return exit('ffmpeg is not installed', 3);
|
||||
return console.error('ffmpeg is not installed', err);
|
||||
console.error('imagemagick is not installed', err);
|
||||
}
|
||||
if (!imoutput || imoutput.stdout.trim() === '') {
|
||||
console.error('imagemagick is not installed');
|
||||
}
|
||||
else {
|
||||
obj.convert = imoutput.stdout.trim();
|
||||
}
|
||||
//if linux
|
||||
if (platform === 'nix') {
|
||||
try {
|
||||
await exec_1.exec('eog -h');
|
||||
obj.eog = 'eog';
|
||||
eogoutput = await exec_1.exec('which eog');
|
||||
}
|
||||
catch (err) {
|
||||
//return exit('eog is not installed', 4);
|
||||
return console.error('eog is not installed', err);
|
||||
console.error('eog is not installed', err);
|
||||
}
|
||||
if (!eogoutput || eogoutput.stdout.trim() === '') {
|
||||
console.error('eog is not installed');
|
||||
}
|
||||
else {
|
||||
obj.eog = eogoutput.stdout.trim();
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
function displayMap(obj) {
|
||||
const sm = {
|
||||
id: obj.id,
|
||||
width: obj.size.width,
|
||||
height: obj.size.height,
|
||||
x: obj.bounds.x,
|
||||
|
@ -98,7 +114,9 @@ async function system(ui) {
|
|||
}
|
||||
obj.displays = await displays();
|
||||
obj.deps = await dependencies(obj.platform);
|
||||
ui.send('system', obj);
|
||||
setTimeout(() => {
|
||||
ui.send('system', obj);
|
||||
}, 3000);
|
||||
return obj;
|
||||
}
|
||||
module.exports = system;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,2BAAkC;AAClC,uCAAkC;AAClC,SAAS;AACT,+BAA4B;AAC5B;;;;;;IAMI;AAEJ,KAAK,UAAU,YAAY,CAAE,QAAiB;IAC7C,IAAI,GAAG,GAAS,EAAE,CAAC;IAEnB,IAAI;QACH,MAAM,WAAI,CAAC,WAAW,CAAC,CAAC;QACxB,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACb,4CAA4C;QAC5C,OAAO,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;KACrD;IAED,IAAI;QACH,MAAM,WAAI,CAAC,YAAY,CAAC,CAAC;QACzB,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC;KACxB;IAAC,OAAO,GAAG,EAAE;QACb,4CAA4C;QAC5C,OAAO,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;KACrD;IACD,UAAU;IACV,IAAI,QAAQ,KAAK,KAAK,EAAE;QACvB,IAAI;YACH,MAAM,WAAI,CAAC,QAAQ,CAAC,CAAC;YACrB,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC;SAChB;QAAC,OAAO,GAAG,EAAE;YACb,yCAAyC;YACzC,OAAO,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;SAClD;KACD;IAED,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,SAAS,UAAU,CAAE,GAAS;IAC7B,MAAM,EAAE,GAAS;QAChB,KAAK,EAAG,GAAG,CAAC,IAAI,CAAC,KAAK;QACtB,MAAM,EAAG,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AAM;QACN,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;IAED,GAAG,CAAC,QAAQ,GAAG,MAAM,QAAQ,EAAE,CAAA;IAC/B,GAAG,CAAC,IAAI,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE5C,UAAU,CAAC,GAAG,EAAE;QACf,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACxB,CAAC,EAAE,IAAI,CAAC,CAAC;IAET,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
|
|
@ -3,7 +3,6 @@ let devices;
|
|||
class Devices {
|
||||
constructor() {
|
||||
this.id = 'devices';
|
||||
this.init();
|
||||
}
|
||||
init() {
|
||||
this.listen();
|
||||
|
@ -14,7 +13,6 @@ class Devices {
|
|||
listen() {
|
||||
ipcRenderer.on('ready', this.ready.bind(this));
|
||||
ipcRenderer.on('intval', this.intvalCb.bind(this));
|
||||
ipcRenderer.on('digital', this.digitalCb.bind(this));
|
||||
}
|
||||
ready(event, arg) {
|
||||
//console.dir(arg)
|
||||
|
@ -156,88 +154,6 @@ class Devices {
|
|||
$('#intval').removeClass('active');
|
||||
}
|
||||
}
|
||||
digitalSelect() {
|
||||
const elem = $('#digital');
|
||||
const extensions = ['mpg', 'mpeg', 'mov', 'mkv', 'avi', 'mp4'];
|
||||
dialog.showOpenDialog({
|
||||
title: `Select video or image sequence`,
|
||||
properties: [`openFile`],
|
||||
defaultPath: 'c:/',
|
||||
filters: [
|
||||
{
|
||||
name: 'All Files',
|
||||
extensions: ['*']
|
||||
},
|
||||
]
|
||||
}, (files) => {
|
||||
let valid = false;
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
digital() {
|
||||
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');
|
||||
}
|
||||
}
|
||||
digitalCb(evt, args) {
|
||||
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');
|
||||
}
|
||||
}
|
||||
}
|
||||
devices = new Devices();
|
||||
module.exports = devices;
|
||||
|
|
|
@ -1,3 +1,185 @@
|
|||
'use strict';
|
||||
function gcd(a, b) {
|
||||
if (b === 0)
|
||||
return a;
|
||||
return gcd(b, a % b);
|
||||
}
|
||||
/**
|
||||
* Reduce a numerator and denominator to it's smallest, integer ratio using Euclid's Algorithm
|
||||
*/
|
||||
function reduceRatio(numerator, denominator) {
|
||||
// from: http://pages.pacificcoast.net/~cazelais/euclid.html
|
||||
let temp;
|
||||
let divisor;
|
||||
if (!isInteger(numerator) || !isInteger(denominator))
|
||||
return '? : ?';
|
||||
if (numerator === denominator)
|
||||
return '1 : 1';
|
||||
// make sure numerator is always the larger number
|
||||
if (+numerator < +denominator) {
|
||||
temp = numerator;
|
||||
numerator = denominator;
|
||||
denominator = temp;
|
||||
}
|
||||
divisor = gcd(+numerator, +denominator);
|
||||
return 'undefined' === typeof temp ? (numerator / divisor) + ' : ' + (denominator / divisor) : (denominator / divisor) + ' : ' + (numerator / divisor);
|
||||
}
|
||||
/**
|
||||
* Determine whether a value is an integer (ie. only numbers)
|
||||
*/
|
||||
function isInteger(value) {
|
||||
return /^[0-9]+$/.test(value);
|
||||
}
|
||||
let filmout;
|
||||
class FilmOut {
|
||||
constructor() {
|
||||
this.id = 'filmout';
|
||||
this.displays = [];
|
||||
}
|
||||
init() {
|
||||
this.listen();
|
||||
}
|
||||
listen() {
|
||||
ipcRenderer.on(this.id, this.onFilmout.bind(this));
|
||||
ipcRenderer.on('system', this.onSystem.bind(this));
|
||||
}
|
||||
onSystem(evt, args) {
|
||||
let option;
|
||||
for (let display of args.displays) {
|
||||
this.displays.push(display);
|
||||
option = $('<option>');
|
||||
option.val(display.id);
|
||||
option.text(display.name);
|
||||
if (display.primary) {
|
||||
this.setDisplay(display.id);
|
||||
}
|
||||
$('#filmout_displays').append(option);
|
||||
}
|
||||
if (args.displays.length > 1) {
|
||||
$('#filmout_displays').on('change', this.onChange.bind(this));
|
||||
}
|
||||
}
|
||||
onChange() {
|
||||
const val = $('#filmout_displays').val();
|
||||
this.setDisplay(val);
|
||||
}
|
||||
setDisplay(id) {
|
||||
const maxW = 800;
|
||||
const maxH = 360;
|
||||
const display = this.displays.find((elem) => {
|
||||
if (elem.id == id)
|
||||
return true;
|
||||
});
|
||||
let scale = display.height / maxH;
|
||||
const w = display.width / scale;
|
||||
const elem = $('#filmout_monitor');
|
||||
const aspect = reduceRatio(display.width, display.height);
|
||||
let h;
|
||||
let top;
|
||||
if (w > maxW) {
|
||||
scale = display.width / maxW;
|
||||
h = display.height / scale;
|
||||
top = Math.floor((maxH - h) / 2);
|
||||
elem.height(h);
|
||||
elem.css('margin-top', `${top}px`);
|
||||
}
|
||||
else {
|
||||
elem.width(w);
|
||||
}
|
||||
elem.addClass('on');
|
||||
$('#filmout_stats_monitor_size').text(`${display.width}x${display.height}`);
|
||||
$('#filmout_stats_monitor_aspect').text(`${aspect}`);
|
||||
console.dir(display);
|
||||
}
|
||||
selectFile() {
|
||||
const elem = $('#digital');
|
||||
const extensions = ['mpg', 'mpeg', 'mov', 'mkv', 'avi', 'mp4'];
|
||||
dialog.showOpenDialog({
|
||||
title: `Select video or image sequence`,
|
||||
properties: [`openFile`],
|
||||
defaultPath: 'c:/',
|
||||
filters: [
|
||||
{
|
||||
name: 'All Files',
|
||||
extensions: ['*']
|
||||
},
|
||||
]
|
||||
}, (files) => {
|
||||
if (!files)
|
||||
return false;
|
||||
let valid = false;
|
||||
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);
|
||||
$('#filmout_file').val(displayName);
|
||||
}
|
||||
});
|
||||
}
|
||||
useFile() {
|
||||
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('filmout', obj);
|
||||
}
|
||||
else {
|
||||
$('#projector_type_digital').prop('checked', 'checked');
|
||||
$('#digital').removeClass('active');
|
||||
}
|
||||
}
|
||||
onFilmout(evt, args) {
|
||||
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);
|
||||
console.dir(args);
|
||||
console.dir(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');
|
||||
$('#filmout_stats_video_name').text(state.fileName);
|
||||
$('#filmout_stats_video_size').text(`${state.info.width}x${state.info.height}`);
|
||||
$('#filmout_stats_video_frames').text(`${state.frames} frames`);
|
||||
gui.updateState();
|
||||
}
|
||||
else {
|
||||
$('#projector_type_digital').prop('checked', 'checked');
|
||||
$('#digital').removeClass('active');
|
||||
}
|
||||
}
|
||||
}
|
||||
filmout = new FilmOut();
|
||||
module.exports = filmout;
|
||||
|
|
|
@ -11,7 +11,7 @@ nav.init = function () {
|
|||
{ type: 'radio', id: 'controls', group: '1', caption: 'Controls', icon: 'fa fa-tasks' },
|
||||
{ type: 'radio', id: 'light', group: '1', caption: 'Light', icon: 'mcopy-light' },
|
||||
{ type: 'radio', id: 'script', group: '1', caption: 'Script', icon: 'fa fa-code' },
|
||||
{ type: 'radio', id: 'video', group: '1', caption : 'Film Out', icon: 'fa fa-video'},
|
||||
{ type: 'radio', id: 'video', group: '1', caption : 'Film Out', icon: 'fa fa-video-camera'},
|
||||
{ type: 'spacer' },
|
||||
{ type: 'radio', id: 'settings', group: '1', caption: 'Settings', icon: 'fa fa-cogs' }
|
||||
],
|
||||
|
|
|
@ -42,7 +42,7 @@ async function init () {
|
|||
mse.console.init();
|
||||
|
||||
devices.init();
|
||||
//filmout.init();
|
||||
filmout.init();
|
||||
light.init();
|
||||
proj.init();
|
||||
cam.init();
|
||||
|
|
|
@ -20,7 +20,7 @@ let devices : Devices;
|
|||
class Devices {
|
||||
private id : string = 'devices';
|
||||
constructor () {
|
||||
this.init();
|
||||
|
||||
}
|
||||
init () {
|
||||
this.listen();
|
||||
|
@ -31,7 +31,6 @@ class Devices {
|
|||
listen () {
|
||||
ipcRenderer.on('ready', this.ready.bind(this));
|
||||
ipcRenderer.on('intval', this.intvalCb.bind(this));
|
||||
ipcRenderer.on('digital', this.digitalCb.bind(this));
|
||||
}
|
||||
|
||||
ready (event : any, arg : any) {
|
||||
|
@ -180,92 +179,6 @@ class Devices {
|
|||
$('#intval').removeClass('active');
|
||||
}
|
||||
}
|
||||
digitalSelect () {
|
||||
const elem : any = $('#digital');
|
||||
const extensions : string[] = ['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 : string[]) => {
|
||||
let valid : boolean = false;
|
||||
let path : string = files[0];
|
||||
let displayName : string;
|
||||
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);
|
||||
}
|
||||
})
|
||||
}
|
||||
digital () {
|
||||
const elem : any = $('#digital');
|
||||
const path : string = elem.attr('data-file');
|
||||
const fileName : string = elem.val();
|
||||
let proceed : boolean = false;
|
||||
let obj : any = {
|
||||
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');
|
||||
}
|
||||
}
|
||||
digitalCb (evt : any, args : any) {
|
||||
let state : any;
|
||||
let color : number[] = [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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
devices = new Devices();
|
||||
|
|
|
@ -10,8 +10,201 @@ declare var log : any;
|
|||
declare var w2popup : any;
|
||||
declare var cam : any;
|
||||
declare var proj : any;
|
||||
declare var grid : any;
|
||||
declare var dialog : any;
|
||||
declare var ipcRenderer : any;
|
||||
|
||||
function gcd (a : number, b : number) {
|
||||
if (b === 0) return a;
|
||||
return gcd(b, a % b);
|
||||
}
|
||||
|
||||
let filmout : any;
|
||||
/**
|
||||
* Reduce a numerator and denominator to it's smallest, integer ratio using Euclid's Algorithm
|
||||
*/
|
||||
function reduceRatio (numerator : number, denominator : number) {
|
||||
// from: http://pages.pacificcoast.net/~cazelais/euclid.html
|
||||
let temp : any;
|
||||
let divisor : any;
|
||||
if (!isInteger(numerator) || !isInteger(denominator)) return '? : ?';
|
||||
if (numerator === denominator) return '1 : 1';
|
||||
// make sure numerator is always the larger number
|
||||
if (+numerator < +denominator) {
|
||||
temp = numerator;
|
||||
numerator = denominator;
|
||||
denominator = temp;
|
||||
}
|
||||
divisor = gcd(+numerator, +denominator);
|
||||
return 'undefined' === typeof temp ? (numerator / divisor) + ' : ' + (denominator / divisor) : (denominator / divisor) + ' : ' + (numerator / divisor);
|
||||
}
|
||||
|
||||
module.exports = filmout
|
||||
/**
|
||||
* Determine whether a value is an integer (ie. only numbers)
|
||||
*/
|
||||
function isInteger(value : any) {
|
||||
return /^[0-9]+$/.test(value);
|
||||
}
|
||||
|
||||
let filmout : FilmOut;
|
||||
|
||||
class FilmOut {
|
||||
private id : string = 'filmout';
|
||||
private displays : any[] = [];
|
||||
constructor () {
|
||||
|
||||
}
|
||||
init () {
|
||||
this.listen();
|
||||
}
|
||||
listen () {
|
||||
ipcRenderer.on(this.id, this.onFilmout.bind(this));
|
||||
ipcRenderer.on('system', this.onSystem.bind(this));
|
||||
}
|
||||
onSystem (evt : Event, args : any) {
|
||||
let option : any;
|
||||
for (let display of args.displays) {
|
||||
this.displays.push(display);
|
||||
option = $('<option>');
|
||||
option.val(display.id);
|
||||
option.text(display.name);
|
||||
if (display.primary) {
|
||||
this.setDisplay(display.id);
|
||||
}
|
||||
$('#filmout_displays').append(option);
|
||||
}
|
||||
|
||||
if (args.displays.length > 1) {
|
||||
$('#filmout_displays').on('change', this.onChange.bind(this));
|
||||
}
|
||||
}
|
||||
|
||||
onChange () {
|
||||
const val : any = $('#filmout_displays').val();
|
||||
this.setDisplay(val);
|
||||
}
|
||||
|
||||
setDisplay (id : any) {
|
||||
const maxW : number = 800;
|
||||
const maxH : number = 360;
|
||||
const display : any = this.displays.find((elem : any) => {
|
||||
if (elem.id == id) return true;
|
||||
});
|
||||
let scale : number = display.height / maxH;
|
||||
const w : number = display.width / scale;
|
||||
const elem : any = $('#filmout_monitor');
|
||||
const aspect : any = reduceRatio(display.width, display.height);
|
||||
let h : number;
|
||||
let top : number;
|
||||
|
||||
if (w > maxW) {
|
||||
scale = display.width / maxW;
|
||||
h = display.height / scale;
|
||||
top = Math.floor((maxH - h) / 2);
|
||||
elem.height(h);
|
||||
elem.css('margin-top', `${top}px`);
|
||||
} else {
|
||||
elem.width(w);
|
||||
}
|
||||
|
||||
elem.addClass('on');
|
||||
$('#filmout_stats_monitor_size').text(`${display.width}x${display.height}`);
|
||||
$('#filmout_stats_monitor_aspect').text(`${aspect}`);
|
||||
console.dir(display);
|
||||
}
|
||||
selectFile () {
|
||||
const elem : any = $('#digital');
|
||||
const extensions : string[] = ['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 : string[]) => {
|
||||
if (!files) return false;
|
||||
let valid : boolean = false;
|
||||
let path : string = files[0];
|
||||
let displayName : string;
|
||||
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);
|
||||
$('#filmout_file').val(displayName);
|
||||
}
|
||||
})
|
||||
}
|
||||
useFile () {
|
||||
const elem : any = $('#digital');
|
||||
const path : string = elem.attr('data-file');
|
||||
const fileName : string = elem.val();
|
||||
let proceed : boolean = false;
|
||||
let obj : any = {
|
||||
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('filmout', obj)
|
||||
} else {
|
||||
$('#projector_type_digital').prop('checked', 'checked');
|
||||
$('#digital').removeClass('active');
|
||||
}
|
||||
}
|
||||
onFilmout (evt : any, args : any) {
|
||||
let state : any;
|
||||
let color : number[] = [255, 255, 255];
|
||||
gui.spinner(false);
|
||||
gui.overlay(false);
|
||||
if (args.valid && args.valid === true) {
|
||||
//success state
|
||||
state = JSON.parse(args.state);
|
||||
console.dir(args)
|
||||
console.dir(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');
|
||||
$('#filmout_stats_video_name').text(state.fileName);
|
||||
$('#filmout_stats_video_size').text(`${state.info.width}x${state.info.height}`);
|
||||
$('#filmout_stats_video_frames').text(`${state.frames} frames`);
|
||||
|
||||
gui.updateState();
|
||||
} else {
|
||||
$('#projector_type_digital').prop('checked', 'checked');
|
||||
$('#digital').removeClass('active');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
filmout = new FilmOut();
|
||||
|
||||
module.exports = filmout;
|
File diff suppressed because one or more lines are too long
|
@ -58,6 +58,7 @@ async function frame(state, light) {
|
|||
}
|
||||
if (output2 && output2.stdout)
|
||||
console.log(`"${output2.stdout}"`);
|
||||
return tmpoutput;
|
||||
}
|
||||
async function frames(video, obj) {
|
||||
let tmppath = TMPDIR;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,+BAA4B;AAC5B,uCAA0D;AAC1D,+BAA4B;AAI5B,IAAI,MAAM,GAAS,EAAE,CAAC;AACtB,IAAI,MAAe,CAAC;AAEpB,SAAS,YAAY,CAAE,CAAU;IAChC,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;IAC1B,IAAI,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QACjC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;KAChB;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,KAAK,UAAU,KAAK,CAAE,KAAW,EAAE,KAAW;IAC7C,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;IACvB,IAAI,KAAK,GAAG,KAAK,CAAC,IAAI,CAAA;IACtB,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAA;IACxB,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAA;IACzB,IAAI,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAChC,IAAI,GAAG,GAAG,KAAK,CAAA;IACf,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC;IACtB,IAAI,SAAS,CAAC;IACd,IAAI,GAAG,CAAC;IAC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AG,CAAC,kBAAkB,MAAM,EAAE,CAAC,CAAC;SACxC;QAAC,OAAO,GAAG,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;SAC7C;KACD;IACD,IAAI;QACH,MAAM,QAAQ,EAAE,CAAC;KACjB;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACnB;AACF,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,MAAM,GAAG,GAAG,CAAC;IACb,MAAM,GAAG,WAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAE3C,QAAQ,EAAE,CAAC;IAEX,OAAO;QACN,MAAM;QACN,KAAK;QACL,KAAK;QACL,QAAQ;KACR,CAAA;AACF,CAAC,CAAA"}
|
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path_1 = require("path");
|
||||
const exec_1 = require("exec");
|
||||
//const spawn = require('spawn');
|
||||
//const exit = require('exit');
|
||||
|
@ -50,7 +51,9 @@ async function info(video) {
|
|||
return json;
|
||||
}
|
||||
async function frames(video) {
|
||||
let cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
const ext = path_1.extname(video.toLowerCase());
|
||||
let cmd = `ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
let backup_cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
let fileExists;
|
||||
let raw;
|
||||
let frames;
|
||||
|
@ -67,6 +70,9 @@ async function frames(video) {
|
|||
console.error(new Error(`File ${video} does not exist`));
|
||||
return false;
|
||||
}
|
||||
if (ext === '.mkv') {
|
||||
cmd = backup_cmd;
|
||||
}
|
||||
try {
|
||||
console.log(cmd);
|
||||
raw = await exec_1.exec(cmd);
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffprobe/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,uCAAkC;AAClC,+BAA4B;AAC5B,iCAAiC;AACjC,+BAA+B;AAE/B,IAAI,MAAM,GAAG,EAAE,CAAC;AAEhB,KAAK,UAAU,IAAI,CAAE,KAAc;IAClC,IAAI,GAAG,GAAG,mEAAmE,KAAK,GAAG,CAAA;IACrF,IAAI,UAAU,CAAC;IACf,IAAI,GAAG,CAAC;IACR,IAAI,IAAI,CAAC;IACT,IAAI,GAAG,CAAC;IAER,IAAI;QACH,UAAU,GAAG,MAAM,iBAAM,CAAC,KAAK,CAAC,CAAC;KACjC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;KACpB;IACD,IAAI,CAAC,UAAU,EAAE;QAChB,iDAAiD;QACjD,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,iBAAiB,CAAC,CAAC,CAAC;QACzD,OAAO,KAAK,CAAA;KACZ;IAED,IAAI;QACH,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,GAAG,MAAM,WAAI,CAAC,GAAG,CAAC,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACb,sBAAsB;QACtB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,KAAK,CAAA;KACZ;IAED,IAAI;QACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;KAC9B;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,GAAG,CAAC,MAAM,CAAC;KAClB;IAED,IAAI,IAAI,IAAI,IAAI,CA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D,IAAI;QACH,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,GAAG,GAAG,MAAM,WAAI,CAAC,GAAG,CAAC,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,KAAK,CAAC;KACb;IAED,IAAI;QACH,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;KAC7B;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,GAAG,CAAC,MAAM,CAAC;KAClB;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,GAAG,CAAE,GAAS;IACtB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,MAAM,GAAG,GAAG,CAAC;IACb,OAAO;QACN,IAAI;QACJ,MAAM;KACN,CAAA;AACF,CAAC,CAAA"}
|
|
@ -13,37 +13,53 @@ const exec_1 = require("exec");
|
|||
**/
|
||||
async function dependencies(platform) {
|
||||
let obj = {};
|
||||
let ffoutput;
|
||||
let imoutput;
|
||||
let eogoutput;
|
||||
try {
|
||||
await exec_1.exec('ffmpeg -h');
|
||||
obj.ffmpeg = 'ffmpeg';
|
||||
ffoutput = await exec_1.exec('which ffmpeg');
|
||||
}
|
||||
catch (err) {
|
||||
//return exit('ffmpeg is not installed', 3);
|
||||
return console.error('ffmpeg is not installed', err);
|
||||
console.error('ffmpeg is not installed', err);
|
||||
}
|
||||
if (!ffoutput || ffoutput.stdout.trim() === '') {
|
||||
console.error('ffmpeg is not installed');
|
||||
}
|
||||
else {
|
||||
obj.ffmpeg = ffoutput.stdout.trim();
|
||||
}
|
||||
try {
|
||||
await exec_1.exec('convert -h');
|
||||
obj.convert = 'convert';
|
||||
imoutput = await exec_1.exec('which convert');
|
||||
}
|
||||
catch (err) {
|
||||
//return exit('ffmpeg is not installed', 3);
|
||||
return console.error('ffmpeg is not installed', err);
|
||||
console.error('imagemagick is not installed', err);
|
||||
}
|
||||
if (!imoutput || imoutput.stdout.trim() === '') {
|
||||
console.error('imagemagick is not installed');
|
||||
}
|
||||
else {
|
||||
obj.convert = imoutput.stdout.trim();
|
||||
}
|
||||
//if linux
|
||||
if (platform === 'nix') {
|
||||
try {
|
||||
await exec_1.exec('eog -h');
|
||||
obj.eog = 'eog';
|
||||
eogoutput = await exec_1.exec('which eog');
|
||||
}
|
||||
catch (err) {
|
||||
//return exit('eog is not installed', 4);
|
||||
return console.error('eog is not installed', err);
|
||||
console.error('eog is not installed', err);
|
||||
}
|
||||
if (!eogoutput || eogoutput.stdout.trim() === '') {
|
||||
console.error('eog is not installed');
|
||||
}
|
||||
else {
|
||||
obj.eog = eogoutput.stdout.trim();
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
function displayMap(obj) {
|
||||
const sm = {
|
||||
id: obj.id,
|
||||
width: obj.size.width,
|
||||
height: obj.size.height,
|
||||
x: obj.bounds.x,
|
||||
|
@ -98,7 +114,9 @@ async function system(ui) {
|
|||
}
|
||||
obj.displays = await displays();
|
||||
obj.deps = await dependencies(obj.platform);
|
||||
ui.send('system', obj);
|
||||
setTimeout(() => {
|
||||
ui.send('system', obj);
|
||||
}, 3000);
|
||||
return obj;
|
||||
}
|
||||
module.exports = system;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,2BAAkC;AAClC,uCAAkC;AAClC,SAAS;AACT,+BAA4B;AAC5B;;;;;;IAMI;AAEJ,KAAK,UAAU,YAAY,CAAE,QAAiB;IAC7C,IAAI,GAAG,GAAS,EAAE,CAAC;IAEnB,IAAI;QACH,MAAM,WAAI,CAAC,WAAW,CAAC,CAAC;QACxB,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC;KACtB;IAAC,OAA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;KACR;IACD,OAAO,CAAC,CAAA;AACT,CAAC;AAED,KAAK,UAAU,QAAQ;IACtB,IAAI,QAAQ,GAAW,iBAAM,CAAC,cAAc,EAAE,CAAC;IAC/C,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACpC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3B,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,KAAK,UAAU,MAAM,CAAE,EAAQ;IAC9B,MAAM,GAAG,GAAS,EAAE,CAAC;IACrB,IAAI,QAAiB,CAAC;IAEtB,IAAI;QACH,GAAG,CAAC,GAAG,GAAG,WAAM,EAAE,CAAC;KACnB;IAAC,OAAO,GAAG,EAAE;QACb,GAAG,CAAC,GAAG,GAAG,MAAM,CAAA;KAChB;IAED,QAAQ,GAAG,SAAI,EAAE,CAAC;IAElB,IAAI,QAAQ,KAAK,QAAQ,EAAE;QAC1B,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;SAAM,IAAI,QAAQ,KAAK,YAAY,EAAE;QACrC,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;SAAM;QACN,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;IAED,GAAG,CAAC,QAAQ,GAAG,MAAM,QAAQ,EAAE,CAAA;IAC/B,GAAG,CAAC,IAAI,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE5C,UAAU,CAAC,GAAG,EAAE;QACf,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACxB,CAAC,EAAE,IAAI,CAAC,CAAC;IAET,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
|
File diff suppressed because one or more lines are too long
|
@ -58,6 +58,7 @@ async function frame(state, light) {
|
|||
}
|
||||
if (output2 && output2.stdout)
|
||||
console.log(`"${output2.stdout}"`);
|
||||
return tmpoutput;
|
||||
}
|
||||
async function frames(video, obj) {
|
||||
let tmppath = TMPDIR;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,+BAA4B;AAC5B,uCAA0D;AAC1D,+BAA4B;AAI5B,IAAI,MAAM,GAAS,EAAE,CAAC;AACtB,IAAI,MAAe,CAAC;AAEpB,SAAS,YAAY,CAAE,CAAU;IAChC,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;IAC1B,IAAI,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QACjC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;KAChB;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,KAAK,UAAU,KAAK,CAAE,KAAW,EAAE,KAAW;IAC7C,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;IACvB,IAAI,KAAK,GAAG,KAAK,CAAC,IAAI,CAAA;IACtB,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAA;IACxB,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAA;IACzB,IAAI,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAChC,IAAI,GAAG,GAAG,KAAK,CAAA;IACf,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC;IACtB,IAAI,SAAS,CAAC;IACd,IAAI,GAAG,CAAC;IACR,IAAI,MAAM,CAAC;IACX,IAAI,IAAI,CAAC;IACT,IAAI,OAAO,CAAC;IAEZ,kCAAkC;IACjC,GAAG,GAAG,KAAK,CAAC;IACb,GAAG;IAEH,GAAG,GAAG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;KACD;IACD,IAAI;QACH,MAAM,QAAQ,EAAE,CAAC;KACjB;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACnB;AACF,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,MAAM,GAAG,GAAG,CAAC;IACb,MAAM,GAAG,WAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAE3C,QAAQ,EAAE,CAAC;IAEX,OAAO;QACN,MAAM;QACN,KAAK;QACL,KAAK;QACL,QAAQ;KACR,CAAA;AACF,CAAC,CAAA"}
|
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path_1 = require("path");
|
||||
const exec_1 = require("exec");
|
||||
//const spawn = require('spawn');
|
||||
//const exit = require('exit');
|
||||
|
@ -50,7 +51,9 @@ async function info(video) {
|
|||
return json;
|
||||
}
|
||||
async function frames(video) {
|
||||
let cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
const ext = path_1.extname(video.toLowerCase());
|
||||
let cmd = `ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
let backup_cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
let fileExists;
|
||||
let raw;
|
||||
let frames;
|
||||
|
@ -67,6 +70,9 @@ async function frames(video) {
|
|||
console.error(new Error(`File ${video} does not exist`));
|
||||
return false;
|
||||
}
|
||||
if (ext === '.mkv') {
|
||||
cmd = backup_cmd;
|
||||
}
|
||||
try {
|
||||
console.log(cmd);
|
||||
raw = await exec_1.exec(cmd);
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"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QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,KAAK,CAAC;KACb;IAED,IAAI;QACH,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;KAC7B;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,GAAG,CAAC,MAAM,CAAC;KAClB;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,GAAG,CAAE,GAAS;IACtB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,MAAM,GAAG,GAAG,CAAC;IACb,OAAO;QACN,IAAI;QACJ,MAAM;KACN,CAAA;AACF,CAAC,CAAA"}
|
|
@ -13,37 +13,53 @@ const exec_1 = require("exec");
|
|||
**/
|
||||
async function dependencies(platform) {
|
||||
let obj = {};
|
||||
let ffoutput;
|
||||
let imoutput;
|
||||
let eogoutput;
|
||||
try {
|
||||
await exec_1.exec('ffmpeg -h');
|
||||
obj.ffmpeg = 'ffmpeg';
|
||||
ffoutput = await exec_1.exec('which ffmpeg');
|
||||
}
|
||||
catch (err) {
|
||||
//return exit('ffmpeg is not installed', 3);
|
||||
return console.error('ffmpeg is not installed', err);
|
||||
console.error('ffmpeg is not installed', err);
|
||||
}
|
||||
if (!ffoutput || ffoutput.stdout.trim() === '') {
|
||||
console.error('ffmpeg is not installed');
|
||||
}
|
||||
else {
|
||||
obj.ffmpeg = ffoutput.stdout.trim();
|
||||
}
|
||||
try {
|
||||
await exec_1.exec('convert -h');
|
||||
obj.convert = 'convert';
|
||||
imoutput = await exec_1.exec('which convert');
|
||||
}
|
||||
catch (err) {
|
||||
//return exit('ffmpeg is not installed', 3);
|
||||
return console.error('ffmpeg is not installed', err);
|
||||
console.error('imagemagick is not installed', err);
|
||||
}
|
||||
if (!imoutput || imoutput.stdout.trim() === '') {
|
||||
console.error('imagemagick is not installed');
|
||||
}
|
||||
else {
|
||||
obj.convert = imoutput.stdout.trim();
|
||||
}
|
||||
//if linux
|
||||
if (platform === 'nix') {
|
||||
try {
|
||||
await exec_1.exec('eog -h');
|
||||
obj.eog = 'eog';
|
||||
eogoutput = await exec_1.exec('which eog');
|
||||
}
|
||||
catch (err) {
|
||||
//return exit('eog is not installed', 4);
|
||||
return console.error('eog is not installed', err);
|
||||
console.error('eog is not installed', err);
|
||||
}
|
||||
if (!eogoutput || eogoutput.stdout.trim() === '') {
|
||||
console.error('eog is not installed');
|
||||
}
|
||||
else {
|
||||
obj.eog = eogoutput.stdout.trim();
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
function displayMap(obj) {
|
||||
const sm = {
|
||||
id: obj.id,
|
||||
width: obj.size.width,
|
||||
height: obj.size.height,
|
||||
x: obj.bounds.x,
|
||||
|
@ -98,7 +114,9 @@ async function system(ui) {
|
|||
}
|
||||
obj.displays = await displays();
|
||||
obj.deps = await dependencies(obj.platform);
|
||||
ui.send('system', obj);
|
||||
setTimeout(() => {
|
||||
ui.send('system', obj);
|
||||
}, 3000);
|
||||
return obj;
|
||||
}
|
||||
module.exports = system;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,2BAAkC;AAClC,uCAAkC;AAClC,SAAS;AACT,+BAA4B;AAC5B;;;;;;IAMI;AAEJ,KAAK,UAAU,YAAY,CAAE,QAAiB;IAC7C,IAAI,GAAG,GAAS,EAAE,CAAC;IAEnB,IAAI;QACH,MAAM,WAAI,CAAC,WAAW,CAAC,CAAC;QACxB,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACb,4CAA4C;QAC5C,OAAO,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;KACrD;IAED,IAAI;QACH,MAAM,WAAI,CAAC,YA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,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACpC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3B,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,KAAK,UAAU,MAAM,CAAE,EAAQ;IAC9B,MAAM,GAAG,GAAS,EAAE,CAAC;IACrB,IAAI,QAAiB,CAAC;IAEtB,IAAI;QACH,GAAG,CAAC,GAAG,GAAG,WAAM,EAAE,CAAC;KACnB;IAAC,OAAO,GAAG,EAAE;QACb,GAAG,CAAC,GAAG,GAAG,MAAM,CAAA;KAChB;IAED,QAAQ,GAAG,SAAI,EAAE,CAAC;IAElB,IAAI,QAAQ,KAAK,QAAQ,EAAE;QAC1B,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;SAAM,IAAI,QAAQ,KAAK,YAAY,EAAE;QACrC,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;SAAM;QACN,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;IAED,GAAG,CAAC,QAAQ,GAAG,MAAM,QAAQ,EAAE,CAAA;IAC/B,GAAG,CAAC,IAAI,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE5C,UAAU,CAAC,GAAG,EAAE;QACf,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACxB,CAAC,EAAE,IAAI,CAAC,CAAC;IAET,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
|
|
@ -40,7 +40,7 @@ class Devices {
|
|||
private async init () {
|
||||
this.log = await Log({ label : 'devices' })
|
||||
this.ipc = require('electron').ipcMain;
|
||||
this.listen()
|
||||
this.listen();
|
||||
}
|
||||
/**
|
||||
* Listen to the "profile" channel for messages from the UI.
|
||||
|
|
|
@ -68,6 +68,7 @@ async function frame (state : any, light : any) {
|
|||
}
|
||||
|
||||
if (output2 && output2.stdout) console.log(`"${output2.stdout}"`);
|
||||
return tmpoutput
|
||||
}
|
||||
|
||||
async function frames (video : string, obj : any) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
import { exists } from 'fs-extra';
|
||||
import { extname } from 'path';
|
||||
import { exec } from 'exec';
|
||||
//const spawn = require('spawn');
|
||||
//const exit = require('exit');
|
||||
|
@ -55,7 +56,9 @@ async function info (video : string) {
|
|||
}
|
||||
|
||||
async function frames (video : string) {
|
||||
let cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
const ext : string = extname(video.toLowerCase());
|
||||
let cmd = `ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
let backup_cmd = `ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 "${video}"`;
|
||||
let fileExists;
|
||||
let raw;
|
||||
let frames;
|
||||
|
@ -73,6 +76,9 @@ async function frames (video : string) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (ext === '.mkv') {
|
||||
cmd = backup_cmd;
|
||||
}
|
||||
try {
|
||||
console.log(cmd);
|
||||
raw = await exec(cmd);
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
interface ExecOutput {
|
||||
stdout : string;
|
||||
stderr : string;
|
||||
}
|
||||
|
||||
import { tmpdir, type } from 'os';
|
||||
import { screen } from 'electron';
|
||||
//private
|
||||
|
@ -12,32 +17,48 @@ import { exec } from 'exec';
|
|||
* @param {string} platform Operating system type
|
||||
**/
|
||||
|
||||
|
||||
async function dependencies (platform : string ) {
|
||||
let obj : any = {};
|
||||
let ffoutput : ExecOutput;
|
||||
let imoutput : ExecOutput;
|
||||
let eogoutput : ExecOutput;
|
||||
|
||||
try {
|
||||
await exec('ffmpeg -h');
|
||||
obj.ffmpeg = 'ffmpeg';
|
||||
ffoutput = await exec('which ffmpeg');
|
||||
} catch (err) {
|
||||
//return exit('ffmpeg is not installed', 3);
|
||||
return console.error('ffmpeg is not installed', err);
|
||||
console.error('ffmpeg is not installed', err);
|
||||
}
|
||||
|
||||
if (!ffoutput || ffoutput.stdout.trim() === '') {
|
||||
console.error('ffmpeg is not installed');
|
||||
} else {
|
||||
obj.ffmpeg = ffoutput.stdout.trim();
|
||||
}
|
||||
|
||||
try {
|
||||
await exec('convert -h');
|
||||
obj.convert = 'convert';
|
||||
imoutput = await exec('which convert');
|
||||
} catch (err) {
|
||||
//return exit('ffmpeg is not installed', 3);
|
||||
return console.error('ffmpeg is not installed', err);
|
||||
console.error('imagemagick is not installed', err);
|
||||
}
|
||||
|
||||
if (!imoutput || imoutput.stdout.trim() === '') {
|
||||
console.error('imagemagick is not installed');
|
||||
} else {
|
||||
obj.convert = imoutput.stdout.trim();
|
||||
}
|
||||
|
||||
//if linux
|
||||
if (platform === 'nix') {
|
||||
try {
|
||||
await exec('eog -h');
|
||||
obj.eog = 'eog';
|
||||
eogoutput = await exec('which eog');
|
||||
} catch (err) {
|
||||
//return exit('eog is not installed', 4);
|
||||
return console.error('eog is not installed', err);
|
||||
console.error('eog is not installed', err);
|
||||
}
|
||||
if (!eogoutput || eogoutput.stdout.trim() === '') {
|
||||
console.error('eog is not installed');
|
||||
} else {
|
||||
obj.eog = eogoutput.stdout.trim();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,6 +67,7 @@ async function dependencies (platform : string ) {
|
|||
|
||||
function displayMap (obj : any) {
|
||||
const sm : any = {
|
||||
id : obj.id,
|
||||
width : obj.size.width,
|
||||
height : obj.size.height,
|
||||
x : obj.bounds.x,
|
||||
|
@ -57,6 +79,7 @@ function displayMap (obj : any) {
|
|||
sm.name = `${sm.width}x${sm.height}${primary}`;
|
||||
return sm;
|
||||
}
|
||||
|
||||
function displaySort (a : any, b : any){
|
||||
if (a.primary) {
|
||||
return -1
|
||||
|
@ -103,7 +126,9 @@ async function system (ui : any) {
|
|||
obj.displays = await displays()
|
||||
obj.deps = await dependencies(obj.platform);
|
||||
|
||||
ui.send('system', obj);
|
||||
setTimeout(() => {
|
||||
ui.send('system', obj);
|
||||
}, 3000);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue