small changaes
This commit is contained in:
parent
56901e4f33
commit
7c3f26a9f8
@ -28,7 +28,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"artnet": "^1.3.2",
|
"artnet": "^1.3.2",
|
||||||
"lowdb": "^0.16.2",
|
"lowdb": "^0.16.2",
|
||||||
"rtpmidi": "^0.1.8",
|
|
||||||
"short-id": "0.1.0-1",
|
"short-id": "0.1.0-1",
|
||||||
"socket.io": "^2.0.3",
|
"socket.io": "^2.0.3",
|
||||||
"socket.io-client": "^2.0.3"
|
"socket.io-client": "^2.0.3"
|
||||||
|
10
src/timec.ts
10
src/timec.ts
@ -10,7 +10,7 @@ db.defaults({}).write();
|
|||||||
import * as httpp from "http";
|
import * as httpp from "http";
|
||||||
var http = httpp.createServer();
|
var http = httpp.createServer();
|
||||||
import io = require("socket.io");
|
import io = require("socket.io");
|
||||||
var ioClient = require("socket.io-client")("http://localhost:5000");
|
var ioClient = require("socket.io-client")("192.168.1.22:5000");
|
||||||
var ios = io(http);
|
var ios = io(http);
|
||||||
|
|
||||||
const artnetp = require("artnet");
|
const artnetp = require("artnet");
|
||||||
@ -236,12 +236,18 @@ ios.on("connection", socket=>{
|
|||||||
socket.on("set", (data)=>{
|
socket.on("set", (data)=>{
|
||||||
var tid = data.track;
|
var tid = data.track;
|
||||||
var time = new FrameTime(data.time);
|
var time = new FrameTime(data.time);
|
||||||
|
if(data.id && data.id != "") {
|
||||||
|
var tracke = db.get(tid+ ".triggers").find({id:data.id}).assign({
|
||||||
|
art:data.art,
|
||||||
|
time:time,
|
||||||
|
}).write();
|
||||||
|
} else {
|
||||||
var tracke = new TrackEvent();
|
var tracke = new TrackEvent();
|
||||||
tracke.art = data.art;
|
tracke.art = data.art;
|
||||||
tracke.time = time;
|
tracke.time = time;
|
||||||
tracke.id = sid.generate();
|
tracke.id = sid.generate();
|
||||||
db.get(tid + ".triggers").push(tracke).write();
|
db.get(tid + ".triggers").push(tracke).write();
|
||||||
socket.emit("set_finished", tracke);
|
}
|
||||||
senddata();
|
senddata();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user