diff -r 129281e4bc2a -r 029cdbeebf03 annot-server/static/js/pianoroll.js --- a/annot-server/static/js/pianoroll.js Tue Oct 28 11:33:52 2014 +0100 +++ b/annot-server/static/js/pianoroll.js Tue Oct 28 09:47:11 2014 +0100 @@ -13,10 +13,10 @@ var nbLines = -1; var noteHeight = 110; var noteColor = [0xB90000, 0x4BDD71, 0xAF931E, 0x1C28BA, 0x536991, - 0xB90000, 0x4BDD71, 0xAF931E, 0x1C28BA, 0x536991, - 0xB90000, 0x4BDD71, 0xAF931E, 0x1C28BA, 0x536991, - 0xB90000, 0x4BDD71, 0xAF931E, 0x1C28BA, 0x536991, - 0xB90000, 0x4BDD71, 0xAF931E, 0x1C28BA, 0x536991, + 0xB90000, 0x4BDD71, 0xAF931E, 0x1C28BA, 0x536991, + 0xB90000, 0x4BDD71, 0xAF931E, 0x1C28BA, 0x536991, + 0xB90000, 0x4BDD71, 0xAF931E, 0x1C28BA, 0x536991, + 0xB90000, 0x4BDD71, 0xAF931E, 0x1C28BA, 0x536991, 0xB90000, 0x4BDD71, 0xAF931E, 0x1C28BA, 0x536991]; // Vars var noteDict = []; @@ -46,12 +46,12 @@ this.container.position.x = xInit; this.container.position.y = yInit; parentContainer.addChild(this.container); - + this.linesDown = linesDown; this.height = height; this.pixelsPerSecond = pixelsPerSecond; this.width = width; - + this.addNote = function(note, startTime, duration, velocity, canal){ //console.log("coucou 1", note, timeFromZero, ts, velocity, pixelsPerSecond, container, prHeight); var beginX = (offsetMusic + startTime) * this.pixelsPerSecond / 1000; @@ -66,7 +66,7 @@ graphics.x = beginX; this.container.addChild(graphics); }; - + this.addLine = function(lineNb){ var graphics = new PIXI.Graphics(); var x = -this.container.x; @@ -89,11 +89,11 @@ t.y = this.linesDown ? this.height - 15 : 2; this.container.addChild(t); }; - + this.moveTo = function(diffTime){ this.container.x = Math.floor(diffTime*this.pixelsPerSecond); }; - + this.removePassedObjets = function(){ var nbChilds = _this.container.children.length; var i = 0, childIsNowDisplayed = false; @@ -111,7 +111,7 @@ i++; } }; - + } // Init containers @@ -201,6 +201,8 @@ } else { wsuri = "ws://" + window.location.hostname + ":8090/broadcast"; } + wsuri = wsuri + "?channel=PIANOROLL&event_code="+event_code; + if ("WebSocket" in window) { sock = new WebSocket(wsuri); } else if ("MozWebSocket" in window) {