From 7a67a0e436d986e871595311e039e3d2ee4e499d Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Wed, 21 Jun 2017 23:19:08 +0200 Subject: [PATCH] Addingm manual Event fireing, Universe as event property, and event when loading track --- lib/index.js | 51 ++++++++++++++++++++++++++++++++++++---- lib/index.js.map | 2 +- src/index.ts | 61 ++++++++++++++++++++++++++++++++++++++++++++---- tsconfig.json | 3 --- web/index.html | 52 ++++++++++++++++++++++++++++++++++++++--- 5 files changed, 153 insertions(+), 16 deletions(-) diff --git a/lib/index.js b/lib/index.js index 25efe85..cfd4430 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,5 +1,6 @@ -//DATABASE "use strict"; +//DATABASE +Object.defineProperty(exports, "__esModule", { value: true }); const low = require("lowdb"); var db = low("db.json"); const sid = require("short-id"); @@ -9,7 +10,8 @@ db.defaults({}).write(); const httpp = require("http"); var http = httpp.createServer(); const io = require("socket.io"); -var ioClient = require("socket.io-client")("http://192.168.1.142:5000", { reconect: true }); +//var ioClient = require("socket.io-client")("http://192.168.1.142:5000", {reconnect:true}); +var ioClient = require("socket.io-client")("http://localhost:5000", { reconnect: true }); ioClient.on("connect", () => { console.log("connected"); }); @@ -105,13 +107,14 @@ class Timecode { else { this.startTime = new Date().getTime() - vlc.time; this.filePlaying = vlc.file; + //console.log("vlc_update", vlc); } var d = vlc.time; this.toTrigger.forEach(e => { if (e.time.milliseconds <= d) { console.log("v", e); ios.emit("artnet", e.art); - artnet.set(universe, Number(e.art.subnet), Number(e.art.value)); + artnet.set(e.art.universe, Number(e.art.subnet), Number(e.art.value)); var i = this.toTrigger.indexOf(e); this.toTrigger.splice(i, 1); } @@ -121,10 +124,10 @@ class Timecode { data.track = this.activeTrack.id; data.filePlaying = this.filePlaying; data.playing = this.playing; + data.paused = vlc.paused; ios.emit("update", data); } update() { - var d = new Date().getTime() - this.startTime; this.toTrigger.forEach(e => { if (e.time.milliseconds <= d) { console.log("u", e); @@ -135,10 +138,18 @@ class Timecode { } }); var data = {}; + var d; + if (this.passedTime) { + d = this.passedTime; + } + else { + d = new Date().getTime() - this.startTime; + } data.time = new FrameTime(d); data.track = this.activeTrack.id; data.filePlaying = this.filePlaying; data.playing = this.playing; + data.paused = this.passedTime !== undefined ? true : false; ios.emit("update", data); } loadTrack(trackid) { @@ -156,8 +167,22 @@ class Timecode { this.toTrigger = tr; this.filePlaying = track.file; this.startTime = 0; + if (this.activeTrack.load) { + artnet(this.activeTrack.load.universe, this.activeTrack.load.subnet, this.activeTrack.load.value); + } + } + pause() { + this.passedTime = new Date().getTime() - this.startTime; } play() { + if (this.passedTime) { + this.startTime = new Date().getTime() - this.passedTime; + if (this.filePlaying) { + } + else { + } + this.passedTime = undefined; + } if (!this.activeTrack) return; if (this.filePlaying) { @@ -222,6 +247,14 @@ ios.on("connection", socket => { } timecode.play(); }); + socket.on("pause", () => { + if (timecode.filePlaying) { + ioClient.emit("pause"); + } + else { + timecode.pause(); + } + }); socket.on("stop", () => { timecode.stop(); if (timecode.activeTrack) @@ -262,6 +295,16 @@ ios.on("connection", socket => { db.get(data.track + ".triggers").remove({ id: data.id }).write(); senddata(); }); + socket.on("fire", (data) => { + artnet.set(data.universe, data.subnet, data.value); + }); + socket.on("load_event", (data) => { + console.log(data); + db.get(data.id).assign({ + load: data.art + }).write(); + senddata(); + }); }); http.listen(5001); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map index 0e529d6..c0e945e 100644 --- a/lib/index.js.map +++ b/lib/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;;AAEV,6BAA8B;AAC9B,IAAI,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;AACxB,gCAAiC;AACjC,GAAG,CAAC,SAAS,CAAC,EAAC,MAAM,EAAC,EAAE,EAAC,CAAC,CAAC;AAC3B,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,K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AC,GAAG,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC;QAClD,CAAC;QACD,QAAQ,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QACd,QAAQ,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI;QACtB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,CAAC,MAAM,CAAC,EAAC,EAAE,EAAC,IAAI,CAAC,EAAE,EAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAC9D,QAAQ,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI;QACtB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,IAAI;QAC1B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,IAAI,EAAC,IAAI,CAAC,GAAG;SACf,CAAC,CAAC,KAAK,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 6a6620c..650208f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,7 +10,8 @@ db.defaults({}).write(); import * as httpp from "http"; var http = httpp.createServer(); import io = require("socket.io"); -var ioClient = require("socket.io-client")("http://192.168.1.142:5000", {reconect:true}); +//var ioClient = require("socket.io-client")("http://192.168.1.142:5000", {reconnect:true}); +var ioClient = require("socket.io-client")("http://localhost:5000", {reconnect:true}); ioClient.on("connect", ()=>{ console.log("connected"); }); @@ -18,7 +19,7 @@ var ios = io(http); const artnetp = require("artnet"); const universe = 21; var artnet = artnetp({host:"192.168.1.255"}); -function reset(){ +function reset(){ //ToDO nachfragen bei Marvin / Alex for(var i = 1; i <= 512; i++){ artnet.set(universe, i, 0); } @@ -116,6 +117,7 @@ class Timecode { filePlaying:string; startTime:number; toTrigger:Array; + passedTime:number; vlcUpdate(vlc:VlcUpdate) { if(!vlc.is_playing){ @@ -131,7 +133,7 @@ class Timecode { if(e.time.milliseconds <= d) { console.log("v",e); ios.emit("artnet", e.art); - artnet.set(universe, Number(e.art.subnet), Number(e.art.value)); + artnet.set(e.art.universe, Number(e.art.subnet), Number(e.art.value)); var i = this.toTrigger.indexOf(e); this.toTrigger.splice(i, 1); } @@ -141,11 +143,11 @@ class Timecode { data.track = this.activeTrack.id; data.filePlaying = this.filePlaying; data.playing = this.playing; + data.paused = vlc.paused; ios.emit("update", data); } update() { - var d = new Date().getTime() - this.startTime; this.toTrigger.forEach(e=>{ if(e.time.milliseconds <= d) { console.log("u", e); @@ -156,10 +158,17 @@ class Timecode { } }); var data:any = {}; + var d:number; + if(this.passedTime){ + d = this.passedTime; + } else { + d = new Date().getTime() - this.startTime; + } data.time = new FrameTime(d); data.track = this.activeTrack.id; data.filePlaying = this.filePlaying; data.playing = this.playing; + data.paused = this.passedTime !== undefined ? true : false; ios.emit("update", data); } @@ -178,9 +187,25 @@ class Timecode { this.toTrigger = tr; this.filePlaying = track.file; this.startTime = 0; + if(this.activeTrack.load){ + artnet(this.activeTrack.load.universe, this.activeTrack.load.subnet, this.activeTrack.load.value) + } + } + + pause() { + this.passedTime = new Date().getTime() - this.startTime; } play() { + if(this.passedTime){ + this.startTime = new Date().getTime() - this.passedTime; + if(this.filePlaying){ + + } else { + + } + this.passedTime = undefined; + } if(!this.activeTrack)return; if(this.filePlaying){ ioClient.emit("play", {file:this.filePlaying}); @@ -221,7 +246,8 @@ class TrackEvent { id:string; art: { subnet:number, - value:number + value:number, + universe:number } time:FrameTime; } @@ -231,12 +257,18 @@ class Track { displayName:string; triggers:Array; file:string; + load: { + subnet:number, + value:number, + universe:number + } } interface VlcUpdate { file:string, time:number, is_playing:boolean; + paused:boolean; } var timecode = new Timecode(); @@ -264,6 +296,13 @@ ios.on("connection", socket=>{ } timecode.play(); }); + socket.on("pause", ()=>{ + if(timecode.filePlaying){ + ioClient.emit("pause"); + } else { + timecode.pause(); + } + }); socket.on("stop", ()=>{ timecode.stop(); if(timecode.activeTrack) @@ -305,6 +344,18 @@ ios.on("connection", socket=>{ db.get(data.track + ".triggers").remove({id:data.id}).write(); senddata(); }); + + socket.on("fire", (data)=>{ + artnet.set(data.universe, data.subnet, data.value); + }); + + socket.on("load_event", (data)=>{ + console.log(data); + db.get(data.id).assign({ + load:data.art + }).write(); + senddata(); + }); }); http.listen(5001); diff --git a/tsconfig.json b/tsconfig.json index d7a9286..91347ba 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,9 +10,6 @@ "node_modules/@types" ] }, - "files": [ - "src/custom.d.ts" - ], "exclude": [ "node_modules" ],"include": [ diff --git a/web/index.html b/web/index.html index b69c781..6823040 100644 --- a/web/index.html +++ b/web/index.html @@ -14,6 +14,7 @@
+ @@ -35,6 +36,12 @@

