client/annotviz/app/js/annotsvizview.js
author rougeronj
Fri, 23 Jan 2015 00:10:09 +0100
changeset 127 0386fb9efe27
parent 126 13d9a532a0a7
child 128 9f2334598088
permissions -rw-r--r--
Merge with b5697bcdbaffd1d52ea785e6276bc70422bf1286
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
98
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
/**
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
* js/annotsvizview.js
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
*
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
* This is the starting point for your application.
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
* Take a look at http://browserify.org/ for more info
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
*/
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
     7
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
     8
'use strict';
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
     9
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    10
var PIXI = require('pixi');
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    11
var _ = require('lodash');
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    12
var DoubleRoll = require('./doubleroll.js');
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    13
var AnnotsTimeLine = require('./annotstimeline.js');
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    14
var AnnotsRoll = require('./annotsroll.js');
121
df6b39f962bc Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents: 113
diff changeset
    15
var Utils = require('./utils.js');
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    16
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    17
var defaultOptions = {
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    18
    xInit: 0,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    19
    yInit: 0,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
    20
    width: 1024,
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    21
    height: 768
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    22
};
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    23
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    24
function AnnotsVizView(options){
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    25
	var _this = this;
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    26
    var opts = _(options).defaults(defaultOptions).value();
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    27
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    28
    this.container = new PIXI.DisplayObjectContainer();
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    29
    this.container.x = opts.xInit;
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    30
    this.container.y = opts.yInit;
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    31
	this.width = opts.width;
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    32
	this.height= opts.height;
113
7531e4180915 Minor time correction
rougeronj
parents: 110
diff changeset
    33
    this.timeBegin = opts.timeBegin;
7531e4180915 Minor time correction
rougeronj
parents: 110
diff changeset
    34
    this.timeEnd = opts.timeEnd;
121
df6b39f962bc Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents: 113
diff changeset
    35
    
df6b39f962bc Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents: 113
diff changeset
    36
    Utils.getAnnotCategories(opts.urlCategories, this.annotCategories);
df6b39f962bc Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents: 113
diff changeset
    37
    
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    38
	var wsPianoroll = opts.wsPianoroll;
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    39
	var wsAnnot = opts.wsAnnot;
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    40
	var stageView = opts.stageView;
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    41
	var currentTime = Date.now() + 3600*1000;
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    42
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    43
	stageView.registerComponent(this);
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    44
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    45
	var timeLineDay2 = new AnnotsTimeLine.AnnotsTimeLine({
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    46
    	stageView : stageView,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    47
        logger: logger,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    48
        ws: new annotviz.WsWrapper(wsUriAnnotation, logger),
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    49
        xInit: 0,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    50
        yInit: 0,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
    51
        width: 1024 - 200 - 200,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    52
        height: 768-200,
113
7531e4180915 Minor time correction
rougeronj
parents: 110
diff changeset
    53
        timeBegin: this.timeBegin,
7531e4180915 Minor time correction
rougeronj
parents: 110
diff changeset
    54
        timeEnd: this.timeEnd,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    55
        intervalWidth: 6,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    56
        intervalHeight: 10,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    57
        maxCellHeight: 70,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
    58
        radius: 200,
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    59
        annotCategories: this.annotCategories
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    60
    });
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    61
	
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    62
    
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    63
    var timeLineDay1 = new AnnotsTimeLine.AnnotsTimeLine({
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    64
    	stageView : stageView,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    65
        logger: logger,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    66
        ws: new annotviz.WsWrapper(wsUriAnnotation, logger),
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    67
        xInit: 0,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    68
        yInit: 0,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    69
        width: 1024 - 200 - 200,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    70
        height: 768-200,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    71
        timeBegin: this.timeBegin,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    72
        timeEnd: this.timeEnd,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    73
        circleX: timeLineDay2.circleX,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    74
        circleY: timeLineDay2.circleY,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    75
        intervalWidth: (timeLineDay2.radius*2/3)* timeLineDay2.intervalWidth / timeLineDay2.radius,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    76
        intervalHeight: (timeLineDay2.intervalHeight * (timeLineDay2.radius - timeLineDay2.radius*2/3))/ timeLineDay2.maxCellHeight,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    77
        maxCellHeight: (timeLineDay2.radius - timeLineDay2.radius*2/3)/4,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    78
        radius: timeLineDay2.radius*2/3,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    79
        annotCategories: this.annotCategories,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    80
        showClockGraphics:false
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    81
    });
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    82
    
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    83
    var currentTimeText = new PIXI.Text("-- : -- : --", { font: '18pt Gothic Standard', fill: '#646464' });
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    84
    currentTimeText.x = timeLineDay2.circleX - currentTimeText.width/2;
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    85
    currentTimeText.y = timeLineDay2.circleY - currentTimeText.height/2;
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    86
    this.container.addChild(currentTimeText);
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    87
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    88
    var timeLineDay3 = new PIXI.Graphics();
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    89
    timeLineDay3.lineStyle(1, 0x646464)
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    90
    	.drawCircle(timeLineDay2.circleX, timeLineDay2.circleY, timeLineDay2.radius/3)
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    91
    	.endFill()
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    92
    this.container.addChild(timeLineDay3);
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    93
    
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    94
	var doubleRollH = new DoubleRoll.DoubleRoll({
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    95
        stageView : stageView,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    96
    	logger: logger,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    97
        ws: wsPianoroll,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    98
        yInit: (this.height - 200),
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    99
        sceneHeight: 200,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   100
        pianorolls : [
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   101
            {
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   102
                height: 200,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   103
                timeWidth: 10,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   104
                lineInterval: 5000,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   105
                noteHeight: 10
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   106
            },
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   107
        ]
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   108
    });
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   109
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   110
	var doubleRollV = new DoubleRoll.DoubleRoll({
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   111
        stageView : stageView,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   112
    	logger: logger,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   113
        ws: wsPianoroll,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   114
        orientation: 'vertical',
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   115
        sceneHeight: 768-200,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   116
        pianorolls : [
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   117
            {
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
   118
                height: 200,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   119
                timeWidth: 60,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   120
                lineInterval: 5000,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   121
                noteHeight: 5,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   122
            },
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   123
        ]
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   124
    });
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   125
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   126
	var annotsRoll = new AnnotsRoll.AnnotsRoll({
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   127
    	stageView : stageView,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   128
        logger: logger,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   129
        ws: wsAnnot,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   130
        parentContainer: doubleRollV.stage,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
   131
        xInit: 1024 - 200 - 200,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   132
        yInit: 768-200,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
   133
        width: 200 + 200,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   134
        height: 768-200,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
   135
        widthRoll: 200,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   136
        framerate: doubleRollV.framerate,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   137
        pixelsPerSecond: Math.floor(1024 / 60),
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   138
        annotColors: this.annotCategories
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   139
    });
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   140
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   141
	var limiters = new PIXI.Graphics()
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   142
		.lineStyle(1, 0x646464)
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   143
		.moveTo(annotsRoll.container.x, annotsRoll.container.y)
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   144
		.lineTo(annotsRoll.container.x, annotsRoll.container.y - annotsRoll.height)
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   145
		.moveTo(annotsRoll.container.x + annotsRoll.widthRoll, annotsRoll.container.y)
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   146
		.lineTo(annotsRoll.container.x + annotsRoll.widthRoll, annotsRoll.container.y - annotsRoll.height)
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   147
		.moveTo(0, this.height - 200)
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   148
		.lineTo(this.width, this.height - 200)
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   149
		.drawRect(0, 0, this.width -1, this.height -1)
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   150
		.beginFill(0xECECEC)
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   151
		.drawRect(1024 - 200, 0, 200, 768-200)
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   152
		.endFill();
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   153
	this.container.addChild(limiters);
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   154
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   155
//	var doubleRollV = new DoubleRoll.DoubleRoll({});
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   156
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   157
	this.init = function(){
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   158
	};
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   159
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   160
	this.updateTime = function(){
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   161
    	currentTime = Date.now() + 3600*1000;
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   162
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   163
        var nbSec = currentTime / 1000;
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   164
        var hours = Math.floor( nbSec / 3600 ) % 24;
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   165
        var minutes = Math.floor( nbSec / 60 ) % 60;
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   166
        var seconds = Math.floor(nbSec % 60);
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   167
        var timeStr = (hours < 10 ? '0' + hours : hours) + ':' + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds  < 10 ? '0' + seconds : seconds);
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   168
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   169
        currentTimeText.setText(timeStr);
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   170
    };
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   171
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   172
    var refreshTimeInterval;
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   173
    
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   174
	this.start = function() {
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   175
		refreshTimeInterval = setInterval(function() {_this.updateTime();}, 1000);
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   176
    };
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   177
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   178
    this.refresh = function() {
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   179
    };
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   180
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   181
    this.stop = function(){
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   182
    };
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   183
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   184
    return this;
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   185
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   186
}
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   187
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   188
module.exports = {
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   189
	AnnotsVizView: AnnotsVizView
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   190
};