small changaes

This commit is contained in:
Fabian Stamm 2017-06-20 12:31:42 +02:00
parent 56901e4f33
commit 7c3f26a9f8
2 changed files with 13 additions and 8 deletions

View File

@ -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"

View File

@ -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);
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();
socket.emit("set_finished", tracke);
}
senddata();
});