author | rougeronj |
Thu, 22 Jan 2015 15:03:58 +0100 | |
changeset 121 | df6b39f962bc |
parent 117 | c0034b35c44e |
child 122 | 3b11017a76a4 |
permissions | -rw-r--r-- |
103 | 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>AnnotsVizView</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 |
<!--pre id="log"></pre--> |
|
21 |
<script src="/js/libs-annotviz.js"></script> |
|
22 |
<script src="/js/annotviz.js"></script> |
|
23 |
<script> |
|
108 | 24 |
|
25 |
var PIXI = require('pixi'); |
|
26 |
||
27 |
function colorToHex(input) { |
|
28 |
if (input.substring(0, 1) === '#') { |
|
29 |
return input; |
|
30 |
} |
|
31 |
else { |
|
32 |
var m = input.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i); |
|
33 |
var r = m[1], g=[2], b=[3]; |
|
34 |
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1); |
|
35 |
} |
|
36 |
} |
|
37 |
||
103 | 38 |
var pianorollChannel = 'PIANOROLL'; |
39 |
var annotationChannel = 'ANNOT'; |
|
121
df6b39f962bc
Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents:
117
diff
changeset
|
40 |
var eventCode = 'atelier2'; |
df6b39f962bc
Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents:
117
diff
changeset
|
41 |
var serverUrl = "http://172.16.0.20:8080"; |
103 | 42 |
var wsUri; |
121
df6b39f962bc
Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents:
117
diff
changeset
|
43 |
|
105
25ac8802c189
Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents:
104
diff
changeset
|
44 |
if (window.location.protocol === 'file:') { |
104 | 45 |
wsUri = 'ws://172.16.0.20:8090/broadcast'; |
105
25ac8802c189
Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents:
104
diff
changeset
|
46 |
} |
25ac8802c189
Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents:
104
diff
changeset
|
47 |
else { |
25ac8802c189
Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents:
104
diff
changeset
|
48 |
wsUri = 'ws://' + window.location.hostname + ':8090/broadcast'; |
25ac8802c189
Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents:
104
diff
changeset
|
49 |
} |
103 | 50 |
wsUriPianoroll = wsUri + '?channel=' + pianorollChannel + '&event_code=' + eventCode; |
51 |
wsUriAnnotation = wsUri + '?channel=' + annotationChannel + '&event_code=' + eventCode; |
|
108 | 52 |
|
103 | 53 |
var logger = new annotviz.ConsoleLogger(true); |
108 | 54 |
|
103 | 55 |
var stageView = new annotviz.StageView({ |
56 |
logger: logger |
|
57 |
}); |
|
58 |
||
108 | 59 |
|
103 | 60 |
var annotsvizview = new annotviz.AnnotsVizView({ |
121
df6b39f962bc
Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents:
117
diff
changeset
|
61 |
urlCategories: serverUrl + "/p/api/v1/event/" + eventCode, |
103 | 62 |
logger: logger, |
63 |
stageView: stageView, |
|
64 |
wsPianoroll: new annotviz.WsWrapper(wsUriPianoroll, logger), |
|
65 |
wsAnnot: new annotviz.WsWrapper(wsUriAnnotation, logger), |
|
113 | 66 |
timeBegin: 1421919000000, |
67 |
timeEnd: 1421951400000 |
|
103 | 68 |
}); |
108 | 69 |
|
103 | 70 |
|
71 |
function stop() { |
|
72 |
stageView.stop(); |
|
73 |
} |
|
74 |
function start() { |
|
75 |
stageView.start(); |
|
76 |
} |
|
77 |
||
78 |
window.onload = function() { |
|
79 |
stageView.init(); |
|
80 |
start(); |
|
81 |
} |
|
82 |
</script> |
|
83 |
</body> |
|
84 |
</html> |