client/annotviz/app/pianoroll_h.html
changeset 98 72d767c5142d
parent 95 806739a26858
child 100 0d7dac03c1a0
--- a/client/annotviz/app/pianoroll_h.html	Mon Jan 19 16:44:59 2015 +0100
+++ b/client/annotviz/app/pianoroll_h.html	Tue Jan 20 11:57:44 2015 +0100
@@ -7,14 +7,14 @@
     <meta name="author" content="I.R.I">
     <link rel="shortcut icon" href="/img/favicon.ico">
 
-    <title>Piano Roll</title>
+    <title>Horizontal Piano Roll</title>
 
     <!-- Custom styles for this template -->
     <link href="/css/annotviz.css" rel="stylesheet">
 </head>
 
 <body>
-    <h1>Piano Roll</h1>
+    <h1>Horizontal Piano Roll</h1>
     <noscript>You must enable JavaScript</noscript>
     <div id="canvasContainer"></div>
     <p>
@@ -26,11 +26,30 @@
     <script src="/js/libs-annotviz.js"></script>
     <script src="/js/annotviz.js"></script>
     <script>
-        var doubleroll = annotviz.DoubleRoll({
-            eventCode: "test_1"
+        var annotationChannel = 'PIANOROLL';
+        var eventCode = 'test_1';
+        var wsUri;
+        if (window.location.protocol === 'file:') {
+            wsUri = 'ws://127.0.0.1:8090/broadcast';
+        }
+        else {
+            wsUri = 'ws://' + window.location.hostname + ':8090/broadcast';
+        }
+        wsUri += '?channel='+annotationChannel+'&event_code='+eventCode;
+
+
+        var doubleroll = new annotviz.DoubleRoll({
+            logger: new annotviz.HtmlLogger(false, 'log'),
+            ws: new annotviz.WsWrapper(wsUri)
         });
+
         function stop() { doubleroll.stop(); }
         function start() { doubleroll.start(); }
+
+        window.onload = function() {
+            doubleroll.init();
+            start();
+        }
     </script>
 </body>
 </html>