client/annotviz/app/annotstimeline.html
changeset 101 7e902dc550c5
child 102 cc7b06bfd574
equal deleted inserted replaced
100:0d7dac03c1a0 101:7e902dc550c5
       
     1 <!DOCTYPE html>
       
     2 <html lang="en">
       
     3 <head>
       
     4     <meta charset="utf-8">
       
     5     <meta name="viewport" content="width=device-width,initial-scale=1">
       
     6     <meta name="description" content="">
       
     7     <meta name="author" content="I.R.I">
       
     8     <link rel="shortcut icon" href="/img/favicon.ico">
       
     9 
       
    10     <title>AnnotsTimeLine</title>
       
    11 
       
    12     <!-- Custom styles for this template -->
       
    13     <link href="/css/annotviz.css" rel="stylesheet">
       
    14 </head>
       
    15 
       
    16 <body>
       
    17     <h1>Piano Roll vertical</h1>
       
    18     <noscript>You must enable JavaScript</noscript>
       
    19     <div id="canvasContainer"></div>
       
    20     <p>
       
    21         <a href="#" onclick="stop(); return false;">stop intervals</a> -
       
    22         <a href="#" onclick="start(); return false;">start intervals</a> -
       
    23         temps écoulé : <span id="timeStarted"></span>
       
    24     </p>
       
    25     <!--pre id="log"></pre-->
       
    26     <script src="/js/libs-annotviz.js"></script>
       
    27     <script src="/js/annotviz.js"></script>
       
    28     <script>
       
    29         var annotationChannel = 'ANNOT';
       
    30         var eventCode = 'test_1';
       
    31         var wsUri;
       
    32         if (window.location.protocol === 'file:') {
       
    33             wsUri = 'ws://127.0.0.1:8090/broadcast';
       
    34         }
       
    35         else {
       
    36             wsUri = 'ws://' + window.location.hostname + ':8090/broadcast';
       
    37         }
       
    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 
       
    46         var annotstimeline = new annotviz.AnnotsTimeLine({
       
    47         	stageView : stageView,
       
    48             logger: logger,
       
    49             ws: new annotviz.WsWrapper(wsUriAnnotation, logger),
       
    50             xInit: 0,
       
    51             yInit: 0,
       
    52             width: 1920 - 435 - 300,
       
    53             height: 1080,
       
    54             timeBegin: Date.now(),
       
    55             timeEnd: Date.now() + 300000,
       
    56             intervalWidth: 30,
       
    57             intervalHeight: 10,
       
    58             maxCellHeight: 50,
       
    59             annotCategories: [{
       
    60            		ts: 0, 
       
    61            		colors: {		
       
    62        	       		'ntm': '#CDC83F',
       
    63        	       	    'iam': '#CDC83F',
       
    64        	       	    'hip': '#CDC83F',
       
    65        	       	    'hop': '#CDC83F',
       
    66        	       	    'rock': '#DE8B53',
       
    67        	       	    'rap': '#DE8B53',
       
    68        	       	    'classic': '#DE8B53',
       
    69        	       	    'drums': '#C5A3CA',
       
    70        	       	    'guitar': '#C5A3CA',
       
    71        	       	    'bass': '#79BB92',
       
    72        	       	   	'default': '#808080'
       
    73 				},
       
    74             	order: ['ntm', 'iam', 'hip', 'hop', 'rock', 'rap', 'classic', 'drums', 'guitar', 'bass', 'default']
       
    75            	}]
       
    76         });
       
    77 
       
    78         function stop() {
       
    79         	stageView.stop();
       
    80         }
       
    81         function start() {
       
    82         	stageView.start();
       
    83         }
       
    84 
       
    85         window.onload = function() {
       
    86         	stageView.init();
       
    87             start();
       
    88         }
       
    89     </script>
       
    90 </body>
       
    91 </html>