removed error
This commit is contained in:
parent
fbd84983ad
commit
3169d8b22e
46
db.json
46
db.json
@ -54,8 +54,8 @@
|
||||
"triggers": [
|
||||
{
|
||||
"art": {
|
||||
"subnet": "0",
|
||||
"value": "0"
|
||||
"subnet": "20",
|
||||
"value": "120"
|
||||
},
|
||||
"time": {
|
||||
"lframe": "0",
|
||||
@ -65,6 +65,48 @@
|
||||
"lmilliseconds": 5000
|
||||
},
|
||||
"id": "cc954c0f41e0"
|
||||
},
|
||||
{
|
||||
"art": {
|
||||
"subnet": "30",
|
||||
"value": "255"
|
||||
},
|
||||
"time": {
|
||||
"lframe": "0",
|
||||
"lseconds": "6",
|
||||
"lminutes": "0",
|
||||
"lhours": "0",
|
||||
"lmilliseconds": 6000
|
||||
},
|
||||
"id": "6a1343d12135"
|
||||
},
|
||||
{
|
||||
"art": {
|
||||
"subnet": "21",
|
||||
"value": "255"
|
||||
},
|
||||
"time": {
|
||||
"lframe": "0",
|
||||
"lseconds": "7",
|
||||
"lminutes": "0",
|
||||
"lhours": "0",
|
||||
"lmilliseconds": 7000
|
||||
},
|
||||
"id": "2e3919ef1e3b"
|
||||
},
|
||||
{
|
||||
"art": {
|
||||
"subnet": "2",
|
||||
"value": "255"
|
||||
},
|
||||
"time": {
|
||||
"lframe": "0",
|
||||
"lseconds": "0",
|
||||
"lminutes": "0",
|
||||
"lhours": "0",
|
||||
"lmilliseconds": 0
|
||||
},
|
||||
"id": "4c93060ca00f"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
19
lib/timec.js
19
lib/timec.js
@ -17,6 +17,13 @@ var ios = io(http);
|
||||
const artnetp = require("artnet");
|
||||
const universe = 21;
|
||||
var artnet = artnetp({ host: "192.168.1.255" });
|
||||
function reset() {
|
||||
for (var i = 1; i <= 512; i++) {
|
||||
artnet.set(universe, i, 0);
|
||||
}
|
||||
artnet.set(universe, 1, 100);
|
||||
}
|
||||
reset();
|
||||
class FrameTime {
|
||||
constructor(millis) {
|
||||
this.lframe = 0;
|
||||
@ -102,9 +109,9 @@ class Timecode {
|
||||
var d = vlc.time;
|
||||
this.toTrigger.forEach(e => {
|
||||
if (e.time.milliseconds <= d) {
|
||||
console.log(e);
|
||||
console.log("v", e);
|
||||
ios.emit("artnet", e.art);
|
||||
artnet.set(universe, e.art.subnet, e.art.value);
|
||||
artnet.set(Number(e.art.subnet), Number(e.art.value));
|
||||
var i = this.toTrigger.indexOf(e);
|
||||
this.toTrigger.splice(i, 1);
|
||||
}
|
||||
@ -119,9 +126,9 @@ class Timecode {
|
||||
var d = new Date().getTime() - this.startTime;
|
||||
this.toTrigger.forEach(e => {
|
||||
if (e.time.milliseconds <= d) {
|
||||
console.log(e);
|
||||
console.log("u", e);
|
||||
ios.emit("artnet", e.art);
|
||||
artnet.set(universe, e.art.subnet);
|
||||
artnet.set(Number(e.art.subnet), Number(e.art.value));
|
||||
var i = this.toTrigger.indexOf(e);
|
||||
this.toTrigger.splice(i, 1);
|
||||
}
|
||||
@ -134,9 +141,9 @@ class Timecode {
|
||||
}
|
||||
loadTrack(trackid) {
|
||||
this.playing = false;
|
||||
for (var i = 0; i < 512; i++) {
|
||||
/*for(var i = 0; i < 512; i++){
|
||||
artnet.set(universe, i, 0);
|
||||
}
|
||||
}*/
|
||||
var track = db.get(trackid).value();
|
||||
var tr = [];
|
||||
track.triggers.forEach(t => {
|
||||
|
File diff suppressed because one or more lines are too long
19
src/timec.ts
19
src/timec.ts
@ -18,6 +18,13 @@ var ios = io(http);
|
||||
const artnetp = require("artnet");
|
||||
const universe = 21;
|
||||
var artnet = artnetp({host:"192.168.1.255"});
|
||||
function reset(){
|
||||
for(var i = 1; i <= 512; i++){
|
||||
artnet.set(universe, i, 0);
|
||||
}
|
||||
artnet.set(universe, 1, 100);
|
||||
}
|
||||
reset();
|
||||
|
||||
class FrameTime{
|
||||
lframe = 0;
|
||||
@ -122,9 +129,9 @@ class Timecode {
|
||||
var d = vlc.time;
|
||||
this.toTrigger.forEach(e=>{
|
||||
if(e.time.milliseconds <= d) {
|
||||
console.log(e);
|
||||
console.log("v",e);
|
||||
ios.emit("artnet", e.art);
|
||||
artnet.set(universe, e.art.subnet, e.art.value)
|
||||
artnet.set(Number(e.art.subnet), Number(e.art.value));
|
||||
var i = this.toTrigger.indexOf(e);
|
||||
this.toTrigger.splice(i, 1);
|
||||
}
|
||||
@ -140,9 +147,9 @@ class Timecode {
|
||||
var d = new Date().getTime() - this.startTime;
|
||||
this.toTrigger.forEach(e=>{
|
||||
if(e.time.milliseconds <= d) {
|
||||
console.log(e);
|
||||
console.log("u", e);
|
||||
ios.emit("artnet", e.art);
|
||||
artnet.set(universe, e.art.subnet)
|
||||
artnet.set(Number(e.art.subnet), Number(e.art.value));
|
||||
var i = this.toTrigger.indexOf(e);
|
||||
this.toTrigger.splice(i, 1);
|
||||
}
|
||||
@ -156,9 +163,9 @@ class Timecode {
|
||||
|
||||
loadTrack(trackid:string) {
|
||||
this.playing = false;
|
||||
for(var i = 0; i < 512; i++){
|
||||
/*for(var i = 0; i < 512; i++){
|
||||
artnet.set(universe, i, 0);
|
||||
}
|
||||
}*/
|
||||
var track =<Track>db.get(trackid).value();
|
||||
var tr = [];
|
||||
track.triggers.forEach(t=>{
|
||||
|
Loading…
Reference in New Issue
Block a user