diff -r 9be99c2fb279 -r d7c5bffdd2d8 annot-server/static/js/pianoroll.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/annot-server/static/js/pianoroll.min.js Mon Jan 12 17:23:05 2015 +0100 @@ -0,0 +1,1 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.pianoroll=e()}}(function(){return function e(n,t,o){function i(s,a){if(!t[s]){if(!n[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(r)return r(s,!0);var d=new Error("Cannot find module '"+s+"'");throw d.code="MODULE_NOT_FOUND",d}var c=t[s]={exports:{}};n[s][0].call(c.exports,function(e){var t=n[s][1][e];return i(t?t:e)},c,c.exports,e,n,t,o)}return t[s].exports}for(var r="function"==typeof require&&require,s=0;se?"0"+e:e)+":"+(10>n?"0"+n:n)+":"+(10>t?"0"+t:t);N.innerHTML=o}var a=e("pixi"),l=!1,d=1920,c=435,h=645,f=c+h,u=16777215,p=4473924,w=Math.floor(d/10),v=w/4,g=Math.floor(d/60),m=5e3,x=-1,y=[12124160,4971889,11506462,1845434,5466513],C={},b=[],I=Date.now(),S=!1,M=new a.Stage(u),D=a.autoDetectRenderer(d,f);document.getElementById("canvasContainer").appendChild(D.view);var O=new a.DisplayObjectContainer;O.position.x=Math.floor(9*d/10),O.position.y=0,M.addChild(O);var T=e("./pianoroll.js"),j=[];j.push(new T(O,0,0,c,!0,w,d,y,C,p,m)),j.push(new T(O,0,c,h,!1,g,d,y,C,p,m));var L=new a.Graphics;L.beginFill(16776960),L.lineStyle(1,p),L.moveTo(0,c),L.lineTo(d,c),L.endFill(),M.addChild(L);var P=null,F=null;window.onload=function(){l?F=document.getElementById("log"):document.body.removeChild(document.getElementById("log"));var e;e="file:"===window.location.protocol?"ws://127.0.0.1:8090/broadcast":"ws://"+window.location.hostname+":8090/broadcast",e=e+"?channel=PIANOROLL&event_code="+eventCode,"WebSocket"in window?P=new WebSocket(e):"MozWebSocket"in window?P=new MozWebSocket(e):(r("Browser does not support WebSocket!"),window.location="http://autobahn.ws/unsupportedbrowser"),P&&(P.onopen=function(){l&&r("Connected to "+e)},P.onclose=function(e){l&&r("Connection closed (wasClean = "+e.wasClean+", code = "+e.code+", reason = '"+e.reason+"')"),P=null},P.onmessage=function(e){l&&r("Got message: "+e.data),o(JSON.parse(e.data))})},i();var R=window.setInterval(t,1e3/v),k=window.setInterval(i,m),E=0,N=document.getElementById("myspan"),B=window.setInterval(s,1e3);n.exports={moveInterval:R,verticalLinesInterval:k,secondInterval:B}},{"./pianoroll.js":2,pixi:"pixi"}],2:[function(e,n){"use strict";function t(e,n,t,r,s,a,l,d,c,h,f){var u=this;this.container=new o.DisplayObjectContainer,this.container.position.x=n,this.container.position.y=t,e.addChild(this.container),this.linesDown=s,this.height=r,this.pixelsPerSecond=a,this.width=l,this.noteColors=d,this.colorsReg=c||{},this.lineColor=h,this.lineInterval=f,this.addNote=function(e,n,t,r,s){var a=(offsetMusic+n)*this.pixelsPerSecond/1e3,l=t*this.pixelsPerSecond/1e3,d=new o.Graphics,c=this.colorsReg[s];if("undefined"==typeof c){var h=Object.keys(this.colorsReg).length;c=this.colorsReg[s]=hs?"0"+s:s)+":"+(10>a?"0"+a:a)+":"+(10>l?"0"+l:l),c={font:"10pt Arial",fill:"#444444"},h=new o.Text(d,c);h.x=t+2,h.y=this.linesDown?this.height-15:2,this.container.addChild(h)},this.moveTo=function(e){this.container.x=Math.floor(e*this.pixelsPerSecond)},this.removePassedObjets=function(){for(var e=u.container.children.length,n=0,t=!1;e>n&&!t;){var o=u.container.children[0];o.x+o.width