diff --git a/db.json b/db.json index 7bf5d7e..6ab9ad4 100644 --- a/db.json +++ b/db.json @@ -5,31 +5,45 @@ "triggers": [ { "art": { - "subnet": 1, - "value": 4 + "subnet": "4", + "value": "4" }, "time": { - "lframe": 15, - "lseconds": 5, - "lminutes": 0, - "lhours": 0, - "lmilliseconds": 5600 + "lframe": "2", + "lseconds": "10", + "lminutes": "0", + "lhours": "0", + "lmilliseconds": 10080 }, - "id": "c06d59297199" + "id": "719be4487857" }, { "art": { - "subnet": "1", - "value": "1" + "subnet": "5", + "value": "5" }, "time": { - "lframe": "1", - "lseconds": "1", - "lminutes": "1", - "lhours": "1", - "lmilliseconds": 3661040 + "lframe": "5", + "lseconds": "5", + "lminutes": "5", + "lhours": "5", + "lmilliseconds": 18305200 }, - "id": "4725a8a0a91d" + "id": "d747ecb81661" + }, + { + "art": { + "subnet": "0", + "value": "0" + }, + "time": { + "lframe": "15", + "lseconds": "10", + "lminutes": "0", + "lhours": "0", + "lmilliseconds": 10600 + }, + "id": "1c599cfdb9df" } ] }, diff --git a/lib/db.json b/lib/db.json deleted file mode 100644 index 9e26dfe..0000000 --- a/lib/db.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/lib/timec.js b/lib/timec.js index dea18f7..cefcfd2 100644 --- a/lib/timec.js +++ b/lib/timec.js @@ -1,200 +1,211 @@ -//DATABASE -"use strict"; -const low = require("lowdb"); -var db = low("db.json"); -const sid = require("short-id"); -sid.configure({ length: 12 }); -db.defaults({}).write(); -//SOCKETIO -const httpp = require("http"); -var http = httpp.createServer(); -const io = require("socket.io"); -var ioClient = require("socket.io-client")("http://localhost:5000"); -var ios = io(http); -const artnetp = require("artnet"); -const universe = 21; -var artnet = artnetp({ host: "192.168.1.255" }); -class FrameTime { - constructor(millis) { - this.lframe = 0; - this.lseconds = 0; - this.lminutes = 0; - this.lhours = 0; - this.lmilliseconds = 0; - if (Number.isInteger(millis)) { - this.milliseconds = millis; - } - else if (typeof millis === "object") { - if (Number.isInteger(Number(millis.frame)) && Number.isInteger(Number(millis.seconds)) && Number.isInteger(Number(millis.minutes)) && Number.isInteger(Number(millis.hours))) { - this.lframe = millis.frame; //use the local, because its mor performant - this.lseconds = millis.seconds; - this.lminutes = millis.minutes; - this.lhours = millis.hours; - this.calcMillis(); - } - else if (Number.isInteger(millis.milliseconds)) { - this.milliseconds = millis.milliseconds; - } - } - } - get milliseconds() { - return this.lmilliseconds; - } - set milliseconds(val) { - this.lmilliseconds = val; - this.millisToFrame(); - } - get frame() { - return this.lframe; - } - set frame(val) { - this.lframe = val; - this.calcMillis(); - } - get seconds() { - return this.lseconds; - } - set seconds(val) { - this.lseconds = val; - this.calcMillis(); - } - get minutes() { - return this.lminutes; - } - set minutes(val) { - this.lminutes = val; - this.calcMillis(); - } - get hours() { - return this.lhours; - } - set hours(val) { - this.lhours = val; - this.calcMillis(); - } - calcMillis() { - this.lmilliseconds = (this.frame / 25 * 1000) + this.seconds * 1000 + this.minutes * 60 * 1000 + this.hours * 60 * 60 * 1000; - } - millisToFrame() { - var millis = this.lmilliseconds; - this.frame = Math.floor((millis % 1000) * 25 / 1000); - this.seconds = Math.floor((millis / 1000) % 60); - this.minutes = Math.floor((millis / (1000 * 60)) % 60); - this.hours = Math.floor((millis / (1000 * 60 * 60)) % 24); - } -} -class Timecode { - vlcUpdate(vlc) { - this.startTime = new Date().getTime() - vlc.time; - this.filePlaying = vlc.file; - } - update(time) { - var d = new Date().getTime() - this.startTime; - this.toTrigger.forEach(e => { - if (e.time.milliseconds <= d) { - ios.emit("artnet", e.art); - artnet.set(universe, e.art.subnet); - var i = this.toTrigger.indexOf(e); - this.toTrigger.splice(i, 1); - } - }); - var data = {}; - data.time = new FrameTime(d); - data.track = this.activeTrack.id; - ios.emit("update", data); - } - loadTrack(trackid) { - this.playing = false; - var track = db.get(trackid).value(); - track.triggers.forEach(t => { - t.time = new FrameTime(t.time); - }); - this.activeTrack = track; - this.toTrigger = track.triggers; - this.filePlaying = track.file; - this.startTime = 0; - } - play() { - if (this.filePlaying) { - ioClient.emit("play", { file: this.filePlaying }); - ioClient.on("playing", () => { - this.startTime = new Date().getTime(); - }); - ioClient.on("update", (data) => { - this.vlcUpdate(data); - }); - } - else { - this.startTime = new Date().getTime(); - this.playing = true; - } - this.interval = setInterval(this.update.bind(this), 1000 / 25); - } - stop() { - clearInterval(this.interval); - this.playing = false; - if (this.filePlaying) { - ioClient.emit("stop"); - ios.emit("stopped"); - } - this.startTime = 0; - } -} -class TrackEvent { -} -class Track { -} -var timecode = new Timecode(); -ios.on("connection", socket => { - function senddata() { - ios.emit("get_data", db.getState()); - } - console.log("Client", socket.id, "connected"); - socket.on("load", (id) => { - var track = db.get(id).value(); - if (track === undefined) { - return socket.emit("play_error", "Track doesn't exist"); - } - timecode.loadTrack(id); - }); - socket.on("play", () => { - if (timecode.playing) { - return socket.emit("play_error", "the active track must be stoppen before re-plaing it"); - } - timecode.play(); - }); - socket.on("stop", () => { - timecode.stop(); - timecode.loadTrack(timecode.activeTrack.id); - }); - socket.on("create", (data) => { - var track = new Track(); - track.displayName = data.name; - track.file = data.file; - track.id = sid.generate(); - track.triggers = []; - db.set(track.id, track).write(); - socket.emit("created", track); - senddata(); - }); - socket.on("set", (data) => { - var tid = data.track; - var time = new FrameTime(data.time); - var tracke = new TrackEvent(); - tracke.art = data.art; - tracke.time = time; - tracke.id = sid.generate(); - db.get(tid + ".triggers").push(tracke).write(); - socket.emit("set_finished", tracke); - senddata(); - }); - socket.on("get", () => { - socket.emit("get_data", db.getState()); - }); - socket.on("delete", (data) => { - db.get(data.track + ".triggers").remove({ id: data.id }).write(); - senddata(); - }); -}); -http.listen(5001); +"use strict"; +//DATABASE +Object.defineProperty(exports, "__esModule", { value: true }); +const low = require("lowdb"); +var db = low("db.json"); +const sid = require("short-id"); +sid.configure({ length: 12 }); +db.defaults({}).write(); +//SOCKETIO +const httpp = require("http"); +var http = httpp.createServer(); +const io = require("socket.io"); +var ioClient = require("socket.io-client")("http://localhost:5000"); +var ios = io(http); +const artnetp = require("artnet"); +const universe = 21; +var artnet = artnetp({ host: "192.168.1.255" }); +class FrameTime { + constructor(millis) { + this.lframe = 0; + this.lseconds = 0; + this.lminutes = 0; + this.lhours = 0; + this.lmilliseconds = 0; + if (Number.isInteger(millis)) { + this.milliseconds = millis; + } + else if (typeof millis === "object") { + if (Number.isInteger(Number(millis.frame)) && Number.isInteger(Number(millis.seconds)) && Number.isInteger(Number(millis.minutes)) && Number.isInteger(Number(millis.hours))) { + this.lframe = millis.frame; //use the local, because its mor performant + this.lseconds = millis.seconds; + this.lminutes = millis.minutes; + this.lhours = millis.hours; + this.calcMillis(); + } + else if (Number.isInteger(millis.milliseconds)) { + this.milliseconds = millis.milliseconds; + } + } + } + get milliseconds() { + return this.lmilliseconds; + } + set milliseconds(val) { + this.lmilliseconds = val; + this.millisToFrame(); + } + get frame() { + return this.lframe; + } + set frame(val) { + this.lframe = val; + this.calcMillis(); + } + get seconds() { + return this.lseconds; + } + set seconds(val) { + this.lseconds = val; + this.calcMillis(); + } + get minutes() { + return this.lminutes; + } + set minutes(val) { + this.lminutes = val; + this.calcMillis(); + } + get hours() { + return this.lhours; + } + set hours(val) { + this.lhours = val; + this.calcMillis(); + } + calcMillis() { + this.lmilliseconds = (this.frame / 25 * 1000) + this.seconds * 1000 + this.minutes * 60 * 1000 + this.hours * 60 * 60 * 1000; + } + millisToFrame() { + var millis = this.lmilliseconds; + this.frame = Math.floor((millis % 1000) * 25 / 1000); + this.seconds = Math.floor((millis / 1000) % 60); + this.minutes = Math.floor((millis / (1000 * 60)) % 60); + this.hours = Math.floor((millis / (1000 * 60 * 60)) % 24); + } +} +class Timecode { + vlcUpdate(vlc) { + this.startTime = new Date().getTime() - vlc.time; + this.filePlaying = vlc.file; + } + update(time) { + var d = new Date().getTime() - this.startTime; + this.toTrigger.forEach(e => { + if (e.time.milliseconds <= d) { + console.log(e); + ios.emit("artnet", e.art); + artnet.set(universe, e.art.subnet); + var i = this.toTrigger.indexOf(e); + this.toTrigger.splice(i, 1); + } + }); + var data = {}; + data.time = new FrameTime(d); + data.track = this.activeTrack.id; + ios.emit("update", data); + } + loadTrack(trackid) { + this.playing = false; + var track = db.get(trackid).value(); + var tr = []; + track.triggers.forEach(t => { + var te = new TrackEvent(); + te.art = t.art; + te.id = t.id; + te.time = new FrameTime(t.time); + tr.push(te); + }); + this.activeTrack = track; + this.toTrigger = tr; + this.filePlaying = track.file; + this.startTime = 0; + } + play() { + if (this.filePlaying) { + ioClient.emit("play", { file: this.filePlaying }); + ioClient.on("playing", () => { + this.startTime = new Date().getTime(); + }); + ioClient.on("update", (data) => { + this.vlcUpdate(data); + }); + } + else { + this.startTime = new Date().getTime(); + this.playing = true; + } + this.interval = setInterval(this.update.bind(this), 1000 / 25); + } + stop() { + clearInterval(this.interval); + this.playing = false; + if (this.filePlaying) { + ioClient.emit("stop"); + ios.emit("stopped"); + } + this.startTime = 0; + } +} +class TrackEvent { +} +class Track { +} +var timecode = new Timecode(); +ios.on("connection", socket => { + function senddata() { + ios.emit("get_data", { + tracks: db.getState(), + loaded: timecode.activeTrack + }); + } + console.log("Client", socket.id, "connected"); + socket.on("load", (id) => { + var track = db.get(id).value(); + if (track === undefined) { + return socket.emit("play_error", "Track doesn't exist"); + } + timecode.loadTrack(id); + senddata(); + }); + socket.on("play", () => { + if (timecode.playing) { + return socket.emit("play_error", "the active track must be stoppen before re-plaing it"); + } + timecode.play(); + }); + socket.on("stop", () => { + timecode.stop(); + timecode.loadTrack(timecode.activeTrack.id); + }); + socket.on("create", (data) => { + var track = new Track(); + track.displayName = data.name; + track.file = data.file; + track.id = sid.generate(); + track.triggers = []; + db.set(track.id, track).write(); + socket.emit("created", track); + senddata(); + }); + socket.on("set", (data) => { + var tid = data.track; + var time = new FrameTime(data.time); + var tracke = new TrackEvent(); + tracke.art = data.art; + tracke.time = time; + tracke.id = sid.generate(); + db.get(tid + ".triggers").push(tracke).write(); + socket.emit("set_finished", tracke); + senddata(); + }); + socket.on("get", () => { + senddata(); + }); + socket.on("delete", (data) => { + db.get(data.track + ".triggers").remove({ id: data.id }).write(); + senddata(); + }); +}); +http.listen(5001); //# sourceMappingURL=timec.js.map \ No newline at end of file diff --git a/lib/timec.js.map b/lib/timec.js.map index c9517c4..03a90b9 100644 --- a/lib/timec.js.map +++ b/lib/timec.js.map @@ -1 +1 @@ -{"version":3,"file":"timec.js","sourceRoot":"","sources":["../src/timec.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,KAAK,EAAE,CAAC;AAExB,UAAU;AACV,8BAA8B;AAC9B,IAAI,IAAI,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;AAChC,gCAAiC;AACjC,IAAI,QAAQ,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,uBAAuB,CAAC,CAAC;AACpE,IAAI,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AAEnB,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAClC,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,IAAI,MAAM,GAAG,OAAO,CAAC,EAAC,IAAI,EAAC,eAAe,EAAC,CAAC,CAAC;AAE7C;IAMG,YAAY,MAAM;QALlB,WAAM,GAAG,CAAC,CAAC;QACX,aAAQ,GAAG,CAAC,CAAC;QACb,aAAQ,GAAG,CAAC,CAAC;QACb,WAAM,GAAG,CAAC,CAAC;QACX,kBAAa,GAAG,CAAC,CAAC;QAEf,EAAE,CAAA,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA,CAAC;YAC1B,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;QAC9B,CAAC;QAA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I,CAAC,CAAC"} \ No newline at end of file diff --git a/mongoose-free-6.5.exe b/mongoose-free-6.5.exe new file mode 100644 index 0000000..de4d19b Binary files /dev/null and b/mongoose-free-6.5.exe differ diff --git a/src/timec.ts b/src/timec.ts index a6fa985..ba46cff 100644 --- a/src/timec.ts +++ b/src/timec.ts @@ -115,6 +115,7 @@ class Timecode { var d = new Date().getTime() - this.startTime; this.toTrigger.forEach(e=>{ if(e.time.milliseconds <= d) { + console.log(e); ios.emit("artnet", e.art); artnet.set(universe, e.art.subnet) var i = this.toTrigger.indexOf(e); @@ -130,11 +131,16 @@ class Timecode { loadTrack(trackid:string) { this.playing = false; var track =db.get(trackid).value(); + var tr = []; track.triggers.forEach(t=>{ - t.time = new FrameTime(t.time); + var te = new TrackEvent(); + te.art = t.art; + te.id = t.id; + te.time = new FrameTime(t.time); + tr.push(te); }); this.activeTrack = track; - this.toTrigger = track.triggers; + this.toTrigger = tr; this.filePlaying = track.file; this.startTime = 0; } @@ -192,7 +198,10 @@ interface VlcUpdate { var timecode = new Timecode(); ios.on("connection", socket=>{ function senddata(){ - ios.emit("get_data", db.getState()); + ios.emit("get_data", { + tracks: db.getState(), + loaded: timecode.activeTrack + }); } console.log("Client", socket.id, "connected"); @@ -202,6 +211,7 @@ ios.on("connection", socket=>{ return socket.emit("play_error", "Track doesn't exist"); } timecode.loadTrack(id); + senddata(); }); socket.on("play", ()=>{ if(timecode.playing){ @@ -236,7 +246,7 @@ ios.on("connection", socket=>{ }); socket.on("get", ()=>{ - socket.emit("get_data", db.getState()); + senddata(); }); socket.on("delete", (data)=>{ diff --git a/web/index.html b/web/index.html index 71c005c..f7dd590 100644 --- a/web/index.html +++ b/web/index.html @@ -11,6 +11,13 @@

Timecode Abiball2017


+
+ + + + +
+
@@ -25,9 +32,11 @@