client/annotviz/app/js/doubleroll.js
changeset 150 c8fe9606d967
parent 149 3a74c554c9b9
child 152 f0e12afcfba1
--- a/client/annotviz/app/js/doubleroll.js	Wed Apr 15 18:26:59 2015 +0200
+++ b/client/annotviz/app/js/doubleroll.js	Thu Apr 16 11:08:05 2015 +0200
@@ -11,6 +11,7 @@
 var PIXI = require('pixi');
 var _ = require('lodash');
 var PianoRoll = require('./pianoroll');
+var Utils = require('./utils.js');
 
 var defaultConfig = {
     orientation: 'horizontal',
@@ -134,8 +135,15 @@
         }
     });
 
+    var currentTimeText = new PIXI.Text('-- : -- : --', { font: '40pt Arial', fill: '#646464' });
+    console.log(currentTimeText);
+    currentTimeText.x = -currentTimeText.width - 60; 
+    currentTimeText.y = sceneHeight - currentTimeText.height - 30;
+    this.container.addChild(currentTimeText);
+    
+    
     if(!isHorizontal) {
-        this.container.rotation = Math.PI/2;
+        this.container.rotation = Math.PI/2; 
         this.container.y = sceneHeight;
         this.container.x = sceneWidth;
     }
@@ -148,7 +156,10 @@
         });
 
     };
-
+    
+    this.updateTime = function(){
+        currentTimeText.setText(Utils.formatTime(Date.now()));
+    };
 
     this.addNotes = function(data) {
 
@@ -165,9 +176,11 @@
 
     // Init page and intervals
     var startTs;
+    var refreshTimeInterval;
 
     this.start = function() {
-
+    	refreshTimeInterval = setInterval(function() {_this.updateTime();}, 1000);
+    	
         startTs = Date.now();
         pianorollList.forEach(function(c) {
             c.start();