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