author | rougeronj |
Wed, 21 Jan 2015 20:16:31 +0100 | |
changeset 103 | 123a611c7903 |
parent 100 | 0d7dac03c1a0 |
child 104 | 685c5ebc59d0 |
permissions | -rw-r--r-- |
98 | 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>AnnotsRoll</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 pianorollChannel = 'PIANOROLL'; |
|
30 |
var annotationChannel = 'ANNOT'; |
|
31 |
var eventCode = 'test_1'; |
|
32 |
var wsUri; |
|
33 |
if (window.location.protocol === 'file:') { |
|
34 |
wsUri = 'ws://127.0.0.1:8090/broadcast'; |
|
35 |
} |
|
36 |
else { |
|
37 |
wsUri = 'ws://' + window.location.hostname + ':8090/broadcast'; |
|
38 |
} |
|
39 |
wsUriPianoroll = wsUri + '?channel=' + pianorollChannel + '&event_code=' + eventCode; |
|
40 |
wsUriAnnotation = wsUri + '?channel=' + annotationChannel + '&event_code=' + eventCode; |
|
41 |
||
42 |
var logger = new annotviz.ConsoleLogger(true); |
|
100
0d7dac03c1a0
Merge with 72d767c5142df7fc6387215096321295fbaaa73d
rougeronj
parents:
98
diff
changeset
|
43 |
|
0d7dac03c1a0
Merge with 72d767c5142df7fc6387215096321295fbaaa73d
rougeronj
parents:
98
diff
changeset
|
44 |
var stageView = new annotviz.StageView({ |
0d7dac03c1a0
Merge with 72d767c5142df7fc6387215096321295fbaaa73d
rougeronj
parents:
98
diff
changeset
|
45 |
logger: logger |
0d7dac03c1a0
Merge with 72d767c5142df7fc6387215096321295fbaaa73d
rougeronj
parents:
98
diff
changeset
|
46 |
}); |
98 | 47 |
|
48 |
var doubleroll = new annotviz.DoubleRoll({ |
|
100
0d7dac03c1a0
Merge with 72d767c5142df7fc6387215096321295fbaaa73d
rougeronj
parents:
98
diff
changeset
|
49 |
stageView : stageView, |
0d7dac03c1a0
Merge with 72d767c5142df7fc6387215096321295fbaaa73d
rougeronj
parents:
98
diff
changeset
|
50 |
logger: logger, |
98 | 51 |
ws: new annotviz.WsWrapper(wsUriPianoroll, logger), |
52 |
orientation: 'vertical', |
|
53 |
sceneHeight: 1080, |
|
54 |
pianorolls : [ |
|
55 |
{ |
|
56 |
height: 435, |
|
57 |
timeWidth: 60, |
|
58 |
lineInterval: 5000, |
|
59 |
noteHeight: undefined |
|
60 |
}, |
|
61 |
] |
|
62 |
}); |
|
63 |
||
64 |
var annotsroll = new annotviz.AnnotsRoll({ |
|
100
0d7dac03c1a0
Merge with 72d767c5142df7fc6387215096321295fbaaa73d
rougeronj
parents:
98
diff
changeset
|
65 |
stageView : stageView, |
98 | 66 |
logger: logger, |
67 |
ws: new annotviz.WsWrapper(wsUriAnnotation, logger), |
|
68 |
parentContainer: doubleroll.stage, |
|
69 |
xInit: 1920 - 435 - 300, |
|
70 |
yInit: 1080, |
|
103 | 71 |
width: 435 + 300, |
98 | 72 |
height: 1080, |
73 |
widthRoll: 300, |
|
74 |
framerate: doubleroll.framerate, |
|
75 |
pixelsPerSecond: Math.floor(1920 / 60), |
|
76 |
annotColors: [{ts: 0, colors: {'ntm' : '#cdc83f'}}], |
|
77 |
}); |
|
78 |
||
79 |
function stop() { |
|
100
0d7dac03c1a0
Merge with 72d767c5142df7fc6387215096321295fbaaa73d
rougeronj
parents:
98
diff
changeset
|
80 |
stageView.stop(); |
98 | 81 |
} |
82 |
function start() { |
|
100
0d7dac03c1a0
Merge with 72d767c5142df7fc6387215096321295fbaaa73d
rougeronj
parents:
98
diff
changeset
|
83 |
stageView.start(); |
98 | 84 |
} |
85 |
||
86 |
window.onload = function() { |
|
100
0d7dac03c1a0
Merge with 72d767c5142df7fc6387215096321295fbaaa73d
rougeronj
parents:
98
diff
changeset
|
87 |
stageView.init(); |
98 | 88 |
start(); |
89 |
} |
|
90 |
</script> |
|
91 |
</body> |
|
92 |
</html> |