+
+ + + + +
@@ -47,6 +54,7 @@ + @@ -98,6 +106,11 @@ $("#fplay").html(data.filePlaying); if(data.playing){ $("#playbutton").css("color", "greenyellow"); + if(data.paused) { + $("#pausebutton").css("display", "none"); + } else { + $("#pausebutton").css("display", "inline-block"); + } } else { $("#playbutton").css("color", "white"); } @@ -138,9 +151,14 @@ $("#trdv").css("display","none"); return; } + if(selected.load){ + $("#universe").val(selected.load.universe); + $("#channel").val(selected.load.subnet); + $("#value").val(selected.load.value); + } $("#trackname").html(selected.displayName); $("#trackfile").html(selected.file !==undefined ? selected.file : ""); - var t = "IDStundeMinuteSekundeFrameArtNet-KanalArt-Net ValueCopyEditDel"; + var t = "IDStundeMinuteSekundeFrameUniverseArtNet-KanalArt-Net ValueRunCopyEditDel"; var sorted = selected.triggers.sort((a, b)=>{ if(a.time.lmilliseconds < b.time.lmilliseconds) return -1; if(a.time.lmilliseconds > b.time.lmilliseconds) return 1; @@ -153,8 +171,10 @@ t += "" + e.time.lminutes + "" t += "" + e.time.lseconds + "" t += "" + e.time.lframe + "" + t += "" + e.art.universe + "" t += "" + e.art.subnet + "" t += "" + e.art.value + "" + t += "" t += "" t += "" t += "" @@ -177,6 +197,7 @@ $("#em").val(el.time.lminutes); $("#es").val(el.time.lseconds); $("#ef").val(el.time.lframe); + $("#eu").val(el.art.universe); $("#esu").val(el.art.subnet); $("#eval").val(el.art.value); } @@ -194,6 +215,7 @@ $("#em").val(el.time.lminutes); $("#es").val(el.time.lseconds); $("#ef").val(el.time.lframe); + $("#eu").val(el.art.universe); $("#esu").val(el.art.subnet); $("#eval").val(el.art.value); } @@ -201,7 +223,13 @@ function remove(id) { socket.emit("delete", {track:selected.id, id:id}) console.log("remove with id", id) - //throw new Error("not implemented"); + } + + function fire(id){ + if(!selected) return; + selected.triggers.forEach(e=>{ + if(e.id == id) socket.emit("fire", e.art); + }); } function saveEvent() { @@ -214,6 +242,7 @@ el.time.seconds = $("#es").val(); el.time.frame = $("#ef").val(); el.art = {}; + el.art.universe = $("#eu").val(); el.art.subnet = $("#esu").val(); el.art.value = $("#eval").val(); socket.emit("set", el); @@ -222,6 +251,7 @@ $("#em").val(""); $("#es").val(""); $("#ef").val(""); + $("#eu").val(""); $("#esu").val(""); $("#eval").val(""); } @@ -238,6 +268,10 @@ socket.emit("stop"); } + function pauseSequence(){ + socket.emit("pause"); + } + $(document).keyup(function(e) { if (e.keyCode === 27) { $("#eid").val(""); @@ -245,10 +279,22 @@ $("#em").val(""); $("#es").val(""); $("#ef").val(""); + $("#eu").val(""); $("#esu").val(""); $("#eval").val(""); - } // esc + } }); + + function saveLoad(){ + var data = {}; + data.id = selected.id; + data.art = {}; + data.art.universe = $("#universe").val(); + data.art.subnet = $("#channel").val(); + data.art.value = $("#value").val(); + console.log(data); + socket.emit("event", data); + }