client/annotviz/app/annotsvizview.html
changeset 134 119b6193c493
parent 131 0bb70072a56f
child 135 d3066fa80a81
equal deleted inserted replaced
133:12f782a13fa2 134:119b6193c493
    19     <div id="canvasContainer"></div>
    19     <div id="canvasContainer"></div>
    20     <!--pre id="log"></pre-->
    20     <!--pre id="log"></pre-->
    21     <script src="/js/libs-annotviz.js"></script>
    21     <script src="/js/libs-annotviz.js"></script>
    22     <script src="/js/annotviz.js"></script>
    22     <script src="/js/annotviz.js"></script>
    23     <script>
    23     <script>
    24     
       
    25 	    var pianorollChannel  = 'PIANOROLL';
       
    26 	    var annotationChannel = 'ANNOT';
       
    27 	    var eventCode = 'test_1';
       
    28 	    var serverUrl = "http://localhost:8080";
       
    29 	    var wsUri;
       
    30 	    
       
    31 	    if (window.location.protocol === 'file:') {
       
    32 	        wsUri = 'ws://172.16.0.20:8090/broadcast';
       
    33 	    }
       
    34 	    else {
       
    35 	        wsUri = 'ws://' + window.location.hostname + ':8090/broadcast';
       
    36 	    }
       
    37 	    wsUriPianoroll = wsUri + '?channel=' + pianorollChannel + '&event_code=' + eventCode;
       
    38 	    wsUriAnnotation = wsUri + '?channel=' + annotationChannel + '&event_code=' + eventCode;
       
    39 
    24 
    40 	    var logger = new annotviz.ConsoleLogger(true);
    25         var pianorollChannel  = 'PIANOROLL';
       
    26         var annotationChannel = 'ANNOT';
       
    27         var eventCode = 'test_1';
       
    28         var serverUrl = "http://localhost:8080";
       
    29         var wsUri;
    41 
    30 
    42 	    var stageView = new annotviz.StageView({
    31         if (window.location.protocol === 'file:') {
    43 	    	logger: logger
    32             wsUri = 'ws://172.16.0.20:8090/broadcast';
    44 	    });
    33         }
       
    34         else {
       
    35             wsUri = 'ws://' + window.location.hostname + ':8090/broadcast';
       
    36         }
       
    37         wsUriPianoroll = wsUri + '?channel=' + pianorollChannel + '&event_code=' + eventCode;
       
    38         wsUriAnnotation = wsUri + '?channel=' + annotationChannel + '&event_code=' + eventCode;
       
    39 
       
    40         var logger = new annotviz.ConsoleLogger(true);
       
    41 
       
    42         var stageView = new annotviz.StageView({
       
    43             logger: logger
       
    44         });
    45 
    45 
    46         var annotsvizview = new annotviz.AnnotsVizView({
    46         var annotsvizview = new annotviz.AnnotsVizView({
    47         	urlCategories: serverUrl + "/p/api/v1/event/" + eventCode,
    47             urlCategories: serverUrl + "/p/api/v1/event/" + eventCode,
    48         	logger: logger,
    48             logger: logger,
    49         	stageView: stageView,
    49             stageView: stageView,
    50         	wsPianoroll: new annotviz.WsWrapper(wsUriPianoroll, logger),
    50             wsPianoroll: new annotviz.WsWrapper(wsUriPianoroll, logger),
    51         	wsAnnot: new annotviz.WsWrapper(wsUriAnnotation, logger),
    51             wsAnnot: new annotviz.WsWrapper(wsUriAnnotation, logger),
    52         	timeBegin: Date.parse("2015-01-23T09:30:00+01:00"),
    52             timeBegin: Date.parse("2015-01-23T09:30:00+01:00"),
    53         	timeEnd: Date.parse("2015-01-23T18:30:00+01:00"),
    53             timeEnd: Date.parse("2015-01-23T18:30:00+01:00"),
    54         	eventCode: eventCode,
    54             eventCode: eventCode,
    55             channel: annotationChannel
    55             channel: annotationChannel
    56         });
    56         });
    57 
    57 
    58 
    58 
    59         function stop() {
    59         function stop() {
    60         	stageView.stop();
    60             stageView.stop();
    61         }
    61         }
    62         function start() {
    62         function start() {
    63         	stageView.start();
    63             stageView.start();
    64         }
    64         }
    65 
    65 
    66         window.onload = function() {
    66         window.onload = function() {
    67         	stageView.init();
    67             stageView.init();
    68             start();
    68             start();
    69         }
    69         }
    70     </script>
    70     </script>
    71 </body>
    71 </body>
    72 </html>
    72 </html>