-
Notifications
You must be signed in to change notification settings - Fork 69
/
vvvv.min.js
620 lines (620 loc) · 320 KB
/
vvvv.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
var VVVV_ENV="production",vvvvjs_jquery=$.noConflict();$=vvvvjs_jquery;
(function(k){k.ajaxPrefilter(function(b,g,h){if("script"==b.dataType||"script"==g.dataType)b.cache=!0});window.console||(window.console={log:function(b){}});VVVV={Nodes:{},PinTypes:{},Types:{},NodeLibrary:{},NodeNames:[],Patches:{},Editors:{},onLowFrameRate:function(){},onNotImplemented:function(b){console.log("Warning: "+b+" is not implemented.")},loadCounter:0,loadScript:function(b,g){var h=document.getElementsByTagName("head")[0],c=document.createElement("script");c.async=!1;c.src=VVVV.Root+"/"+
b;g&&c.addEventListener("load",g);VVVV.loadCounter++;h.appendChild(c)},init:function(b,g,h){function c(){var f=new VVVV.Core.Patch("");_(VVVV.Nodes).each(function(a){var e=new a(0,f);"development"==VVVV_ENV&&console.log("Registering "+e.nodename);VVVV.NodeLibrary[e.nodename.toLowerCase()]=a;VVVV.NodeNames.push(e.nodename)});"development"==VVVV_ENV&&console.log("done ...");VVVV.MainLoops=[];k("link[rel='VVVV'], script[language='VVVV']").each(function(a){var e="href";"SCRIPT"==k(this).get(0).tagName&&
("development"==VVVV_ENV&&console.warn('DEPRECATED: loading patches via <script language="VVVV" src="..."> tag is deprecated. Use <link rel="VVVV" href="..."> instead.'),e="src");e=new VVVV.Core.Patch(k(this).attr(e),function(){var a=new VVVV.Core.MainLoop(this);VVVV.MainLoops.push(a)});VVVV.Patches[a]=e});"function"===typeof h&&h.call()}VVVV.Root=b||"./";"development"==VVVV_ENV&&console.log("loading vvvv.js ...");if("development"==VVVV_ENV){var d=function(f){f.target.removeEventListener("load",d);
0>=--VVVV.loadCounter&&c()};document.getElementsByTagName("head");0==k("script[src*=thirdparty]").length&&VVVV.loadScript("thirdparty.js",d);0==k("script[src*=underscore]").length&&VVVV.loadScript("lib/underscore/underscore-min.js",d);0!=k('script[src*="d3.js"]').length||"full"!=g&&"vvvviewer"!=g||VVVV.loadScript("lib/d3-v3/d3.v3.min.js",d);0!=k("script[src*=glMatrix]").length||"full"!=g&&"run"!=g||VVVV.loadScript("lib/glMatrix-0.9.5.min.js",d);if(0==k('script[src*="vvvv.core.js"]').length){VVVV.loadScript("core/vvvv.core.js",
d);if("run"==g||"full"==g)VVVV.loadScript("mainloop/vvvv.mainloop.js",d),VVVV.loadScript("mainloop/vvvv.dominterface.js",d),VVVV.loadScript("types/vvvv.shared_types.js",d),VVVV.loadScript("nodes/vvvv.nodes.value.js",d),VVVV.loadScript("nodes/vvvv.nodes.string.js",d),VVVV.loadScript("nodes/vvvv.nodes.boolean.js",d),VVVV.loadScript("nodes/vvvv.nodes.color.js",d),VVVV.loadScript("nodes/vvvv.nodes.spreads.js",d),VVVV.loadScript("nodes/vvvv.nodes.spectral.js",d),VVVV.loadScript("nodes/vvvv.nodes.animation.js",
d),VVVV.loadScript("nodes/vvvv.nodes.network.js",d),VVVV.loadScript("nodes/vvvv.nodes.system.js",d),VVVV.loadScript("nodes/vvvv.nodes.canvas.js",d),VVVV.loadScript("nodes/vvvv.nodes.html5.js",d),VVVV.loadScript("nodes/vvvv.nodes.audio.js",d),VVVV.loadScript("nodes/vvvv.nodes.transform.js",d),VVVV.loadScript("nodes/vvvv.nodes.vectors.js",d),VVVV.loadScript("nodes/vvvv.nodes.webgl.js",d),VVVV.loadScript("nodes/vvvv.nodes.complex.js",d),VVVV.loadScript("nodes/vvvv.nodes.enumerations.js",d),VVVV.loadScript("nodes/vvvv.nodes.2d.js",
d),VVVV.loadScript("nodes/vvvv.nodes.3d.js",d),VVVV.loadScript("nodes/vvvv.nodes.node.js",d),VVVV.loadScript("nodes/vvvv.nodes.astronomy.js",d),VVVV.loadScript("nodes/vvvv.nodes.xml.js",d),VVVV.loadScript("nodes/vvvv.nodes.differential.js",d),VVVV.loadScript("nodes/vvvv.nodes.xelement.js",d),VVVV.loadScript("nodes/vvvv.nodes.html.js",d),VVVV.loadScript("vvvv.makros.js",d);VVVV.loadScript("editors/vvvv.editors.browser_editor.js",d)}}"production"==VVVV_ENV&&c()}}})(vvvvjs_jquery);(function(k){VVVV.MousePositions={_all:{x:[0],y:[0],wheel:[0],lb:[0],mb:[0],rb:[0]}};VVVV.PinDirection={Input:0,Output:1,Configuration:2};VVVV.PinTypes.Generic={typeName:"Generic",reset_on_disconnect:!0,defaultValue:function(){return"0"}};VVVV.PinTypes.Value={typeName:"Value",reset_on_disconnect:!1,defaultValue:function(){return 0},primitive:!0};VVVV.PinTypes.String={typeName:"String",reset_on_disconnect:!1,defaultValue:function(){return""},primitive:!0};VVVV.PinTypes.Enum={typeName:"Enum",reset_on_disconnect:!1,
defaultValue:function(){return""},primitive:!0};VVVV.Helpers={translateOperators:function(b){b=b.replace("Add","+");b=b.replace("Subtract","-");b=b.replace("Multiply","*");b=b.replace("Divide","/");b=b.replace("EQ","=");b=b.replace("GT",">");b=b.replace("GTE",">=");b=b.replace("LT","<");return b=b.replace("LTE","<=")},prepareFilePath:function(b,g){b=b.replace(/\\/g,"/");return b.match(/^%VVVV%/)?b.replace("%VVVV%",VVVV.Root):b.match(/^%PAGE%/)?b.replace("%PAGE%",location.pathname):b.match(/^(\/|.+:\/\/)/)?
b:g?g.getAbsolutePath()+b:b},dynamicPins:function(b,g,h,c){for(var d=g.length;d<h;d++)g[d]=c.call(b,d);for(d=h;d<g.length;d++)b.removeInputPin(g[d].pinname);g.length=h;b.parentPatch.afterUpdate()}};VVVV.Core={Pin:function(b,g,h,c,d){this.direction=g;this.pinname=b;this.links=[];this.values=[];this.values.changedAt=0;this.node=c;this.reset_on_disconnect=this.active=!1;this.masterPin=this.slavePin=void 0;this.connectionChangedHandlers={};this.enumOptions=[];this.getValue=function(f,a){if(!a||1==a)return this.values[f%
this.values.length];for(var e=[],d=0;d<a;d++)e.push(this.values[(f*a+d)%this.values.length]);return e};this.setValue=function(f,a){this.direction!=VVVV.PinDirection.Output&&this.isConnected()||(this.typeName&&VVVV.PinTypes[this.typeName].primitive&&this.values[f]==a&&"Color"!=this.typeName||this.markPinAsChanged(),this.values[f]=a);this.node.isIOBox&&"Descriptive Name"==this.pinname&&this.node.invisiblePins["Descriptive Name"]&&(this.node.parentPatch.domInterface?this.node.parentPatch.domInterface.connect(this.node):
this.node.parentPatch.parentPatch&&this.node.registerInterfacePin())};this.markPinAsChanged=function(){this.node.parentPatch.mainloop&&(this.values.changedAt=this.node.parentPatch.mainloop.frameNum)};this.pinIsChanged=function(){return this.node.parentPatch.mainloop?this.values.changedAt==this.node.parentPatch.mainloop.frameNum:!0};this.connect=function(f){this.values=f.values;if(this.direction==VVVV.PinDirection.Output){f=this.links.length;for(var a=0;a<f;a++)this.links[a].toPin.values=this.values}this.slavePin&&
(this.slavePin.values=this.values);this.markPinAsChanged()};this.disconnect=function(){if("Color"==this.typeName){for(var f=[],a=0;a<this.values.length;a++)f[a]=new VVVV.Types.Color("0,0,0,0"),this.values[a].copy_to(f[a]);this.values=f}else this.values=this.values.slice(0);this.slavePin&&(this.slavePin.values=this.values);this.markPinAsChanged()};this.isConnected=function(){return 0<this.links.length||this.masterPin&&this.masterPin.isConnected()||this.slavePin&&0<this.slavePin.links.length};this.getSliceCount=
function(){return this.values.length};this.setSliceCount=function(f){0>f&&(f=0);this.values.length!=f&&(this.direction!=VVVV.PinDirection.Output&&this.isConnected()||(this.values.length=f),this.markPinAsChanged())};this.setType=function(f){if(f.typeName!=this.typeName){var a=this;delete this.connectionChangedHandlers.webglresource;_(f.connectionChangedHandlers).each(function(e,d){a.connectionChangedHandlers[d]=f.connectionChangedHandlers[d]});this.typeName=f.typeName;this.defaultValue=f.defaultValue;
this.direction==VVVV.PinDirection.Input&&this.defaultValue&&!this.isConnected()&&(this.setValue(0,this.defaultValue()),this.setSliceCount(1));void 0!=f.reset_on_disconnect&&(this.reset_on_disconnect=f.reset_on_disconnect)}};void 0==d&&(d=VVVV.PinTypes.Generic);d==VVVV.PinTypes.Generic&&(this.unvalidated=!0);this.setType(d);if(h&&0<h.length)for(b=h.length;b--;)this.setValue(b,h[b]);this.reset=function(){this.values=[];this.slavePin&&(this.slavePin.values=this.values);this.defaultValue?(this.setValue(0,
this.defaultValue()),this.setSliceCount(1)):(this.values=h.slice(0),this.markPinAsChanged());this.markPinAsChanged()};this.connectionChanged=function(){var f=this;_(this.connectionChangedHandlers).each(function(a){a.call(f)})};this.generateStaticCode=function(f){for(var a="",e="if (",d="if (",c=0;c<this.values.incomingPins.length;c++)var h=this.values.incomingPins[c],e=e+("patch.nodeMap["+h.node.id+"].inputPins['"+h.pinname+"'].pinIsChanged() || "),d=d+("patch.nodeMap["+h.node.id+"].inputPins['"+
h.pinname+"'].values[0]==undefined || "),a="Math.max(patch.nodeMap["+h.node.id+"].inputPins['"+h.pinname+"'].getSliceCount(), "+a;d+="false) { patch.nodeMap["+this.node.id+"].outputPins['Output'].setSliceCount(0); }\n else {";a+="0)";for(c=0;c<this.values.incomingPins.length-1;c++)a+=")";f&&(d+=e+"false) {\n");d=d+" var iii = "+(a+";\n");d+=" patch.nodeMap["+this.node.id+"].outputPins['Output'].setSliceCount(iii);";d+=" while (iii--) {\n";d+=" patch.nodeMap["+this.node.id+"].outputPins['Output'].setValue(iii, "+
this.values.code+");\n";d+=" }\n";f&&(d+="}\n");return d+="}\n"}},Node:function(b,g,h){this.nodename=g;this.id=b;this.height=this.width=this.y=this.x=0;this.isShader=this.isIOBox=!1;this.resourcesPending=0;this.auto_nil=!0;this.setupObject=function(){this.inputPins={};this.outputPins={};this.invisiblePins={};this.defaultPinValues={}};this.setupObject();this.delays_output=this.auto_evaluate=!1;this.dirty=!0;(this.parentPatch=h)&&(this.parentPatch.nodeMap[b]=this);this.addDefault=function(c,d){this.defaultPinValues[c]=
d};this.addInputPin=function(c,d,f){f=f||VVVV.PinTypes.Generic;d=new VVVV.Core.Pin(c,VVVV.PinDirection.Input,d,this,f);this.inputPins[c]=d;this.parentPatch&&(this.parentPatch.pinMap[this.id+"_in_"+c]=d);this.applyPinValuesFromXML(c);return d};this.addOutputPin=function(c,d,f){f=f||VVVV.PinTypes.Generic;d=new VVVV.Core.Pin(c,VVVV.PinDirection.Output,d,this,f);this.outputPins[c]=d;this.parentPatch&&(this.parentPatch.pinMap[this.id+"_out_"+c]=d);return d};this.removeInputPin=function(c){if(this.inputPins[c]){var d=
this.inputPins[c].links[0];d&&(d.fromPin.connectionChanged(),d.destroy());delete this.inputPins[c];this.dirty=!0}};this.removeOutputPin=function(c){if(this.outputPins[c]){for(var d=this.outputPins[c].links.length,f=0;f<d;f++){var a=this.outputPins[c].links[f];a.toPin.connectionChanged();a.destroy()}delete this.outputPins[c];this.dirty=!0}};this.addInvisiblePin=function(c,d,f){f=f||VVVV.PinTypes.Generic;d=new VVVV.Core.Pin(c,VVVV.PinDirection.Configuration,d,this,f);this.invisiblePins[c]=d;this.parentPatch.pinMap[this.id+
"_inv_"+c]=d;void 0!=this.defaultPinValues[c]&&(d.values=this.defaultPinValues[c],d.markPinAsChanged());return d};this.IOBoxType=function(){var c=/^IOBox \((.*)\)/.exec(this.nodename);return c&&1<c.length?c[1]:""};this.IOBoxInputPin=function(){switch(this.IOBoxType()){case "Value Advanced":return this.inputPins["Y Input Value"];case "String":return this.inputPins["Input String"];case "Color":return this.inputPins["Color Input"];case "Node":return this.inputPins["Input Node"]}};this.IOBoxOutputPin=
function(){switch(this.IOBoxType()){case "Value Advanced":return this.outputPins["Y Output Value"];case "String":return this.outputPins["Output String"];case "Color":return this.outputPins["Color Output"];case "Node":return this.outputPins["Output Node"]}};this.IOBoxRows=function(){return this.invisiblePins.Rows?this.invisiblePins.Rows.getValue(0):1};this.isComment=function(){return this.isIOBox&&0==_(this.outputPins).size()};this.label=function(){if(this.isIOBox)return this.IOBoxInputPin().getValue(0)?
this.IOBoxInputPin().getValue(0).toString():"";if(this.isSubpatch)return"||"+this.nodename.match(/([^\/]+)\.v4p$/)[1];var c=this.nodename.replace(/\s\(.+\)/,"");return c=VVVV.Helpers.translateOperators(c)};this.getWidth=function(){var c;c=100==this.width||0==this.width?this.isIOBox?60:Math.max(18,6*(this.label().length+2)):this.width/15;return c=Math.max(c,12*(_(this.inputPins).size()-1)+4)};this.getHeight=function(){return this.isIOBox&&100==this.height?18*this.IOBoxRows():100==this.height||this.isSubpatch?
18:Math.max(18,this.height/15)};this.getUpstreamNodes=function(){var c=[];_(this.inputPins).each(function(d){0<d.links.length&&c.push(d.links[0].fromPin.node)});return c};this.getDownstreamNodes=function(){var c=[];_(this.outputPins).each(function(d){for(var f=0;f<d.links.length;f++)c.push(d.links[f].toPin.node)});return c};this.findDownstreamNodes=function(c){var d=[];_(this.outputPins).each(function(f){for(var a=0;a<f.links.length;a++)f.links[a].toPin.node.nodename==c?d.push(f.links[a].toPin.node):
d=f.links[a].toPin.slavePin?d.concat(f.links[a].toPin.slavePin.node.findDownstreamNodes(c)):f.links[a].toPin.node.isIOBox&&f.links[a].toPin.node.IOBoxOutputPin().slavePin?d.concat(f.links[a].toPin.node.IOBoxOutputPin().slavePin.node.findDownstreamNodes(c)):d.concat(f.links[a].toPin.node.findDownstreamNodes(c))});return d};this.hasNilInputs=function(){var c=!1;_(this.inputPins).each(function(d){if(0==d.getSliceCount()||void 0==d.values[0])c=!0});return c};this.isDirty=function(){if(this.dirty)return!0;
for(var c in this.inputPins)if(this.inputPins[c].pinIsChanged())return!0;for(c in this.invisiblePins)if(this.invisiblePins[c].pinIsChanged())return!0;return!1};this.getMaxInputSliceCount=function(){var c=0,d;for(d in this.inputPins)this.inputPins[d].getSliceCount()>c&&(c=this.inputPins[d].values.length);return c};this.applyPinValuesFromXML=function(c){if(this.inputPins[c]){var d=this.inputPins[c];c=this.defaultPinValues[c];if(void 0!=c&&(!d.reset_on_disconnect||1<c.length||""!=c[0])){for(var f=0;f<
c.length;f++)d.values[f]!=c[f]&&("Color"==d.typeName?d.setValue(f,new VVVV.Types.Color(c[f])):"Value"==d.typeName?d.setValue(f,parseFloat(c[f])):d.setValue(f,c[f]));d.setSliceCount(c.length)}}};this.registerInterfacePin=function(){var c=this;if(this.isIOBox&&this.parentPatch.parentPatch&&""!=this.invisiblePins["Descriptive Name"].getValue(0)){var d=this.invisiblePins["Descriptive Name"].getValue(0);this.IOBoxInputPin().connectionChangedHandlers.subpatchpins=function(){if(0<this.links.length&&this.masterPin){"development"==
VVVV_ENV&&console.log("deleting "+d+" input pin because node has input connection...");for(var f=0;f<this.masterPin.links.length;f++)this.masterPin.links[f].destroy();this.disconnect();c.parentPatch.removeInputPin(d);this.masterPin=void 0}0==c.IOBoxOutputPin().links.length&&(c.IOBoxOutputPin().slavePin?c.IOBoxOutputPin().slavePin.pinname!=d&&("development"==VVVV_ENV&&console.log("renaming "+c.IOBoxOutputPin().slavePin.pinname+" to "+d),c.parentPatch.outputPins[d]=c.parentPatch.outputPins[c.IOBoxOutputPin().slavePin.pinname],
c.parentPatch.removeOutputPin(c.IOBoxOutputPin().slavePin.pinname),c.IOBoxOutputPin().slavePin.pinname=d):("development"==VVVV_ENV&&console.log("interfacing output pin detected: "+d),f=c.parentPatch.outputPins[d],void 0==f&&(f=c.parentPatch.addOutputPin(d,c.IOBoxOutputPin().values)),f.setType(VVVV.PinTypes[c.IOBoxOutputPin().typeName]),c.IOBoxOutputPin().slavePin=f,f.masterPin=c.IOBoxOutputPin(),f.connect(c.IOBoxOutputPin())));this.node.parentPatch.parentPatch.afterUpdate()};this.IOBoxInputPin().connectionChanged();
this.IOBoxOutputPin().connectionChangedHandlers.subpatchpins=function(){if(0<this.links.length&&this.slavePin){"development"==VVVV_ENV&&console.log("deleting "+d+" output pin because node "+c.id+" has output connection...");for(var f=0;f<this.slavePin.links.length;f++)this.slavePin.links[f].destroy();this.slavePin.disconnect();c.parentPatch.removeOutputPin(d);this.slavePin=void 0}if(0==c.IOBoxInputPin().links.length)if(c.IOBoxInputPin().masterPin)c.IOBoxInputPin().masterPin.pinname!=d&&(console.log("renaming "+
c.IOBoxInputPin().masterPin.pinname+" to "+d),c.parentPatch.inputPins[d]=c.parentPatch.inputPins[c.IOBoxInputPin().masterPin.pinname],c.parentPatch.removeInputPin(c.IOBoxInputPin().masterPin.pinname),c.IOBoxInputPin().masterPin.pinname=d);else{"development"==VVVV_ENV&&console.log("interfacing input pin detected: "+d);var a=c.parentPatch.inputPins[d];void 0==a&&("development"==VVVV_ENV&&console.log("creating new input pin at parent patch, using IOBox values"),a=c.parentPatch.addInputPin(d,c.IOBoxInputPin().values));
var e=a.values.slice();a.setType(VVVV.PinTypes[c.IOBoxInputPin().typeName]);if(a.unvalidated&&VVVV.PinTypes[a.typeName].primitive&&!a.isConnected()){if("V"==a.typeName[0])for(f=0;f<e.length;f++)a.values[f]=parseFloat(e[f]);else a.values=e;a.markPinAsChanged()}a.unvalidated=!1;a.slavePin=c.IOBoxInputPin();c.IOBoxInputPin().masterPin=a;c.IOBoxInputPin().connect(a)}this.node.parentPatch.parentPatch.afterUpdate()};this.IOBoxOutputPin().connectionChanged()}};this.setup=function(){this.addInvisiblePin("Descriptive Name",
[""],VVVV.PinTypes.String)};this.initialize=function(){};this.evaluate=function(){_(this.outputPins).each(function(c){c.setValue(0,"not calculated")})};this.dealWithNilInput=function(){if(this.auto_nil&&!this.isSubpatch&&this.hasNilInputs()){for(pinname in this.outputPins)this.outputPins[pinname].setSliceCount(0);return!0}return!1};this.destroy=function(){this.isIOBox&&(this.IOBoxInputPin().masterPin&&(this.parentPatch.removeInputPin(this.IOBoxInputPin().masterPin.pinname),this.parentPatch.parentPatch.afterUpdate()),
this.IOBoxOutputPin().slavePin&&(this.parentPatch.removeOutputPin(this.IOBoxOutputPin().slavePin.pinname),this.parentPatch.parentPatch.afterUpdate()))};this.serialize=function(){var c=k("<NODE>");c.attr("id",this.id);c.attr("nodename",this.nodename);c.attr("systemname",this.nodename);this.shaderFile&&c.attr("filename",this.shaderFile.replace(".vvvvjs.fx",".fx").replace("%VVVV%/effects","%VVVV%/lib/nodes/effects"));this.isSubpatch&&(c.attr("filename",this.nodename),c.attr("systemname",this.nodename.match("(.*).v4p$")[1]));
this.isIOBox?c.attr("componentmode","InABox"):c.attr("componentmode","Hidden");var d=k("<BOUNDS>");this.isIOBox?d.attr("type","Box"):d.attr("type","Node");d.attr("left",parseInt(15*this.x));d.attr("top",parseInt(15*this.y));d.attr("width",parseInt(this.width));d.attr("height",parseInt(this.height));c.append(d);var f=this;_(this.inputPins).each(function(a){var e=k("<PIN>");e.attr("pinname",a.pinname);e.attr("visible","1");(!a.isConnected()||a.masterPin)&&VVVV.PinTypes[a.typeName].primitive&&f.defaultPinValues[a.pinname]&&
e.attr("values",_(f.defaultPinValues[a.pinname]).map(function(a){return"|"+a.toString().replace(/\|/g,"||")+"|"}).join(","));c.append(e)});_(this.invisiblePins).each(function(a){var e=k("<PIN>");e.attr("pinname",a.pinname);e.attr("visible","0");VVVV.PinTypes[a.typeName].primitive&&e.attr("values",_(a.values).map(function(a){return"|"+a.toString().replace(/\|/g,"||")+"|"}).join(","));c.append(e)});return c}},Link:function(b,g){this.fromPin=b;this.toPin=g;this.fromPin.links.push(this);this.toPin.links.push(this);
this.destroy=function(){this.fromPin.links.splice(this.fromPin.links.indexOf(this),1);this.toPin.links.splice(this.toPin.links.indexOf(this),1);this.fromPin.node.parentPatch.linkList.splice(this.fromPin.node.parentPatch.linkList.indexOf(this),1);this.toPin.disconnect();if(this.toPin.reset_on_disconnect)this.toPin.reset();else{this.toPin.node.defaultPinValues[this.toPin.pinname]=[];for(var h=this.toPin.getSliceCount();h--;)this.toPin.node.defaultPinValues[this.toPin.pinname][h]=this.toPin.values[h]}};
this.serialize=function(){var h=k("<LONK>");h.attr("srcnodeid",this.fromPin.node.id);h.attr("srcpinname",this.fromPin.pinname);h.attr("dstnodeid",this.toPin.node.id);h.attr("dstpinname",this.toPin.pinname);return h}},Patch:function(b,g,h,c,d){function f(a){if(void 0==a)return[];if("45_26">=this.vvvv_version)return separator=/\|/.test(a)?"|":",",a.split(separator).filter(function(a,e){return""!=a});for(var e=[],f="",d=!1,l=a.length,c=0;c<l;c++)","!=a[c]||d?"|"==a[c]?"|"!=a[c+1]||c+1==a.length-1?d=
!d:f+=a[++c]:f+=a[c]:(e.push(f),f="");e.push(f);return e}function a(){var a=window.location.hash.match("#([^/]+)/("+p.ressource+"|[0-9]+)$");a&&VVVV.Editors[a[1]]&&(a[2]==p.ressource||VVVV.Patches[a[2]]==p||VVVV.Patches.length==a[2])&&(console.log("launching editor ..."),(new VVVV.Editors[a[1]]).enable(p))}this.ressource=b;this.vvvv_version="45_26.1";this.boundingBox={width:0,height:0};this.windowHeight=this.windowWidth=500;this.pinMap={};this.nodeMap={};this.nodeList=[];this.linkList=[];this.pinList=
[];this.mainloop=this.compiledFunc=void 0;this.success=g;this.error=h;this.editor=void 0;this.setupObject();c&&(this.parentPatch=c);d&&(this.id=d);var e=!1;this.getAbsolutePath=function(){var a=this.getRelativePath();this.parentPatch&&(a=this.parentPatch.getAbsolutePath()+a);return a};this.getRelativePath=function(){return this.nodename.match(/(.*\/)?[^/]+\.v4p/)[1]||""};this.destroy=function(){for(var a=0;a<this.nodeList.length;a++)this.nodeList[a].destroy(),delete this.nodeMap[this.nodeList[a].id],
delete this.nodeList[a]};if("45_26">=this.vvvv_version)var l={},r={},n={},q={};var p=this;this.doLoad=function(a,e){function d(a){"complete"==h&&(r={});k(a).find('link[deleteme="pronto"]').each(function(){for(var a=!1,e=0;e<p.linkList.length;e++)p.linkList[e].fromPin.node.id==k(this).attr("srcnodeid")&&p.linkList[e].fromPin.pinname==k(this).attr("srcpinname")&&p.linkList[e].toPin.node.id==k(this).attr("dstnodeid")&&p.linkList[e].toPin.pinname==k(this).attr("dstpinname")&&(a=p.linkList[e]);if(a){"development"==
VVVV_ENV&&console.log("removing "+a.fromPin.pinname+" -> "+a.toPin.pinname);var e=a.fromPin,f=a.toPin;a.destroy();e.connectionChanged();f.connectionChanged();f.markPinAsChanged()}});k(a).find('link[deleteme!="pronto"]').each(function(){var a=p.pinMap[k(this).attr("srcnodeid")+"_out_"+k(this).attr("srcpinname")],e=p.pinMap[k(this).attr("dstnodeid")+"_in_"+k(this).attr("dstpinname")];void 0==a&&p.nodeMap[k(this).attr("srcnodeid")]&&(a=p.nodeMap[k(this).attr("srcnodeid")].addOutputPin(k(this).attr("srcpinname"),
void 0));void 0==e&&p.nodeMap[k(this).attr("dstnodeid")]&&(e=p.nodeMap[k(this).attr("dstnodeid")].addInputPin(k(this).attr("dstpinname"),void 0));if(a&&e){for(var f=!1,d=0;d<p.linkList.length;d++)p.linkList[d].fromPin.node.id==a.node.id&&p.linkList[d].fromPin.pinname==a.pinname&&p.linkList[d].toPin.node.id==e.node.id&&p.linkList[d].toPin.pinname==e.pinname&&(f=p.linkList[d]);f||(f=new VVVV.Core.Link(a,e),a.connectionChanged(),e.connectionChanged(),p.linkList.push(f),e.connect(a));"complete"==h&&(r[a.node.id+
"_"+a.pinname+"-"+e.node.id+"_"+e.pinname]=f)}});"complete"==h&&(_(l).each(function(a,e){if(void 0==r[e]){"development"==VVVV_ENV&&console.log("removing "+a.fromPin.pinname+" -> "+a.toPin.pinname);var f=a.fromPin,d=a.toPin;a.destroy();f.connectionChanged();d.connectionChanged();d.markPinAsChanged();d.reset_on_disconnect&&d.reset()}}),l={},_(r).each(function(a,e){l[e]=a}))}var c=this;do c.dirty=!0;while(c=c.parentPatch);if(c=/^<!DOCTYPE\s+PATCH\s+SYSTEM\s+"(.+)\\(.+)\.dtd/.exec(a))p.vvvv_version=c[2].replace(/[a-zA-Z]+/,
"_");var h="diff";if(/\s<PATCH/.test(a)||"45_26">=p.vvvv_version)h="complete","development"==VVVV_ENV&&console.log("complete: "+this.nodename);c=k(a).find('bounds[type="Window"]').first();0<c.length&&(p.windowWidth=c.attr("width")/15,p.windowHeight=c.attr("height")/15);"complete"==h&&(q={});k(a).find("node").each(function(){var l=void 0,c=!1;void 0!=p.nodeMap[k(this).attr("id")]&&("pronto"==k(this).attr("createme")?l=p.nodeMap[k(this).attr("id")]:c=!0);var r;r="InABox"==k(this).attr("componentmode")?
k(this).find('bounds[type="Box"]').first():k(this).find('bounds[type="Node"]').first();if(c)m=p.nodeMap[k(this).attr("id")];else{var n=""!=k(this).attr("systemname")?k(this).attr("systemname"):k(this).attr("nodename");if(void 0==n)return;if(void 0!=VVVV.NodeLibrary[n.toLowerCase()]){var m=new (VVVV.NodeLibrary[n.toLowerCase()])(k(this).attr("id"),p);VVVV.NodeLibrary[n.toLowerCase()].definingNode&&(m.definingNode=VVVV.NodeLibrary[n.toLowerCase()].definingNode,l?VVVV.NodeLibrary[n.toLowerCase()].definingNode.relatedNodes[VVVV.NodeLibrary[n.toLowerCase()].definingNode.relatedNodes.indexOf(l)]=
m:VVVV.NodeLibrary[n.toLowerCase()].definingNode.relatedNodes.push(m));VVVV.NodeLibrary[n.toLowerCase()].requirements&&_(VVVV.NodeLibrary[n.toLowerCase()].requirements).each(function(f){void 0===VVVV.LoadedLibs[f]&&(p.resourcesPending++,VVVV.loadScript(VVVV.ThirdPartyLibs[f],function(){p.resourcesPending--;VVVV.LoadedLibs[f]=VVVV.ThirdPartyLibs[f];d(a);p.afterUpdate();p.compile();0>=p.resourcesPending&&e&&(e(),e=void 0)}))})}else if(/.fx$/.test(k(this).attr("filename")))m=new VVVV.Nodes.GenericShader(k(this).attr("id"),
p),m.isShader=!0,m.shaderFile=k(this).attr("filename").replace(/\\/g,"/").replace(/\.fx$/,".vvvvjs.fx").replace("lib/nodes/",""),m.nodename=n;else if(/.v4p$/.test(k(this).attr("filename"))){p.resourcesPending++;var g=this,m=new VVVV.Core.Patch(k(this).attr("filename"),function(){p.resourcesPending--;"development"==VVVV_ENV&&console.log(this.nodename+"invoking update links");d(a);p.editor&&p.editor.addPatch(this);if(this.auto_evaluate){var f=p;do f.auto_evaluate=!0;while(f=f.parentPatch)}this.setMainloop(p.mainloop);
p.afterUpdate();p.compile();0>=p.resourcesPending&&e&&(e(),e=void 0)},function(){p.resourcesPending--;this.not_implemented=!0;VVVV.onNotImplemented(n);d(a);p.afterUpdate();p.compile();0>=p.resourcesPending&&e&&(e(),e=void 0)},p,k(g).attr("id"));m.isSubpatch=!0;p.editor&&!m.editor&&p.editor.addPatch(m);p.nodeMap[m.id]=m}else m=new VVVV.Core.Node(k(this).attr("id"),n,p),m.not_implemented=!0,VVVV.onNotImplemented(n);"development"==VVVV_ENV&&"complete"!=h&&console.log(p.nodename+": inserted new node "+
m.nodename)}if(m.auto_evaluate){g=p;do g.auto_evaluate=!0;while(g=g.parentPatch)}if("pronto"==k(this).attr("deleteme")){"development"==VVVV_ENV&&console.log("removing node "+m.id);if(m.isSubpatch&&!m.not_implemented){m.editor&&m.editor.removePatch(m);g=m.getSubPatches();g.push(m);for(var b,x=0;x<g.length;x++)b=VVVV.Helpers.prepareFilePath(g[x].nodename,g[x].parentPatch),VVVV.Patches[b].splice(VVVV.Patches[b].indexOf(m),1),0==VVVV.Patches[b].length&&delete VVVV.Patches[b]}m.definingNode&&m.definingNode.relatedNodes.splice(m.definingNode.relatedNodes.indexOf(m),
1);p.nodeList.splice(p.nodeList.indexOf(m),1);m.destroy();delete p.nodeMap[m.id]}0<r.length&&(r.attr("left")&&(m.x=r.attr("left")/15,m.y=r.attr("top")/15,p.boundingBox.width=Math.max(p.boundingBox.width,m.x+100),p.boundingBox.height=Math.max(p.boundingBox.height,m.y+100)),r.attr("width")&&(m.width=r.attr("width"),m.height=r.attr("height")));/^iobox/.test(m.nodename.toLowerCase())&&(m.isIOBox=!0);c||m.setup();g=this;k(this).find("pin").each(function(){var e=k(this).attr("pinname"),d=f(k(this).attr("values"));
void 0!=d&&0<d.length&&m.addDefault(e,d);if(void 0==m.outputPins[e])if(void 0!=m.inputPins[e])m.inputPins[e].isConnected()||m.applyPinValuesFromXML(e);else if(void 0!=m.invisiblePins[e]){if(void 0!=d){for(var l=0;l<d.length;l++)m.invisiblePins[e].values[l]!=d[l]&&m.invisiblePins[e].setValue(l,d[l]);m.invisiblePins[e].setSliceCount(d.length)}}else 1==k(this).attr("visible")&&"Configuration"!=k(this).attr("pintype")||m.isSubpatch?"Output"==k(this).attr("pintype")||0<k(a).find("link[srcnodeid="+m.id+
"]").filter("link[srcpinname='"+e.replace(/[\[\]]/,"")+"']").length?void 0==m.outputPins[e]&&m.addOutputPin(e,d):void 0==m.inputPins[e]&&void 0==m.invisiblePins[e]&&m.addInputPin(e,d):void 0==m.inputPins[e]&&void 0==m.invisiblePins[e]&&m.addInvisiblePin(e,d)});c||(l&&(console.log("replacing node "+m.id+" / "+l.nodename+" with "+m.nodename),_(l.invisiblePins).each(function(a,e){m.invisiblePins[e]?(p.pinMap[m.id+"_inv_"+e]=m.inputPins[e],m.invisiblePins[e].typeName==a.typeName&&(m.invisiblePins[e].values=
a.values)):m.invisiblePins[e]=a})),m.initialize(),l&&(_(l.inputPins).each(function(a,e){if(m.inputPins[e])if(p.pinMap[m.id+"_in_"+e]=m.inputPins[e],m.inputPins[e].typeName!=a.typeName)for(var f=a.links.length;f--;)a.links[f].destroy();else for(m.inputPins[e].values=a.values,f=a.links.length;f--;)m.inputPins[e].links[f]=a.links[f],m.inputPins[e].links[f].toPin=m.inputPins[e];else for(f=a.links.length;f--;)a.links[f].destroy()}),_(l.outputPins).each(function(a,e){if(m.outputPins[e])if(p.pinMap[m.id+
"_out_"+e]=m.outputPins[e],m.outputPins[e].typeName!=a.typeName)for(var f=a.links.length;f--;)a.links[f].destroy();else for(m.outputPins[e].values=a.values,f=a.links.length;f--;)m.outputPins[e].links[f]=a.links[f],m.outputPins[e].links[f].fromPin=m.outputPins[e];else for(f=a.links.length;f--;)a.links[f].destroy()}),p.nodeList.splice(p.nodeList.indexOf(l),1),l.destroy(),delete l,l=void 0),p.nodeList.push(m));"complete"==h&&(q[m.id]=m)});"complete"==h&&(_(n).each(function(a,e){void 0==q[e]&&("development"==
VVVV_ENV&&console.log("removing node "+a.id),p.nodeList.splice(p.nodeList.indexOf(a),1),delete p.nodeMap[a.id])}),n={},_(q).each(function(a,e){n[e]=a}));0===this.resourcesPending&&d(a);this.compile();0>=this.resourcesPending&&e&&(e(),e=void 0)};this.getSubPatches=function(){for(var a=[],e=0;e<this.nodeList.length;e++)this.nodeList[e].isSubpatch&&(a.push(this.nodeList[e]),a=a.concat(this.nodeList[e].getSubPatches()));return a};this.setMainloop=function(a){this.mainloop=a;for(var e=0;e<this.nodeList.length;e++)this.nodeList[e].isSubpatch&&
this.nodeList[e].setMainloop(a)};this.afterEvaluate=function(){};this.afterUpdate=function(){};this.toXML=function(){var a=k("<PATCH>"),e=k("<BOUNDS>");e.attr("type","Window");e.attr("width",parseInt(15*this.windowWidth));e.attr("height",parseInt(15*this.windowHeight));a.append(e);for(e=0;e<this.nodeList.length;e++)a.append(this.nodeList[e].serialize());for(e=0;e<this.linkList.length;e++)a.append(this.linkList[e].serialize());a='<!DOCTYPE PATCH SYSTEM "http://vvvv.org/versions/vvvv45beta28.1.dtd" >\r\n '+
a.wrapAll("<d></d>").parent().html();a=a.replace(/<patch/g,"<PATCH");a=a.replace(/<\/patch>/g,"\n </PATCH>");a=a.replace(/<node/g,"\n <NODE");a=a.replace(/<\/node>/g,"\n </NODE>");a=a.replace(/<bounds/g,"\n <BOUNDS");a=a.replace(/<\/bounds>/g,"\n </BOUNDS>");a=a.replace(/<pin/g,"\n <PIN");a=a.replace(/<\/pin>/g,"\n </PIN>");a=a.replace(/<lonk/g,"\n <LINK");return a=a.replace(/<\/lonk>/g,"\n </LINK>")};this.compile=function(){function a(n){if(0>f.indexOf(n.id)){f.push(n.id);var q=n.getUpstreamNodes(),
m=!1;_(q).each(function(f){void 0==e[f.id]&&(m=m||a(f))});f.pop()}m&&n.delays_output&&d.push(n);if(!m&&0>f.indexOf(n.id)||n.delays_output){if(n.getCode){n.outputPins.Output.values.incomingPins=[];for(var p=q="("+n.getCode()+")",g;g=r.exec(q);){var b;n.inputPins[g[1]].values.code?(b=n.inputPins[g[1]].values.code,n.outputPins.Output.values.incomingPins=n.outputPins.Output.values.incomingPins.concat(n.inputPins[g[1]].values.incomingPins)):(b=n.inputPins[g[1]].isConnected()||1!=n.inputPins[g[1]].getSliceCount()?
"patch.nodeMap["+n.id+"].inputPins['"+g[1]+"'].getValue(iii)":n.inputPins[g[1]].getValue(0),n.outputPins.Output.values.incomingPins.push(n.inputPins[g[1]]));p=p.replace("{"+g[1]+"}",b)}n.outputPins.Output.values.code=p;for(q=0;q<n.outputPins.Output.links.length;q++)if(!n.outputPins.Output.links[q].toPin.node.getCode){h+=n.outputPins.Output.generateStaticCode(!0);break}}else n.not_implemented||(l.push(n),h+="var n = patch.nodeMap["+n.id+"];\n",h+="if ((n.isDirty() || n.auto_evaluate || n.isSubpatch) && !n.dealWithNilInput()) { n.evaluate(); n.dirty = false; }\n");
for(var x in n.inputPins)0==n.inputPins[x].links.length&&c.push(n.inputPins[x]);for(x in n.invisiblePins)c.push(n.invisiblePins[x]);for(x in n.outputPins)c.push(n.outputPins[x]);e[n.id]=n;return!1}return!0}this.evaluationRecipe=[];this.pinList=[];for(var e={},f=[],d=[],l=this.evaluationRecipe,c=this.pinList,r=new RegExp(/\{([^\}]+)\}/g),h="",n=0;n<this.nodeList.length;n++)(0==this.nodeList[n].getDownstreamNodes().length||this.nodeList[n].auto_evaluate||this.nodeList[n].delays_output)&&void 0==e[this.nodeList[n].id]&&
a(this.nodeList[n]);for(n=0;n<d.length;n++)a(d[n]);h="try {\n"+h+"\n} catch (e) { console.error(e.message); console.log(e.stack); }";this.compiledFunc=new Function("patch",h)};this.evaluate=function(){if(!(0<this.resourcesPending)){if(e)var a={},f=(new Date).getTime();this.compiledFunc(this);e&&(_(a).each(function(a,e){console.log(a.count+"x "+e+": "+a.dt+"ms")}),f=(new Date).getTime());this.afterEvaluate();e&&console.log("patch rendering: "+((new Date).getTime()-f)+"ms");e=!1}};k(window).keydown(function(a){84==
a.which&&a.altKey&&a.ctrlKey&&(e=!0)});if(/\.v4p[^<>\s]*$/.test(b)){this.nodename=b;var m=this,x=b;this.parentPatch&&(x=VVVV.Helpers.prepareFilePath(b,this.parentPatch));VVVV.Patches[x]?m.doLoad(VVVV.Patches[x][0].toXML(),function(){VVVV.Patches[x].push(m);m.success&&m.success();m.afterUpdate()}):k.ajax({url:x,type:"get",dataType:"text",success:function(a){m.doLoad(a,function(){VVVV.Patches[x]=VVVV.Patches[x]||[];VVVV.Patches[x].push(m);m.success&&m.success();m.afterUpdate()})},error:function(){m.error&&
m.error()}})}else this.doLoad(b,function(){this.success&&this.success()});a();k(window).bind("hashchange",function(){a()})}};VVVV.Core.Patch.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Core.DOMInterface=function(b){function g(f){if("event"==f.property_class){var a=f.selector;"window"==a&&(a=window);"document"==a&&(a=document);k(a).each(function(a){f.values[a]=0;k(this).bind(f.property,function(){f.values[a]=1;return!1})})}}var h={},c={};b.domInterface=this;this.connect=function(f){_(h).each(function(a,e){a.node.id==f.id&&("event"==a.property_class&&k(a.selector).unbind(a.property),delete h[e])});_(c).each(function(a,e){a.node.id==f.id&&delete c[e]});var a=/([^\/]+)(\/(event|attribute|style)\/(.+))?/.exec(f.invisiblePins["Descriptive Name"].getValue(0));
if(null!=a){var e={selector:a[1],property_class:a[3],property:a[4],values:[],node:f};0!=k(e.selector).length&&(0==f.getUpstreamNodes().length?h[a[0]]=e:0==f.getDownstreamNodes().length&&(c[a[0]]=e),g(e))}};var d=this;_(b.nodeList).each(function(f){f.isIOBox&&void 0!=f.invisiblePins["Descriptive Name"]&&(d.connect(f),f.IOBoxInputPin().connectionChanged=function(){d.connect(f)})});this.populateInputConnectors=function(){var f,a;for(f in h)switch(a=h[f],a.property_class){case "event":a.values.length!=
a.node.IOBoxInputPin().values.length&&a.node.IOBoxInputPin().setSliceCount(a.values.length);for(var e=0;e<a.values.length;e++)void 0!=a.node.IOBoxInputPin().values[e]&&a.values[e]==a.node.IOBoxInputPin().values[e]||a.node.IOBoxInputPin().setValue(e,a.values[e]);break;default:for(this.fetchValuesFromDOM(a),a.values.length!=a.node.IOBoxInputPin().values.length&&a.node.IOBoxInputPin().setSliceCount(a.values.length),e=0;e<a.values.length;e++)a.node.IOBoxInputPin().getValue(e)!=a.values[e]&&a.node.IOBoxInputPin().setValue(e,
a.values[e])}};this.processOutputConnectors=function(){for(var f in c)switch(c[f].property_class){default:this.setDOMByIOBox(c[f])}for(f in h)if("event"==h[f].property_class)for(var a=0;a<h[f].values.length;a++)h[f].values[a]=0};this.fetchValuesFromDOM=function(f){f.values.length=0;k(f.selector).each(function(a){var e;if(void 0==f.property_class)switch(this.nodeName){case "INPUT":"text"==k(this).attr("type")&&(e=k(this).val());"checkbox"==k(this).attr("type")&&(e=k(this).attr("checked")?1:0);break;
default:e=k(this).text()}"attribute"==f.property_class&&(e=k(this).attr(f.property));"style"==f.property_class&&(e=k(this).css(f.property));f.values[a]=e})};this.setDOMByIOBox=function(f){var a=f.node.IOBoxOutputPin();if(a.pinIsChanged()){var a=a.getValue(0,a.getSliceCount()),e=k(f.selector).length;void 0==f.property_class&&(k(f.selector).empty(),k(f.selector).val(""));for(var d=0;d<Math.max(a.length,e);d++){var c=d%e,n=d%a.length,h=k(f.selector).eq(c);if(0!=h.length){if(void 0==f.property_class)switch(h[0].nodeName){case "INPUT":h.val(k(f.selector).eq(c).val()+
a[n]);break;default:h.html(k(f.selector).eq(c).html()+a[n])}"attribute"==f.property_class&&h.attr(f.property,a[n]);"style"==f.property_class&&h.css(f.property,a[n])}}}}}})(vvvvjs_jquery);(function(k){VVVV.fps=60;VVVV.Core.MainLoop=function(b,g){function h(){if(0==b.resourcesPending){c++;var n=(new Date).getTime();a&&(r.deltaT=n-a);a=n;d.populateInputConnectors();b.evaluate();d.processOutputConnectors();n=(new Date).getTime()-a;0==c%10&&(l&&(console.log(1/((a-e)/1E4)+"fps"),l=!1),e=a);r.frameNum++;if(66<n&&50<r.lowFrameRateCount++)VVVV.onLowFrameRate();else lowFrameRateCount=0}f&&window.setTimeout(function(){window.requestAnimationFrame(h)},Math.max(0,Math.round(1E3/VVVV.fps-n)))}
VVVV.fps=g||60;var c=0,d=new VVVV.Core.DOMInterface(b),f=!0,a=void 0,e=this.lowFrameRateCount=0,l=!1;this.deltaT=1E3/VVVV.fps;this.frameNum=0;b.setMainloop(this);var r=this;this.stop=function(){f=!1};this.start=function(){f||(f=!0,h())};this.isRunning=function(){return f};h();k(window).keydown(function(a){(102==a.which||70==a.which)&&a.altKey&&a.ctrlKey&&(l=!0)})}})(vvvvjs_jquery);(function(k){VVVV.Types.Color=function(b){this.rgba=new Float32Array(_(b.split(",")).map(function(g){return parseFloat(g)}));this.toString=function(){return this.rgba[0]+", "+this.rgba[1]+", "+this.rgba[2]+", "+this.rgba[3]};this.setHSV=function(g,h,c){g=(g%1+1)%1*360;var d=Math.floor(g/60),f=g/60-d;g=c*(1-h);var a=c*(1-h*f);h=c*(1-h*(1-f));switch(d){case 1:this.rgba[0]=a;this.rgba[1]=c;this.rgba[2]=g;break;case 2:this.rgba[0]=g;this.rgba[1]=c;this.rgba[2]=h;break;case 3:this.rgba[0]=g;this.rgba[1]=
a;this.rgba[2]=c;break;case 4:this.rgba[0]=h;this.rgba[1]=g;this.rgba[2]=c;break;case 5:this.rgba[0]=c;this.rgba[1]=g;this.rgba[2]=a;break;default:this.rgba[0]=c,this.rgba[1]=h,this.rgba[2]=g}};this.getHSV=function(){var g=this.rgba[0],h=this.rgba[1],c=this.rgba[2],d=Math.max(g,Math.max(h,c)),f=Math.min(g,Math.min(h,c)),a;d==f?a=0:d==g?a=60*(0+(h-c)/(d-f)):d==h?a=60*(2+(c-g)/(d-f)):d==c&&(a=60*(4+(g-h)/(d-f)));0>a&&(a+=360);g=0;0!=d&&(g=(d-f)/d);return[a/360,g,d]};this.copy_to=function(g){g.rgba[0]=
this.rgba[0];g.rgba[1]=this.rgba[1];g.rgba[2]=this.rgba[2];g.rgba[3]=this.rgba[3]}};VVVV.Types.CanvasGraphics={typeName:"CanvasGraphics",reset_on_disconnect:!0,defaultValue:function(){return"NONE"}}})(vvvvjs_jquery);(function(k){VVVV.Nodes.Cross2d=function(b,g){this.constructor(b,"Cross (2d)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("X In",[0],VVVV.PinTypes.Value),c=this.addInputPin("Y In",[0],VVVV.PinTypes.Value),d=this.addInputPin("Include Upper",[1],VVVV.PinTypes.Value),f=this.addInputPin("Include Lower",[1],VVVV.PinTypes.Value),a=this.addInputPin("Include Equal",[1],VVVV.PinTypes.Value),e=this.addOutputPin("X Out",
[0],VVVV.PinTypes.Value),l=this.addOutputPin("Y Out",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var r=0,n=0;n<c.getSliceCount();n++)for(var q=0;q<h.getSliceCount();q++).5>d.getValue(0)&&n>q||.5>f.getValue(0)&&n<q||.5>a.getValue(0)&&n==q||(e.setValue(r,h.getValue(q)),l.setValue(r,c.getValue(n)),r++);e.setSliceCount(r);l.setSliceCount(r)}};VVVV.Nodes.Cross2d.prototype=new VVVV.Core.Node;VVVV.Nodes.Polar2d=function(b,g){this.constructor(b,"Polar (2d)",g);this.meta={authors:["Matthias Zauner"],
original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("X",[1],VVVV.PinTypes.Value),c=this.addInputPin("Y",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Angle",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Length",[1],VVVV.PinTypes.Value);this.initialize=function(){};this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),e=0;e<a;e++){var l=h.getValue(e),r=c.getValue(e);d.setValue(e,Math.atan2(r,l)/(2*Math.PI));f.setValue(e,Math.sqrt(l*
l+r*r))}d.setSliceCount(a);f.setSliceCount(a)}};VVVV.Nodes.Polar2d.prototype=new VVVV.Core.Node;VVVV.Nodes.Cartesian2d=function(b,g){this.constructor(b,"Cartesian (2d)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Angle",[0],VVVV.PinTypes.Value),c=this.addInputPin("Length",[1],VVVV.PinTypes.Value),d=this.addOutputPin("X",[1],VVVV.PinTypes.Value),f=this.addOutputPin("Y",[0],VVVV.PinTypes.Value);
this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),e=0;e<a;e++){var l=h.getValue(e),r=c.getValue(e);d.setValue(e,r*Math.cos(l*Math.PI*2));f.setValue(e,r*Math.sin(l*Math.PI*2))}d.setSliceCount(a);f.setSliceCount(a)}};VVVV.Nodes.Cartesian2d.prototype=new VVVV.Core.Node;VVVV.Nodes.Points2Vector2d=function(b,g){this.constructor(b,"Points2Vector (2d)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("X1",
[0],VVVV.PinTypes.Value),c=this.addInputPin("Y1",[0],VVVV.PinTypes.Value),d=this.addInputPin("X2",[1],VVVV.PinTypes.Value),f=this.addInputPin("Y2",[0],VVVV.PinTypes.Value),a=this.addOutputPin("X",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Length",[1],VVVV.PinTypes.Value),r=this.addOutputPin("Angle",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var n=this.getMaxInputSliceCount(),q=0;q<n;q++){var p=h.getValue(q),m=c.getValue(q),g=d.getValue(q),
b=f.getValue(q),g=g-p,b=b-m;a.setValue(q,p+g/2);e.setValue(q,m+b/2);l.setValue(q,Math.sqrt(g*g+b*b));r.setValue(q,Math.atan2(b,g)/(2*Math.PI))}a.setSliceCount(n);e.setSliceCount(n);l.setSliceCount(n);r.setSliceCount(n)}};VVVV.Nodes.Points2Vector2d.prototype=new VVVV.Core.Node;VVVV.Nodes.Vector2Points2d=function(b,g){this.constructor(b,"Vector2Points (2d)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("X",
[0],VVVV.PinTypes.Value),c=this.addInputPin("Y",[0],VVVV.PinTypes.Value),d=this.addInputPin("Length",[1],VVVV.PinTypes.Value),f=this.addInputPin("Angle",[0],VVVV.PinTypes.Value),a=this.addOutputPin("X1",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Y1",[0],VVVV.PinTypes.Value),l=this.addOutputPin("X2",[0],VVVV.PinTypes.Value),r=this.addOutputPin("Y2",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var n=this.getMaxInputSliceCount(),q=0;q<n;q++){var p=h.getValue(q),m=c.getValue(q),g=d.getValue(q),
b=f.getValue(q)-.5*Math.PI,k=g/2*Math.sin(b),g=-g/2*Math.cos(b);a.setValue(q,p+k);e.setValue(q,m+g);l.setValue(q,p-k);r.setValue(q,m-g)}a.setSliceCount(n);e.setSliceCount(n);l.setSliceCount(n);r.setSliceCount(n)}};VVVV.Nodes.Vector2Points2d.prototype=new VVVV.Core.Node;VVVV.Nodes.Attractor2d=function(b,g){this.constructor(b,"Attractor (2d)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("X",
[0],VVVV.PinTypes.Value),c=this.addInputPin("Y",[0],VVVV.PinTypes.Value),d=this.addInputPin("Attractor X",[0],VVVV.PinTypes.Value),f=this.addInputPin("Attractor Y",[0],VVVV.PinTypes.Value),a=this.addInputPin("Attractor Strength",[1],VVVV.PinTypes.Value),e=this.addInputPin("Attractor Power",[1],VVVV.PinTypes.Value),l=this.addInputPin("Attractor Radius",[.1],VVVV.PinTypes.Value),r=this.addOutputPin("Output X",[0],VVVV.PinTypes.Value),n=this.addOutputPin("Output Y",[0],VVVV.PinTypes.Value);this.evaluate=
function(){for(var q=Math.max(h.getSliceCount(),c.getSliceCount()),p=Math.max(d.getSliceCount(),f.getSliceCount()),m,g,b,k,w,y,u=0;u<q;u++){m=h.getValue(u);g=c.getValue(u);for(var A=0;A<p;A++)if(b=d.getValue(A),k=f.getValue(A),attractorstrength=a.getValue(A),w=e.getValue(A),y=l.getValue(A),b=m-b,k=g-k,0!=b||0!=k){var t=Math.sqrt(Math.pow(b,2)+Math.pow(k,2)),B=0;t<=y&&(y=t/y,B=attractorstrength*(Math.pow(y,w)*(0>y?-1:0<y?1:0)/y-1));m+=b*B;g+=k*B}r.setValue(u,m);n.setValue(u,g)}r.setSliceCount(q);n.setSliceCount(q)}};
VVVV.Nodes.Attractor2d.prototype=new VVVV.Core.Node;VVVV.Nodes.ConnectAll2d=function(b,g){this.constructor(b,"ConnectAll (2d)",g);this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("X In",[0],VVVV.PinTypes.Value),c=this.addInputPin("Y In",[0],VVVV.PinTypes.Value),d=this.addOutputPin("X1 Out",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Y1 Out",[0],VVVV.PinTypes.Value),a=this.addOutputPin("X2 Out",[0],VVVV.PinTypes.Value),
e=this.addOutputPin("Y2 Out",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var l=this.getMaxInputSliceCount(),r=0,n=0;n<l;n++)for(var q=n+1;q<l;q++)d.setValue(r,h.getValue(n)),f.setValue(r,c.getValue(n)),a.setValue(r,h.getValue(q)),e.setValue(r,c.getValue(q)),r++;d.setSliceCount(r);f.setSliceCount(r);a.setSliceCount(r);e.setSliceCount(r)}};VVVV.Nodes.ConnectAll2d.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.Polar3d=function(b,g){this.constructor(b,"Polar (3d)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("X",[0],VVVV.PinTypes.Value),c=this.addInputPin("Y",[0],VVVV.PinTypes.Value),d=this.addInputPin("Z",[-1],VVVV.PinTypes.Value),f=this.addOutputPin("Pitch",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Yaw",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Length",[1],VVVV.PinTypes.Value);
this.evaluate=function(){for(var l=this.getMaxInputSliceCount(),r=0;r<l;r++){var n=h.getValue(r),q=c.getValue(r),p=d.getValue(r),m=Math.sqrt(n*n+q*q+p*p);a.setValue(r,Math.atan2(-n,-p)/(2*Math.PI));f.setValue(r,0==m?0:Math.acos(-q/m)/(2*Math.PI)-.25);e.setValue(r,m)}a.setSliceCount(l);f.setSliceCount(l);e.setSliceCount(l)}};VVVV.Nodes.Polar3d.prototype=new VVVV.Core.Node;VVVV.Nodes.Cartesian3d=function(b,g){this.constructor(b,"Cartesian (3d)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],
credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Pitch",[0],VVVV.PinTypes.Value),c=this.addInputPin("Yaw",[0],VVVV.PinTypes.Value),d=this.addInputPin("Length",[1],VVVV.PinTypes.Value),f=this.addOutputPin("X",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Z",[1],VVVV.PinTypes.Value);this.evaluate=function(){for(var l=this.getMaxInputSliceCount(),r=0;r<l;r++){var n=2*(h.getValue(r)+.25)*Math.PI,q=2*c.getValue(r)*Math.PI,
p=d.getValue(r);e.setValue(r,-p*Math.cos(q)*Math.sin(n));f.setValue(r,-p*Math.sin(q)*Math.sin(n));a.setValue(r,-p*Math.cos(n))}f.setSliceCount(l);a.setSliceCount(l);e.setSliceCount(l)}};VVVV.Nodes.Cartesian3d.prototype=new VVVV.Core.Node;VVVV.Nodes.Normalize3d=function(b,g){this.constructor(b,"Normalize (3d)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("X",[1],VVVV.PinTypes.Value),c=this.addInputPin("Y",
[0],VVVV.PinTypes.Value),d=this.addInputPin("Z",[0],VVVV.PinTypes.Value),f=this.addOutputPin("NormalizedX",[1],VVVV.PinTypes.Value),a=this.addOutputPin("NormalizedY",[0],VVVV.PinTypes.Value),e=this.addOutputPin("NormalizedZ",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Input Length",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var r=this.getMaxInputSliceCount(),n=0;n<r;n++){var q=h.getValue(n),p=c.getValue(n),m=d.getValue(n),g=Math.sqrt(q*q+p*p+m*m);f.setValue(n,0==g?0:q/g);a.setValue(n,
0==g?0:p/g);e.setValue(n,0==g?0:m/g);l.setValue(n,g)}f.setSliceCount(r);a.setSliceCount(r);e.setSliceCount(r);l.setSliceCount(r)}};VVVV.Nodes.Normalize3d.prototype=new VVVV.Core.Node;VVVV.Nodes.Normalize3dVector=function(b,g){this.constructor(b,"Normalize (3d Vector)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("XYZ",[],VVVV.PinTypes.Value),c=this.addOutputPin("NormalizedXYZ",[],VVVV.PinTypes.Value),
d=this.addOutputPin("Input Length",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f/3;a++){var e=h.getValue(a,3),l=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);c.setValue(3*a,0==l?0:e[0]/l);c.setValue(3*a+1,0==l?0:e[1]/l);c.setValue(3*a+2,0==l?0:e[2]/l);d.setValue(a,l)}c.setSliceCount(3*Math.ceil(f/3));d.setSliceCount(Math.ceil(f/3))}};VVVV.Nodes.Normalize3dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Multiply3dCross=function(b,g){this.constructor(b,"Multiply (3d Cross)",
g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input1 XYZ",[],VVVV.PinTypes.Value),c=this.addInputPin("Input2 XYZ",[],VVVV.PinTypes.Value),d=this.addOutputPin("Output XYZ",[],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f/3;a++){var e=h.getValue(a,3),l=c.getValue(a,3);d.setValue(3*a+0,e[1]*l[2]-e[2]*l[1]);d.setValue(3*a+1,-(e[0]*l[2]-e[2]*l[0]));
d.setValue(3*a+2,e[0]*l[1]-e[1]*l[0])}d.setSliceCount(3*Math.ceil(f/3))}};VVVV.Nodes.Multiply3dCross.prototype=new VVVV.Core.Node;VVVV.Nodes.Multiply3dDot=function(b,g){this.constructor(b,"Multiply (3d Dot)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input1 XYZ",[],VVVV.PinTypes.Value),c=this.addInputPin("Input2 XYZ",[],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);
this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f/3;a++){var e=h.getValue(a,3),l=c.getValue(a,3);d.setValue(a,e[0]*l[0]+e[1]*l[1]+e[2]*l[2])}d.setSliceCount(Math.ceil(f/3))}};VVVV.Nodes.Multiply3dDot.prototype=new VVVV.Core.Node;VVVV.Nodes.Multiply3dVector=function(b,g){this.constructor(b,"Multiply (3d Vector)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Transform",
[],VVVV.PinTypes.Transform),c=this.addInputPin("XYZ UnTransformed",[0,0,0],VVVV.PinTypes.Value),d=this.addOutputPin("XYZ Transformed",[0,0,0],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=Math.max(h.getSliceCount(),c.getSliceCount()/3),a=0;a<f;a++){var e=c.getValue(a,3),l=h.getValue(a);mat4.multiplyVec3(l,e);d.setValue(3*a+0,e[0]);d.setValue(3*a+1,e[1]);d.setValue(3*a+2,e[2])}d.setSliceCount(Math.ceil(3*f))}};VVVV.Nodes.Multiply3dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Multiply4dVector=
function(b,g){this.constructor(b,"Multiply (4d Vector)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),c=this.addInputPin("XYZW UnTransformed",[0,0,0,1],VVVV.PinTypes.Value),d=this.addOutputPin("XYZW Transformed",[0,0,0,1],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=Math.max(h.getSliceCount(),c.getSliceCount()/4),a=0;a<f;a++){var e=c.getValue(a,
4),l=h.getValue(a);mat4.multiplyVec4(l,e);d.setValue(4*a+0,e[0]);d.setValue(4*a+1,e[1]);d.setValue(4*a+2,e[2]);d.setValue(4*a+3,e[3])}d.setSliceCount(Math.ceil(4*f))}};VVVV.Nodes.Multiply4dVector.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.LFO=function(b,g){this.constructor(b,"LFO (Animation)",g);this.meta={authors:["Matthias Zauner, sebl, woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Not spreadable yet"]};this.auto_evaluate=!0;var h=this.addInputPin("Period",[1],VVVV.PinTypes.Value),c=this.addInputPin("Pause",[0],VVVV.PinTypes.Value),d=this.addInputPin("Reverse",[0],VVVV.PinTypes.Value),f=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),a=this.addInputPin("Phase",[0],VVVV.PinTypes.Value),
e=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Change",[0],VVVV.PinTypes.Value),r=this.addOutputPin("Cycles",[0],VVVV.PinTypes.Value),n=[],q=[],p=(new Date).getTime(),m=(new Date).getTime();this.evaluate=function(){var g=this.getMaxInputSliceCount();p=(new Date).getTime()-m;for(var b=0;b<g;b++){var k=h.getValue(b),w=c.getValue(b),y=d.getValue(b),u=f.getValue(b),A=a.getValue(b),t=0;void 0==n[b]&&(n[b]=0);void 0==q[b]&&(q[b]=0);.5>w&&0!=k&&isFinite(k)&&(dv=1/(1E3*k)*p,0<
y&&(dv*=-1),n[b]+=dv,0>n[b]&&(q[b]-=Math.ceil(-n[b]),n[b]=1+n[b],t=1),1<n[b]&&(q[b]+=Math.floor(n[b]),t=1));m=(new Date).getTime();.5<=u&&(n[b]=0,q[b]=0,t=1);if(.5>w||.5<=u)e.setValue(b,(n[b]+A)%1),l.setValue(b,t),r.setValue(b,q[b]);n[b]%=1}e.setSliceCount(g);l.setSliceCount(g);r.setSliceCount(g);n.splice(g);q.splice(g)}};VVVV.Nodes.LFO.prototype=new VVVV.Core.Node;VVVV.Nodes.LinearFilter=function(b,g){this.constructor(b,"LinearFilter (Animation)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],
credits:[],compatibility_issues:["Cyclic Pin not implemented","Acceleration Out is not set yet"]};this.auto_evaluate=!0;var h=this.addInputPin("Go To Position",[0],VVVV.PinTypes.Value),c=this.addInputPin("FilterTime",[1],VVVV.PinTypes.Value),d=this.addOutputPin("Position Out",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Velocity Out",[0],VVVV.PinTypes.Value);this.addOutputPin("Acceleration Out",[0],VVVV.PinTypes.Value);var a=[],e=[],l=[],r=[],n=[],q=[];this.evaluate=function(){for(var p=this.getMaxInputSliceCount(),
m=h.pinIsChanged()||c.pinIsChanged(),b=0;b<p;b++){void 0==a[b]&&(a[b]=(new Date).getTime());var g=this.parentPatch.mainloop.deltaT,k=h.getValue(b),w=c.getValue(b);void 0==r[b]&&(r[b]=k);if(k!=e[b]||w!=l[b])q[b]=void 0,e[b]=k,l[b]=w,n[b]=0<l[b]?(e[b]-r[b])/(1E3*l[b]):0;r[b]=Math.abs(n[b]*g)>Math.abs(e[b]-r[b])?e[b]:r[b]+n[b]*g;0!=q[b]&&(d.setValue(b,r[b]),f.setValue(b,n[b]));q[b]=e[b]-r[b];a[b]=(new Date).getTime()}m&&d.getSliceCount()!=p&&(e.splice(p),l.splice(p),a.splice(p),r.splice(p),n.splice(p),
q.splice(p),d.setSliceCount(p))}};VVVV.Nodes.LinearFilter.prototype=new VVVV.Core.Node;VVVV.Nodes.Damper=function(b,g){this.constructor(b,"Damper (Animation)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Cyclic Pin not implemented","Acceleration Out is not set yet"]};this.auto_evaluate=!0;var h=this.addInputPin("Go To Position",[0],VVVV.PinTypes.Value),c=this.addInputPin("FilterTime",[1],VVVV.PinTypes.Value),d=this.addOutputPin("Position Out",
[0],VVVV.PinTypes.Value),f=this.addOutputPin("Velocity Out",[0],VVVV.PinTypes.Value);this.addOutputPin("Acceleration Out",[0],VVVV.PinTypes.Value);var a=[],e=[],l=[],r=[];this.evaluate=function(){for(var n=this.getMaxInputSliceCount(),q=h.pinIsChanged()||c.pinIsChanged(),b=0;b<n;b++){void 0==a[b]&&(a[b]=(new Date).getTime());var m=this.parentPatch.mainloop.deltaT,g=h.getValue(b),v=c.getValue(b);void 0==e[b]&&(e[b]=g);l[b]=0<v?(g-e[b])/(1E3*v):0;e[b]=Math.abs(l[b]*m)>Math.abs(g-e[b])?g:e[b]+l[b]*m;
0!=r[b]&&(d.setValue(b,e[b]),f.setValue(b,l[b]));r[b]=g-e[b];a[b]=(new Date).getTime()}q&&d.getSliceCount()!=n&&(a.splice(n),e.splice(n),l.splice(n),r.splice(n),d.setSliceCount(n))}};VVVV.Nodes.Damper.prototype=new VVVV.Core.Node;VVVV.Nodes.Delay=function(b,g){this.constructor(b,"Delay (Animation)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Reset not implemented","Linear Mode not implemented"]};this.auto_evaluate=!0;var h=this.addInputPin("Input",
[0],VVVV.PinTypes.Value),c=this.addInputPin("Time",[1],VVVV.PinTypes.Value),d=this.addInputPin("Insert",[1],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),a=[],e=Array(1024);this.evaluate=function(){var l=this.getMaxInputSliceCount();now=(new Date).getTime();var r=h.pinIsChanged();if(void 0==h.getValue(0))r&&f.setValue(0,void 0);else{if(1==d.getValue(0)&&(r||c.pinIsChanged()))for(e.pop(),e.unshift(now),r=0;r<l;r++){if(void 0==a[r]){a[r]=Array(1024);for(var n=1024;n--;)a[r][n]=
0}1024<=a[r].length&&a[r].pop();a[r].unshift(h.getValue(r))}for(r=0;r<l;r++){for(var q=now-1E3*c.getValue(r),b=!1,n=0;1024>n;n++)if(e[n]<=q){f.values[r]!=a[r][n]&&f.setValue(r,a[r][n]);b=!0;break}b||0==f.values[r]||f.setValue(r,0)}f.setSliceCount(l);a.splice(l)}}};VVVV.Nodes.Delay.prototype=new VVVV.Core.Node;VVVV.Nodes.Change=function(b,g){this.constructor(b,"Change (Animation)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=
!0;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addOutputPin("OnChange",[0],VVVV.PinTypes.Value),d=[];this.evaluate=function(){var f=this.getMaxInputSliceCount();if(h.pinIsChanged()){for(var a=0;a<f;a++)d[a]!=h.getValue(a)?c.setValue(a,1):1==c.getValue(a)&&c.setValue(a,0),d[a]=h.getValue(a);c.setSliceCount(f)}else{for(a=0;a<f;a++)1==c.getValue(a)&&(c.setValue(a,0),c.setSliceCount(f));d[a]=h.getValue(a)}}};VVVV.Nodes.Change.prototype=new VVVV.Core.Node;VVVV.Nodes.TogEdge=function(b,
g){this.constructor(b,"TogEdge (Animation)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!0;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Up Edge",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Down Edge",[0],VVVV.PinTypes.Value),f=[];this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),e=0;e<a;e++)(0>=Math.round(f[e])||void 0==f[e])&&1<=Math.round(h.getValue(e))?c.setValue(e,
1):0!=c.values[e]&&c.setValue(e,0),1<=Math.round(f[e])&&0>=Math.round(h.getValue(e))?d.setValue(e,1):0!=d.values[e]&&d.setValue(e,0),f[e]=h.getValue(e);c.setSliceCount(a);d.setSliceCount(a)}};VVVV.Nodes.TogEdge.prototype=new VVVV.Core.Node;VVVV.Nodes.FlipFlop=function(b,g){this.constructor(b,"FlipFlop (Animation)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Set",[0],VVVV.PinTypes.Value),c=this.addInputPin("Reset",
[0],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Inverse Output",[1],VVVV.PinTypes.Value),a=!1;this.evaluate=function(){var e=this.getMaxInputSliceCount(),l=d.getSliceCount();if(e>l)for(;l<e;l++)d.setValue(l,0),f.setValue(l,1);for(l=0;l<e;l++){var r=void 0;1<=Math.round(c.getValue(l))&&(r=0);1<=Math.round(h.getValue(l))&&(r=1);void 0!=r?(d.setValue(l,r),f.setValue(l,1-r)):a||(d.setValue(l,0),f.setValue(l,1))}d.setSliceCount(e);f.setSliceCount(e);
a=!0}};VVVV.Nodes.FlipFlop.prototype=new VVVV.Core.Node;VVVV.Nodes.MonoFlop=function(b,g){this.constructor(b,"MonoFlop (Animation)",g);this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!0;var h=this.addInputPin("Set",[0],VVVV.PinTypes.Value),c=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),d=this.addInputPin("Time",[0],VVVV.PinTypes.Value),f=this.addInputPin("Retriggerable",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Output",[0],
VVVV.PinTypes.Value),e=this.addOutputPin("Inverse Output",[1],VVVV.PinTypes.Value),l=[];this.evaluate=function(){var r=this.getMaxInputSliceCount(),n=a.getSliceCount();if(r>n)for(;n<r;n++)a.setValue(n,0),e.setValue(n,1);for(n=0;n<r;n++)if(void 0==l[n]&&(l[n]=0),void 0==a.getValue(n)&&a.setValue(n,0),1==a.getValue(n)){if(l[n]+=this.parentPatch.mainloop.deltaT/1E3,1==h.getValue(n)&&1==f.getValue(n)&&(l[n]=0),l[n]>=d.getValue(n)||1==c.getValue(n))l[n]=0,a.setValue(n,0),e.setValue(n,1)}else 1==h.getValue(n)&&
(a.setValue(n,1),e.setValue(n,0));a.setSliceCount(r);e.setSliceCount(r);l.splice(r)}};VVVV.Nodes.MonoFlop.prototype=new VVVV.Core.Node;VVVV.Nodes.SampleAndHold=function(b,g){this.constructor(b,"S+H (Animation)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["different output slice count in pure VVVV, if Set pin has only one slice"]};var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Set",[0],VVVV.PinTypes.Value),
d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){var f=this.getMaxInputSliceCount();if(c.pinIsChanged()||h.pinIsChanged()){for(var a=0;a<f;a++)void 0==d.values[a]&&d.setValue(a,0),1<=Math.round(c.getValue(a))&&d.setValue(a,h.getValue(a));d.setSliceCount(f)}}};VVVV.Nodes.SampleAndHold.prototype=new VVVV.Core.Node;VVVV.Nodes.FrameDelay=function(b,g){this.constructor(b,"FrameDelay (Animation)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],
compatibility_issues:["no dynamice pin count"]};this.auto_evaluate=this.delays_output=!0;var h=this.addInputPin("Input 1",[0],VVVV.PinTypes.Value),c=this.addInputPin("Default 1",[0],VVVV.PinTypes.Value),d=this.addInputPin("Initialize",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output 1",[0],VVVV.PinTypes.Value),a=[];this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),l=0;l<e;l++).5<d.getValue(l)||void 0==a[l]?f.setValue(l,c.getValue(l)):f.setValue(l,a[l]);for(l=0;l<e;l++)a[l]=h.getValue(l);
f.setSliceCount(e)}};VVVV.Nodes.FrameDelay.prototype=new VVVV.Core.Node;VVVV.Nodes.Toggle=function(b,g){this.constructor(b,"Toggle (Animation)",g);this.meta={authors:["David M\u00f3r\u00e1sz (micro.D)"],original_authors:["VVVV Group"],credits:["Matthias Zauner"],compatibility_issues:[]};this.auto_evaluate=!0;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Inverse Output",
[1],VVVV.PinTypes.Value),a=!1;this.evaluate=function(){var e=this.getMaxInputSliceCount(),l=d.getSliceCount();if(e>l)for(;l<e;l++)d.setValue(l,0),f.setValue(l,1);for(l=0;l<e;l++){var r=void 0;1<=Math.round(c.getValue(l))&&(r=0);1<=Math.round(h.getValue(l))&&(r=1-d.getValue(l));void 0!=r&&d.getValue(l)!=r?(d.setValue(l,r),f.setValue(l,1-r)):a||(d.setValue(l,0),f.setValue(l,1))}d.setSliceCount(e);f.setSliceCount(e);a=!0}};VVVV.Nodes.Toggle.prototype=new VVVV.Core.Node;VVVV.Nodes.Counter=function(b,
g){this.constructor(b,"Counter (Animation)",g);this.meta={authors:["David M\u00f3r\u00e1sz (micro.D)","Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!0;var h=this.addInputPin("Up",[0],VVVV.PinTypes.Value),c=this.addInputPin("Down",[0],VVVV.PinTypes.Value),d=this.addInputPin("Minimum",[0],VVVV.PinTypes.Value),f=this.addInputPin("Maximum",[15],VVVV.PinTypes.Value),a=this.addInputPin("Increment",[1],VVVV.PinTypes.Value),e=this.addInputPin("Default",
[0],VVVV.PinTypes.Value),l=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),r=this.addInputPin("Mode",["Wrap"],VVVV.PinTypes.Enum);r.enumOptions=["Wrap","Unlimited","Clamp"];var n=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),q=this.addOutputPin("Underflow",[0],VVVV.PinTypes.Value),p=this.addOutputPin("Overflow",[0],VVVV.PinTypes.Value),m=!1;this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=d.pinIsChanged()||f.pinIsChanged()||e.pinIsChanged()||l.pinIsChanged()||r.pinIsChanged(),
k=0;k<b;k++)1!=p.getValue(k)&&m||p.setValue(k,0),1!=q.getValue(k)&&m||q.setValue(k,0),m||n.setValue(k,0),g=g||.5<=h.getValue(k)||.5<=c.getValue(k);if(g){for(k=0;k<b;k++){var g=a.getValue(k),w=k>=n.getSliceCount()?0:n.getValue(k),y=f.getValue(k),u=d.getValue(k),A=0;"Unlimited"==r.getValue(k)&&(A=1);"Clamp"==r.getValue(k)&&(A=2);switch(A){case 1:.5<=h.getValue(k)&&(w+=g);.5<=c.getValue(k)&&(w-=g);break;case 2:.5<=h.getValue(k)&&(w+=g);.5<=c.getValue(k)&&(w-=g);w>y&&(w=y,p.setValue(k,1));w<u&&(w=u,q.setValue(k,
1));break;default:.5<=h.getValue(k)&&(w+=g),.5<=c.getValue(k)&&(w-=g),w>y&&(w=u,p.setValue(k,1)),w<u&&(w=y,q.setValue(k,1))}n.getValue(k)!=w&&n.setValue(k,w);.5<=l.getValue(k)&&n.setValue(k,e.getValue(k))}n.setSliceCount(b);q.setSliceCount(b);p.setSliceCount(b)}m=!0}};VVVV.Nodes.Counter.prototype=new VVVV.Core.Node;VVVV.Nodes.ADSR=function(b,g){this.constructor(b,"ADSR (Animation)",g);this.meta={authors:["Lukas Winter"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=
!0;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Attack Time",[.1],VVVV.PinTypes.Value),d=this.addInputPin("Decay Time",[.1],VVVV.PinTypes.Value),f=this.addInputPin("Sustain Level",[.5],VVVV.PinTypes.Value),a=this.addInputPin("Release Time",[.5],VVVV.PinTypes.Value),e=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),l=["idle"],r=(new Date).getTime(),n=[0],q=[0];this.evaluate=function(){var b=this.getMaxInputSliceCount(),m=(new Date).getTime(),g=m-r;n=h.getValue(0,
b);n.length||(n=[n]);e.setSliceCount(b);for(var k=0;k<b;k++){.5<n[k]&&.5>q[k]&&(l[k]="attack");var z=n[k],w=e.getValue(k),y=1E3*c.getValue(k),u=1E3*d.getValue(k),A=f.getValue(k),t=1E3*a.getValue(k);switch(l[k]){case "attack":w+=g/y;1<=w&&(w=1,l[k]=z?"decay":"release");break;case "decay":w-=g/u;z?w<=A&&(w=A,l[k]="sustain"):l[k]="release";break;case "sustain":z||(l[k]="release");break;case "release":w-=g/t*A,0>=w&&(w=0,l[k]="idle")}e.setValue(k,w)}r=m;q=n}};VVVV.Nodes.ADSR.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.CurrentTimeAstronomy=function(b,g){this.constructor(b,"CurrentTime (Astronomy)",g);this.meta={authors:["Zauner"],original_authors:["VVVV Group"],credits:["http://javascript.about.com/library/bldst.htm"],compatibility_issues:["Time Zone index differs from classic VVVV","Time Zone Name does not work in Firefox"]};this.auto_evaluate=!0;var h=new Date,c=this.addOutputPin("GMT",[],VVVV.PinTypes.Value),d=this.addOutputPin("Time Zone",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Time Zone Name",
[""],VVVV.PinTypes.String);this.addOutputPin("Daylight Saving Time",[h.getTimezoneOffset()<function(a){var f=new Date(a.getFullYear(),0,1);a=new Date(a.getFullYear(),6,1);return Math.max(f.getTimezoneOffset(),a.getTimezoneOffset())}(h)?1:0],VVVV.PinTypes.Value);var a=this.addOutputPin("Current Time",[],VVVV.PinTypes.Value);this.evaluate=function(){var e=new Date,l=36E5*e.getTimezoneOffset(),r=e.getTime();c.setValue(0,r/1E3/60/60/24+25569);d.setValue(0,l/1E3/60/60);e.toString().match(/\((.+)\)$/)?
f.setValue(0,e.toString().match(/\((.+)\)$/)[1]):f.setValue(0,"n/a");a.setValue(0,(r-l)/1E3/60/60/24+25569)}};VVVV.Nodes.CurrentTimeAstronomy.prototype=new VVVV.Core.Node;VVVV.Nodes.GregorianAstronomySplit=function(b,g){this.constructor(b,"Gregorian (Astronomy Split)",g);this.meta={authors:["Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Time",[41491.4301],VVVV.PinTypes.Value),c=this.addOutputPin("Millisecond",[0],VVVV.PinTypes.Value),
d=this.addOutputPin("Second",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Minute",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Hour",[0],VVVV.PinTypes.Value),e=this.addOutputPin("DayOfWeek",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Day",[1],VVVV.PinTypes.Value),r=this.addOutputPin("Month",[1],VVVV.PinTypes.Value),n=this.addOutputPin("Year",[2E3],VVVV.PinTypes.Value);this.evaluate=function(){for(var q=this.getMaxInputSliceCount(),b=0;b<q;b++){var m=864E5*(h.getValue(b)-25569),m=new Date(m),g=
m.getMilliseconds();c.setValue(b,g);g=m.getSeconds();d.setValue(b,g);g=m.getMinutes();f.setValue(b,g);g=m.getHours();a.setValue(b,g);g=m.getDay();e.setValue(b,g);g=m.getDate();l.setValue(b,g);g=m.getMonth()+1;r.setValue(b,g);g=m.getYear()+1900;n.setValue(b,g)}c.setSliceCount(q);d.setSliceCount(q);f.setSliceCount(q);a.setSliceCount(q);e.setSliceCount(q);l.setSliceCount(q);r.setSliceCount(q);n.setSliceCount(q)}};VVVV.Nodes.GregorianAstronomySplit.prototype=new VVVV.Core.Node;VVVV.Nodes.GregorianAstronomyJoin=
function(b,g){this.constructor(b,"Gregorian (Astronomy Join)",g);this.meta={authors:["Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Millisecond",[0],VVVV.PinTypes.Value),c=this.addInputPin("Second",[0],VVVV.PinTypes.Value),d=this.addInputPin("Minute",[0],VVVV.PinTypes.Value),f=this.addInputPin("Hour",[0],VVVV.PinTypes.Value),a=this.addInputPin("Day",[1],VVVV.PinTypes.Value),e=this.addInputPin("Month",[1],VVVV.PinTypes.Value),
l=this.addInputPin("Year",[2E3],VVVV.PinTypes.Value),r=this.addOutputPin("Time",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var n=this.getMaxInputSliceCount(),b=0;b<n;b++){var g=new Date;g.setMilliseconds(h.getValue(b));g.setSeconds(c.getValue(b));g.setMinutes(d.getValue(b));g.setHours(f.getValue(b));g.setDate(a.getValue(b));g.setMonth(e.getValue(b)-1);g.setYear(l.getValue(b));r.setValue(b,g.getTime()/864E5+25569)}}};VVVV.Nodes.GregorianAstronomyJoin.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){function b(d,f,a){a?(this.constructor(d,f,a),c||(c=new AudioContext),this.initialize=function(){this.createAPIMultiNode(1);this.createAudioPins();this.createParamPins()},this.destroy=function(){this.truncateAPIMultiNode(0)},this.audioInputPins=[],this.audioOutputPins=[],this.paramPins=[],this.modulationPins=[],this.apiMultiNode=[],this.auto_nil=!1):(this.createAPISingleNode=function(a){var f="Analyser"==d?c.createAnalyser(a):"MediaElementSource"==d?c.createMediaElementSource(a):"Oscillator"==
d?c.createOscillator(a):"Delay"==d?c.createDelay(a):"Gain"==d?c.createGain(a):"DynamicsCompressor"==d?c.createDynamicsCompressor(a):"BiquadFilter"==d?c.createBiquadFilter(a):"MediaStreamSource"==d?c.createMediaStreamSource(a):"Convolver"==d?c.createConvolver(a):"WaveShaper"==d?c.createWaveShaper(a):c["create"+d].apply(c,arguments);f._id=g++;return f},this.auto_evaluate=!1)}if(window.AudioContext){var g=0;VVVV.PinTypes.WebAudio={typeName:"WebAudio",reset_on_disconnect:!0,defaultValue:function(){return"Unconnected Audio"},
connectionChangedHandlers:{}};VVVV.PinTypes.AudioBuffer={typeName:"AudioBuffer",reset_on_disconnect:!0,defaultValue:function(){return"Empty audio buffer"},connectionChangedHandlers:{}};var h=function(d,f){this.srcApiNode=d;this.srcName=f;this.connections=[]};h.prototype={connect:function(d,f){console.log("CONNECT ",this.srcApiNode," OUTPUT ",this.srcName,"\n TO ",d," INPUT ",f);if("number"==typeof f)this.srcApiNode.connect(d,this.srcName,f);else if("string"==typeof f){var a=d[f];console.log("DEST PARAM ",
a);this.srcApiNode.connect(a,this.srcName)}else console.log("EEEK!",typeof f,f);this.connections.push({destApiNode:d,destName:f})},disconnect:function(d,f){console.log("DISCONNECT ",this.srcApiNode," OUTPUT ",this.srcName,"\n FROM ",d," INPUT ",f);var a=this;this.srcApiNode.disconnect(this.srcName);var e=-1;this.connections.forEach(function(l,c){l.destApiNode==d&&l.destName==f?e=c:"number"==typeof l.destName?a.srcApiNode.connect(l.destApiNode,a.srcName,l.destName):"string"==typeof l.destName&&a.srcApiNode.connect(l.destApiNode[l.destName],
a.srcName)});-1!=e?this.connections.splice(e,1):console.log("Warning: Connection removal bug detected!")},toString:function(){return this.srcApiNode.constructor.name+":"+this.srcName+" ("+this.srcApiNode.channelCount+"ch)"}};var c=null;b.prototype=new VVVV.Core.Node;b.prototype.truncateAPIMultiNode=function(d){var f=this;this.audioInputPins.concat(this.modulationPins).forEach(function(a){for(var e=d;e<f.apiMultiNode.length;e++){var l=a.oldValue[e];l&&"Unconnected Audio"!=l&&l.disconnect(f.apiMultiNode[e],
a.apiName);delete a.oldValue[e]}});this.apiMultiNode.splice(d)};b.prototype.createAPIMultiNode=function(d){for(var f=this,a=[].slice.call(arguments,1),e=this.apiMultiNode.length;e<d;e++){var l=[];a.forEach(function(a){a instanceof Array?l.push(a[e]):l.push(a)});this.apiMultiNode[e]=this.createAPISingleNode.apply(this.createAPISingleNode,l);this.audioOutputPins.forEach(function(a){a.setValue(e,new h(f.apiMultiNode[e],a.apiName))})}this.apiNode=this.apiMultiNode[0]};b.prototype.resizeAPIMultiNode=function(d){this.truncateAPIMultiNode(d);
this.createAPIMultiNode(d)};b.prototype.createAudioPins=function(){for(var d=0;d<this.apiNode.numberOfInputs;d++){var f=this.addInputPin("Input "+(d+1),[],VVVV.PinTypes.WebAudio);f.apiName=d;f.oldValue=[];this.audioInputPins.push(f)}for(d=0;d<this.apiNode.numberOfOutputs;d++)f="Output "+(d+1),this.outputPins.hasOwnProperty(f)?(f=this.outputPins[f],f.setType(VVVV.PinTypes.WebAudio),f.setValue(0,new h(this.apiNode,d))):f=this.addOutputPin(f,[new h(this.apiNode,d)],VVVV.PinTypes.WebAudio),f.apiName=
d,f.audioConnections=[],this.audioOutputPins.push(f)};b.prototype.createParamPins=function(){for(var d in this.apiNode){var f=this.apiNode[d];if(f instanceof AudioParam){var a=d.replace(/([a-z^])([A-Z])/g,"$1 $2"),a=a.charAt(0).toUpperCase()+a.slice(1),f=this.addInputPin(a,[f.defaultValue],VVVV.PinTypes.Value);f.apiName=d;this.paramPins.push(f);a=this.addInputPin(a+" Modulation",[],VVVV.PinTypes.WebAudio);a.apiName=d;a.oldValue=[];this.modulationPins.push(a)}}};b.prototype.updateParamPins=function(){var d=
this;this.paramPins.forEach(function(f,a){f.pinIsChanged()&&d.apiMultiNode.forEach(function(a,d){a[f.apiName].value=f.getValue(d)})})};b.prototype.getAudioSliceCount=function(){return this.getMaxInputSliceCount()};b.prototype.updateAudioConnections=function(){var d=this,f=this.getAudioSliceCount(),a=this.apiMultiNode.length;this.resizeAPIMultiNode(f);f!=a&&d.audioOutputPins.forEach(function(a){a.setSliceCount(f)});this.audioInputPins.concat(this.modulationPins).forEach(function(e){var l=f;f!=a&&(l=
a);for(e.pinIsChanged()&&(l=0);l<f;l++){var c=e.getValue(l),n=e.oldValue[l];n==c?console.log("No change!"):(n&&"Unconnected Audio"!=n&&n.disconnect(d.apiMultiNode[l],e.apiName),c&&"Unconnected Audio"!=c&&(console.log(c),c.connect(d.apiMultiNode[l],e.apiName)),e.oldValue[l]=c)}})};VVVV.Nodes.FileAudioBuffer=function(d,f){this.constructor(d,"FileAudioBuffer (HTML5 Audio)",f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};var a=this;this.auto_evaluate=!1;
var e=this.addInputPin("Filename",[""],VVVV.PinTypes.String),l=this.addOutputPin("Audio Out",[],VVVV.PinTypes.AudioBuffer);this.evaluate=function(){if(c&&e.pinIsChanged()){for(var f=this.getMaxInputSliceCount(),d=0;d<f;d++){var h=VVVV.Helpers.prepareFilePath(e.getValue(d),this.parentPatch),b=new XMLHttpRequest;b.open("GET",h,!0);b.responseType="arraybuffer";b.onload=function(e){return function(){c.decodeAudioData(b.response,function(f){e<a.getMaxInputSliceCount()&&l.setValue(e,f)})}}(d);b.send()}l.setSliceCount(f)}}};
VVVV.Nodes.FileAudioBuffer.prototype=new VVVV.Core.Node;VVVV.Nodes.FFT=function(d,f){b.call(this,d,"FFT (HTML5 Audio)",f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};this.auto_evaluate=!0;var a=this.addInputPin("FFTSize",[2048],VVVV.PinTypes.Value),e=this.addInputPin("Smoothing",[.8],VVVV.PinTypes.Value),l=this.addOutputPin("FFT",[],VVVV.PinTypes.Value),c=new Float32Array(1024),n=1024;this.evaluate=function(){var f=this.getMaxInputSliceCount();f==this.apiMultiNode.length||
a.pinIsChanged()||(l.setSliceCount(n*f),c=new Float32Array(n));this.updateAudioConnections();if(a.pinIsChanged()){for(var d=n=0;d<f;d++){var h=a.getValue(d);32>h&&(h=32);32768<h&&(h=32768);h=Math.pow(2,Math.round(Math.log(h)/Math.log(2)));this.apiMultiNode[d].fftSize=h;n=Math.max(h/2,n)}n!=c.length&&(l.setSliceCount(n*f),c=new Float32Array(n))}for(d=0;d<f;d++)for(e.pinIsChanged()&&(this.apiMultiNode[d].smoothingTimeConstant=e.getValue(d)),this.apiMultiNode[d].getFloatFrequencyData(c),h=0;h<n;h++)l.setValue(d*
n+h,c[h])}};VVVV.Nodes.FFT.prototype=new b("Analyser");VVVV.Nodes.MediaElementSource=function(d,f){b.call(this,d,"MediaElementSource (HTML5 Audio)",f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};var a=this.addInputPin("Audio",[],this),e=this.addOutputPin("Output",[],VVVV.PinTypes.WebAudio);e.apiName=0;this.audioOutputPins.push(e);this.initialize=function(){};var l=[];this.evaluate=function(){if(a.pinIsChanged()){var f=this.getMaxInputSliceCount();e.setSliceCount(f);
l.length=f;for(var d=0;d<f;d++){var c=a.getValue(d);c&&c!=l[d]&&(l[d]=c,this.apiMultiNode[d]=this.createAPISingleNode(c),c.volume=1,e.setValue(d,new h(this.apiMultiNode[d],0)))}}this.updateAudioConnections()}};VVVV.Nodes.MediaElementSource.prototype=new b("MediaElementSource");VVVV.Nodes.AudioDestination=function(d,f){b.call(this,d,"AudioDestination (HTML5 Audio)",f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};this.createAPISingleNode=function(){return c.destination};
this.evaluate=function(){this.updateAudioConnections()}};VVVV.Nodes.AudioDestination.prototype=new b("AudioDestination");VVVV.Nodes.AudioIn=function(d,f){b.call(this,d,"AudioIn (HTML5 Audio)",f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};var a=this,e=this.addOutputPin("Status",["Waiting"],VVVV.PinTypes.String);this.initialize=function(){navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia;navigator.getUserMedia?
navigator.getUserMedia({audio:{mandatory:{googEchoCancellation:"false",googAutoGainControl:"false",googNoiseSuppression:"false",googHighpassFilter:"false"},optional:[]}},function(f){a.createAPIMultiNode(1,f);a.createAudioPins();e.setValue(0,"OK")},function(a){e.setValue(0,a)}):e.setValue(0,"Error: getUserMedia not supported!")};this.evaluate=function(){this.updateAudioConnections()}};VVVV.Nodes.AudioIn.prototype=new b("MediaStreamSource");VVVV.Nodes.Oscillator=function(d,f){b.call(this,d,"Oscillator (HTML5 Audio)",
f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};var a=this.addInputPin("Type",["sine"],VVVV.PinTypes.Enum);a.enumOptions=["sine","square","sawtooth","triangle","custom"];this.createAPISingleNode=function(){var a=c.createOscillator();a.start();return a};this.evaluate=function(){this.updateAudioConnections();this.updateParamPins();var e=this.getMaxInputSliceCount();if(a.pinIsChanged())for(var f=0;f<e;f++)this.apiMultiNode[f].type=a.getValue(f)}};VVVV.Nodes.Oscillator.prototype=
new b("Oscillator");VVVV.Nodes.DelayAudio=function(d,f){b.call(this,d,"Delay (HTML5 Audio)",f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};var a=this.addInvisiblePin("Maximum Delay",[1],VVVV.PinTypes.Value);this.createAPISingleNode=function(){return c.createDelay(a.getValue(0))};this.evaluate=function(){this.updateAudioConnections();this.updateParamPins()}};VVVV.Nodes.DelayAudio.prototype=new b("Delay");VVVV.Nodes.Gain=function(d,f){b.call(this,d,"Gain (HTML5 Audio)",
f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};this.evaluate=function(){this.updateAudioConnections();this.updateParamPins()}};VVVV.Nodes.Gain.prototype=new b("Gain");VVVV.Nodes.AddAudio=function(d,f){b.call(this,d,"Add (HTML5 Audio)",f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};var a=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),e=this,l=function(){var f=Math.max(2,a.getValue(0));VVVV.Helpers.dynamicPins(e,
e.audioInputPins,f,function(a){a=e.addInputPin("Input "+(a+1),[],VVVV.PinTypes.WebAudio);a.apiName=0;a.oldValue=[];return a})};this.initialize=function(){this.createAPIMultiNode(1);this.createAudioPins()};this.evaluate=function(){a.pinIsChanged()&&l();this.updateAudioConnections()}};VVVV.Nodes.AddAudio.prototype=new b("Gain");VVVV.Nodes.AddAudioSpectral=function(d,f){b.call(this,d,"Add (HTML5 Audio Spectral)",f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};
var a;this.createAPISingleNode=function(){a||(a=c.createGain());return a};this.initialize=function(){this.createAPIMultiNode(1);this.createAudioPins()};this.evaluate=function(){this.updateAudioConnections();this.audioOutputPins[0].setSliceCount(1)}};VVVV.Nodes.AddAudioSpectral.prototype=new b("Gain");VVVV.Nodes.Convolver=function(d,f){b.call(this,d,"Convolver (HTML5 Audio)",f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};var a=this.addInputPin("Impulse Response",
[],VVVV.PinTypes.AudioBuffer),e=this.addInputPin("Normalize",[1],VVVV.PinTypes.Value);this.evaluate=function(){this.updateAudioConnections();this.updateParamPins();if(e.pinIsChanged()||a.pinIsChanged())for(var f=this.getMaxInputSliceCount(),d=0;d<f;d++)this.apiMultiNode[d].normalize=.5<e.getValue(d),a.getValue(d)instanceof AudioBuffer&&(this.apiMultiNode[d].buffer=a.getValue(d))}};VVVV.Nodes.Convolver.prototype=new b("Convolver");VVVV.Nodes.WaveShaper=function(d,f){b.call(this,d,"WaveShaper (HTML5 Audio)",
f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};var a=this.addInputPin("Curve",[],VVVV.PinTypes.Value),e=this.addInputPin("Bin Size",[-1],VVVV.PinTypes.Value),l=this.addInputPin("Oversample",[1],VVVV.PinTypes.Enum);l.enumOptions=["none","2x","4x"];this.getAudioSliceCount=function(){return Math.max(this.audioInputPins[0].getSliceCount(),l.getSliceCount(),e.getSliceCount())};this.evaluate=function(){this.updateAudioConnections();this.updateParamPins();
var f=this.getAudioSliceCount();if(a.pinIsChanged()||e.pinIsChanged())for(var d=0,c=0;c<f;c++){var h=e.getValue(c);0>h&&(h=Math.ceil(a.getSliceCount()/-h));var b=new Float32Array(a.getValue(d/h,h));console.log(b);2<b.length&&(this.apiMultiNode[c].curve=b);d+=h}if(l.pinIsChanged())for(c=0;c<f;c++)this.apiMultiNode[c].oversample=l.getValue(c)}};VVVV.Nodes.WaveShaper.prototype=new b("WaveShaper");VVVV.Nodes.BiquadFilter=function(d,f){b.call(this,d,"BiquadFilter (HTML5 Audio)",f);this.meta={authors:["Lukas Winter"],
original_authors:[],credits:[],compatibility_issues:[]};var a=this.addInputPin("Type",["lowpass"],VVVV.PinTypes.Enum);a.enumOptions="lowpass highpass bandpass lowshelf highshelf peaking notch allpass".split(" ");this.evaluate=function(){this.updateAudioConnections();this.updateParamPins();if(a.pinIsChanged())for(var e=this.getMaxInputSliceCount(),f=0;f<e;f++)this.apiMultiNode[f].type=a.getValue(f)}};VVVV.Nodes.BiquadFilter.prototype=new b("BiquadFilter");VVVV.Nodes.DynamicsCompressor=function(d,f){b.call(this,
d,"DynamicsCompressor (HTML5 Audio)",f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};this.auto_evaluate=!0;var a=this.addOutputPin("Reduction",[0],VVVV.PinTypes.Value);this.evaluate=function(){this.updateAudioConnections();this.updateParamPins();this.apiMultiNode.forEach(function(e,f){a.setValue(f,e.reduction.value)})}};VVVV.Nodes.DynamicsCompressor.prototype=new b("DynamicsCompressor");VVVV.Nodes.BeatDetector=function(d,f){b.call(this,d,"BeatDetector (HTML5 Audio)",
f);this.meta={authors:["Lukas Winter"],original_authors:[],credits:[],compatibility_issues:[]};this.auto_evaluate=!0;var a=new Float32Array(1024),e=[],l=this.addOutputPin("Beat Counter",[0],VVVV.PinTypes.Value),h=this.addOutputPin("BPM",[0],VVVV.PinTypes.Value);this.createAPISingleNode=function(){var a=c.createAnalyser();a.fftSize=2048;a.smoothingTimeConstant=0;return a};this.evaluate=function(){this.updateAudioConnections();for(var f=this.getMaxInputSliceCount(),d=0;d<f;d++)e[d]||(e[d]=new BeatDetektor),
this.apiMultiNode[d].getFloatFrequencyData(a),e[d].process(c.currentTime,a),l.setValue(d,e[d].beat_counter),h.setValue(d,e[d].win_bpm_int/10);e.length=f;l.setSliceCount(f);h.setSliceCount(f)}};VVVV.Nodes.BeatDetector.prototype=new b("Analyser");VVVV.Nodes.BeatDetector.requirements=["beatdetektor"]}})(vvvvjs_jquery);(function(k){VVVV.Nodes.And=function(b,g){this.constructor(b,"AND (Boolean)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),c=[],d=this.addOutputPin("Output",[1],VVVV.PinTypes.Value);this.initialize=function(){var f=Math.max(2,h.getValue(0));VVVV.Helpers.dynamicPins(this,c,f,function(a){return this.addInputPin("Input "+(a+1),[1],VVVV.PinTypes.Value)})};this.evaluate=function(){h.pinIsChanged()&&
this.initialize();for(var f=this.getMaxInputSliceCount(),a=c.length,e,l=0;l<f;l++){e=!0;for(var r=0;r<a;r++)e=e&&.5<=c[r].getValue(l);d.setValue(l,e?1:0)}d.setSliceCount(f)}};VVVV.Nodes.And.prototype=new VVVV.Core.Node;VVVV.Nodes.Or=function(b,g){this.constructor(b,"OR (Boolean)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),c=[],d=this.addOutputPin("Output",[1],VVVV.PinTypes.Value);
this.initialize=function(){var f=Math.max(2,h.getValue(0));VVVV.Helpers.dynamicPins(this,c,f,function(a){return this.addInputPin("Input "+(a+1),[1],VVVV.PinTypes.Value)})};this.evaluate=function(){h.pinIsChanged()&&this.initialize();for(var f=this.getMaxInputSliceCount(),a=c.length,e,l=0;l<f;l++){e=!1;for(var r=0;r<a;r++)e=e||.5<=c[r].getValue(l);d.setValue(l,e?1:0)}d.setSliceCount(f)}};VVVV.Nodes.Or.prototype=new VVVV.Core.Node;VVVV.Nodes.Not=function(b,g){this.constructor(b,"NOT (Boolean)",g);this.meta=
{authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input",[1],VVVV.PinTypes.Value),c=this.addOutputPin("Output",[1],VVVV.PinTypes.Value);this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),f=0;f<d;f++)c.setValue(f,1-Math.round(h.getValue(f)));c.setSliceCount(this.getMaxInputSliceCount())}};VVVV.Nodes.Not.prototype=new VVVV.Core.Node;VVVV.Nodes.OrSpectral=function(b,g){this.constructor(b,"OR (Boolean Spectral)",g);this.meta=
{authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Bin Size",[-1],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0,e=0,l=!1,r=0;r<f||0<c.getValue(0)&&(0<e||0!=a%c.getSliceCount());r++)0==e&&(l=!1),l=l||.5<=h.getValue(r),e++,0<c.getValue(0)?e>=c.getValue(a)&&(d.setValue(a,l?1:0),a++,e=
0):d.setValue(0,l?1:0);d.setSliceCount(a+(0<e))}};VVVV.Nodes.OrSpectral.prototype=new VVVV.Core.Node;VVVV.Nodes.AndSpectral=function(b,g){this.constructor(b,"AND (Boolean Spectral)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Bin Size",[-1],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),
a=0,e=0,l=!1,r=0;r<f||0<c.getValue(0)&&(0<e||0!=a%c.getSliceCount());r++)0==e&&(l=!0),l=l&&.5<=h.getValue(r),e++,0<c.getValue(0)?e>=c.getValue(a)&&(d.setValue(a,l?1:0),a++,e=0):d.setValue(0,l?1:0);d.setSliceCount(a+(0<e))}};VVVV.Nodes.AndSpectral.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Types.CanvasTexture={imageObject:void 0,loaded:!1};VVVV.Types.CanvasRenderState=function(){this.fillColor=new VVVV.Types.Color("1,1,1,1");this.strokeColor=new VVVV.Types.Color("0,0,0,0");this.lineWidth=1;this.capStyle="butt";this.joinStyle="miter";this.gradient={type:"none"};this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0;this.shadowColor=new VVVV.Types.Color("0,0,0,1");this.blendMode="source-over";this.copy_attributes=function(c){c.fillColor.copy_to(this.fillColor);c.strokeColor.copy_to(this.strokeColor);
this.lineWidth=c.lineWidth;this.capStyle=c.capStyle;this.joinStyle=c.joinStyle;this.gradient=c.gradient;this.shadowOffsetX=c.shadowOffsetX;this.shadowOffsetY=c.shadowOffsetY;this.shadowBlur=c.shadowBlur;c.shadowColor.copy_to(this.shadowColor);this.blendMode=c.blendMode};this.apply=function(c){if("none"!=this.gradient.type){if("linear"==this.gradient.type)var d=c.createLinearGradient(this.gradient.startX,this.gradient.startY,this.gradient.endX,this.gradient.endY);for(var f=Math.max(this.gradient.colors.length,
this.gradient.colorPositions.length),a=0;a<f;a++){var e=this.gradient.colors[a];d.addColorStop(this.gradient.colorPositions[a],"rgba("+parseInt(255*e.rgba[0])+","+parseInt(255*e.rgba[1])+","+parseInt(255*e.rgba[2])+","+e.rgba[3]+")")}c.fillStyle=d}else c.fillStyle="rgba("+parseInt(255*this.fillColor.rgba[0])+","+parseInt(255*this.fillColor.rgba[1])+","+parseInt(255*this.fillColor.rgba[2])+","+this.fillColor.rgba[3]+")";c.strokeStyle="rgba("+parseInt(255*this.strokeColor.rgba[0])+","+parseInt(255*
this.strokeColor.rgba[1])+","+parseInt(255*this.strokeColor.rgba[2])+","+this.strokeColor.rgba[3]+")";c.lineWidth=this.lineWidth/c.canvas.height;c.lineCap=this.capStyle;c.lineJoin=this.joinStyle;c.shadowOffsetX=this.shadowOffsetX;c.shadowOffsetY=this.shadowOffsetY;c.shadowBlur=this.shadowBlur;c.shadowColor="rgba("+parseInt(255*this.shadowColor.rgba[0])+","+parseInt(255*this.shadowColor.rgba[1])+","+parseInt(255*this.shadowColor.rgba[2])+","+this.shadowColor.rgba[3]+")";c.globalCompositeOperation=
this.blendMode}};var b=new VVVV.Types.CanvasRenderState,g=new VVVV.Types.CanvasRenderState;g.fillColor=new VVVV.Types.Color("0.0, 0.0, 0.0, 0.0");VVVV.PinTypes.CanvasRenderState={typeName:"CanvasRenderState",reset_on_disconnect:!0,defaultValue:function(){return b}};VVVV.Types.CanvasLayer=function(){this.draw=function(){}};var h=new VVVV.Types.CanvasLayer;VVVV.PinTypes.CanvasLayer={typeName:"CanvasLayer",reset_on_disconnect:!0,defaultValue:function(){return h}};VVVV.Nodes.FillCanvas=function(c,d){this.constructor(c,
"Fill (Canvas VVVVjs RenderState)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.CanvasRenderState),a=this.addInputPin("Color",[new VVVV.Types.Color("1.0, 1.0, 1.0, 1.0")],VVVV.PinTypes.Color),e=this.addOutputPin("Render State Out",[],VVVV.PinTypes.CanvasRenderState),l=[];this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),c=0;c<d;c++)void 0==l[c]&&(l[c]=new VVVV.Types.CanvasRenderState),
l[c].copy_attributes(f.getValue(c)),a.getValue(c).copy_to(l[c].fillColor),e.setValue(c,l[c]);e.setSliceCount(d)}};VVVV.Nodes.FillCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.StrokeCanvas=function(c,d){this.constructor(c,"Stroke (Canvas VVVVjs RenderState)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.CanvasRenderState),a=this.addInputPin("Color",[new VVVV.Types.Color("1.0, 1.0, 1.0, 1.0")],
VVVV.PinTypes.Color),e=this.addInputPin("Width",[1],VVVV.PinTypes.Value),l=this.addInputPin("Cap Style",["butt"],VVVV.PinTypes.Enum);l.enumOptions=["butt","round","square"];var h=this.addInputPin("Join Style",["miter"],VVVV.PinTypes.Enum);h.enumOptions=["miter","round","bevel"];var n=this.addOutputPin("Render State Out",[],VVVV.PinTypes.CanvasRenderState),b=[];this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),c=0;c<d;c++)void 0==b[c]&&(b[c]=new VVVV.Types.CanvasRenderState),b[c].copy_attributes(f.getValue(c)),
a.getValue(c).copy_to(b[c].strokeColor),b[c].lineWidth=e.getValue(c),b[c].capStyle=l.getValue(c),b[c].joinStyle=h.getValue(c),n.setValue(c,b[c]);n.setSliceCount(d)}};VVVV.Nodes.StrokeCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.ShadowCanvas=function(c,d){this.constructor(c,"Shadow (Canvas VVVVjs RenderState)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.CanvasRenderState),a=this.addInputPin("Color",
[new VVVV.Types.Color("0.0, 0.0, 0.0, 1.0")],VVVV.PinTypes.Color),e=this.addInputPin("Offset X",[0],VVVV.PinTypes.Value),l=this.addInputPin("Offset Y",[0],VVVV.PinTypes.Value),h=this.addInputPin("Blur",[0],VVVV.PinTypes.Value),n=this.addOutputPin("Render State Out",[],VVVV.PinTypes.CanvasRenderState),b=[];this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),c=0;c<d;c++)void 0==b[c]&&(b[c]=new VVVV.Types.CanvasRenderState),b[c].copy_attributes(f.getValue(c)),b[c].shadowOffsetX=e.getValue(c),
b[c].shadowOffsetY=l.getValue(c),b[c].shadowBlur=h.getValue(c),a.getValue(c).copy_to(b[c].shadowColor),n.setValue(c,b[c]);n.setSliceCount(d)}};VVVV.Nodes.ShadowCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.BlendCanvas=function(c,d){this.constructor(c,"Blend (Canvas VVVVjs RenderState)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.CanvasRenderState),a=this.addInputPin("Mode",["source-over"],
VVVV.PinTypes.Enum);a.enumOptions="source-over source-out source-in source-atop destination-over destination-out destination-in destination-atop copy lighter xor".split(" ");var e=this.addOutputPin("Render State Out",[],VVVV.PinTypes.CanvasRenderState),l=[];this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),c=0;c<d;c++)void 0==l[c]&&(l[c]=new VVVV.Types.CanvasRenderState),l[c].copy_attributes(f.getValue(c)),l[c].blendMode=a.getValue(c),e.setValue(c,l[c]);e.setSliceCount(d)}};VVVV.Nodes.BlendCanvas.prototype=
new VVVV.Core.Node;VVVV.Nodes.LinearGradientCanvas=function(c,d){this.constructor(c,"LinearGradient (Canvas VVVVjs RenderState)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.CanvasRenderState),a=this.addInputPin("Start X",[0],VVVV.PinTypes.Value),e=this.addInputPin("Start Y",[0],VVVV.PinTypes.Value),l=this.addInputPin("End X",[0],VVVV.PinTypes.Value),h=this.addInputPin("End Y",[0],VVVV.PinTypes.Value),
b=this.addInputPin("Colors",[new VVVV.Types.Color("1.0, 1.0, 1.0, 1.0"),new VVVV.Types.Color("0.0, 0.0, 0.0, 1.0")],VVVV.PinTypes.Color),g=this.addInputPin("Color Positions",[0,1],VVVV.PinTypes.Value),p=this.addOutputPin("Render State Out",[],VVVV.PinTypes.CanvasRenderState),m=[];this.evaluate=function(){for(var d=Math.max(f.getSliceCount(),a.getSliceCount()),d=Math.max(d,e.getSliceCount()),d=Math.max(d,l.getSliceCount()),d=Math.max(d,h.getSliceCount()),c=0;c<d;c++){void 0==m[c]&&(m[c]=new VVVV.Types.CanvasRenderState);
m[c].copy_attributes(f.getValue(c));m[c].gradient={type:"linear"};m[c].gradient.startX=a.getValue(c);m[c].gradient.startY=e.getValue(c);m[c].gradient.endX=l.getValue(c);m[c].gradient.endY=h.getValue(c);m[c].gradient.colors=[];m[c].gradient.colorPositions=[];for(var k=Math.max(b.getSliceCount(),g.getSliceCount()),w=0;w<k;w++)m[c].gradient.colors.push(b.getValue(w)),m[c].gradient.colorPositions.push(g.getValue(w));p.setValue(c,m[c])}p.setSliceCount(d)}};VVVV.Nodes.LinearGradientCanvas.prototype=new VVVV.Core.Node;
VVVV.Nodes.ArcCanvas=function(c,d){this.constructor(c,"Arc (Canvas VVVVjs)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State",[],VVVV.PinTypes.CanvasRenderState),a=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),e=this.addInputPin("Clipping Layer",[],VVVV.PinTypes.CanvasLayer),l=this.addInputPin("Radius",[1],VVVV.PinTypes.Value),r=this.addInputPin("Start Angle",[0],VVVV.PinTypes.Value),n=this.addInputPin("End Angle",
[.5],VVVV.PinTypes.Value),q=this.addInputPin("Draw Segment",[0],VVVV.PinTypes.Value),p=this.addOutputPin("Layer",[],VVVV.PinTypes.CanvasLayer),m=[],k=function(){this.transform=mat4.create();mat4.identity(this.transform);this.startAngle=0;this.endAngle=.5;this.strokeColor=[1,1,1,1];this.lineWidth=1;this.renderState=b;this.clippingLayer=h;this.drawSegment=!1;this.draw=function(a,e){this.clippingLayer!=h&&(a.save(),this.clippingLayer.draw(a,!0),a.clip());a.restoreView();this.transform&&a.transform(this.transform[0],
this.transform[1],this.transform[4],this.transform[5],this.transform[12],this.transform[13]);a.scale(.01,.01);a.beginPath();e?g.apply(a):this.renderState.apply(a);a.lineWidth*=100;this.drawSegment&&(a.moveTo(0,0),a.lineTo(Math.cos(this.startAngle)*this.radius,Math.sin(this.startAngle)*this.radius));a.arc(0,0,100*this.radius,this.startAngle,this.endAngle,!1);this.drawSegment&&(a.moveTo(Math.cos(this.endAngle)*this.radius,Math.sin(this.endAngle)*this.radius),a.lineTo(0,0));0<this.renderState.fillColor.rgba[3]&&
a.fill();0<this.renderState.strokeColor.rgba[3]&&a.stroke();this.clippingLayer!=h&&a.restore()}};this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),c=0;c<d;c++)void 0==m[c]&&(m[c]=new k),m[c].transform=a.getValue(c),m[c].radius=l.getValue(c),m[c].startAngle=r.getValue(c)*Math.PI*2,m[c].endAngle=n.getValue(c)*Math.PI*2,m[c].renderState=f.getValue(c),m[c].drawSegment=1==q.getValue(c),0>m[c].radius&&(m[c].radius=-m[c].radius,m[c].startAngle+=Math.PI,m[c].endAngle+=Math.PI),m[c].clippingLayer=
e.getValue(c);for(c=0;c<m.length;c++)p.setValue(c,m[c]);p.setSliceCount(d)}};VVVV.Nodes.ArcCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.RectangleCanvas=function(c,d){this.constructor(c,"Rectangle (Canvas VVVVjs)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State",[],VVVV.PinTypes.CanvasRenderState),a=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),e=this.addInputPin("Clipping Layer",[],VVVV.PinTypes.CanvasLayer),
l=this.addInputPin("Width",[1],VVVV.PinTypes.Value),r=this.addInputPin("Height",[1],VVVV.PinTypes.Value),n=this.addInputPin("Corner Radius",[0],VVVV.PinTypes.Value),q=this.addOutputPin("Layer",[],VVVV.PinTypes.CanvasLayer),p=[],m=function(){this.transform=mat4.create();mat4.identity(this.transform);this.renderState=b;this.clippingLayer=h;this.draw=function(a,e){this.clippingLayer!=h&&(a.save(),this.clippingLayer.draw(a,!0),a.clip());a.restoreView();this.transform&&a.transform(this.transform[0],this.transform[1],
this.transform[4],this.transform[5],this.transform[12],this.transform[13]);a.scale(.01,.01);a.beginPath();e?g.apply(a):this.renderState.apply(a);a.lineWidth*=100;var f=100*this.width/2,d=f-100*this.cornerRadius,c=100*this.height/2,l=c-100*this.cornerRadius,b=-f,n=-d,r=-c,m=-l;a.moveTo(n,r);a.lineTo(d,r);a.arc(d,m,100*this.cornerRadius,1.5*Math.PI,0,!1);a.lineTo(f,l);a.arc(d,l,100*this.cornerRadius,0,.5*Math.PI,!1);a.lineTo(n,c);a.arc(n,l,100*this.cornerRadius,.5*Math.PI,Math.PI,!1);a.lineTo(b,m);
a.arc(n,m,100*this.cornerRadius,Math.PI,1.5*Math.PI,!1);a.closePath();0<this.renderState.fillColor.rgba[3]&&a.fill();0<this.renderState.strokeColor.rgba[3]&&a.stroke();this.clippingLayer!=h&&a.restore()}};this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),c=0;c<d;c++)void 0==p[c]&&(p[c]=new m),p[c].transform=a.getValue(c),p[c].width=l.getValue(c),p[c].height=r.getValue(c),p[c].cornerRadius=n.getValue(c),p[c].renderState=f.getValue(c),p[c].clippingLayer=e.getValue(c);for(c=0;c<p.length;c++)q.setValue(c,
p[c]);q.setSliceCount(d)}};VVVV.Nodes.RectangleCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.TextCanvas=function(c,d){this.constructor(c,"Text (Canvas VVVVjs)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State",[],VVVV.PinTypes.CanvasRenderState),a=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),e=this.addInputPin("Clipping Layer",[],VVVV.PinTypes.CanvasLayer),l=this.addInputPin("Text",["VVVV.js"],VVVV.PinTypes.String),
r=this.addInputPin("Font",["10px sans-serif"],VVVV.PinTypes.String),n=this.addInputPin("Align",["start"],VVVV.PinTypes.Enum);n.enumOptions=["start","left","end","right","center"];var q=this.addInputPin("Baseline",["alphabetic"],VVVV.PinTypes.Enum);q.enumOptions="top hanging middle alphabetic ideographic bottom".split(" ");var p=this.addOutputPin("Layer",[],VVVV.PinTypes.CanvasLayer),m=[],k=function(){this.transform=mat4.create();mat4.identity(this.transform);this.text="VVVV.js";this.font="sans-serif";
this.align="start";this.baseline="top";this.renderState=b;this.clippingLayer=h;this.draw=function(a,e){this.clippingLayer!=h&&(a.save(),this.clippingLayer.draw(a,!0),a.clip());a.restoreView();a.save();this.transform&&a.transform(this.transform[0],this.transform[1],this.transform[4],this.transform[5],this.transform[12],this.transform[13]);a.scale(.01,-.01);a.font="100px "+this.font;a.textAlign=this.align;a.textBaseline=this.baseline;e?g.apply(a):this.renderState.apply(a);0<this.renderState.fillColor.rgba[3]&&
a.fillText(this.text,0,0);0<this.renderState.strokeColor.rgba[3]&&a.strokeText(this.text,0,0);a.restore();this.clippingLayer!=h&&a.restore()}};this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),c=0;c<d;c++)void 0==m[c]&&(m[c]=new k),m[c].transform=a.getValue(c),m[c].text=l.getValue(c),m[c].font=r.getValue(c),m[c].align=n.getValue(c),m[c].baseline=q.getValue(c),m[c].renderState=f.getValue(c),m[c].clippingLayer=e.getValue(c);for(c=0;c<m.length;c++)p.setValue(c,m[c]);p.setSliceCount(d)}};
VVVV.Nodes.TextCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.BezierCurveCanvas=function(c,d){function f(a,e){a.x.splice(e);a.y.splice(e);a.c1x.splice(e);a.c1y.splice(e);a.c2x.splice(e);a.c2y.splice(e)}this.constructor(c,"BezierCurve (Canvas VVVVjs)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var a=this.addInputPin("Render State",[],VVVV.PinTypes.CanvasRenderState),e=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),l=this.addInputPin("Clipping Layer",
[],VVVV.PinTypes.CanvasLayer),r=this.addInputPin("X",[0],VVVV.PinTypes.Value),n=this.addInputPin("Y",[0],VVVV.PinTypes.Value),q=this.addInputPin("Control 1 X",[0],VVVV.PinTypes.Value),p=this.addInputPin("Control 1 Y",[0],VVVV.PinTypes.Value),m=this.addInputPin("Control 2 X",[0],VVVV.PinTypes.Value),k=this.addInputPin("Control 2 Y",[0],VVVV.PinTypes.Value),v=this.addInputPin("BinSize",[-1],VVVV.PinTypes.Value),z=this.addOutputPin("Layer",[],VVVV.PinTypes.CanvasLayer),w=[],y=function(){this.transform=
mat4.create();mat4.identity(this.transform);this.x=[];this.y=[];this.c1x=[];this.c1y=[];this.c2x=[];this.c2y=[];this.strokeColor=[1,1,1,1];this.lineWidth=1;this.fillColor=[1,1,1,1];this.renderState=b;this.clippingLayer=h;this.draw=function(a,e){if(!(1>this.x.length)){this.clippingLayer!=h&&(a.save(),this.clippingLayer.draw(a,!0),a.clip());e?g.apply(a):this.renderState.apply(a);a.restoreView();this.transform&&a.transform(this.transform[0],this.transform[1],this.transform[4],this.transform[5],this.transform[12],
this.transform[13]);a.beginPath();a.moveTo(this.x[0],this.y[0]);for(var f=1;f<this.x.length;f++)a.bezierCurveTo(this.c1x[f-1]+this.x[f-1],this.c1y[f-1]+this.y[f-1],this.c2x[f]+this.x[f],this.c2y[f]+this.y[f],this.x[f],this.y[f]);0<this.renderState.fillColor.rgba[3]&&a.fill();0<this.renderState.strokeColor.rgba[3]&&a.stroke();this.clippingLayer!=h&&a.restore()}}};this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),c=0,h=0,b=0;b<d||0<v.getValue(0)&&(0<h||0<c%e.getSliceCount());b++)void 0==
w[c]&&(w[c]=new y),0==h&&(w[c].renderState=a.getValue(c),w[c].transform=e.getValue(c),w[c].clippingLayer=l.getValue(c)),w[c].x[h]=r.getValue(b),w[c].y[h]=n.getValue(b),w[c].c1x[h]=q.getValue(b),w[c].c1y[h]=p.getValue(b),w[c].c2x[h]=m.getValue(b),w[c].c2y[h]=k.getValue(b),h++,0<v.getValue(0)&&h>=v.getValue(c)&&(h<w[c].x.length&&f(w[c],h),c++,h=0);0>v.getValue(0)?h<w[c].x.length&&(f(w[c],h),w.splice(1)):w.splice(c);for(d=0;d<w.length;d++)z.setValue(d,w[d]);z.setSliceCount(w.length)}};VVVV.Nodes.BezierCurveCanvas.prototype=
new VVVV.Core.Node;VVVV.Nodes.QuadCanvas=function(c,d){this.constructor(c,"Quad (Canvas VVVVjs)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),a=this.addInputPin("Clipping Layer",[],VVVV.PinTypes.CanvasLayer),e=this.addInputPin("Texture",[],VVVV.PinTypes.HTML5Texture),l=this.addInputPin("Color",[new VVVV.Types.Color("1.0, 1.0, 1.0, 1.0")],VVVV.PinTypes.Color),b=this.addOutputPin("Layer",
[],VVVV.PinTypes.CanvasLayer),n=[],g=function(){this.transform=mat4.create();this.clippingLayer=h;mat4.identity(this.transform);this.texture=VVVV.PinTypes.HTML5Texture.defaultValue();this.color=[1,1,1,1];this.draw=function(a,e){this.clippingLayer!=h&&(a.save(),this.clippingLayer.draw(a,!0),a.clip());a.restoreView();this.transform&&a.transform(this.transform[0],this.transform[1],this.transform[4],this.transform[5],this.transform[12],this.transform[13]);"Empty Texture"!=this.texture?this.texture.loaded&&
(a.globalAlpha=this.color[3],a.save(),a.translate(-.5,.5),this.texture.videoWidth?a.scale(1/this.texture.videoWidth,-1/this.texture.videoHeight):a.scale(1/this.texture.width,-1/this.texture.height),a.drawImage(this.texture,0,0),a.restore(),a.fillStyle="rgba(0, 0, 0, .001)",a.fillRect(-.5,-.5,1,1),a.globalAlpha=1):(a.fillStyle="rgba("+parseInt(255*this.color.rgba[0])+", "+parseInt(255*this.color.rgba[1])+", "+parseInt(255*this.color.rgba[2])+", "+this.color.rgba[3]+")",a.fillRect(-.5,-.5,1,1));this.clippingLayer!=
h&&a.restore()}};this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),c=0;c<d;c++)void 0==n[c]&&(n[c]=new g),n[c].transform=f.getValue(c),n[c].texture=e.getValue(c),n[c].color=l.getValue(c),n[c].clippingLayer=a.getValue(c);for(c=0;c<n.length;c++)b.setValue(c,n[c]);b.setSliceCount(d)}};VVVV.Nodes.QuadCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.GroupCanvas=function(c,d){this.constructor(c,"Group (Canvas VVVVjs)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],
compatibility_issues:[]};var f=this.addInvisiblePin("Layer Count",[2],VVVV.PinTypes.Value),a=[],e=this.addOutputPin("Layer",[],VVVV.PinTypes.CanvasLayer);this.initialize=function(){var e=Math.max(2,f.getValue(0));VVVV.Helpers.dynamicPins(this,a,e,function(a){return this.addInputPin("Layer "+(a+1),[],VVVV.PinTypes.CanvasLayer)})};this.evaluate=function(){f.pinIsChanged()&&this.initialize();for(var d=0,c=a.length,b,g=0;g<c;g++)if(a[g].isConnected()){b=a[g].getSliceCount();for(var p=0;p<b;p++)e.setValue(d++,
a[g].getValue(p))}0<d?e.setSliceCount(d):(e.setValue(0,h),e.setSliceCount(1))}};VVVV.Nodes.GroupCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.RendererCanvas=function(c,d){function f(a){function e(f){switch(f.which){case 1:VVVV.MousePositions._all.lb[0]=0;VVVV.MousePositions[a.id].lb[0]=0;break;case 2:VVVV.MousePositions._all.mb[0]=0;VVVV.MousePositions[a.id].mb[0]=0;break;case 3:VVVV.MousePositions._all.rb[0]=0,VVVV.MousePositions[a.id].rb[0]=0}}function f(a,e){for(var d=a.originalEvent.changedTouches.length;d--;){var c=
2*(a.originalEvent.changedTouches[d].pageX-k(e).offset().left)/k(e).width()-1,l=-(2*(a.originalEvent.changedTouches[d].pageY-k(e).offset().top)/k(e).height()-1);VVVV.MousePositions._all.x[a.originalEvent.changedTouches[d].identifier]=VVVV.MousePositions[e.id].x[a.originalEvent.changedTouches[d].identifier]=c;VVVV.MousePositions._all.y[a.originalEvent.changedTouches[d].identifier]=VVVV.MousePositions[e.id].y[a.originalEvent.changedTouches[d].identifier]=l}}k(a).detach("mousemove");k(a).detach("mousedown");
k(a).detach("mouseup");VVVV.MousePositions[a.id]={x:[0],y:[0],wheel:[0],lb:[0],mb:[0],rb:[0]};k(a).mousemove(function(e){var f=2*(e.pageX-k(this).offset().left)/k(this).width()-1;e=-(2*(e.pageY-k(this).offset().top)/k(this).height()-1);VVVV.MousePositions._all.x[0]=f;VVVV.MousePositions._all.y[0]=e;VVVV.MousePositions[a.id].x[0]=f;VVVV.MousePositions[a.id].y[0]=e});k(a).bind("mousewheel",function(e){e=e.originalEvent.wheelDelta/120;VVVV.MousePositions[a.id].wheel[0]+=e;VVVV.MousePositions._all.wheel[0]+=
e});k(a).bind("DOMMouseScroll",function(e){e=-e.originalEvent.detail/3;VVVV.MousePositions[a.id].wheel[0]+=e;VVVV.MousePositions._all.wheel[0]+=e});k(a).mousedown(function(f){switch(f.which){case 1:VVVV.MousePositions._all.lb[0]=1;VVVV.MousePositions[a.id].lb[0]=1;break;case 2:VVVV.MousePositions._all.mb[0]=1;VVVV.MousePositions[a.id].mb[0]=1;break;case 3:VVVV.MousePositions._all.rb[0]=1,VVVV.MousePositions[a.id].rb[0]=1}k(document).unbind("mouseup",e);k(document).mouseup(e)});k(a).bind("touchstart",
function(e){for(var d=e.originalEvent.changedTouches.length;d--;)VVVV.MousePositions._all.lb[e.originalEvent.changedTouches[d].identifier]=VVVV.MousePositions[a.id].lb[e.originalEvent.changedTouches[d].identifier]=1;f(e,this)});k(a).bind("touchend",function(e){for(var f=e.originalEvent.changedTouches.length;f--;)VVVV.MousePositions._all.lb[e.originalEvent.changedTouches[f].identifier]=VVVV.MousePositions[a.id].lb[e.originalEvent.changedTouches[f].identifier]=0});k(a).bind("touchmove",function(a){f(a,
this);a.preventDefault()})}this.constructor(c,"Renderer (Canvas VVVVjs)",d);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_nil=!1;var a=this.addInputPin("Layers",[],VVVV.PinTypes.CanvasLayer);this.addInputPin("Clear",[1],VVVV.PinTypes.Value);var e=this.addInputPin("Background Color",[new VVVV.Types.Color("0.0, 0.0, 0.0, 1.0")],VVVV.PinTypes.Color),l=this.addInputPin("Backbuffer Width",[0],VVVV.PinTypes.Value),h=this.addInputPin("Backbuffer Height",
[0],VVVV.PinTypes.Value),n=this.addInputPin("View",[],VVVV.PinTypes.Transform),g=this.addOutputPin("Canvas Out",[],VVVV.PinTypes.CanvasGraphics),p,m,x,v=[0,0,0,1],z,w=mat4.create(),y;this.getContext=function(){var a=this.invisiblePins["Descriptive Name"].getValue(0);if((a=k(a).get(0))&&"CANVAS"==a.nodeName)z=a;else{var e=parseInt(l.getValue(0)),d=parseInt(h.getValue(0));z=k('<canvas width="'+(0<e?e:512)+'" height="'+(0<d?d:512)+'" id="vvvv-js-generated-renderer-'+(new Date).getTime()+'" class="vvvv-js-generated-renderer"></canvas>');
a||(a="body");k(a).append(z);z=z.get(0)}m=z.width;x=z.height;z&&z.getContext&&(f(z),p=z.getContext("2d"),z.ctx=p,p.restoreView=function(){p.setTransform(w[0],w[1],w[4],w[5],w[12],w[13])})};this.destroy=function(){k(z).remove()};this.evaluate=function(){this.invisiblePins["Descriptive Name"].pinIsChanged()&&(k(z).hasClass("vvvv-js-generated-renderer")&&k(z).remove(),this.getContext());if(p){if(l.pinIsChanged()||h.pinIsChanged()){var f=parseInt(l.getValue(0)),d=parseInt(h.getValue(0));0<f&&(m=f,k(z).attr("width",
m));0<d&&(x=d,k(z).attr("height",x));y=mat4.create([m/2,0,0,0,0,-x/2,0,0,0,0,1,0,m/2,x/2,0,1]);n.getValue(0)&&mat4.multiply(y,n.getValue(0),w)}e.pinIsChanged()&&void 0!=e.getValue(0)&&(f=e.getValue(0),v[0]=parseInt(255*f.rgba[0]),v[1]=parseInt(255*f.rgba[1]),v[2]=parseInt(255*f.rgba[2]),v[3]=f.rgba[3]);b.apply(p);p.setTransform(1,0,0,1,0,0);1>v[3]&&p.clearRect(0,0,m,x);p.fillStyle="rgba("+v[0]+","+v[1]+","+v[2]+","+v[3]+")";p.fillRect(0,0,m,x);n.pinIsChanged()&&mat4.multiply(y,n.getValue(0),w);p.restoreView();
if(a.isConnected())for(f=0;f<a.getSliceCount();f++)void 0!=a.getValue(f)&&a.getValue(f).draw(p);g.setValue(0,z);z.loaded=!0}}};VVVV.Nodes.RendererCanvas.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.PinTypes.Color={typeName:"Color",reset_on_disconnect:!1,defaultValue:function(){return new VVVV.Types.Color("1.0, 1.0, 1.0, 1.0")},primitive:!0};VVVV.Nodes.RGBJoin=function(b,g){this.constructor(b,"RGB (Color Join)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Red",[1],VVVV.PinTypes.Value),c=this.addInputPin("Green",[1],VVVV.PinTypes.Value),d=this.addInputPin("Blue",[1],VVVV.PinTypes.Value),
f=this.addInputPin("Alpha",[1],VVVV.PinTypes.Value),a=this.addOutputPin("Output",[],VVVV.PinTypes.Color),e=[];this.evaluate=function(){for(var l=this.getMaxInputSliceCount(),b=0;b<l;b++)e[b]||(e[b]=new VVVV.Types.Color("0.0,0.0,0.0,0.0")),e[b].rgba[0]=h.getValue(b)||0,e[b].rgba[1]=c.getValue(b)||0,e[b].rgba[2]=d.getValue(b)||0,e[b].rgba[3]=f.getValue(b)||0,a.setValue(b,e[b]);e.length=l;a.setSliceCount(l)}};VVVV.Nodes.RGBJoin.prototype=new VVVV.Core.Node;VVVV.Nodes.HSVJoin=function(b,g){this.constructor(b,
"HSV (Color Join)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Hue",[.33],VVVV.PinTypes.Value),c=this.addInputPin("Saturation",[0],VVVV.PinTypes.Value),d=this.addInputPin("Value",[1],VVVV.PinTypes.Value),f=this.addInputPin("Alpha",[1],VVVV.PinTypes.Value),a=this.addOutputPin("Output",[],VVVV.PinTypes.Color),e=[],l,r,n,q;this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++)l=h.getValue(g),
r=c.getValue(g),n=d.getValue(g),q=f.getValue(g),e[g]||(e[g]=new VVVV.Types.Color("0.0, 0.0, 0.0, 0.0")),e[g].setHSV(l,r,n),e[g].rgba[3]=q,a.setValue(g,e[g]);e.length=b;a.setSliceCount(b)}};VVVV.Nodes.HSVJoin.prototype=new VVVV.Core.Node;VVVV.Nodes.IOBoxColor=function(b,g){this.constructor(b,"IOBox (Color)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Color Input",[new VVVV.Types.Color("0.0, 1.0, 0.0, 1.0")],
VVVV.PinTypes.Color),c=this.addOutputPin("Color Output",[],VVVV.PinTypes.Color);this.addInvisiblePin("Rows",[1],VVVV.PinTypes.Value);this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),f=0;f<d;f++)c.setValue(f,h.getValue(f));c.setSliceCount(d)}};VVVV.Nodes.IOBoxColor.prototype=new VVVV.Core.Node;VVVV.Nodes.SetAlphaColor=function(b,g){this.constructor(b,"SetAlpha (Color)",g);this.meta={authors:["Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=
!1;var h=this.addInputPin("Input",[new VVVV.Types.Color("0.0, 0.0, 0.0, 0.0")],VVVV.PinTypes.Color),c=this.addInputPin("Alpha",[1],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[],VVVV.PinTypes.Color),f=[];this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),e=0;e<a;e++){var l=h.getValue(e),b=c.getValue(e);f[e]||(f[e]=new VVVV.Types.Color("0.0, 0.0, 0.0, 0.0"));f[e].rgba[0]=l.rgba[0];f[e].rgba[1]=l.rgba[1];f[e].rgba[2]=l.rgba[2];f[e].rgba[3]=b;d.setValue(e,f[e])}f.length=a;d.setSliceCount(a)}};
VVVV.Nodes.SetAlphaColor.prototype=new VVVV.Core.Node;VVVV.Nodes.SwitchColorInput=function(b,g){this.constructor(b,"Switch (Color Input)",g);this.meta={authors:["Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Switch",[0],VVVV.PinTypes.Value),c=[];c[0]=this.addInputPin("Input 1",[],VVVV.PinTypes.Color);c[1]=this.addInputPin("Input 2",[],VVVV.PinTypes.Color);var d=this.addOutputPin("Output",[],VVVV.PinTypes.Color);this.addInvisiblePin("Input Count",
[2],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++)d.setValue(a,c[Math.round(Math.abs(h.getValue(a)))%c.length].getValue(a));d.setSliceCount(f)}};VVVV.Nodes.SwitchColorInput.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.Abs=function(b,g){this.constructor(b,"Abs (Complex)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input Real",[0],VVVV.PinTypes.Value),c=this.addInputPin("Input Imagiary",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[.5],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++)d.setValue(a,Math.sqrt(Math.pow(h.getValue(a),2)+Math.pow(c.getValue(a),
2)));d.setSliceCount(f)}};VVVV.Nodes.Abs.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.Integrate=function(b,g){this.constructor(b,"Integrate (Differential)",g);this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!0;var h=this.addInputPin("Position In",[0],VVVV.PinTypes.Value),c=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Position Out",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Velocity Out",[0],VVVV.PinTypes.Value),a=[];this.evaluate=function(){dt=this.parentPatch.mainloop.deltaT/
1E3;for(var e=this.getMaxInputSliceCount(),l=0;l<e;l++){void 0==a[l]&&(a[l]=0);var b=h.getValue(l);a[l]+=b*dt;.5<=c.getValue(l)&&(a[l]=0);d.setValue(l,a[l]);f.setValue(l,b)}d.setSliceCount(e);f.setSliceCount(e);a.splice(e)}};VVVV.Nodes.Integrate.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.String2Enum=function(b,g){this.constructor(b,"String2Enum (Enumerations)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Validation check does not work"]};var h=this.addInputPin("String Value",[],VVVV.PinTypes.String),c=this.addOutputPin("Enum",[],VVVV.PinTypes.Enum);this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),f=0;f<d;f++)c.setValue(f,h.getValue(f));c.setSliceCount(d)}};VVVV.Nodes.String2Enum.prototype=
new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Types.HTMLLayer=function(h){this.tagName=h;this.styles={};this.attributes={};this.tagName?(this.element=k("<"+this.tagName+">"),this.element.data("vvvvjslayer",this)):this.element=void 0;this.children=[b];this.parent=b;this.text="";this.position=0;this.style=g;this.set_style_properties={};this.setText=function(c){this.element&&"IFRAME"!=this.element.prop("tagName")&&(this.text=c,c=k(this.element),0<c.contents().length&&3==c.contents().first()[0].nodeType?c.contents().first()[0].data=
this.text:c.prepend(document.createTextNode(this.text)))};this.setAttribute=function(c,d){this.element&&this.attributes[c]!=d&&(this.attributes[c]=d,this.element.attr(c,d))};this.setStyle=function(c){if(this.element){this.style=c;for(var d in this.set_style_properties)1!=this.set_style_properties[d]||this.style.style_properties[d]||(this.element.css(d,""),this.set_style_properties[d]=!1);this.style.apply(this)}};this.setParent=function(c){!this.element||this.parent.element&&c.element&&this.parent.element[0]==
c.element[0]||void 0==this.parent.element&&void 0==c.element&&0!=this.element.parent().length||(this.parent=c,this.parent.tagName?this.parent.element[0]!=this.element[0].parentElement&&this.parent.element.append(this.element):this.element[0].parentElement!=document.body&&k("body").append(this.element))};this.changeTagName=function(c){this.element&&this.tagName!=c&&(this.tagName=c,c=k("<"+this.tagName+">"),this.element.before(c),this.element.contents().detach().appendTo(c),this.element.remove(),this.element=
c,this.style.apply(this))}};var b=new VVVV.Types.HTMLLayer;VVVV.PinTypes.HTMLLayer={typeName:"HTMLLayer",reset_on_disconnect:!0,defaultValue:function(){return b}};VVVV.Types.HTMLStyle=function(){this.style_properties={};this.inherited_properties={};this.set_properties={};this.apply=function(h){var c=k(h.element),d;for(d in this.inherited_properties)c.css(d,this.inherited_properties[d]),h.set_style_properties[d]=!0;for(d in this.style_properties)c.css(d,this.style_properties[d]),h.set_style_properties[d]=
!0};this.copy_properties=function(h){for(var c in h.style_properties)this.inherited_properties[c]=h.style_properties[c];for(c in h.inherited_properties)this.inherited_properties[c]=h.inherited_properties[c];for(c in this.inherited_properties)h.style_properties[c]||h.inherited_properties[c]||delete this.inherited_properties[c]}};var g=new VVVV.Types.HTMLStyle;VVVV.PinTypes.HTMLStyle={typeName:"HTMLStyle",reset_on_disconnect:!0,defaultValue:function(){return g}};[{nodename:"Element",tagname:"div",pins:[],
dynamic:!0},{nodename:"Link",tagname:"a",pins:[{name:"href",type:VVVV.PinTypes.String,value:"#",attribute:!0}]},{nodename:"Image",tagname:"img",pins:[{name:"src",type:VVVV.PinTypes.String,value:"",attribute:!0}]},{nodename:"TextInput",tagname:"input type='text'",pins:[{name:"name",value:"",type:VVVV.PinTypes.String,attribute:!0},{name:"value",value:"",type:VVVV.PinTypes.String,attribute:!0}]},{nodename:"Checkbox",tagname:"input type='checkbox'",pins:[{name:"name",value:"",type:VVVV.PinTypes.String,
attribute:!0,attribute:!0},{name:"value",value:"1",type:VVVV.PinTypes.String,attribute:!0}]},{nodename:"RadioButton",tagname:"input type='radio'",pins:[{name:"name",value:"",type:VVVV.PinTypes.String,attribute:!0},{name:"value",value:"1",type:VVVV.PinTypes.String,attribute:!0}]},{nodename:"Button",tagname:"input type='button'",pins:[{name:"name",value:"",type:VVVV.PinTypes.String,attribute:!0},{name:"value",value:"Push me",type:VVVV.PinTypes.String,attribute:!0}]},{nodename:"RangeSlider",tagname:"input type='range'",
pins:[{name:"name",value:"",type:VVVV.PinTypes.String,attribute:!0},{name:"value",value:0,type:VVVV.PinTypes.Value,attribute:!0},{name:"min",value:0,type:VVVV.PinTypes.Value,attribute:!0},{name:"max",value:10,type:VVVV.PinTypes.Value,attribute:!0},{name:"step",value:1,type:VVVV.PinTypes.Value,attribute:!0}]},{nodename:"SelectBox",tagname:"select",pins:[{name:"name",value:"",type:VVVV.PinTypes.String,attribute:!0}]},{nodename:"SelectOption",tagname:"option",pins:[{name:"value",value:"",type:VVVV.PinTypes.String,
attribute:!0}]}].forEach(function(h){VVVV.Nodes[h.nodename+"HTML"]=function(c,d){this.constructor(c,h.nodename+" (HTML)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInvisiblePin("Attribute Names",[""],VVVV.PinTypes.String),a=this.addInputPin("Style In",[],VVVV.PinTypes.HTMLStyle),e="",l=void 0;h.dynamic?l=this.addInputPin("Tag Name",["div"],VVVV.PinTypes.String):e=h.tagname;for(var b=this.addInputPin("Parent",[],VVVV.PinTypes.HTMLLayer),
n=this.addInputPin("Text",[""],VVVV.PinTypes.String),g=[],p=[],m=0;m<h.pins.length;m++)h.pins[m].type&&1==h.pins[m].attribute?p.push(this.addInputPin(h.pins[m].name,[h.pins[m].value],h.pins[m].type)):this.addInputPin(h.pins[m].name,[h.pins[m].value],h.pins[m].type);var k=this.addOutputPin("Layers Out",[],VVVV.PinTypes.HTMLLayer),v=[];this.initialize=function(){for(var a=[],e=new RegExp(/([a-z]+)/g),d;d=e.exec(f.getValue(0));)a.push(d[0]);for(e=0;e<a.length;e++)this.inputPins[a[e]]?this.inputPins[a[e]].unvalidated&&
(g.push(this.inputPins[a[e]]),d=this.inputPins[a[e]].values.slice(),this.inputPins[a[e]].setType(VVVV.PinTypes.String),this.inputPins[a[e]].isConnected()||(this.inputPins[a[e]].values=d)):g.push(this.addInputPin(a[e],[""],VVVV.PinTypes.String));for(e=0;e<g.length;e++)if(0>a.indexOf(g[e].pinname))for(this.removeInputPin(g[e].pinname),d=0;d<v.length;d++)delete v[d].attributes[g[e].pinname]};this.evaluate=function(){f.pinIsChanged()&&this.initialize();for(var d=this.getMaxInputSliceCount(),c=0;c<d;c++){var h=
!1;void 0==v[c]&&(v[c]=new VVVV.Types.HTMLLayer(l?l.getValue(c):e),h=!0);l&&v[c].tagName!=l.getValue(c)&&v[c].changeTagName(l.getValue(c));(h||n.pinIsChanged())&&v[c].setText(n.getValue(c));(h||b.pinIsChanged())&&v[c].setParent(b.getValue(c));for(var m=0;m<g.length;m++)(h||g[m].pinIsChanged())&&v[c].setAttribute(g[m].pinname,g[m].getValue(c));for(m=0;m<p.length;m++)(h||p[m].pinIsChanged())&&v[c].setAttribute(p[m].pinname,p[m].getValue(c));(h||a.pinIsChanged())&&v[c].setStyle(a.getValue(c));k.setValue(c,
v[c])}for(c=d;c<v.length;c++)v[c].element.remove();v.length=d;k.setSliceCount(d)};this.destroy=function(){for(var a=0;a<v.length;a++)v[a].element.remove()}};VVVV.Nodes[h.nodename+"HTML"].prototype=new VVVV.Core.Node});VVVV.Nodes.GroupHTML=function(h,c){this.constructor(h,"Group (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var d=this.addInputPin("Parent",[],VVVV.PinTypes.HTMLLayer),f=this.addInvisiblePin("Output Count",[2],VVVV.PinTypes.Value),
a=[];this.initialize=function(){for(var e=Math.max(2,f.getValue(0)),d=a.length;d<e;d++)a.push(this.addOutputPin("Element Slot "+(d+1),[],VVVV.PinTypes.HTMLLayer));for(d=a.length-1;d>=e;d--)this.removeOutputPin(a[d].pinname);a.length=e};this.evaluate=function(){f.pinIsChanged()&&(this.initialize(),this.parentPatch.afterUpdate());for(var e=d.getSliceCount(),c=0;c<e;c++)for(var h=0;h<a.length;h++){var b=a[h].values[c];b||(b=new VVVV.Types.HTMLLayer("span"));b.setParent(d.getValue(c));a[h].setValue(c,
b)}for(c=0;c<a.length;c++){for(h=a[c].values.length-1;h>=e;h--)a[c].values[h].element.remove();a[c].setSliceCount(e)}};this.destroy=function(){for(var e=0;e<a.length;e++)for(var f=0;f<a[e].values.length;f++)a[e].values[f].element.remove()}};VVVV.Nodes.GroupHTML.prototype=new VVVV.Core.Node;VVVV.Nodes.GetElementHTML=function(h,c){this.constructor(h,"GetElement (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var d=this.addInputPin("Selector",
[""],VVVV.PinTypes.String),f=this.addInputPin("Parent",[],VVVV.PinTypes.HTMLLayer);this.addInputPin("Refresh",[0],VVVV.PinTypes.Value);var a=this.addOutputPin("Layers Out",[],VVVV.PinTypes.HTMLLayer),e=this.addOutputPin("Bin Size",[-1],VVVV.PinTypes.Value),l=[];this.evaluate=function(){this.getMaxInputSliceCount();var c;c=f.isConnected()?f.getValue(0).element:k(document);for(var h=d.getSliceCount(),b=0,g=0;g<h;g++){var m=d.getValue(g);if(""!=m){var x=0;c.find(m).each(function(){void 0==l[b]&&(l[b]=
new VVVV.Types.HTMLLayer);l[b].tagName=k(this).prop("tagName");l[b].element=k(this);a.setValue(b,l[b]);b++;x++});e.setValue(g,x)}}l.length=b;a.setSliceCount(b);e.setSliceCount(h)}};VVVV.Nodes.GetElementHTML.prototype=new VVVV.Core.Node;VVVV.Nodes.GetPositionHTML=function(h,c){function d(f,d){var c;c=a.getValue(d)==a.enumOptions[0]||a.getValue(d)==a.enumOptions[1]?k(f).offset():k(f).position();a.getValue(d)==a.enumOptions[1]&&(c.left=c.left/window.outerWidth*2-1,c.top=-1*(c.top/window.outerHeight*
2-1));e.setValue(d,c.left);l.setValue(d,c.top)}this.constructor(h,"GetPosition (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Element",[],VVVV.PinTypes.HTMLLayer),a=this.addInputPin("Space",["Document Pixels"],VVVV.PinTypes.Enum);a.enumOptions=["Document Pixels","Document [-1, +1]","Parent Element Pixels"];var e=this.addOutputPin("X",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),b=[],n=[];
this.evaluate=function(){var a=this.getMaxInputSliceCount();if(f.isConnected()&&""!=f.getValue(0).tagName){for(var c=0;c<a;c++)void 0!=n[c]&&n[c]!=f.getValue(c).element[0]&&(b[c].disconnect(),b[c]=void 0),void 0==b[c]&&(function(a){b[a]=new MutationObserver(function(e){d(n[a],a)})}(c),n[c]=f.getValue(c).element[0],k(n[c]).parents().each(function(){b[c].observe(this,{attributes:!0,attributeFilter:["style"]})}),b[c].observe(n[c],{attributes:!0,attributeFilter:["style"]})),d(n[c],c);b.length=a;n.length=
a;e.setSliceCount(a);l.setSliceCount(a)}else b.forEach(function(a){a.disconnect()}),b.length=0,n.length=0,e.setValue(0,0),l.setValue(0,0),e.setSliceCount(1),l.setSliceCount(1)};this.destroy=function(){b.forEach(function(a){a.disconnect()})}};VVVV.Nodes.GetPositionHTML.prototype=new VVVV.Core.Node;VVVV.Nodes.PositionHTML=function(h,c){this.constructor(h,"Position (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var d=this.addInputPin("Style In",
[],VVVV.PinTypes.HTMLStyle),f=this.addInputPin("Absolute Position",[1],VVVV.PinTypes.Value),a=this.addInputPin("X",[0],VVVV.PinTypes.Value),e=this.addInputPin("Y",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Style Out",[],VVVV.PinTypes.HTMLStyle),b=[];this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),h=0;h<c;h++)b[h]||(b[h]=new VVVV.Types.HTMLStyle),b[h].copy_properties(d.getValue(h)),.5<=f.getValue(h)?(b[h].style_properties.position="absolute",b[h].style_properties.left=a.getValue(h)+
"px",b[h].style_properties.top=e.getValue(h)+"px",delete b[h].style_properties["margin-left"],delete b[h].style_properties["margin-right"]):(delete b[h].style_properties.position,delete b[h].style_properties.left,delete b[h].style_properties.top,b[h].style_properties["margin-left"]=a.getValue(h)+"px",b[h].style_properties["margin-top"]=e.getValue(h)+"px"),l.setValue(h,b[h]);b.length=c;l.setSliceCount(c)}};VVVV.Nodes.PositionHTML.prototype=new VVVV.Core.Node;VVVV.Nodes.TransformHTML=function(h,c){this.constructor(h,
"Transform (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var d=this.addInputPin("Style In",[],VVVV.PinTypes.HTMLStyle),f=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform),a=this.addOutputPin("Style Out",[],VVVV.PinTypes.HTMLStyle),e=[];this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),h,b,g,p=0;p<c;p++){e[p]||(e[p]=new VVVV.Types.HTMLStyle);e[p].copy_properties(d.getValue(p));h="matrix3d(";g=f.getValue(p);for(b=0;15>
b;b++)h+=g[b]+",";h+=g[b]+")";e[p].style_properties.transform=h;a.setValue(p,e[p])}e.length=c;a.setSliceCount(c)}};VVVV.Nodes.TransformHTML.prototype=new VVVV.Core.Node;VVVV.Nodes.GetValueHTML=function(h,c){this.constructor(h,"GetValue (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var d=this.addInputPin("Element",[],VVVV.PinTypes.HTMLLayer),f=this.addOutputPin("Output",[0],VVVV.PinTypes.String),a=[],e=[],l=[];this.evaluate=function(){var c=
this.getMaxInputSliceCount(),h=this;if(d.isConnected()&&""!=d.getValue(0).tagName){for(var b=0;b<c;b++)void 0!=e[b]&&e[b]!=d.getValue(b).element[0]&&(k(e[b]).unbind("change input paste keyup",a[b]),a[b]=void 0),void 0==a[b]&&(e[b]=d.getValue(b).element[0],function(e){a[e]=function(a){a="";"SELECT"==k(this).prop("tagName")?a=k(this).find("option:selected").attr("value"):"INPUT"==k(this).prop("tagName")&&"checkbox"==k(this).prop("type")?a=k(this).is(":checked")?k(this).attr("value"):"":"INPUT"==k(this).prop("tagName")&&
"radio"==k(this).prop("type")?a=k(this).is(":checked")?k(this).attr("value"):"":"INPUT"==k(this).prop("tagName")&&(a=k(this).val());void 0==a&&(a="");l.push({sliceIdx:e,value:a});h.dirty=!0}}(b),k(e[b]).bind("change input paste keyup",a[b]),a[b].call(e[b]));a.length=c;e.length=c;f.setSliceCount(c)}else{for(b=0;b<e.length;b++)k(e[b]).unbind("change input paste keyup",a[b]);a.length=0;e.length=0;f.setValue(0,"");f.setSliceCount(1)}if(0<l.length){for(b=l.length;b--;)f.setValue(l[b].sliceIdx,l[b].value);
l.length=0;h.dirty=!1}};this.destroy=function(){for(var f=0;f<e.length;f++)k(e[f]).unbind("change input paste keyup",a[f])}};VVVV.Nodes.GetValueHTML.prototype=new VVVV.Core.Node;[{name:"Event",code:"click",dynamic:!0},{name:"Click",code:"click"},{name:"MouseDown",code:"mousedown"},{name:"MouseUp",code:"mouseup"},{name:"MouseOver",code:"mouseover"},{name:"MouseEnter",code:"mouseenter"},{name:"MouseLeave",code:"mouseleave"},{name:"Change",code:"change"},{name:"Focus",code:"focus"},{name:"Blur",code:"blur"}].forEach(function(h){VVVV.Nodes["On"+
h.name+"HTML"]=function(c,d){this.constructor(c,"On"+h.name+" (HTML)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};this.auto_evaluate=!0;var f=this.addInputPin("Element",[],VVVV.PinTypes.HTMLLayer),a="",e=void 0;h.dynamic?e=this.addInputPin("Event",["click"],VVVV.PinTypes.String):a=h.code;var l=this.addOutputPin("OnEvent",[0],VVVV.PinTypes.Value),b=[],n=[],g=[],p=[],m=!1;this.evaluate=function(){var d=this.getMaxInputSliceCount();if(f.isConnected()&&
""!=f.getValue(0).tagName){for(var c=0;c<d;c++)e&&(a=e.getValue(c)),void 0==n[c]||n[c]==f.getValue(c).element[0]&&g[c]==a||(k(n[c]).unbind(g[c],b[c]),b[c]=void 0),void 0==b[c]&&(n[c]=f.getValue(c).element[0],g[c]=a,function(a){b[a]=function(e){p.push(a);m=!1}}(c),k(n[c]).bind(g[c],b[c]),l.setValue(c,0));b.length=d;n.length=d;g.length=d;l.setSliceCount(d)}else{for(c=0;c<n.length;c++)k(n[c]).unbind(g[c],b[c]);b.length=0;n.length=0;l.setValue(0,0);l.setSliceCount(1)}if(m){for(c=l.getSliceCount();c--;)l.setValue(c,
0);m=!1}if(0<p.length){for(c=p.length;c--;)l.setValue(p[c],1);p.length=0;m=!0}};this.destroy=function(){for(var a=0;a<b.length;a++)k(n[a]).unbind(g[a],b[a])}};VVVV.Nodes["On"+h.name+"HTML"].prototype=new VVVV.Core.Node});VVVV.Nodes.StyleHTML=function(h,c){this.constructor(h,"Style (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var d=this.addInputPin("Style In",[],VVVV.PinTypes.HTMLStyle),f=this.addInputPin("Property Name",[],VVVV.PinTypes.String),
a=this.addInputPin("Property Value",[],VVVV.PinTypes.String),e=this.addOutputPin("Style Out",[],VVVV.PinTypes.HTMLStyle),l=[];this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),h=[],b=0;b<c;b++)l[b]||(l[b]=new VVVV.Types.HTMLStyle),l[b].copy_properties(d.getValue(b)),""!=f.getValue(b)&&(l[b].style_properties[f.getValue(b)]=a.getValue(b),h[b]||(h[b]={}),h[b][f.getValue(b)]=!0),e.setValue(b,l[b]);for(b=0;b<c;b++)for(stylename in l[b].style_properties)h[b][stylename]||delete l[b].style_properties[stylename];
e.setSliceCount(c)}};VVVV.Nodes.StyleHTML.prototype=new VVVV.Core.Node;[{name:"Background",pins:[{name:"background-color",type:VVVV.PinTypes.Color,is_property:!0}]},{name:"Border",pins:[{name:"border-width",value:1,unit:"px",type:VVVV.PinTypes.Value,is_property:!0},{name:"border-color",type:VVVV.PinTypes.Color,is_property:!0},{name:"border-style",value:"solid",type:VVVV.PinTypes.Enum,enumOptions:["solid","dashed","dotted"],is_property:!0}]},{name:"Padding",pins:[{name:"padding-left",value:1,unit:"px",
type:VVVV.PinTypes.Value,is_property:!0},{name:"padding-top",value:1,unit:"px",type:VVVV.PinTypes.Value,is_property:!0},{name:"padding-right",value:1,unit:"px",type:VVVV.PinTypes.Value,is_property:!0},{name:"padding-bottom",value:1,unit:"px",type:VVVV.PinTypes.Value,is_property:!0}]},{name:"Margin",pins:[{name:"margin-left",value:1,unit:"px",type:VVVV.PinTypes.Value,is_property:!0},{name:"margin-top",value:1,unit:"px",type:VVVV.PinTypes.Value,is_property:!0},{name:"margin-right",value:1,unit:"px",
type:VVVV.PinTypes.Value,is_property:!0},{name:"margin-bottom",value:1,unit:"px",type:VVVV.PinTypes.Value,is_property:!0}]},{name:"Font",pins:[{name:"color",type:VVVV.PinTypes.Color,is_property:!0},{name:"font-family",value:"inherit",type:VVVV.PinTypes.String,is_property:!0},{name:"font-weight",value:"inherit",type:VVVV.PinTypes.Enum,is_property:!0,enumOptions:["inherit","normal","light","bold"]},{name:"text-decoration",value:"inherit",type:VVVV.PinTypes.Enum,is_property:!0,enumOptions:["inherit",
"none","underline","line-through"]}]},{name:"FontSize",pins:[{name:"font-size",value:12,unit:"px",type:VVVV.PinTypes.Value,is_property:!0}]}].forEach(function(b){VVVV.Nodes[b.name+"HTML"]=function(c,d){this.constructor(c,b.name+" (HTML)",d);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};for(var f=this.addInputPin("Style In",[],VVVV.PinTypes.HTMLStyle),a=[],e=0;e<b.pins.length;e++){var l=[];b.pins[e].value&&l.push(b.pins[e].value);l=this.addInputPin(b.pins[e].name,
l,b.pins[e].type);b.pins[e].unit&&(l.unit=b.pins[e].unit);if(b.pins[e].enumOptions){l.enumOptions=[];for(var g=0;g<b.pins[e].enumOptions.length;g++)l.enumOptions[g]=b.pins[e].enumOptions[g]}b.pins[e].is_property&&a.push(l)}var n=this.addOutputPin("Style Out",[],VVVV.PinTypes.HTMLStyle),q=[],p=[];this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),c=[],d=0;d<e;d++){q[d]||(q[d]=new VVVV.Types.HTMLStyle);q[d].copy_properties(f.getValue(d));for(var l=0;l<a.length;l++){var b;"Color"==a[l].typeName?
(p[0]=parseInt(256*a[l].getValue(d).rgba[0]),p[1]=parseInt(256*a[l].getValue(d).rgba[1]),p[2]=parseInt(256*a[l].getValue(d).rgba[2]),p[3]=a[l].getValue(d).rgba[3],b="rgba("+p.join(",")+")"):b=a[l].getValue(d);""!=b?(a[l].unit&&(b+=a[l].unit),q[d].style_properties[a[l].pinname]=b,c[d]||(c[d]={}),c[d][a[l].pinname]=!0):c[d]&&(c[d][a[l].pinname]=!1)}n.setValue(d,q[d])}for(d=0;d<e;d++)for(stylename in q[d].style_properties)c[d]&&!c[d][stylename]&&delete q[d].style_properties[stylename];n.setSliceCount(e)}};
VVVV.Nodes[b.name+"HTML"].prototype=new VVVV.Core.Node});VVVV.Nodes.ApplyStyleHTML=function(b,c){this.constructor(b,"ApplyStyle (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var d=this.addInputPin("Style",[],VVVV.PinTypes.HTMLStyle),f=this.addInputPin("Element",[],VVVV.PinTypes.HTMLLayer);this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),e,c=0;c<a;c++)e=f.getValue(c),e.style=d.getValue(c),e.style.apply(e)}};VVVV.Nodes.ApplyStyleHTML.prototype=
new VVVV.Core.Node;VVVV.Nodes.GetTextHTML=function(b,c){function d(e,c){var d="";k(e).contents().each(function(){3==this.nodeType&&(d+=this.data)});a.setValue(c,d)}this.constructor(b,"GetText (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Element",[],VVVV.PinTypes.HTMLLayer),a=this.addOutputPin("Text",[""],VVVV.PinTypes.String),e=[],l=[];this.evaluate=function(){var c=this.getMaxInputSliceCount();if(f.isConnected()&&
""!=f.getValue(0).tagName){for(var b=0;b<c;b++)void 0!=l[b]&&l[b]!=f.getValue(b).element[0]&&(e[b].disconnect(),e[b]=void 0),void 0==e[b]&&(function(a){e[a]=new MutationObserver(function(e){d(l[a],a)})}(b),l[b]=f.getValue(b).element[0],e[b].observe(l[b],{childList:!0,characterData:!0})),d(l[b],b);e.length=c;l.length=c;a.setSliceCount(c)}else e.forEach(function(a){a.disconnect()}),e.length=0,l.length=0,a.setValue(0,""),a.setSliceCount(1)};this.destroy=function(){e.forEach(function(a){a.disconnect()})}};
VVVV.Nodes.GetTextHTML.prototype=new VVVV.Core.Node;VVVV.Nodes.SetTextHTML=function(b,c){this.constructor(b,"SetText (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var d=this.addInputPin("Element",[],VVVV.PinTypes.HTMLLayer),f=this.addInputPin("Text",[],VVVV.PinTypes.String);this.evaluate=function(){var a=d.getSliceCount();if(d.isConnected()&&""!=d.getValue(0).tagName)for(var e,c=0;c<a;c++)e=d.getValue(c).element,0<e.contents().length&&3==
e.contents().first()[0].nodeType?e.contents().first()[0].data=f.getValue(0):e.prepend(document.createTextNode(f.getValue(0)))}};VVVV.Nodes.SetTextHTML.prototype=new VVVV.Core.Node;VVVV.Nodes.GetAttributeHTML=function(b,c){function d(a,e){for(var c=0;c<q[e].length;c++)l.setValue(p[e][c],k(n[e]).attr(q[e][c])||k(n[e]).prop(q[e][c])||"")}this.constructor(b,"GetAttribute (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Element",
[],VVVV.PinTypes.HTMLLayer),a=this.addInputPin("Attribute Name",[""],VVVV.PinTypes.String),e=this.addInputPin("Attribute Bin Size",[-1],VVVV.PinTypes.Value),l=this.addOutputPin("Attribute Value",[""],VVVV.PinTypes.String),g=[],n=[],q=[],p=[];this.evaluate=function(){var c=a.pinIsChanged()||e.pinIsChanged(),b=0,h=a.getSliceCount(),k=0<=e.getValue(0),w=f.getSliceCount();if(f.isConnected()&&""!=f.getValue(0).tagName){for(var y=0;y<w;y++)if(void 0==n[y]||n[y]==f.getValue(y).element[0]&&!c||(g[y].disconnect(),
g[y]=void 0),void 0==g[y]){(function(a){g[a]=new MutationObserver(function(e){d(n[a],a)})})(y);n[y]=f.getValue(y).element[0];k&&(h=e.getValue(y));q[y]=[];p[y]=[];for(var u=0;u<h;u++)q[y].push(a.getValue(b)),p[y].push(b++);g[y].observe(n[y],{attributes:!0,attributeFilter:q[y]});d(n[y],y);l.setSliceCount(b)}g.length=w;n.length=w;q.length=w;p.length=w}else g.forEach(function(a){a.disconnect()}),g.length=0,n.length=0,q.length=0,p.length=0,l.setValue(0,""),l.setSliceCount(1)};this.destroy=function(){g.forEach(function(a){a.disconnect()})}};
VVVV.Nodes.GetAttributeHTML.prototype=new VVVV.Core.Node;VVVV.Nodes.SetAttributeHTML=function(b,c){this.constructor(b,"SetAttribute (HTML)",c);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var d=this.addInputPin("Element",[],VVVV.PinTypes.HTMLLayer),f=this.addInputPin("Attribute Name",[""],VVVV.PinTypes.String),a=this.addInputPin("Attribute Value",[""],VVVV.PinTypes.String),e=this.addInputPin("Attribute BinSize",[-1],VVVV.PinTypes.Value);this.evaluate=
function(){d.getSliceCount();if(d.isConnected()&&""!=d.getValue(0).tagName)for(var c=0,b=Math.max(f.getSliceCount(),a.getSliceCount()),h=0<=e.getValue(0),g=d.getSliceCount(),p,m=0;m<g;m++){p=d.getValue(m).element;h&&(b=e.getValue(m));for(var k=0;k<b;k++)""!=f.getValue(c)&&(p.attr(f.getValue(c),a.getValue(c)),c++)}}};VVVV.Nodes.SetAttributeHTML.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.PinTypes.HTML5Texture={typeName:"HTML5Texture",reset_on_disconnect:!0,defaultValue:function(){return"Empty Texture"}};VVVV.Nodes.FileTextureCanvas=function(b,g){this.constructor(b,"FileTexture (HTML5 VVVVjs)",g);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};this.auto_evaluate=!0;var h=this.addInputPin("Filename",[],VVVV.PinTypes.String),c=this.addOutputPin("Texture Out",[],VVVV.PinTypes.HTML5Texture),d=this.addOutputPin("Width",[0],
VVVV.PinTypes.Value),f=this.addOutputPin("Height",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Up and Running",[0],VVVV.PinTypes.Value),e=[],l=!1;this.evaluate=function(){var b=this.getMaxInputSliceCount();if(h.pinIsChanged()){for(var g=0;g<b;g++){var q=VVVV.Helpers.prepareFilePath(h.getValue(g),this.parentPatch);0===q.indexOf("http://")&&void 0!==VVVV.ImageProxyPrefix&&(q=VVVV.ImageProxyPrefix+encodeURI(q));if(void 0==e[g]||e[g].origSrc!=q)e[g]=new Image,e[g].loaded=!1,e[g].origSrc=q,e[g].onload=
function(a){return function(){l=e[a].loaded=!0}}(g),e[g].src=q,a.setValue(g,0),c.setValue(g,e[g])}e.length=b;c.setSliceCount(b);d.setSliceCount(b);f.setSliceCount(b);a.setSliceCount(b)}if(l){for(g=0;g<b;g++)c.setValue(g,e[g]),d.setValue(g,e[g].width),f.setValue(g,e[g].height),a.setValue(g,e[g].loaded?1:0);l=!1}}};VVVV.Nodes.FileTextureCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.FileStreamCanvas=function(b,g){this.constructor(b,"FileStream (HTML5 VVVVjs)",g);this.meta={authors:["Matthias Zauner"],
original_authors:[],credits:[],compatibility_issues:[]};this.auto_evaluate=!0;var h=["NETWORK_EMPTY","NETWORK_IDLE","NETWORK_LOADING","NETWORK_NO_SOURCE"],c=["HAVE_NOTHING","HAVE_METADATA","HAVE_FUTURE_DATA","HAVE_ENOUGH_DATA","HAVE_CURRENT_DATA"],d=this.addInputPin("Play",[1],VVVV.PinTypes.Value),f=this.addInputPin("Loop",[0],VVVV.PinTypes.Value),a=this.addInputPin("Start Time",[0],VVVV.PinTypes.Value),e=this.addInputPin("End Time",[-1],VVVV.PinTypes.Value),l=this.addInputPin("Do Seek",[0],VVVV.PinTypes.Value),
r=this.addInputPin("Seek Position",[0],VVVV.PinTypes.Value),n=this.addInputPin("Filename",["http://html5doctor.com/demos/video-canvas-magic/video.ogg"],VVVV.PinTypes.String),q=this.addOutputPin("Video",[],this),p=this.addOutputPin("Audio",[],this),m=this.addOutputPin("Duration",[0],VVVV.PinTypes.Value),x=this.addOutputPin("Position",[0],VVVV.PinTypes.Value),v=this.addOutputPin("Video Width",[0],VVVV.PinTypes.Value),z=this.addOutputPin("Video Height",[0],VVVV.PinTypes.Value),w=this.addOutputPin("Network Status",
[""],VVVV.PinTypes.String),y=this.addOutputPin("Ready Status",[""],VVVV.PinTypes.String),u=[];this.evaluate=function(){var b=this.getMaxInputSliceCount();if(n.pinIsChanged())for(var g=0;g<b;g++){filename=VVVV.Helpers.prepareFilePath(n.getValue(g),this.parentPatch);if(void 0==u[g]){var B=k('<video style="display:none"><source src="" type=video/ogg></video>');k("body").append(B);u[g]=B[0];u[g].volume=0;B=function(a){return function(){}}(g);u[g].onprogress=B;u[g].oncanplay=B;u[g].oncanplaythrough=B}filename!=
u[g].currentSrc&&(k(u[g]).find("source").first().attr("src",filename),u[g].load(),.5<d.getValue(g)?u[g].play():u[g].pause(),u[g].loaded=!0,q.setValue(g,u[g]),p.setValue(g,u[g]))}if(d.pinIsChanged())for(g=0;g<b;g++).5<d.getValue(g)?u[g].play():u[g].pause();if(l.pinIsChanged())for(g=0;g<b;g++)u[g%u.length].loaded&&.5<=l.getValue(g)&&(u[g%u.length].currentTime=r.getValue(g),.5<d.getValue(g)&&u[g].play());for(g=0;g<b;g++){if(!u[g].paused){q.setValue(g,u[g]);p.setValue(g,u[g]);m.getValue(g)!=u[g].duration&&
m.setValue(g,u[g].duration);x.setValue(g,u[g].currentTime);var B=e.getValue(g),C=a.getValue(g);u[g].currentTime<C&&(u[g].currentTime=C);if(u[g].currentTime>=u[g].duration||0<=B&&u[g].currentTime>=B).5<=f.getValue(g)?u[g].currentTime=C:u[g].pause()}if(u[g].videoWidth!=v.getValue(g)||u[g].videoHeight!=z.getValue(g))v.setValue(g,u[g].videoWidth),z.setValue(g,u[g].videoHeight);w.getValue(g)!=h[u[g].networkState]&&w.setValue(g,h[u[g].networkState]);y.getValue(g)!=c[u[g].readyState]&&y.setValue(g,c[u[g].readyState])}q.setSliceCount(b);
p.setSliceCount(b)}};VVVV.Nodes.FileStreamCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.AudioOutHTML5=function(b,g){this.constructor(b,"AudioOut (HTML5 VVVVjs)",g);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var h=this.addInputPin("Audio",[],this),c=this.addInputPin("Volume",[.5],VVVV.PinTypes.Value);this.evaluate=function(){var d=this.getMaxInputSliceCount();if(c.pinIsChanged())for(var f=0;f<d;f++)h.getValue(f).volume=Math.max(0,Math.min(1,c.getValue(f)))}};
VVVV.Nodes.AudioOutHTML5.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.HTTPGet=function(b,g){this.constructor(b,"HTTP (Network Get)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Doesnt handle get variables yet","Doesnt support proxies","No header output pin yet"]};this.auto_evaluate=!0;var h=this.addInputPin("URL",["http://localhost"],VVVV.PinTypes.String),c=this.addInputPin("Name",[""],VVVV.PinTypes.String),d=this.addInputPin("Value",[""],VVVV.PinTypes.String),f=this.addInputPin("Refresh",
[0],VVVV.PinTypes.Value),a=this.addOutputPin("Status",[""],VVVV.PinTypes.String),e=this.addOutputPin("Body",[""],VVVV.PinTypes.String),l=this.addOutputPin("Fail",[0],VVVV.PinTypes.Value),r=this.addOutputPin("Success",[0],VVVV.PinTypes.Value),n,q,p,m=!1;this.evaluate=function(){this.getMaxInputSliceCount();var b=h.pinIsChanged()||c.pinIsChanged()||d.pinIsChanged()||f.pinIsChanged()&&1==f.getValue(0);1==r.getValue(0)&&r.setValue(0,0);1==l.getValue(0)&&l.setValue(0,0);m&&(e.setValue(0,n),a.setValue(0,
void 0),r.setValue(0,q),l.setValue(0,p),m=!1);b&&(void 0==h.getValue(0)?(e.setValue(0,""),a.setValue(0,"")):k.ajax({url:h.getValue(0),type:"get",dataType:"text",success:function(a,e,c){n=a;q=1;m=!0},error:function(a,e){n="";p=1;m=!0}}))}};VVVV.Nodes.HTTPGet.prototype=new VVVV.Core.Node;VVVV.Nodes.WebsocketClient=function(b,g){this.constructor(b,"Websocket (Network Client)",g);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};this.auto_evaluate=!0;var h=
this.addInputPin("URL",["localhost"],VVVV.PinTypes.String),c=this.addInputPin("Port",[8006],VVVV.PinTypes.Value),d=this.addInputPin("Input",["Hello"],VVVV.PinTypes.String),f=this.addInputPin("DoSend",[0],VVVV.PinTypes.Value),a=this.addInputPin("Enabled",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Output",[""],VVVV.PinTypes.String),l=this.addOutputPin("OnData",[0],VVVV.PinTypes.Value),r=this.addOutputPin("Connected",[0],VVVV.PinTypes.Value),n=null,q=[];this.evaluate=function(){(.5>a.getValue(0)||
h.pinIsChanged()||c.pinIsChanged())&&null!=n&&(n.close(),n=null);.5<=a.getValue(0)&&null==n&&(n=new WebSocket("ws://"+h.getValue(0)+":"+c.getValue(0)),n.onopen=function(a){r.setValue(0,1)},n.onclose=function(a){r.setValue(0,0)},n.onmessage=function(a){q.push(a.data)});0<q.length?(e.setValue(0,q.shift()),l.setValue(0,1)):(e.setValue(0,""),l.setValue(0,0));.5<=f.getValue(0)&&n&&n.send(d.getValue(0))}};VVVV.Nodes.WebsocketClient.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.PinTypes.Node={typeName:"Node",reset_on_disconnect:!0,connectionChangedHandlers:{nodepin:function(){function b(c,d){for(var f in this.node.inputPins)if(this.pinname!=f&&this.node.inputPins[f].typeName==c.typeName&&"Node"!=this.node.inputPins[f].typeName&&this.node.inputPins[f].isConnected())return;for(f in this.node.outputPins)if(this.pinname!=f&&this.node.outputPins[f].typeName==c.typeName&&"Node"!=this.node.outputPins[f].typeName&&this.node.outputPins[f].isConnected())return;for(f in this.node.outputPins)if(this.node.outputPins[f].typeName==
c.typeName){this.node.outputPins[f].setType(d);this.node.outputPins[f].slavePin&&this.node.outputPins[f].slavePin.setType(d);for(var a=this.node.outputPins[f].links.length;a--;)this.node.outputPins[f].links[a].toPin.typeName!=d.typeName&&this.node.outputPins[f].links[a].toPin.connectionChanged()}for(f in this.node.inputPins)this.node.inputPins[f].typeName==c.typeName&&(this.node.inputPins[f].setType(d),this.node.inputPins[f].masterPin&&this.node.inputPins[f].masterPin.setType(d),this.pinname!=f&&
0<this.node.inputPins[f].links.length&&this.node.inputPins[f].links[0].fromPin.connectionChanged())}if(this.direction==VVVV.PinDirection.Input)if(this.isConnected()){var g;0<this.links.length?g=this.links[0].fromPin:this.masterPin&&(g=this.masterPin);b.call(this,VVVV.PinTypes.Node,VVVV.PinTypes[g.typeName])}else b.call(this,VVVV.PinTypes[this.typeName],VVVV.PinTypes.Node);else if(this.direction==VVVV.PinDirection.Output)if(this.isConnected()){var h;0<this.links.length?h=this.links[0].toPin:this.slavePin&&
(h=this.slavePin);b.call(this,VVVV.PinTypes.Node,VVVV.PinTypes[h.typeName])}else b.call(this,VVVV.PinTypes[this.typeName],VVVV.PinTypes.Node)}}};VVVV.Nodes.IOBoxNode=function(b,g){this.constructor(b,"IOBox (Node)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input Node",[],VVVV.PinTypes.Node),c=this.addOutputPin("Output Node",[],VVVV.PinTypes.Node);this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),
f=0;f<d;f++)c.setValue(f,h.getValue(f));c.setSliceCount(d)}};VVVV.Nodes.IOBoxNode.prototype=new VVVV.Core.Node;VVVV.Nodes.SwitchNodeInput=function(b,g){this.constructor(b,"Switch (Node Input)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["No dynamic pin count yet"]};this.auto_nil=!1;var h=this.addInputPin("Switch",[0],VVVV.PinTypes.Value),c=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),d=[],f=this.addOutputPin("Output",[],
VVVV.PinTypes.Node);this.initialize=function(){for(var a=c.getValue(0),e=d.length;e<a;e++)d[e]=this.addInputPin("Input "+(e+1),[],VVVV.PinTypes.Node);d.length=a};this.evaluate=function(){c.pinIsChanged()&&this.initialize();if(void 0==h.getValue(0))f.setValue(0,void 0);else{for(var a=d[Math.round(Math.abs(h.getValue(0)))%d.length],e=a.getSliceCount(),l=0;l<e;l++)f.setValue(l,a.getValue(l));f.setSliceCount(e)}}};VVVV.Nodes.SwitchNodeInput.prototype=new VVVV.Core.Node;VVVV.Nodes.GetSliceNode=function(b,
g){this.constructor(b,"GetSlice (Node)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input",[],VVVV.PinTypes.Node),c=this.addInputPin("BinSize",[1],VVVV.PinTypes.Value),d=this.addInputPin("Index",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[],VVVV.PinTypes.Node);this.evaluate=function(){for(var a=d.getSliceCount(),e,l,b=0,g=0;g<a;g++)if(l=c.getValue(g),e=h.getValue(Math.round(d.getValue(g)),l),1<l)for(l=
0;l<e.length;l++)f.setValue(b,e[l]),b++;else f.setValue(g,e),b++;f.setSliceCount(b)}};VVVV.Nodes.GetSliceNode.prototype=new VVVV.Core.Node;VVVV.Nodes.SelectNode=function(b,g){this.constructor(b,"Select (Node)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input",[],VVVV.PinTypes.Node),c=this.addInputPin("Select",[1],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[],VVVV.PinTypes.Node),f=this.addOutputPin("Former Slice",
[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),e=0,b=0;b<a;b++)for(var g=0;g<c.getValue(b);g++)d.setValue(e,h.getValue(b)),f.setValue(e,b),e++;d.setSliceCount(e);f.setSliceCount(e)}};VVVV.Nodes.SelectNode.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.BoundsSpectral=function(b,g){this.constructor(b,"Bounds (Spectral)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Bin Size",[-1],VVVV.PinTypes.Value),d=this.addOutputPin("Center",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Width",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Minimum",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Maximum",
[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0,n=0,q,p,m,k=0;k<b||0<c.getValue(0)&&(0<n||0!=g%c.getSliceCount());k++)q=h.getValue(k),0==n&&(center=p=m=q,width=0),p=Math.min(q,p),m=Math.max(q,m),n++,0<c.getValue(0)&&n>=c.getValue(g)&&(a.setValue(g,p),e.setValue(g,m),d.setValue(g,p+(m-p)/2),f.setValue(g,Math.abs(m-p)),g++,n=0);-1==c.getValue(0)&&(a.setValue(g,p),e.setValue(g,m),d.setValue(g,p+(m-p)/2),f.setValue(g,Math.abs(m-p)));d.setSliceCount(g+(0<n));
f.setSliceCount(g+(0<n));a.setSliceCount(g+(0<n));e.setSliceCount(g+(0<n))}};VVVV.Nodes.BoundsSpectral.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.GetSliceSpreads=function(b,g){this.constructor(b,"GetSlice (Spreads)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Bin Size",[1],VVVV.PinTypes.Value),d=this.addInputPin("Index",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=d.getSliceCount(),e,b,g=0,n=0;n<a;n++)if(b=c.getValue(n),
e=h.getValue(Math.round(d.getValue(n)),b),1<b)for(b=0;b<e.length;b++)f.setValue(g,e[b]),g++;else f.setValue(n,e),g++;f.setSliceCount(g)}};VVVV.Nodes.GetSliceSpreads.prototype=new VVVV.Core.Node;VVVV.Nodes.SetSliceSpreads=function(b,g){this.constructor(b,"SetSlice (Spreads)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Spread",[0],VVVV.PinTypes.Value),c=this.addInputPin("Input",[0],VVVV.PinTypes.Value),
d=this.addInputPin("Index",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=h.getSliceCount(),e=0;e<a;e++)f.setValue(e,h.getValue(e));size=Math.max(c.getSliceCount(),d.getSliceCount());for(e=0;e<size;e++)f.setValue(d.getValue(e)%a,c.getValue(e));f.setSliceCount(a)}};VVVV.Nodes.SetSliceSpreads.prototype=new VVVV.Core.Node;VVVV.Nodes.RandomSpread=function(b,g){function h(c){var d=[],f=0,a=0;(function(a){for(var c=0;256>c;c++)d[c]=c;for(var f=
0,c=0;256>c;c++){var f=(f+d[c]+a.charCodeAt(c%a.length))%256,b=d[c];d[c]=d[f];d[f]=b}})(c);this.getRandomNumber=function(){for(var e=0,c=1,b=0;8>b;b++){f=(f+1)%256;a=(a+d[f])%256;var g=d[f];d[f]=d[a];d[a]=g;e+=d[(d[f]+d[a])%256]*c;c*=256}return e/1.8446744073709552E19}}this.constructor(b,"RandomSpread (Spreads)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:["http://www.webdeveloper.com/forum/showthread.php?t=140572"],compatibility_issues:["Doesnt handle spreaded inputs",
"random result will differ from original vvvv node because of different algorithm"]};this.addInputPin("Input",[0],VVVV.PinTypes.Value);this.addInputPin("Width",[1],VVVV.PinTypes.Value);this.addInputPin("Random Seed",[0],VVVV.PinTypes.Value);this.addInputPin("Spread Count",[1],VVVV.PinTypes.Value);this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){var c=parseInt(this.inputPins["Spread Count"].getValue(0)),d=this.inputPins.Input.getValue(0),f=this.inputPins.Width.getValue(0),
a=parseInt(this.inputPins["Random Seed"].getValue(0));rng=new h(a.toString());this.outputPins.Output.setSliceCount(c);for(a=0;a<c;a++)this.outputPins.Output.setValue(a,rng.getRandomNumber()*f-f/2+d)}};VVVV.Nodes.RandomSpread.prototype=new VVVV.Core.Node;VVVV.Nodes.SortSpreads=function(b,g){this.constructor(b,"Sort (Spreads)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.addInputPin("Input",[0],VVVV.PinTypes.Value);this.addOutputPin("Output",
[0],VVVV.PinTypes.Value);this.addOutputPin("Former Index",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=_(this.inputPins.Input.values).map(function(c,f){return[c,f]}),b=_(b).sortBy(function(c){return c[0]}),c=0;c<b.length;c++)this.outputPins.Output.setValue(c,b[c][0]),this.outputPins["Former Index"].setValue(c,b[c][1]);this.outputPins.Output.setSliceCount(b.length);this.outputPins["Former Index"].setSliceCount(b.length)}};VVVV.Nodes.SortSpreads.prototype=new VVVV.Core.Node;VVVV.Nodes.LinearSpread=
function(b,g){this.constructor(b,"LinearSpread (Spreads)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["phase does not work with Block alignment"]};var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Width",[1],VVVV.PinTypes.Value),d=this.addInputPin("Alignment",["Centered"],VVVV.PinTypes.Enum);d.enumOptions=["Centered","Block","LeftJustified","RightJustified"];var f=this.addInputPin("Phase",[0],VVVV.PinTypes.Value),
a=this.addInputPin("Spread Count",[1],VVVV.PinTypes.Value),e=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0,n=0;n<b;n++){var q=parseInt(a.getValue(n)),p=c.getValue(n),m=f.getValue(n),k=h.getValue(n),v=d.getValue(n);""==v&&(v="Centered");var z=p/q;"Block"==v&&(z=p/(q-1));var w=z/2;if("Block"==v||"LeftJustified"==v)w=0;"RightJustified"==v&&(w=z);for(var y,u=0;u<q;u++)y=u*z+w,"Block"!=v&&0!=p&&(y=(y+m*p)%p),y=k-p/2+y,e.setValue(g,
y),g++}e.setSliceCount(g)}};VVVV.Nodes.LinearSpread.prototype=new VVVV.Core.Node;VVVV.Nodes.AvoidNil=function(b,g){this.constructor(b,"AvoidNIL (Spreads)",g);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["Kalle"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Default",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){if(h.pinIsChanged()||c.pinIsChanged()){var f=
h;0==h.getSliceCount()&&(f=c);for(var a=0;a<f.values.length;a++)d.setValue(a,f.getValue(a));d.setSliceCount(f.getSliceCount())}}};VVVV.Nodes.AvoidNil.prototype=new VVVV.Core.Node;VVVV.Nodes.SwapDim=function(b,g){this.constructor(b,"SwapDim (Spreads)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["BinSize not implemented"]};var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Column Count",[0],VVVV.PinTypes.Value),
d=this.addInputPin("Row Count",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=parseInt(c.getValue(0)),e=parseInt(d.getValue(0)),b=a*e,g=0;g<b;g++)f.setValue(g%a*e+parseInt(g/a),h.getValue(g));f.setSliceCount(b)}};VVVV.Nodes.SwapDim.prototype=new VVVV.Core.Node;VVVV.Nodes.I=function(b,g){this.constructor(b,"I (Spreads)",g);this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:["Matthias Zauner, M\u00f3r\u00e1sz D\u00e1vid (micro.D)"],
compatibility_issues:[]};var h=this.addInputPin("[ From ..",[0],VVVV.PinTypes.Value),c=this.addInputPin(".. To [",[1],VVVV.PinTypes.Value),d=this.addInputPin("Phase",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),e=0,b=0;b<a;b++){var g=Math.round(h.getValue(b)),n=Math.round(c.getValue(b)),k=d.getValue(b),p=n-g,m=Math.abs(p);if(g<=n)for(n=0;n<m;n++,e++){var x=parseFloat(n)-m*k,x=Math.round(x)%p;0>x&&(x=
p+x);x+=g;f.setValue(e,x)}else for(n=m;0<n;n--,e++)x=parseFloat(n)-m*k,x=Math.round(x)%p,0>p&&(x*=-1),0>x&&(x=p-x),x+=g,f.setValue(e,x)}f.setSliceCount(e)}};VVVV.Nodes.I.prototype=new VVVV.Core.Node;VVVV.Nodes.CircularSpread=function(b,g){this.constructor(b,"CircularSpread (Spreads)",g);this.meta={authors:["Matija Miloslavich, woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.xIn=this.addInputPin("Input X",[0],VVVV.PinTypes.Value);this.yIn=this.addInputPin("Input Y",
[0],VVVV.PinTypes.Value);this.widthIn=this.addInputPin("Width",[1],VVVV.PinTypes.Value);this.heightIn=this.addInputPin("Height",[1],VVVV.PinTypes.Value);this.factorIn=this.addInputPin("Factor",[1],VVVV.PinTypes.Value);this.phaseIn=this.addInputPin("Phase",[0],VVVV.PinTypes.Value);this.sprcntIn=this.addInputPin("Spread Count",[1],VVVV.PinTypes.Value);this.xOut=this.addOutputPin("Output X",[0],VVVV.PinTypes.Value);this.yOut=this.addOutputPin("Output Y",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=
2*Math.PI,c=0,d=0;d<this.getMaxInputSliceCount();d++)for(var f=this.xIn.getValue(d),a=this.yIn.getValue(d),e=.5*this.widthIn.getValue(d),l=.5*this.heightIn.getValue(d),g=this.factorIn.getValue(d),n=this.phaseIn.getValue(d)*b,k=parseInt(this.sprcntIn.getValue(d)),p=0;p<k;p++){var m=n+p/k*b*g,x=a+Math.sin(m)*l;this.xOut.setValue(c,f+Math.cos(m)*e);this.yOut.setValue(c,x);c++}this.xOut.setSliceCount(c);this.yOut.setSliceCount(c)}};VVVV.Nodes.CircularSpread.prototype=new VVVV.Core.Node;VVVV.Nodes.ReverseSpreads=
function(b,g){this.constructor(b,"Reverse (Spreads)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var d=h.getSliceCount(),f=0;f<d;f++){var a=h.getValue(f);c.setValue(d-f-1,a)}c.setSliceCount(d)}};VVVV.Nodes.ReverseSpreads.prototype=new VVVV.Core.Node;VVVV.Nodes.IntegralSpreads=
function(b,g){this.constructor(b,"Integral (Spreads)",g);this.meta={authors:["Matthias Zauner, woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Input Bin Size",[-1],VVVV.PinTypes.Value),d=this.addInputPin("Offset",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Output Bin Size",[2],VVVV.PinTypes.Value);this.evaluate=function(){var e=
h.getSliceCount(),b=Math.max(c.getSliceCount(),d.getSliceCount()),g=0,n=0,k=[];if(0<b)for(;g<b||n<e;){var p=parseInt(c.getValue(g));0>p&&(p=parseInt(Math.round(e/parseFloat(Math.abs(p)))));n+=p;k[g]=p;g++}k.splice(g);for(n=b=e=0;n<g;n++){p=k[n];a.setValue(n,p+1);for(var m=d.getValue(n),x=0;x<p;x++)f.setValue(b,m),b++,m+=h.getValue(e+x);e+=p;f.setValue(b,m);b++}f.setSliceCount(b);a.setSliceCount(g)}};VVVV.Nodes.IntegralSpreads.prototype=new VVVV.Core.Node;VVVV.Nodes.DifferentialSpreads=function(b,
g){this.constructor(b,"Differential (Spreads)",g);this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Input Bin Size",[-1],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output Bin Size",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Offset",[0],VVVV.PinTypes.Value);this.evaluate=function(){var e=h.getSliceCount(),
b=c.getSliceCount(),g=0,n=0,k=[];if(0<b)for(;g<b||n<e;){var p=parseInt(c.getValue(g));0>p&&(p=parseInt(Math.round(e/parseFloat(Math.abs(p)))));n+=p;k[g]=p;g++}k.splice(g);for(n=b=e=0;n<g;n++){var p=k[n]-1,m=h.getValue(e);f.setValue(n,p);a.setValue(n,m);for(var x=0;x<p;x++){var v=h.getValue(e+x+1);d.setValue(b,v-m);m=v;b++}e+=p+1}d.setSliceCount(b);f.setSliceCount(g);a.setSliceCount(g)}};VVVV.Nodes.DifferentialSpreads.prototype=new VVVV.Core.Node;VVVV.Nodes.ConsSpreads=function(b,g){this.constructor(b,
"Cons (Spreads)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=[],c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),d=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value);this.initialize=function(){var c=Math.max(2,d.getValue(0));VVVV.Helpers.dynamicPins(this,h,c,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){d.pinIsChanged()&&this.initialize();
for(var f=0,a=0;a<h.length;a++)for(var e=0;e<h[a].getSliceCount();e++)c.setValue(f++,h[a].getValue(e));c.setSliceCount(f)}};VVVV.Nodes.ConsSpreads.prototype=new VVVV.Core.Node;VVVV.Nodes.IntervalSpreads=function(b,g){this.constructor(b,"Interval (Spreads)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",[.5],VVVV.PinTypes.Value),c=this.addInputPin("Intervals",[0],VVVV.PinTypes.Value),
d=this.addOutputPin("Index",[0],VVVV.PinTypes.Value),f=0;this.evaluate=function(){var a=h.getSliceCount(),e=c.getSliceCount();if(c.pinIsChanged()){f=void 0;for(var b=0;b<e;b++)if(c.getValue(b)<f||void 0==f)f=c.getValue(b)}for(b=0;b<a;b++){var g=h.getValue(b);if(g<f)d.setValue(b,-1);else{for(var n=0;n<e-1&&!(g>=c.getValue(n)&&g<c.getValue(n+1));n++);d.setValue(b,n)}}d.setSliceCount(a)}};VVVV.Nodes.IntervalSpreads.prototype=new VVVV.Core.Node;VVVV.Nodes.QueueSpreads=function(b,g){this.constructor(b,
"Queue (Spreads)",g);this.meta={authors:["Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Insert",[0],VVVV.PinTypes.Value),d=this.addInputPin("Frame Count",[1],VVVV.PinTypes.Value),f=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Output",[],VVVV.PinTypes.Value),e=this.addOutputPin("Output Bin Size",[],VVVV.PinTypes.Value),l=[],r=[];this.evaluate=function(){var b=
c.getValue(0),g=d.getValue(0),k=f.getValue(0),m=!1;if(.5<=b&&.5>k){b=h.getSliceCount();for(m=b-1;0<=m;m--)l.unshift(h.getValue(m));r.unshift(b);m=!0}if(d.pinIsChanged()||m){for(m=currFrameCount=r.length;m>g;m--)l.splice(-r[m-1]);r.splice(g);m=!0}if(m){for(m=0;m<l.length;m++)a.setValue(m,l[m]);for(m=0;m<r.length;m++)e.setValue(m,r[m]);a.setSliceCount(l.length);a.setSliceCount(r.length)}.5<=k&&(l.length=0,r.length=0,a.setSliceCount(0),e.setSliceCount(0))}};VVVV.Nodes.QueueSpreads.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.IOBoxString=function(b,g){this.constructor(b,"IOBox (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.addInvisiblePin("Rows",[1],VVVV.PinTypes.Value);this.addInputPin("SliceOffset",[0],VVVV.PinTypes.Value);this.addInputPin("Input String",[""],VVVV.PinTypes.String);this.addOutputPin("Output String",[""],VVVV.PinTypes.String);this.evaluate=function(){this.outputPins["Output String"].setSliceCount(this.inputPins["Input String"].getSliceCount());
for(var b=0;b<this.inputPins["Input String"].getSliceCount();b++)this.outputPins["Output String"].setValue(b,this.inputPins["Input String"].getValue(b))}};VVVV.Nodes.IOBoxString.prototype=new VVVV.Core.Node;VVVV.Nodes.SwitchStringInput=function(b,g){this.constructor(b,"Switch (String Input)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),c=this.addInputPin("Switch",[0],
VVVV.PinTypes.Value),d=[],f=this.addOutputPin("Output",["text"],VVVV.PinTypes.String);this.initialize=function(){var a=Math.max(2,h.getValue(0));VVVV.Helpers.dynamicPins(this,d,a,function(a){return this.addInputPin("Input "+(a+1),["text"],VVVV.PinTypes.String)})};this.evaluate=function(){h.pinIsChanged()&&this.initialize();for(var a=this.getMaxInputSliceCount(),e=0;e<a;e++)f.setValue(e,d[Math.round(Math.abs(c.getValue(e)))%d.length].getValue(e));f.setSliceCount(a)}};VVVV.Nodes.SwitchStringInput.prototype=
new VVVV.Core.Node;VVVV.Nodes.AddString=function(b,g){this.constructor(b,"Add (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["No dynamic pin count yet","Intersperse *Enum* not implemented"]};var h=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),c=[],d=this.addInputPin("Intersperse String",[""],VVVV.PinTypes.String),f=this.addOutputPin("Output",["texttext"],VVVV.PinTypes.String);this.initialize=function(){var a=Math.max(2,
h.getValue(0));VVVV.Helpers.dynamicPins(this,c,a,function(a){return this.addInputPin("Input "+(a+1),["text"],VVVV.PinTypes.String)})};this.evaluate=function(){h.pinIsChanged()&&this.initialize();for(var a=this.getMaxInputSliceCount(),e=0;e<a;e++){var b=[],g=d.getValue(e);void 0==g&&(g="");for(var n=0;n<c.length;n++)b.push(c[n].getValue(e));f.setValue(e,b.join(g))}f.setSliceCount(a)}};VVVV.Nodes.AddString.prototype=new VVVV.Core.Node;VVVV.Nodes.GetSliceString=function(b,g){this.constructor(b,"GetSlice (String)",
g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Bin Size not implemented"]};var h=this.addInputPin("Input",["text"],VVVV.PinTypes.String);this.addInputPin("Bin Size",[1],VVVV.PinTypes.Value);var c=this.addInputPin("Index",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Output",["text"],VVVV.PinTypes.String);this.evaluate=function(){for(var f=0;f<c.values.length;f++)d.setValue(f,h.getValue(Math.round(c.getValue(f))));d.setSliceCount(c.getSliceCount())}};
VVVV.Nodes.GetSliceString.prototype=new VVVV.Core.Node;VVVV.Nodes.AsValue=function(b,g){this.constructor(b,"AsValue (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input",[],VVVV.PinTypes.String),c=this.addInputPin("Default",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++){var e=h.getValue(a);/^\s*-?[0-9.e]+\s*$/.test(e)?
d.setValue(a,parseFloat(e)):d.setValue(a,c.getValue(a))}d.setSliceCount(f)}};VVVV.Nodes.AsValue.prototype=new VVVV.Core.Node;VVVV.Nodes.SortString=function(b,g){this.constructor(b,"Sort (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",["text"],VVVV.PinTypes.String);this.addInputPin("Reverse Sorting",[0],VVVV.PinTypes.Value);var c=this.addOutputPin("Output",["text"],VVVV.PinTypes.String),
d=this.addOutputPin("Former Index",[0],VVVV.PinTypes.Value);this.initialize=function(){};this.evaluate=function(){for(var f=_(h.values).map(function(a,c){return[a,c]}),f=_(f).sortBy(function(a){return a[0]}),a=0;a<f.length;a++)c.setValue(a,f[a][0]),d.setValue(a,f[a][1]);c.setSliceCount(f.length);d.setSliceCount(f.length)}};VVVV.Nodes.SortString.prototype=new VVVV.Core.Node;VVVV.Nodes.LengthString=function(b,g){this.constructor(b,"Length (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],
credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",["text"],VVVV.PinTypes.String),c=this.addOutputPin("Count",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),f=0;f<d;f++){var a=h.getValue(f);c.setValue(f,a.length)}c.setSliceCount(d)}};VVVV.Nodes.LengthString.prototype=new VVVV.Core.Node;VVVV.Nodes.SiftString=function(b,g){this.constructor(b,"Sift (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],
credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",["text"],VVVV.PinTypes.String),c=this.addInputPin("Filter",["text"],VVVV.PinTypes.String),d=this.addInputPin("Comparison",["Matches"],VVVV.PinTypes.Enum);d.enumOptions=["Matches","Contains","MatchesAny","ContainsAny"];var f=this.addInputPin("Case Sensitive",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Hits",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Input Index",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Filter Index",
[0],VVVV.PinTypes.Value),k=this.addOutputPin("Found At Position",[0],VVVV.PinTypes.Value);this.evaluate=function(){var b=this.getMaxInputSliceCount();a.setSliceCount(b);var g=d.getValue(0);f.getValue(0);for(var p=0,m=0;m<b;m++){var x=h.getValue(m),v=1;if("MatchesAny"==g||"ContainsAny"==g)v=c.getSliceCount();for(var z=0,w=0;w<v;w++){var y=c.getValue(w+m),u=[];if("Matches"==g||"MatchesAny"==g)y==x&&u.push(-1);else for(var y=new RegExp(y,"gi"),A;A=y.exec(x);)u.push(A.index);for(y=0;y<u.length;y++)e.setValue(p,
m%h.getSliceCount()),l.setValue(p,(m+w)%c.getSliceCount()),k.setValue(p,u[y]+1),p++,z++}a.setValue(m,z)}e.setSliceCount(p);l.setSliceCount(p);k.setSliceCount(p)}};VVVV.Nodes.SiftString.prototype=new VVVV.Core.Node;VVVV.Nodes.SeparateString=function(b,g){this.constructor(b,"Separate (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Quotes don't work"]};this.auto_evaluate=!1;var h=this.addInputPin("Input",["text"],VVVV.PinTypes.String),
c=this.addInputPin("Intersperse",["None"],VVVV.PinTypes.Enum);c.enumOptions="None Space Comma CommaPlusSpace Semicolon Colon Pipe UnixPath DosPath Dash NewLineAutoDetection Dot UnderScore Minus".split(" ");var d=this.addInputPin("Intersperse String",[""],VVVV.PinTypes.String),f=this.addInputPin("Ignore between",["Double"],VVVV.PinTypes.Enum);f.enumOptions=["Single","Double"];var a=this.addInputPin("Keep Quotes",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Output",["text"],VVVV.PinTypes.String),l=
this.addOutputPin("Former Index",[0],VVVV.PinTypes.Value),k={None:"",Space:" ",Comma:",",CommaPlusSpace:", ",Semicolon:";",Colon:":",Pipe:"|",UnixPath:"/",DosPath:"\\",Dash:"-",NewLineAutoDetection:"\n",Dot:".",UnderScore:"_",Minus:"-"},n={Single:"'",Double:'"'};this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0,m=0;m<b;m++){var x=h.getValue(m),v=k[c.getValue(m)],z=d.getValue(m),w=n[f.getValue(m)],y=a.getValue(m);""==v&&(v=z);""==v&&(v=void 0);x=x.split(v);v=x.length;w=new RegExp("[^"+
w+"]*","g");for(z=0;z<v;z++)1==y?e.setValue(g,x[z]):e.setValue(g,x[z].match(w).join("")),l.setValue(g,m),g++}e.setSliceCount(g);l.setSliceCount(g)}};VVVV.Nodes.SeparateString.prototype=new VVVV.Core.Node;VVVV.Nodes.EQString=function(b,g){this.constructor(b,"EQ (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input 1",[""],VVVV.PinTypes.String),c=this.addInputPin("Input 2",[""],VVVV.PinTypes.String),
d=this.addInputPin("Case Sensitive",[1],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Inverse Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),b=0;b<e;b++){var g=h.getValue(b),n=c.getValue(b),k=d.getValue(b),g=g==n||0==k&&g.toLowerCase()==n.toLowerCase()?1:0;f.setValue(b,g);a.setValue(b,1-g)}f.setSliceCount(e);a.setSliceCount(e)}};VVVV.Nodes.EQString.prototype=new VVVV.Core.Node;VVVV.Nodes.SelectString=
function(b,g){this.constructor(b,"Select (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input",[""],VVVV.PinTypes.String),c=this.addInputPin("Select",[1],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[""],VVVV.PinTypes.String),f=this.addOutputPin("Former Slice",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),e=0,b=0;b<a;b++)for(var g=0;g<c.getValue(b);g++)d.setValue(e,
h.getValue(b)),f.setValue(e,b),e++;d.setSliceCount(e);f.setSliceCount(e)}};VVVV.Nodes.SelectString.prototype=new VVVV.Core.Node;VVVV.Nodes.CountString=function(b,g){this.constructor(b,"Count (String)",g);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.addInputPin("Input",[""],VVVV.PinTypes.String);this.addOutputPin("Count",[1],VVVV.PinTypes.Value);this.addOutputPin("High",[0],VVVV.PinTypes.Value);this.evaluate=function(){this.inputPins.Input.pinIsChanged()&&
(this.outputPins.Count.setValue(0,this.inputPins.Input.values.length),this.outputPins.High.setValue(0,this.inputPins.Input.values.length-1))}};VVVV.Nodes.CountString.prototype=new VVVV.Core.Node;VVVV.Nodes.CleanString=function(b,g){this.constructor(b,"Clean (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",["text"],VVVV.PinTypes.String),c=this.addOutputPin("Output",["text"],VVVV.PinTypes.String);
this.evaluate=function(){for(var d=this.getMaxInputSliceCount(),f=0;f<d;f++)h.getValue(f)?c.setValue(f,h.getValue(f).trim()):c.setValue(f,void 0);c.setSliceCount(d)}};VVVV.Nodes.CleanString.prototype=new VVVV.Core.Node;VVVV.Nodes.AvoidNilString=function(b,g){this.constructor(b,"AvoidNIL (String)",g);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["Kalle"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input",["text"],VVVV.PinTypes.String),c=this.addInputPin("Default",
["text"],VVVV.PinTypes.String),d=this.addOutputPin("Output",["text"],VVVV.PinTypes.String);this.evaluate=function(){if(h.pinIsChanged()||c.pinIsChanged()){var f=h;0==h.getSliceCount()&&(f=c);for(var a=0;a<f.values.length;a++)d.setValue(a,f.getValue(a));d.setSliceCount(f.getSliceCount())}}};VVVV.Nodes.AvoidNilString.prototype=new VVVV.Core.Node;VVVV.Nodes.FormatValueString=function(b,g){this.constructor(b,"FormatValue (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],
credits:["pad function: http://stackoverflow.com/a/10073788","thousands separator regex: http://stackoverflow.com/a/2901298"],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Characters before Comma",[1],VVVV.PinTypes.Value),d=this.addInputPin("Characters after Comma",[0],VVVV.PinTypes.Value),f=this.addInputPin("Thousands Symbol",["None"],VVVV.PinTypes.Enum);f.enumOptions=["None","Dot","Comma","Space"];var a=this.addInputPin("Comma Symbol",
["Dot"],VVVV.PinTypes.Enum);a.enumOptions=["Dot","Comma"];var e=this.addInputPin("Leading Zeroes",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Output",["0"],VVVV.PinTypes.String),k={Dot:".",Comma:",",None:"",Space:" "};this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++){var p=h.getValue(g),m=parseInt(c.getValue(g)),x=parseInt(d.getValue(g)),v=f.getValue(g),z=a.getValue(g),w=e.getValue(g),m=m+x+(0<x),p=p.toFixed(x),w=w=.5<=w?"0":" ",p=p+"",p=p.length>=m?p:Array(m-p.length+
1).join(w)+p,p=p.replace(".",k[z]).replace(/\B(?=(\d{3})+(?!\d))/g,k[v]);l.setValue(g,p)}l.setSliceCount(b)}};VVVV.Nodes.FormatValueString.prototype=new VVVV.Core.Node;VVVV.Nodes.SampleAndHoldString=function(b,g){this.constructor(b,"S+H (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["different output slice count in pure VVVV, if Set pin has only one slice"]};var h=this.addInputPin("Input",[""],VVVV.PinTypes.String),c=this.addInputPin("Set",
[0],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[""],VVVV.PinTypes.String);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++)void 0==d.values[a]&&d.setValue(a,0),.5<=Math.round(c.getValue(a))&&d.setValue(a,h.getValue(a));d.setSliceCount(f)}};VVVV.Nodes.SampleAndHoldString.prototype=new VVVV.Core.Node;VVVV.Nodes.ConsString=function(b,g){this.constructor(b,"Cons (String)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};
this.auto_evaluate=!1;var h=[],c=this.addOutputPin("Output",["text"],VVVV.PinTypes.String),d=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value);this.initialize=function(){var c=Math.max(2,d.getValue(0));VVVV.Helpers.dynamicPins(this,h,c,function(a){return this.addInputPin("Input "+(a+1),["text"],VVVV.PinTypes.String)})};this.evaluate=function(){d.pinIsChanged()&&this.initialize();for(var f=0,a=0;a<h.length;a++)for(var e=0;e<h[a].getSliceCount();e++)c.setValue(f++,h[a].getValue(e));c.setSliceCount(f)}};
VVVV.Nodes.ConsString.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.MouseGlobal=function(b,g){function h(a){for(var e=a.originalEvent.changedTouches.length;e--;)n[a.originalEvent.changedTouches[e].identifier]=2*a.originalEvent.changedTouches[e].pageX/parseInt(k("body").css("width"))-1,q[a.originalEvent.changedTouches[e].identifier]=-(2*a.originalEvent.changedTouches[e].pageY/parseInt(k("body").css("height"))-1)}this.constructor(b,"Mouse (System Global)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Cyclic mode not supported"]};
this.auto_evaluate=!0;var c=this.addInputPin("Maximum Touch Points",[1],VVVV.PinTypes.Value),d=this.addOutputPin("X",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Mouse Wheel",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Left Button",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Middle Button",[0],VVVV.PinTypes.Value),r=this.addOutputPin("Right Button",[0],VVVV.PinTypes.Value),n=[0],q=[0],p=[0],m=[0],x=[0],v=[0];k(document).mousemove(function(a){n[0]=
2*a.pageX/parseInt(k("body").css("width"))-1;q[0]=-(2*a.pageY/parseInt(k("body").css("height"))-1)});k(document).bind("mousewheel",function(a){p[0]+=a.originalEvent.wheelDelta/120});k(document).bind("DOMMouseScroll",function(a){p[0]+=-a.originalEvent.detail/3});k(document).mousedown(function(a){switch(a.which){case 1:m[0]=1;break;case 2:x[0]=1;break;case 3:v[0]=1}});k(document).mouseup(function(a){switch(a.which){case 1:m[0]=0;break;case 2:x[0]=0;break;case 3:v[0]=0}});k(document).bind("touchstart",
function(a){for(var e=a.originalEvent.changedTouches.length;e--;)m[a.originalEvent.changedTouches[e].identifier]=1;h(a)});k(document).bind("touchend",function(a){for(var e=a.originalEvent.changedTouches.length;e--;)m[a.originalEvent.changedTouches[e].identifier]=0});k(document).bind("touchmove",h);this.evaluate=function(){for(var b=Math.max(1,c.getValue(0)),g=b;g--;)d.setValue(g,n[g]||0),f.setValue(g,q[g]||0),a.setValue(g,p[g]||0),e.setValue(g,m[g]||0),l.setValue(g,x[g]||0),r.setValue(g,v[g]||0);
c.pinIsChanged()&&[d,f,a,e,l,r].forEach(function(a){a.setSliceCount(b)})}};VVVV.Nodes.MouseGlobal.prototype=new VVVV.Core.Node;VVVV.Nodes.MouseWindow=function(b,g){this.constructor(b,"Mouse (System Window)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Cyclic mode not supported","No Mouse Wheel pin","No Left Button Pin","No Right Button Pin","No Middle Button Pin"]};this.auto_evaluate=!0;var h=this.addInputPin("Maximum Touch Points",[1],
VVVV.PinTypes.Value),c=this.addOutputPin("X",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Mouse Wheel",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Left Button",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Middle Button",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Right Button",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=Math.max(1,h.getValue(0)),g=b;g--;)c.setValue(g,VVVV.MousePositions._all.x[g]||0),d.setValue(g,VVVV.MousePositions._all.y[g]||
0),f.setValue(g,VVVV.MousePositions._all.wheel[g]||0),a.setValue(g,VVVV.MousePositions._all.lb[g]||0),e.setValue(g,VVVV.MousePositions._all.mb[g]||0),l.setValue(g,VVVV.MousePositions._all.rb[g]||0);h.pinIsChanged()&&[c,d,f,a,e,l].forEach(function(a){a.setSliceCount(b)})}};VVVV.Nodes.MouseWindow.prototype=new VVVV.Core.Node;VVVV.Nodes.ShellExecute=function(b,g){this.constructor(b,"ShellExecute (Windows)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["This actually does something completely different from the original node: the origin node executes a shell command, this node evals javascript code"]};
var h=this.addInputPin("File",[0],VVVV.PinTypes.String),c=this.addInputPin("Do Execute",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Result",[""],VVVV.PinTypes.String);this.evaluate=function(){if(1<=Math.round(c.getValue(0))){var f=eval(h.getValue(0));f instanceof Array||f instanceof Object||(f=[f]);if(void 0!=f)for(var a=0;a<f.length;a++)d.setValue(a,f[a])}}};VVVV.Nodes.ShellExecute.prototype=new VVVV.Core.Node;VVVV.Nodes.ScreenInfo=function(b,g){this.constructor(b,"ScreenInfo (Windows)",g);this.meta=
{authors:["David M\u00f3r\u00e1sz (micro.D)"],original_authors:["VVVV Group"],credits:["Matthias Zauner"],compatibility_issues:["Outputs the window size (ResolutionXY) and the document size (Working AreaXY) only","no Bits per pixel"]};this.auto_evaluate=!0;var h=this.addOutputPin("ResolutionXY",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Working AreaXY",[0],VVVV.PinTypes.Value),d=0,f=0,a=0,e=0;k(document).ready(function(){f=k(window).innerHeight();d=k(window).innerWidth();e=k(document).height();
a=k(document).width()});k(window).resize(function(){f=k(window).innerHeight();d=k(window).innerWidth();e=k(document).height();a=k(document).width()});this.evaluate=function(){if(h.getValue(0)!=d||h.getValue(1)!=f)h.setValue(0,d),h.setValue(1,f);if(c.getValue(0)!=a||c.getValue(1)!=e)c.setValue(0,a),c.setValue(1,e)}};VVVV.Nodes.ScreenInfo.prototype=new VVVV.Core.Node;VVVV.Nodes.DefineNode=function(b,g){this.constructor(b,"DefineNode (System)",g);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],
original_authors:["Matthias Zauner"],credits:[],compatibility_issues:["Not available in classic VVVV"]};this.auto_evaluate=!1;var h=this.addInvisiblePin("Node Name",[""],VVVV.PinTypes.String),c=this.addInvisiblePin("Source Code",['var valueIn = this.addInputPin("Value In", [0], VVVV.PinTypes.Value);\nvar stringIn = this.addInputPin("String In", ["text"], VVVV.PinTypes.String);\nvar colorIn = this.addInputPin("Color In", [], VVVV.PinTypes.Color);\n\nvar valueOut = this.addOutputPin("Value Out", [0], VVVV.PinTypes.Value);\nvar stringOut = this.addOutputPin("String Out", ["text"], VVVV.PinTypes.String);\nvar colorOut = this.addOutputPin("Color Out", [], VVVV.PinTypes.Color);\n\nthis.initialize = function() {\n\n//Put node configuration code here ...\n}\n\nthis.evaluate = function() {\n var maxSize = this.getMaxInputSliceCount();\n\n for (var i=0; i<maxSize; i++) {\n\n valueOut.setValue(i, valueIn.getValue(i));\n stringOut.setValue(i, stringIn.getValue(i));\n colorOut.setValue(i, colorIn.getValue(i));\n }\n\n valueOut.setSliceCount(maxSize);\n stringOut.setSliceCount(maxSize);\n colorOut.setSliceCount(maxSize);\n}\n\nthis.destroy = function() {\n // This is called when the node is deleted\n}'],
VVVV.PinTypes.String),d="",f=void 0,a;this.relatedNodes=[];this.initialize=function(){this.evaluate()};this.evaluate=function(){if(""!=h.getValue(0)){if(h.pinIsChanged()){var e=h.getValue(0);if(""==e)return;VVVV.NodeLibrary[e.toLowerCase()]&&VVVV.NodeLibrary[e.toLowerCase()].definingNode!=this&&(console.warn("The node '"+e+"' has already been defined."),this.not_implemented=!0);""!=d&&(VVVV.NodeLibrary[e.toLowerCase()]=VVVV.NodeLibrary[d.toLowerCase()],delete VVVV.NodeLibrary[d.toLowerCase()]);d=
e;this.not_implemented=!1;a&&k("#path",a.document).text((this.parentPatch.nodename||"root")+" / "+(""!=d?d:"Untitled"))}if(c.pinIsChanged()||h.pinIsChanged())try{f=new Function("id","graph",'this.constructor(id, "'+d+'", graph); '+c.getValue(0));f.prototype=new VVVV.Core.Node;f.definingNode=this;VVVV.NodeLibrary[d.toLowerCase()]=f;for(e=0;e<this.relatedNodes.length;e++){var b=this.relatedNodes[e];b.parentPatch.doLoad("<PATCH><NODE id='"+b.id+"' systemname='"+d+"' createme='pronto'><BOUNDS type='Node' left='"+
15*b.x+"' top='"+15*b.y+"'></BOUNDS></NODE></PATCH>",function(){b.parentPatch.afterUpdate()})}0<=VVVV.NodeNames.indexOf(d)&&VVVV.NodeNames.splice(VVVV.NodeNames.indexOf(d),1);VVVV.NodeNames.push(d);this.showStatus("success","Successfully updated.");this.not_implemented=!1}catch(g){this.showStatus("error",g.message),this.not_implemented=!0}}};this.openUIWindow=function(){a=window.open(location.protocol+"//"+location.host+("/"==VVVV.Root[0]?"":location.pathname.replace(/\/[^\/]*$/,"")+"/")+VVVV.Root+
"/code_editor.html",d+" / VVVV.js Effect Editor","location=no, width=800, height=800, toolbar=no");var e=this;window.setTimeout(function(){a.document.title=d+" / VVVV.js Node Editor";var f=e.parentPatch.nodename||"root",b=""!=d?d:"Untitled";k("#path",a.document).text(f+" / "+b);k("textarea",a.document).text(c.getValue(0));k("#compile_button",a.document).click(function(){""==d?e.showStatus("error","Please provide a name for this node first"):(c.setValue(0,k("textarea",a.document).val()),e.showStatus("notice",
"Compiling ..."),e.evaluate())});a.focus()},500)};this.showStatus=function(e,c){a&&(k("#status",a.document).text(c),k("#status",a.document).attr("class",e))}};VVVV.Nodes.DefineNode.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.PinTypes.Transform={typeName:"Transform",reset_on_disconnect:!0,defaultValue:function(){return mat4.identity(mat4.create())}};VVVV.Nodes.Rotate=function(b,g){this.constructor(b,"Rotate (Transform)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=[];this.trIn=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform);this.xIn=this.addInputPin("X",[0],VVVV.PinTypes.Value);this.yIn=this.addInputPin("Y",[0],VVVV.PinTypes.Value);
this.zIn=this.addInputPin("Z",[0],VVVV.PinTypes.Value);this.trOut=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform);this.evaluate=function(){var c=this.trIn.isConnected()?this.getMaxInputSliceCount():Math.max(this.xIn.getSliceCount(),this.yIn.getSliceCount(),this.zIn.getSliceCount());if(c>h.length)for(var d=h.length;d++<c;)h.push(mat4.create());else c<h.length&&(h.length=c);for(d=0;d<c;d++){var f=this.inputPins["Transform In"].getValue(d),a=this.inputPins.X.getValue(d),e=this.inputPins.Y.getValue(d),
b=this.inputPins.Z.getValue(d);mat4.rotate(f,e*Math.PI*2,[0,1,0],h[d]);mat4.rotate(h[d],a*Math.PI*2,[1,0,0]);mat4.rotate(h[d],b*Math.PI*2,[0,0,1]);this.trOut.setValue(d,h[d])}this.trOut.setSliceCount(c)}};VVVV.Nodes.Rotate.prototype=new VVVV.Core.Node;VVVV.Nodes.Translate=function(b,g){this.constructor(b,"Translate (Transform)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=[];this.trIn=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform);
this.xIn=this.addInputPin("X",[0],VVVV.PinTypes.Value);this.yIn=this.addInputPin("Y",[0],VVVV.PinTypes.Value);this.zIn=this.addInputPin("Z",[0],VVVV.PinTypes.Value);this.trOut=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform);this.evaluate=function(){var c=this.trIn.isConnected()?this.getMaxInputSliceCount():Math.max(this.xIn.getSliceCount(),this.yIn.getSliceCount(),this.zIn.getSliceCount());if(c>h.length)for(var d=h.length;d++<c;)h.push(mat4.create());else c<h.length&&(h.length=c);for(d=
0;d<c;d++){var f=this.xIn.getValue(d),a=this.yIn.getValue(d),e=this.zIn.getValue(d);mat4.translate(this.trIn.getValue(d),[f,a,e],h[d]);this.trOut.setValue(d,h[d])}this.trOut.setSliceCount(c)}};VVVV.Nodes.Translate.prototype=new VVVV.Core.Node;VVVV.Nodes.Scale=function(b,g){this.constructor(b,"Scale (Transform)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=[];this.trIn=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform);
this.xIn=this.addInputPin("X",[1],VVVV.PinTypes.Value);this.yIn=this.addInputPin("Y",[1],VVVV.PinTypes.Value);this.zIn=this.addInputPin("Z",[1],VVVV.PinTypes.Value);this.trOut=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform);this.evaluate=function(){var c=this.trIn.isConnected()?this.getMaxInputSliceCount():Math.max(this.xIn.getSliceCount(),this.yIn.getSliceCount(),this.zIn.getSliceCount());if(c>h.length)for(var d=h.length;d++<c;)h.push(mat4.create());else c<h.length&&(h.length=c);for(d=
0;d<c;d++){var f=this.inputPins.X.getValue(d),a=this.inputPins.Y.getValue(d),e=this.inputPins.Z.getValue(d);mat4.scale(this.trIn.getValue(d),[f,a,e],h[d]);this.trOut.setValue(d,h[d])}this.trOut.setSliceCount(c)}};VVVV.Nodes.Scale.prototype=new VVVV.Core.Node;VVVV.Nodes.UniformScale=function(b,g){this.constructor(b,"UniformScale (Transform)",g);this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=[];this.trIn=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform);
this.xyzIn=this.addInputPin("XYZ",[1],VVVV.PinTypes.Value);this.trOut=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform);this.evaluate=function(){var c=this.trIn.isConnected()?this.getMaxInputSliceCount():this.xyzIn.getSliceCount();if(c>h.length)for(var d=h.length;d++<c;)h.push(mat4.create());else c<h.length&&(h.length=c);for(d=0;d<c;d++){var f=this.inputPins.XYZ.getValue(d);mat4.scale(this.trIn.getValue(d),[f,f,f],h[d]);this.trOut.setValue(d,h[d])}this.trOut.setSliceCount(c)}};VVVV.Nodes.UniformScale.prototype=
new VVVV.Core.Node;VVVV.Nodes.Trapeze=function(b,g){this.constructor(b,"Trapeze (Transform)",g);this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=[],c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];this.trIn=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform);this.xIn=this.addInputPin("X",[0],VVVV.PinTypes.Value);this.yIn=this.addInputPin("Y",[0],VVVV.PinTypes.Value);this.zIn=this.addInputPin("Z",[0],VVVV.PinTypes.Value);this.trOut=this.addOutputPin("Transform Out",
[],VVVV.PinTypes.Transform);this.evaluate=function(){var d=this.trIn.isConnected()?this.getMaxInputSliceCount():Math.max(this.xIn.getSliceCount(),this.yIn.getSliceCount(),this.zIn.getSliceCount());if(d>h.length)for(var f=h.length;f++<d;)h.push(mat4.create());else d<h.length&&(h.length=d);for(f=0;f<d;f++){var a=2*this.inputPins.X.getValue(f),e=2*this.inputPins.Y.getValue(f),b=2*this.inputPins.Z.getValue(f);c[3]=a;c[7]=e;c[11]=b;mat4.multiply(this.inputPins["Transform In"].getValue(f),c,h[f]);this.trOut.setValue(f,
h[f])}this.trOut.setSliceCount(d)}};VVVV.Nodes.Trapeze.prototype=new VVVV.Core.Node;VVVV.Nodes.Transform2d=function(b,g){this.constructor(b,"Transform (Transform 2d)",g);this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=[];this.trIn=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform);this.txIn=this.addInputPin("TranslateX",[0],VVVV.PinTypes.Value);this.tyIn=this.addInputPin("TranslateY",[0],VVVV.PinTypes.Value);this.sxIn=this.addInputPin("ScaleX",
[1],VVVV.PinTypes.Value);this.syIn=this.addInputPin("ScaleY",[1],VVVV.PinTypes.Value);this.rIn=this.addInputPin("Rotate",[0],VVVV.PinTypes.Value);this.cxIn=this.addInputPin("CenterX",[0],VVVV.PinTypes.Value);this.cyIn=this.addInputPin("CenterY",[0],VVVV.PinTypes.Value);this.trOut=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform);this.evaluate=function(){var c=this.getMaxInputSliceCount();if(c>h.length)for(var d=h.length;d++<c;)h.push(mat4.create());else c<h.length&&(h.length=c);for(d=
0;d<c;d++){var f=this.inputPins.TranslateX.getValue(d),a=this.inputPins.TranslateY.getValue(d),e=this.inputPins.ScaleX.getValue(d),b=this.inputPins.ScaleY.getValue(d),g=this.inputPins.Rotate.getValue(d),n=this.inputPins.CenterX.getValue(d),k=this.inputPins.CenterY.getValue(d);mat4.translate(this.inputPins["Transform In"].getValue(d),[f,a,0],h[d]);mat4.rotate(h[d],g*Math.PI*2,[0,0,1]);mat4.scale(h[d],[e,b,1]);mat4.translate(h[d],[-n,-k,0]);this.trOut.setValue(d,h[d])}this.trOut.setSliceCount(c)}};
VVVV.Nodes.Transform2d.prototype=new VVVV.Core.Node;VVVV.Nodes.AspectRatio=function(b,g){this.constructor(b,"AspectRatio (Transform)",g);this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=[];this.trIn=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform);this.wIn=this.addInputPin("Aspect Width",[1],VVVV.PinTypes.Value);this.hIn=this.addInputPin("Aspect Height",[1],VVVV.PinTypes.Value);this.sIn=this.addInputPin("Uniform Scale",[1],VVVV.PinTypes.Value);
this.alignmentIn=this.addInputPin("Alignment",["FitIn"],VVVV.PinTypes.Enum);this.alignmentIn.enumOptions=["FitIn","FitWidth","FitHeight","FitOut"];this.trOut=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform);this.evaluate=function(){var c=this.trIn.isConnected()?this.getMaxInputSliceCount():Math.max(this.wIn.getSliceCount(),this.hIn.getSliceCount(),this.sIn.getSliceCount(),this.alignmentIn.getSliceCount());if(c>h.length)for(var d=h.length;d++<c;)h.push(mat4.create());else c<h.length&&
(h.length=c);for(d=0;d<c;d++){var f=this.inputPins["Aspect Width"].getValue(d),a=this.inputPins["Aspect Height"].getValue(d),e=this.inputPins["Uniform Scale"].getValue(d),b=e,g=e;switch(this.alignmentIn.getValue(d)){case "FitIn":f>a?g*=a/f:b*=f/a;break;case "FitWidth":g*=a/f;b*=a/f;break;case "FitHeight":b*=f/a;g*=f/a;break;case "FitOut":f<a?g*=a/f:b*=f/a}mat4.scale(this.inputPins["Transform In"].getValue(d),[b,g,e],h[d]);this.trOut.setValue(d,h[d])}this.trOut.setSliceCount(c)}};VVVV.Nodes.AspectRatio.prototype=
new VVVV.Core.Node;VVVV.Nodes.Perspective=function(b,g){this.constructor(b,"Perspective (Transform)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Not spreadable"]};mat4.identity(mat4.create());this.addInputPin("Transform In",[],VVVV.PinTypes.Transform);this.addInputPin("FOV",[.25],VVVV.PinTypes.Value);this.addInputPin("Near Plane",[.05],VVVV.PinTypes.Value);this.addInputPin("Far Plane",[100],VVVV.PinTypes.Value);this.addOutputPin("Transform Out",
[],VVVV.PinTypes.Transform);this.evaluate=function(){var b=this.inputPins.FOV.getValue(0),c=this.inputPins["Near Plane"].getValue(0),d=this.inputPins["Far Plane"].getValue(0),f=mat4.create();mat4.identity(f);mat4.perspective(360*b,1,c,d,f);this.inputPins["Transform In"].isConnected()&&(b=this.inputPins["Transform In"].getValue(0),mat4.multiply(b,f,f));this.outputPins["Transform Out"].setValue(0,f)}};VVVV.Nodes.Perspective.prototype=new VVVV.Core.Node;VVVV.Nodes.InverseTransform=function(b,g){this.constructor(b,
"Inverse (Transform)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=[],c=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform),d=this.addInputPin("Source",[],VVVV.PinTypes.Transform),f=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform);this.evaluate=function(){var a=this.getMaxInputSliceCount();if(a>h.length)for(var e=h.length;e++<a;)h.push(mat4.create());else a<h.length&&(h.length=a);for(e=0;e<a;e++)mat4.set(d.getValue(e),
h[e]),mat4.multiply(c.getValue(e),mat4.inverse(h[e],h[e]),h[e]),f.setValue(e,h[e]);f.setSliceCount(a)}};VVVV.Nodes.InverseTransform.prototype=new VVVV.Core.Node;VVVV.Nodes.LookAtTransformVector=function(b,g){this.constructor(b,"LookAt (Transform Vector)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform),c=this.addInputPin("Position XYZ",[0,0,0],VVVV.PinTypes.Value),
d=this.addInputPin("LookAt XYZ",[0,0,1],VVVV.PinTypes.Value),f=this.addInputPin("UpVector XYZ",[0,1,0],VVVV.PinTypes.Value),a=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform),e=mat4.create();mat4.identity(e);mat4.scale(e,[-1,1,-1]);var l=[];this.evaluate=function(){var b=Math.max(h.getSliceCount(),Math.max(c.getSliceCount()/3,Math.max(d.getSliceCount()/3,f.getSliceCount()/3))),b=Math.ceil(b);if(b>l.length)for(var g=l.length;g++<b;)l.push(mat4.create());else b<l.length&&(l.length=b);for(g=
0;g<b;g++){var k=c.getValue(g,3),p=d.getValue(g,3),m=f.getValue(g,3);mat4.lookAt(k,p,m,l[g]);mat4.multiply(e,l[g],l[g]);h.isConnected()&&mat4.multiply(h.getValue(g),l[g],l[g]);a.setValue(g,l[g])}a.setSliceCount(b)}};VVVV.Nodes.LookAtTransformVector.prototype=new VVVV.Core.Node;VVVV.Nodes.LookAtTransform=function(b,g){this.constructor(b,"LookAt (Transform)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Transform In",
[],VVVV.PinTypes.Transform),c=this.addInputPin("Position X",[0],VVVV.PinTypes.Value),d=this.addInputPin("Position Y",[0],VVVV.PinTypes.Value),f=this.addInputPin("Position Z",[0],VVVV.PinTypes.Value),a=this.addInputPin("LookAt X",[0],VVVV.PinTypes.Value),e=this.addInputPin("LookAt Y",[0],VVVV.PinTypes.Value),l=this.addInputPin("LookAt Z",[1],VVVV.PinTypes.Value),k=this.addInputPin("UpVector X",[0],VVVV.PinTypes.Value),n=this.addInputPin("UpVector Y",[1],VVVV.PinTypes.Value),q=this.addInputPin("UpVector Z",
[0],VVVV.PinTypes.Value),p=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform),m=mat4.create();mat4.identity(m);mat4.scale(m,[-1,1,-1]);var x=[],v=vec3.create(),z=vec3.create(),w=vec3.create();this.evaluate=function(){var b=this.getMaxInputSliceCount();if(b>x.length)for(var g=x.length;g++<b;)x.push(mat4.create());else b<x.length&&(x.length=b);for(g=0;g<b;g++)v[0]=c.getValue(g),v[1]=d.getValue(g),v[2]=f.getValue(g),z[0]=a.getValue(g),z[1]=e.getValue(g),z[2]=l.getValue(g),w[0]=k.getValue(g),
w[1]=n.getValue(g),w[2]=q.getValue(g),mat4.lookAt(v,z,w,x[g]),mat4.multiply(m,x[g],x[g]),h.isConnected()&&mat4.multiply(h.getValue(g),x[g],x[g]),p.setValue(g,x[g]);p.setSliceCount(b)}};VVVV.Nodes.LookAtTransform.prototype=new VVVV.Core.Node;VVVV.Nodes.MultiplyTransform=function(b,g){this.constructor(b,"Multiply (Transform)",g);this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=[],c=2;this.trOut=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform);
var d=this.addInvisiblePin("Transform In Count",[2],VVVV.PinTypes.Value),f=[];this.initialize=function(){c=Math.max(2,d.getValue(0));VVVV.Helpers.dynamicPins(this,f,c,function(a){return this.addInputPin("Transform In "+(a+1),[],VVVV.PinTypes.Transform)})};this.evaluate=function(){d.pinIsChanged()&&this.initialize();var a=this.getMaxInputSliceCount();if(a>h.length)for(var e=h.length;e++<a;)h.push(mat4.create());else a<h.length&&(h.length=a);for(e=0;e<a;e++){mat4.identity(h[e]);for(var b=c-1;0<=b;b--)if(f[b].isConnected()){var g=
f[b].getValue(e);mat4.multiply(h[e],g,h[e])}this.trOut.setValue(e,h[e])}this.trOut.setSliceCount(a)}};VVVV.Nodes.MultiplyTransform.prototype=new VVVV.Core.Node;VVVV.Nodes.ApplyTransform=function(b,g){this.constructor(b,"ApplyTransform (Transform)",g);this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),c=this.addInputPin("X UnTransformed",[0],VVVV.PinTypes.Value),d=this.addInputPin("Y UnTransformed",
[0],VVVV.PinTypes.Value),f=this.addInputPin("Z UnTransformed",[0],VVVV.PinTypes.Value),a=this.addOutputPin("X Transformed",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Y Transformed",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Z Transformed",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++){var k=h.getValue(g),p=[];p[0]=c.getValue(g);p[1]=d.getValue(g);p[2]=f.getValue(g);mat4.multiplyVec3(k,p);a.setValue(g,p[0]);e.setValue(g,p[1]);l.setValue(g,
p[2])}a.setSliceCount(b);e.setSliceCount(b);l.setSliceCount(b)}};VVVV.Nodes.ApplyTransform.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.AddValue=function(b,g){this.constructor(b,"Add (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var h=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),c=[],d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.initialize=function(){var d=Math.max(2,h.getValue(0));VVVV.Helpers.dynamicPins(this,c,d,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=
function(){h.pinIsChanged()&&this.initialize();var f=this.getMaxInputSliceCount();d.setSliceCount(f);for(var a=0;a<f;a++){for(var e=c[0].getValue(a),b=1;b<c.length;b++)e+=c[b].getValue(a);d.setValue(a,e)}};this.getCode=function(){h.pinIsChanged()&&this.initialize();for(var d=[],a=0;a<c.length;a++)d.push("{Input "+(a+1)+"}");return d.join(" + ")}};VVVV.Nodes.AddValue.prototype=new VVVV.Core.Node;VVVV.Nodes.SubtractValue=function(b,g){this.constructor(b,"Subtract (Value)",g);this.meta={authors:["Matthias Zauner"],
original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var h=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),c=[],d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.initialize=function(){var d=Math.max(2,h.getValue(0));VVVV.Helpers.dynamicPins(this,c,d,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){h.pinIsChanged()&&this.initialize();var f=this.getMaxInputSliceCount();d.setSliceCount(f);for(var a=0;a<f;a++){for(var e=
c[0].getValue(a),b=1;b<c.length;b++)e-=c[b].getValue(a);d.setValue(a,e)}};this.getCode=function(){h.pinIsChanged()&&this.initialize();for(var d=[],a=0;a<c.length;a++)d.push("{Input "+(a+1)+"}");return d.join(" - ")}};VVVV.Nodes.SubtractValue.prototype=new VVVV.Core.Node;VVVV.Nodes.EqValue=function(b,g){this.constructor(b,"EQ (Value)",g);this.meta={authors:["Matthias Zauner","Fibo"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input 1",[0],VVVV.PinTypes.Value),
c=this.addInputPin("Input 2",[0],VVVV.PinTypes.Value),d=this.addInputPin("Epsilon",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Inverse Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),b=0;b<e;b++){var g=0;Math.abs(h.getValue(b)-c.getValue(b))<=Math.abs(d.getValue(b))&&(g=1);f.setValue(b,g);a.setValue(b,1-g)}f.setSliceCount(e);a.setSliceCount(e)}};VVVV.Nodes.EqValue.prototype=new VVVV.Core.Node;
VVVV.Nodes.GtValue=function(b,g){this.constructor(b,"GT (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["No dynamic pin count yet"]};var h=this.addInputPin("Input 1",[0],VVVV.PinTypes.Value),c=this.addInputPin("Input 2",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++){var e=0;h.getValue(a)>c.getValue(a)&&(e=1);d.setValue(a,e)}d.setSliceCount(f)};
this.getCode=function(){return"{Input 1} > {Input 2} ? 1 : 0"}};VVVV.Nodes.GtValue.prototype=new VVVV.Core.Node;VVVV.Nodes.LtValue=function(b,g){this.constructor(b,"LT (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["No dynamic pin count yet"]};var h=this.addInputPin("Input 1",[0],VVVV.PinTypes.Value),c=this.addInputPin("Input 2",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=
this.getMaxInputSliceCount(),a=0;a<f;a++){var e=0;h.getValue(a)<c.getValue(a)&&(e=1);d.setValue(a,e)}d.setSliceCount(f)};this.getCode=function(){return"{Input 1} < {Input 2} ? 1 : 0"}};VVVV.Nodes.LtValue.prototype=new VVVV.Core.Node;VVVV.Nodes.MultiplyValue=function(b,g){this.constructor(b,"Multiply (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var h=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),c=[],d=this.addOutputPin("Output",
[0],VVVV.PinTypes.Value);this.initialize=function(){var d=Math.max(2,h.getValue(0));VVVV.Helpers.dynamicPins(this,c,d,function(a){return this.addInputPin("Input "+(a+1),[1],VVVV.PinTypes.Value)})};this.evaluate=function(){h.pinIsChanged()&&this.initialize();var f=this.getMaxInputSliceCount();d.setSliceCount(f);for(var a=0;a<f;a++){for(var e=c[0].getValue(a),b=1;b<c.length;b++)e*=c[b].getValue(a);d.setValue(a,e)}};this.getCode=function(){h.pinIsChanged()&&this.initialize();for(var d=[],a=0;a<c.length;a++)d.push("{Input "+
(a+1)+"}");return d.join(" * ")}};VVVV.Nodes.MultiplyValue.prototype=new VVVV.Core.Node;VVVV.Nodes.DivideValue=function(b,g){this.constructor(b,"Divide (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.addInvisiblePin("Inputs Count",[2],VVVV.PinTypes.Value);var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Input 2",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.initialize=
function(){};this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++)0==c.getValue(a)?d.setValue(a,1):d.setValue(a,h.getValue(a)/c.getValue(a));d.setSliceCount(f)};this.getCode=function(){return"{Input} / {Input 2}"}};VVVV.Nodes.DivideValue.prototype=new VVVV.Core.Node;VVVV.Nodes.IOBoxValueAdvanced=function(b,g){this.constructor(b,"IOBox (Value Advanced)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.addInputPin("Y Input Value",
[0],VVVV.PinTypes.Value);this.addInvisiblePin("Rows",[1],VVVV.PinTypes.Value);this.addOutputPin("Y Output Value",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.inputPins["Y Input Value"].getSliceCount(),c,d=0;d<b;d++)c=parseFloat(this.inputPins["Y Input Value"].getValue(d)),isFinite(c)||(c=0),this.outputPins["Y Output Value"].setValue(d,c);this.outputPins["Y Output Value"].setSliceCount(this.inputPins["Y Input Value"].getSliceCount())}};VVVV.Nodes.IOBoxValueAdvanced.prototype=new VVVV.Core.Node;
VVVV.Nodes.CountValue=function(b,g){this.constructor(b,"Count (Value)",g);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.addInputPin("Input",[0],VVVV.PinTypes.Value);this.addOutputPin("Count",[1],VVVV.PinTypes.Value);this.addOutputPin("High",[0],VVVV.PinTypes.Value);this.evaluate=function(){this.inputPins.Input.pinIsChanged()&&(this.outputPins.Count.setValue(0,this.inputPins.Input.values.length),this.outputPins.High.setValue(0,
this.inputPins.Input.values.length-1))}};VVVV.Nodes.CountValue.prototype=new VVVV.Core.Node;VVVV.Nodes.SwitchValueInput=function(b,g){this.constructor(b,"Switch (Value Input)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["No dynamic pin count yet"]};var h=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),c=this.addInputPin("Switch",[0],VVVV.PinTypes.Value),d=[];this.initialize=function(){var a=Math.max(2,h.getValue(0));VVVV.Helpers.dynamicPins(this,
d,a,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};var f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){h.pinIsChanged()&&this.initialize();for(var a=this.getMaxInputSliceCount(),e=0;e<a;e++)f.setValue(e,d[Math.round(Math.abs(c.getValue(e)))%d.length].getValue(e));f.setSliceCount(a)}};VVVV.Nodes.SwitchValueInput.prototype=new VVVV.Core.Node;VVVV.Nodes.SelectValue=function(b,g){this.constructor(b,"Select (Value)",g);this.meta={authors:["Matthias Zauner"],
original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Select",[1],VVVV.PinTypes.Value),d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Former Slice",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),e=0,b=0;b<a;b++)for(var g=0;g<c.getValue(b);g++)d.setValue(e,h.getValue(b)),f.setValue(e,b),e++;d.setSliceCount(e);f.setSliceCount(e)}};VVVV.Nodes.SelectValue.prototype=
new VVVV.Core.Node;VVVV.Nodes.AsString=function(b,g){this.constructor(b,"AsString (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["SubType not implemented, always returns float formatting"]};var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("SubType",["Real (MinFloat .. MaxFloat)"],VVVV.PinTypes.Enum);c.enumOptions=["Real (MinFloat .. MaxFloat)","Integer (MinInt .. MaxInt)"];var d=this.addOutputPin("Output",
[0],VVVV.PinTypes.String);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++){subtype=c.getValue(a).match(/^(.+) \(/)[1];var e;switch(subtype){case "Real":e=h.getValue(a).toFixed(4);break;case "Integer":e=h.getValue(a).toFixed(0)}d.setValue(a,e)}d.setSliceCount(f)}};VVVV.Nodes.AsString.prototype=new VVVV.Core.Node;VVVV.Nodes.Frac=function(b,g){this.constructor(b,"Frac (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};
var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Whole Part",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Real Part",[.5],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++){var e=h.getValue(a);c.setValue(a,Math.floor(e));d.setValue(a,e-Math.floor(e))}c.setSliceCount(f);d.setSliceCount(f)}};VVVV.Nodes.Frac.prototype=new VVVV.Core.Node;VVVV.Nodes.AddValueSpectral=function(b,g){this.constructor(b,"Add (Value Spectral)",g);this.meta=
{authors:["David M\u00f3r\u00e1sz (micro.D)","Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.addInputPin("Input",[0],VVVV.PinTypes.Value);this.addInputPin("Bin Size",[-1],VVVV.PinTypes.Value);this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),c=0,d=0,f=0;f<b||0<this.inputPins["Bin Size"].getValue(0)&&(0<d||0!=c%this.inputPins["Bin Size"].getSliceCount());f++){if(0==d)var a=0;a+=this.inputPins.Input.getValue(f);
d++;0<this.inputPins["Bin Size"].getValue(0)?d>=this.inputPins["Bin Size"].getValue(c)&&(this.outputPins.Output.setValue(c,a),c++,d=0):this.outputPins.Output.setValue(0,a)}this.outputPins.Output.setSliceCount(c+(0<d))}};VVVV.Nodes.AddValueSpectral.prototype=new VVVV.Core.Node;VVVV.Nodes.WaveShaperValue=function(b,g){this.constructor(b,"WaveShaper (Value)",g);this.meta={authors:["sebl"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",
[0],VVVV.PinTypes.Value),c=this.addInputPin("Shape",["Linear"],VVVV.PinTypes.Enum);c.enumOptions=["Linear","Inverse","Triangle","Sine","Rectangle"];var d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.initialize=function(){};this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++){var e=h.getValue(a);switch(c.getValue(a)){case "Linear":d.setValue(a,e);break;case "Inverse":d.setValue(a,1-e);break;case "Triangle":.5>e?d.setValue(a,2*e):d.setValue(a,2*(1-e));break;case "Sine":inp=
(e+.25)%1*6.28318530717959;d.setValue(a,Math.sin(inp)/2+.5);break;case "Rectangle":.5>e?d.setValue(a,0):d.setValue(a,1)}}d.setSliceCount(f)}};VVVV.Nodes.WaveShaperValue.prototype=new VVVV.Core.Node;VVVV.Nodes.MapValue=function(b,g){this.constructor(b,"Map (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Mirror Mapping Mode not implemented"]};this.auto_evaluate=!1;var h=this.addInputPin("Input",[.5],VVVV.PinTypes.Value),c=this.addInputPin("Source Minimum",
[0],VVVV.PinTypes.Value),d=this.addInputPin("Source Maximum",[1],VVVV.PinTypes.Value),f=this.addInputPin("Destination Minimum",[0],VVVV.PinTypes.Value),a=this.addInputPin("Destination Maximum",[1],VVVV.PinTypes.Value),e=this.addInputPin("Mapping",["Float"],VVVV.PinTypes.Enum);e.enumOptions=["Float","Wrap","Clamp"];var l=this.addOutputPin("Output",[.5],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++){var k=h.getValue(g),p=c.getValue(g),m=d.getValue(g),
x=f.getValue(g),v=a.getValue(g),z=e.getValue(g);if(m==p)l.setValue(g,x);else{k-=p;m-=p;switch(z){case "Clamp":k=Math.max(0,Math.min(m,k));break;case "Wrap":k=(m+k%m)%m}l.setValue(g,(v-x)/m*k+x)}}l.setSliceCount(b)}};VVVV.Nodes.MapValue.prototype=new VVVV.Core.Node;VVVV.Nodes.MinValue=function(b,g){this.constructor(b,"Min (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addOutputPin("Output",[0],
VVVV.PinTypes.Value),c=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),d=[];this.initialize=function(){var f=Math.max(2,c.getValue(0));VVVV.Helpers.dynamicPins(this,d,f,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){c.pinIsChanged()&&this.initialize();for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++){for(var e=void 0,b=0;b<d.length;b++)if(void 0==e||d[b].getValue(a)<e)e=d[b].getValue(a);h.setValue(a,e)}h.setSliceCount(f)}};VVVV.Nodes.MinValue.prototype=
new VVVV.Core.Node;VVVV.Nodes.MaxValue=function(b,g){this.constructor(b,"Max (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),c=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),d=[];this.initialize=function(){var f=Math.max(2,c.getValue(0));VVVV.Helpers.dynamicPins(this,d,f,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};
this.evaluate=function(){c.pinIsChanged()&&this.initialize();for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++){for(var e=void 0,b=0;b<d.length;b++)if(void 0==e||d[b].getValue(a)>e)e=d[b].getValue(a);h.setValue(a,e)}h.setSliceCount(f)}};VVVV.Nodes.MaxValue.prototype=new VVVV.Core.Node;VVVV.Nodes.ModValue=function(b,g){this.constructor(b,"Mod (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addOutputPin("Output",
[0],VVVV.PinTypes.Value),c=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),d=[];this.initialize=function(){var f=Math.max(2,c.getValue(0));VVVV.Helpers.dynamicPins(this,d,f,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){c.pinIsChanged()&&this.initialize();for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++){for(var e=d[0].getValue(a),b=1;b<d.length;b++)e=0==d[b].getValue(a)?0:e%d[b].getValue(a);h.setValue(a,e)}h.setSliceCount(f)}};
VVVV.Nodes.ModValue.prototype=new VVVV.Core.Node;VVVV.Nodes.PowerValue=function(b,g){this.constructor(b,"Power (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),c=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),d=[];this.initialize=function(){var f=Math.max(2,c.getValue(0));VVVV.Helpers.dynamicPins(this,d,f,function(a){return this.addInputPin("Input "+
(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){c.pinIsChanged()&&this.initialize();for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++){for(var e=d[0].getValue(a),b=1;b<d.length;b++)e=Math.pow(e,d[b].getValue(a));h.setValue(a,e)}h.setSliceCount(f)}};VVVV.Nodes.PowerValue.prototype=new VVVV.Core.Node;VVVV.Nodes.RandomValue=function(b,g){this.constructor(b,"Random (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=
!0;var h=this.addInputPin("Enabled",[1],VVVV.PinTypes.Value),c=this.addInputPin("Is Integer",[0],VVVV.PinTypes.Value),d=this.addInputPin("Scale",[1],VVVV.PinTypes.Value),f=this.addInputPin("Prevent from doubles",[1],VVVV.PinTypes.Value),a=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),b=0;b<e;b++){var g=h.getValue(b),n=c.getValue(b),k=d.getValue(b),p=f.getValue(b),m=a.getValue(b);void 0==m&&a.setValue(b,0);if(.5<=g){m=a.getValue(b);
do g=Math.random()*k,.5<=n&&(g=Math.round(g));while(.5<=p&&g==m);a.setValue(b,g)}}a.setSliceCount(e)}};VVVV.Nodes.RandomValue.prototype=new VVVV.Core.Node;VVVV.Nodes.SignValue=function(b,g){this.constructor(b,"Sign (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Sign Part",[0],VVVV.PinTypes.Value),d=this.addOutputPin("Absolute Part",
[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),a=0;a<f;a++){var e=h.getValue(a);c.setValue(a,0==e?0:e/Math.abs(e));d.setValue(a,Math.abs(e))}d.setSliceCount(f);c.setSliceCount(f)}};VVVV.Nodes.SignValue.prototype=new VVVV.Core.Node;VVVV.Nodes.InputMorphValue=function(b,g){this.constructor(b,"InputMorph (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Switch",
[0],VVVV.PinTypes.Value),c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),d=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),f=[];this.initialize=function(){var a=Math.max(2,d.getValue(0));VVVV.Helpers.dynamicPins(this,f,a,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){d.pinIsChanged()&&this.initialize();for(var a=this.getMaxInputSliceCount(),e,b,g,n=0;n<a;n++)e=h.getValue(n),b=((Math.floor(e)+f.length)%f.length+f.length)%f.length,
g=((Math.ceil(e)+f.length)%f.length+f.length)%f.length,e-=Math.floor(e),c.setValue(n,(1-e)*f[b].getValue(n)+e*f[g].getValue(n));c.setSliceCount(a)}};VVVV.Nodes.InputMorphValue.prototype=new VVVV.Core.Node;VVVV.Nodes.Sift=function(b,g){this.constructor(b,"Sift (Value)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Input",[0],VVVV.PinTypes.Value),c=this.addInputPin("Filter",[0],VVVV.PinTypes.Value),
d=this.addInputPin("Epsilon",[0],VVVV.PinTypes.Value),f=this.addInputPin("Find",["First"],VVVV.PinTypes.Enum);f.enumOptions=["First","Last","All"];var a=this.addOutputPin("Hits",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Input Index",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Filter Index",[0],VVVV.PinTypes.Value);this.evaluate=function(){this.getMaxInputSliceCount();var b=h.getSliceCount(),g=c.getSliceCount();a.setSliceCount(b);d.getValue(0);for(var k=f.getValue(0),p={},m=0,x=0;x<b;x++){var v=
x;"Last"==k&&(v=b-x-1);var z=h.getValue(v);if("All"!=k){if(p[z]){a.setValue(v,0);continue}p[z]=!0}for(var w=0,y=0;y<g;y++)if(filter=c.getValue(y),filter==z){e.setValue(m,v);l.setValue(m,y);m++;w++;break}a.setValue(v,w)}e.setSliceCount(m);l.setSliceCount(m)}};VVVV.Nodes.Sift.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){function b(){function b(a){return 0<a?parseInt(a):parseInt(a-1)}function h(a,e,c){return a[0]*e+a[1]*c}function c(a,e,c,d){return a[0]*e+a[1]*c+a[2]*d}function d(a,e,c,d,f){return a[0]*e+a[1]*c+a[2]*d+a[3]*f}var f=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,1]],a=[[0,1,1,1],[0,1,1,-1],[0,1,-1,1],[0,1,-1,-1],[0,-1,1,1],[0,-1,1,-1],[0,-1,-1,1],[0,-1,-1,-1],[1,0,1,1],[1,0,1,-1],[1,0,-1,1],[1,0,-1,-1],[-1,0,1,1],[-1,0,1,-1],[-1,
0,-1,1],[-1,0,-1,-1],[1,1,0,1],[1,1,0,-1],[1,-1,0,1],[1,-1,0,-1],[-1,1,0,1],[-1,1,0,-1],[-1,-1,0,1],[-1,-1,0,-1],[1,1,1,0],[1,1,-1,0],[1,-1,1,0],[1,-1,-1,0],[-1,1,1,0],[-1,1,-1,0],[-1,-1,1,0],[-1,-1,-1,0]],e=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,
220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,
157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,
169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,
128,195,78,66,215,61,156,180],l=[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],
[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]];this.noise2d=function(a,c){var d,l,m;m=.5*(a+c)*(Math.sqrt(3)-1);var k=b(a+m),v=b(c+m),z=(3-Math.sqrt(3))/6;m=(k+v)*z;d=a-(k-m);var w=c-(v-m),y,u;d>w?(y=1,u=0):(y=0,u=1);l=d-y+z;var A=w-u+z;m=d-1+2*z;var z=w-1+2*z,t=k&255,v=v&255,k=e[t+e[v]]%12;y=e[t+y+e[v+u]]%12;u=e[t+1+e[v+1]]%12;v=.5-d*d-w*w;0>v?d=0:(v*=v,d=v*v*h(f[k],d,w));w=
.5-l*l-A*A;0>w?l=0:(w*=w,l=w*w*h(f[y],l,A));A=.5-m*m-z*z;0>A?m=0:(A*=A,m=A*A*h(f[u],m,z));return 70*(d+l+m)};this.noise3d=function(a,d,h){var l,m,k,v=1/3*(a+d+h),z=b(a+v),w=b(d+v),y=b(h+v),v=1/6;k=(z+w+y)*v;l=a-(z-k);m=d-(w-k);var u=h-(y-k),A,t,B,C,D,E;l>=m?m>=u?(A=1,B=t=0,D=C=1,E=0):(l>=u?(A=1,B=t=0):(t=A=0,B=1),C=1,D=0,E=1):m<u?(t=A=0,B=1,C=0,E=D=1):l<u?(A=0,t=1,C=B=0,E=D=1):(A=0,t=1,B=0,D=C=1,E=0);var G=l-A+v,L=m-t+v,J=u-B+v;k=l-C+2*v;a=m-D+2*v;var N=u-E+2*v;h=l-1+3*v;d=m-1+3*v;var v=u-1+3*v,z=
z&255,H=w&255,I=y&255,w=e[z+e[H+e[I]]]%12,y=e[z+A+e[H+t+e[I+B]]]%12;C=e[z+C+e[H+D+e[I+E]]]%12;z=e[z+1+e[H+1+e[I+1]]]%12;D=.6-l*l-m*m-u*u;0>D?l=0:(D*=D,l=D*D*c(f[w],l,m,u));m=.6-G*G-L*L-J*J;0>m?m=0:(m*=m,m=m*m*c(f[y],G,L,J));G=.6-k*k-a*a-N*N;0>G?k=0:(G*=G,k=G*G*c(f[C],k,a,N));a=.6-h*h-d*d-v*v;0>a?h=0:(a*=a,h=a*a*c(f[z],h,d,v));return 32*(l+m+k+h)};this.noise4d=function(c,f,h,k){var m=(5-Math.sqrt(5))/20,x,v,z,w=(Math.sqrt(5)-1)/4*(c+f+h+k),y=b(c+w),u=b(f+w),A=b(h+w),t=b(k+w),w=(y+u+A+t)*m;x=c-(y-w);
v=f-(u-w);var B=h-(A-w),C=k-(t-w);k=(x>v?32:0)+(x>B?16:0)+(v>B?8:0)+(x>C?4:0)+(v>C?2:0)+(B>C?1:0);var D,E,G,L,J,N,H,I,F,K,P,Q;D=3<=l[k][0]?1:0;E=3<=l[k][1]?1:0;G=3<=l[k][2]?1:0;L=3<=l[k][3]?1:0;J=2<=l[k][0]?1:0;N=2<=l[k][1]?1:0;H=2<=l[k][2]?1:0;I=2<=l[k][3]?1:0;F=1<=l[k][0]?1:0;K=1<=l[k][1]?1:0;P=1<=l[k][2]?1:0;Q=1<=l[k][3]?1:0;var R=x-D+m,S=v-E+m,T=B-G+m,U=C-L+m;z=x-J+2*m;var M=v-N+2*m,V=B-H+2*m,W=C-I+2*m;f=x-F+3*m;c=v-K+3*m;var X=B-P+3*m,Y=C-Q+3*m;k=x-1+4*m;h=v-1+4*m;var w=B-1+4*m,m=C-1+4*m,y=y&
255,u=u&255,O=A&255,t=t&255,A=e[y+e[u+e[O+e[t]]]]%32;D=e[y+D+e[u+E+e[O+G+e[t+L]]]]%32;J=e[y+J+e[u+N+e[O+H+e[t+I]]]]%32;F=e[y+F+e[u+K+e[O+P+e[t+Q]]]]%32;t=e[y+1+e[u+1+e[O+1+e[t+1]]]]%32;u=.6-x*x-v*v-B*B-C*C;0>u?x=0:(u*=u,x=u*u*d(a[A],x,v,B,C));v=.6-R*R-S*S-T*T-U*U;0>v?v=0:(v*=v,v=v*v*d(a[D],R,S,T,U));B=.6-z*z-M*M-V*V-W*W;0>B?z=0:(B*=B,z=B*B*d(a[J],z,M,V,W));M=.6-f*f-c*c-X*X-Y*Y;0>M?f=0:(M*=M,f=M*M*d(a[F],f,c,X,Y));c=.6-k*k-h*h-w*w-m*m;0>c?k=0:(c*=c,k=c*c*d(a[t],k,h,w,m));return 27*(x+v+z+f+k)}}VVVV.Nodes.Join2dVector=
function(b,h){this.constructor(b,"Vector (2d Join)",h);this.meta={authors:["Julien Vulliet"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var c=this.addInputPin("X",[0],VVVV.PinTypes.Value),d=this.addInputPin("Y",[0],VVVV.PinTypes.Value),f=this.addOutputPin("XY",[0,0],VVVV.PinTypes.Value);this.evaluate=function(){var a=this.getMaxInputSliceCount();f.setSliceCount(2*a);for(var e=0;e<a;e++)f.setValue(2*e,c.getValue(e)),f.setValue(2*e+1,d.getValue(e))}};VVVV.Nodes.Join2dVector.prototype=
new VVVV.Core.Node;VVVV.Nodes.Join3dVector=function(b,h){this.constructor(b,"Vector (3d Join)",h);this.meta={authors:["Julien Vulliet"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var c=this.addInputPin("X",[0],VVVV.PinTypes.Value),d=this.addInputPin("Y",[0],VVVV.PinTypes.Value),f=this.addInputPin("Z",[0],VVVV.PinTypes.Value),a=this.addOutputPin("XYZ",[0,0,0],VVVV.PinTypes.Value);this.evaluate=function(){var e=this.getMaxInputSliceCount();a.setSliceCount(3*e);for(var b=0;b<
e;b++)a.setValue(3*b,c.getValue(b)),a.setValue(3*b+1,d.getValue(b)),a.setValue(3*b+2,f.getValue(b))}};VVVV.Nodes.Join3dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Join4dVector=function(b,h){this.constructor(b,"Vector (4d Join)",h);this.meta={authors:["Julien Vulliet"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var c=this.addInputPin("X",[0],VVVV.PinTypes.Value),d=this.addInputPin("Y",[0],VVVV.PinTypes.Value),f=this.addInputPin("Z",[0],VVVV.PinTypes.Value),a=this.addInputPin("W",
[0],VVVV.PinTypes.Value),e=this.addOutputPin("XYZW",[0,0,0,1],VVVV.PinTypes.Value);this.evaluate=function(){var b=this.getMaxInputSliceCount();e.setSliceCount(4*b);for(var g=0;g<b;g++)e.setValue(4*g,c.getValue(g)),e.setValue(4*g+1,d.getValue(g)),e.setValue(4*g+2,f.getValue(g)),e.setValue(4*g+3,a.getValue(g))}};VVVV.Nodes.Join4dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Split2dVector=function(b,h){this.constructor(b,"Vector (2d Split)",h);this.meta={authors:["Julien Vulliet"],original_authors:["VVVV Group"],
credits:[],compatibility_issues:[""]};var c=this.addInputPin("XY",[0],VVVV.PinTypes.Value),d=this.addOutputPin("X",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Y",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),e=0,b=0;b<a;b+=2)d.setValue(e,c.getValue(b)),f.setValue(e,c.getValue(b+1)),e++;d.setSliceCount(e);f.setSliceCount(e)}};VVVV.Nodes.Split2dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Split3dVector=function(b,h){this.constructor(b,"Vector (3d Split)",
h);this.meta={authors:["Julien Vulliet"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var c=this.addInputPin("XYZ",[0],VVVV.PinTypes.Value),d=this.addOutputPin("X",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Z",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),b=0,g=0;g<e;g+=3)d.setValue(b,c.getValue(g)),f.setValue(b,c.getValue(g+1)),a.setValue(b,c.getValue(g+2)),b++;d.setSliceCount(b);
f.setSliceCount(b);a.setSliceCount(b)}};VVVV.Nodes.Split3dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Split4dVector=function(b,h){this.constructor(b,"Vector (4d Split)",h);this.meta={authors:["Julien Vulliet"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var c=this.addInputPin("XYZW",[0,0,0,1],VVVV.PinTypes.Value),d=this.addOutputPin("X",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Z",[0],VVVV.PinTypes.Value),e=this.addOutputPin("W",
[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0,h=0;h<b;h+=4)d.setValue(g,c.getValue(h)),f.setValue(g,c.getValue(h+1)),a.setValue(g,c.getValue(h+2)),e.setValue(g,c.getValue(h+3)),g++;d.setSliceCount(g);f.setSliceCount(g);a.setSliceCount(g);e.setSliceCount(g)}};VVVV.Nodes.Split4dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Simplex2d=function(g,h){this.constructor(g,"Simplex (2d)",h);this.meta={authors:["woei"],original_authors:["tonfilm"],credits:[],compatibility_issues:[]};
var c=this.addInputPin("Position Input XY",[.5,.5],VVVV.PinTypes.Value),d=this.addInputPin("Octaves",[0],VVVV.PinTypes.Value),f=this.addInputPin("Frequency",[1],VVVV.PinTypes.Value),a=this.addInputPin("Persistance",[.5],VVVV.PinTypes.Value),e=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),l=new b;this.evaluate=function(){for(var b=Math.ceil(Math.max(.5*c.getSliceCount())),g=parseInt(d.getValue(0)),h=f.getValue(0),k=a.getValue(0),m=0;m<b;m++){for(var x=c.getValue(2*m),v=c.getValue(2*m+1),z=0,
w=0;w<=g;w++)var y=Math.pow(h,w),z=z+l.noise2d(x*y,v*y)*Math.pow(k,w);e.setValue(m,z)}e.setSliceCount(b)}};VVVV.Nodes.Simplex2d.prototype=new VVVV.Core.Node;VVVV.Nodes.Simplex3d=function(g,h){this.constructor(g,"Simplex (3d)",h);this.meta={authors:["woei"],original_authors:["tonfilm"],credits:[],compatibility_issues:[]};var c=this.addInputPin("Position Input XYZ",[.5,.5,.5],VVVV.PinTypes.Value),d=this.addInputPin("Octaves",[0],VVVV.PinTypes.Value),f=this.addInputPin("Frequency",[1],VVVV.PinTypes.Value),
a=this.addInputPin("Persistance",[.5],VVVV.PinTypes.Value),e=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),l=new b;this.evaluate=function(){for(var b=Math.ceil(Math.max(c.getSliceCount()/3)),g=parseInt(d.getValue(0)),h=f.getValue(0),k=a.getValue(0),m=0;m<b;m++){for(var x=c.getValue(3*m),v=c.getValue(3*m+1),z=c.getValue(3*m+2),w=0,y=0;y<=g;y++)var u=Math.pow(h,y),w=w+l.noise3d(x*u,v*u,z*u)*Math.pow(k,y);e.setValue(m,w)}e.setSliceCount(b)}};VVVV.Nodes.Simplex3d.prototype=new VVVV.Core.Node;VVVV.Nodes.Simplex4d=
function(g,h){this.constructor(g,"Simplex (4d)",h);this.meta={authors:["woei"],original_authors:["tonfilm"],credits:[],compatibility_issues:[]};var c=this.addInputPin("Position Input XYZW",[.5,.5,.5,.5],VVVV.PinTypes.Value),d=this.addInputPin("Octaves",[0],VVVV.PinTypes.Value),f=this.addInputPin("Frequency",[1],VVVV.PinTypes.Value),a=this.addInputPin("Persistance",[.5],VVVV.PinTypes.Value),e=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),l=new b;this.evaluate=function(){for(var b=Math.ceil(Math.max(c.getSliceCount()/
3)),g=parseInt(d.getValue(0)),h=f.getValue(0),k=a.getValue(0),m=0;m<b;m++){for(var x=c.getValue(4*m),v=c.getValue(4*m+1),z=c.getValue(4*m+2),w=c.getValue(4*m+3),y=0,u=0;u<=g;u++)var A=Math.pow(h,u),y=y+l.noise4d(x*A,v*A,z*A,w*A)*Math.pow(k,u);e.setValue(m,y)}e.setSliceCount(b)}};VVVV.Nodes.Simplex4d.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.ShaderCodeResources={"%VVVV%/effects/PhongDirectional.vvvvjs.fx":void 0,"%VVVV%/effects/GouraudDirectional.vvvvjs.fx":void 0,"%VVVV%/effects/Constant.vvvvjs.fx":void 0};VVVV.Types.ShaderCodeResource=function(){var b="";this.relatedNodes=[];this.definingNode=void 0;this.setSourceCode=function(h){b=h;for(h=0;h<this.relatedNodes.length;h++)this.relatedNodes[h].shaderSourceUpdated(b)};this.addRelatedNode=function(h){this.relatedNodes.push(h);""!=b&&h.shaderSourceUpdated(b)}};mat4.identity(mat4.create());
VVVV.Types.WebGlRenderState=function(){this.alphaBlending=!0;this.srcBlendMode="SRC_ALPHA";this.destBlendMode="ONE_MINUS_SRC_ALPHA";this.enableZWrite=!0;this.depthFunc="LEQUAL";this.depthOffset=0;this.cullFace=void 0;this.polygonDrawMode="TRIANGLES";this.copy_attributes=function(b){this.alphaBlending=b.alphaBlending;this.alphaFunc=b.alphaFunc;this.srcBlendMode=b.srcBlendMode;this.destBlendMode=b.destBlendMode;this.enableZwrite=b.enableZWrite;this.depthFunc=b.depthFunc;this.depthOffset=b.depthOffset;
this.cullFace=b.cullFace;this.polygonDrawMode=b.polygonDrawMode};this.apply=function(b){this.alphaBlending?b.enable(b.BLEND):b.disable(b.BLEND);b.blendFunc(b[this.srcBlendMode],b[this.destBlendMode]);void 0!==this.cullFace?(b.enable(b.CULL_FACE),b.frontFace(b[this.cullFace]),b.cullFace(b.BACK)):b.disable(b.CULL_FACE);b.depthMask(this.enableZWrite)}};VVVV.Types.VertexBuffer=function(b,h){this.vbo=void 0;this.subBuffers={};this.length=0;this.setSubBuffer=function(c,d,b){this.subBuffers[c]={usage:c,
data:new Float32Array(b),size:d,offset:this.length};this.length+=this.subBuffers[c].data.byteLength};this.updateSubBuffer=function(c,d){this.subBuffers[c].data=new Float32Array(d)};this.create=function(){this.vbo=b.createBuffer()};this.update=function(){b.bindBuffer(b.ARRAY_BUFFER,this.vbo);b.bufferData(b.ARRAY_BUFFER,this.length,b.DYNAMIC_DRAW);_(this.subBuffers).each(function(c){b.bufferSubData(b.ARRAY_BUFFER,c.offset,c.data)})}};VVVV.Types.Mesh=function(b,h,c){this.vertexBuffer=h;this.indexBuffer=
b.createBuffer();this.update=function(c){b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.indexBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,new Uint16Array(c),b.DYNAMIC_DRAW);this.numIndices=c.length}};VVVV.Types.Layer=function(){this.mesh=null;this.textures=[];this.shader=null;this.uniforms={};this.uniformNames=[];this.renderState=b;this.toString=function(){return"Layer"}};VVVV.PinTypes.WebGlResource={typeName:"WebGlResource",reset_on_disconnect:!0,connectionChangedHandlers:{webglresource:function(){function b(c){return"WebGlResource"==
c||"WebGlTexture"==c}if(this.direction!=VVVV.PinDirection.Input){var h=this.node,c=h.findDownstreamNodes("Renderer (EX9)");h.renderContexts||(h.renderContexts=[]);void 0==h.contextChanged&&(h.contextChanged=!1);for(var d=0;d<c.length;d++)h.contextChanged|=!h.renderContexts[d]||h.renderContexts[d].canvas.id!=c[d].ctxt.id,h.renderContexts[d]=c[d].ctxt,h.dirty=!0;h.renderContexts.length!=c.length&&(h.renderContexts.length=c.length,h.contextChanged=!0,h.dirty=!0);h.isSubpatch||_(h.inputPins).each(function(c){var a;
c.markPinAsChanged();"Renderer (EX9)"!=h.nodename&&c.isConnected()&&(0<c.links.length?a=c.links[0].fromPin:0<c.masterPin.links[0].fromPin.links.length&&(a=c.masterPin.links[0].fromPin),a&&b(a.typeName)&&a.connectionChanged())});this.masterPin&&b(this.masterPin.typeName)&&this.masterPin.connectionChanged()}}},defaultValue:function(){return new VVVV.Types.Layer}};VVVV.PinTypes.WebGlTexture={typeName:"WebGlTexture",reset_on_disconnect:!0,connectionChangedHandlers:{webglresource:VVVV.PinTypes.WebGlResource.connectionChangedHandlers.webglresource},
defaultValue:function(){return VVVV.DefaultTexture}};var b=new VVVV.Types.WebGlRenderState;VVVV.PinTypes.WebGlRenderState={typeName:"WebGlRenderState",reset_on_disconnect:!0,defaultValue:function(){return b}};VVVV.DefaultTexture="Empty Texture";VVVV.Types.ShaderProgram=function(){this.uniformSpecs={};this.attributeSpecs={};this.attribSemanticMap={};this.uniformSemanticMap={};var b="",h="",c,d;this.isSetup=!1;this.shaderProgram=void 0;this.log="";var f=this;this.extractSemantics=function(a){f.attributeSpecs=
{};f.attribSemanticMap={};f.uniformSpecs={};f.uniformSemanticMap={};for(var c=/(uniform|attribute) ([a-zA-Z]+)([0-9xD]*) ([a-zA-Z0-9_]+)( : ([A-Z0-9]+))?( = \{?([^;\}]+)\}?)?;/g,d;d=c.exec(a);)"attribute"!=d[1]||f.attributeSpecs[d[4]]?"uniform"!=d[1]||f.uniformSpecs[d[4]]||(f.uniformSpecs[d[4]]={varname:d[4],semantic:d[6],position:0,type:d[2],defaultValue:d[8],dimension:""==d[3]?1:d[3]},void 0!=d[6]&&(f.uniformSemanticMap[d[6]]=d[4])):(f.attributeSpecs[d[4]]={varname:d[4],semantic:d[6],position:0},
void 0!=d[6]&&(f.attribSemanticMap[d[6]]=d[4]))};this.setVertexShader=function(a){b=a};this.setFragmentShader=function(a){h=a};this.setup=function(a){this.log="";c=a.createShader(a.VERTEX_SHADER);a.shaderSource(c,b.replace(/((uniform|attribute) [a-zA-Z0-9]+ [a-zA-Z0-9_]+)[^;]*/g,"$1"));a.compileShader(c);a.getShaderParameter(c,a.COMPILE_STATUS)||(this.log=a.getShaderInfoLog(c),console.log(this.log));d=a.createShader(a.FRAGMENT_SHADER);a.shaderSource(d,h.replace(/((uniform|attribute) [a-zA-Z0-9]+ [a-zA-Z0-9_]+)[^;]*/g,
"$1"));a.compileShader(d);a.getShaderParameter(d,a.COMPILE_STATUS)||(this.log=a.getShaderInfoLog(d),console.log(this.log));this.shaderProgram=a.createProgram();a.attachShader(this.shaderProgram,c);a.attachShader(this.shaderProgram,d);a.linkProgram(this.shaderProgram);a.getProgramParameter(this.shaderProgram,a.LINK_STATUS)||console.log("Could not initialise shaders");_(this.attributeSpecs).each(function(c){c.position=a.getAttribLocation(f.shaderProgram,c.varname)});_(this.uniformSpecs).each(function(c){c.position=
a.getUniformLocation(f.shaderProgram,c.varname)});this.isSetup=!0;return""==this.log}};VVVV.Nodes.FileTexture=function(b,h){this.constructor(b,"FileTexture (EX9.Texture)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Always loads in background","No reload pin","No preload pin (preloading handled by browser)","No up and running pin","No texture info outputs"]};this.auto_evaluate=!1;var c=this.addInputPin("Filename",[""],
VVVV.PinTypes.String),d=this.addOutputPin("Texture Out",[],VVVV.PinTypes.WebGlTexture),f=this.addInvisiblePin("Type",["Texture"],VVVV.PinTypes.Enum);f.enumOptions=["Texture","Cube Texture"];var a=[];this.evaluate=function(){if(this.renderContexts){var e=this.renderContexts[0];if(e){if(this.contextChanged){for(var b=0;b<a.length;b++)a[b].context.deleteTexture(a[b]);a=[]}if(c.pinIsChanged()||f.pinIsChanged()||this.contextChanged){for(var g=f.getValue(0),h=this.getMaxInputSliceCount(),b=0;b<h;b++){var q=
VVVV.Helpers.prepareFilePath(c.getValue(b),this.parentPatch);0===q.indexOf("http://")&&void 0!==VVVV.ImageProxyPrefix&&(q=VVVV.ImageProxyPrefix+encodeURI(q));a[b]=e.createTexture();a[b].context=e;"Texture"==g?(a[b].image=new Image,a[b].image.onload=function(c){return function(){e.bindTexture(e.TEXTURE_CUBE_MAP,null);e.bindTexture(e.TEXTURE_2D,a[c]);e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,a[c].image);e.generateMipmap(e.TEXTURE_2D);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,
e.LINEAR);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_NEAREST);e.bindTexture(e.TEXTURE_2D,null);d.setValue(c,a[c])}}(b),a[b].image.src=q):"Cube Texture"==g&&(a[b].image=new Image,a[b].image.onload=function(c){return function(){var b=[{face:e.TEXTURE_CUBE_MAP_POSITIVE_X,offset:[2,1]},{face:e.TEXTURE_CUBE_MAP_NEGATIVE_X,offset:[0,1]},{face:e.TEXTURE_CUBE_MAP_POSITIVE_Y,offset:[1,0]},{face:e.TEXTURE_CUBE_MAP_NEGATIVE_Y,offset:[1,2]},{face:e.TEXTURE_CUBE_MAP_POSITIVE_Z,offset:[1,
1]},{face:e.TEXTURE_CUBE_MAP_NEGATIVE_Z,offset:[3,1]}];e.bindTexture(e.TEXTURE_CUBE_MAP,a[c]);var f=k('<canvas style="display:none" width="'+this.width/4+'" height="'+this.height/3+'"></canvas>');k("body").append(f);for(var g=f.get(0).getContext("2d"),h=0;6>h;h++)g.save(),g.translate(-this.width/4*b[h].offset[0],-this.height/3*b[h].offset[1]),g.drawImage(this,0,0),e.texImage2D(b[h].face,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,f.get(0)),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_CUBE_MAP,
e.TEXTURE_MIN_FILTER,e.NEAREST),g.restore();e.bindTexture(e.TEXTURE_CUBE_MAP,null);f.remove();d.setValue(c,a[c])}}(b),a[b].image.src=q);d.setValue(b,VVVV.defaultTexture)}d.setSliceCount(h)}this.contextChanged=!1}}};this.destroy=function(){for(var c=0;c<a.length;c++)a[c].context.deleteTexture(a[c])}};VVVV.Nodes.FileTexture.prototype=new VVVV.Core.Node;VVVV.Nodes.DX9Texture=function(b,h){this.constructor(b,"DX9Texture (EX9.Texture)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],
credits:[],compatibility_issues:[]};var c=this.addInputPin("Source",[],VVVV.PinTypes.WebGlResource),d=this.addOutputPin("Texture Out",[],VVVV.PinTypes.WebGlTexture),f,a=!1;this.evaluate=function(){if(this.renderContexts){var e=this.renderContexts[0];if(e){this.contextChanged&&f&&(f.context.deleteTexture(f),f=void 0);if(c.isConnected()){var b=c.getValue(0);if(!b)return;0==(b.width&b.width-1)&&0==(b.height&b.height-1)||console.log("Warning: Source renderer's width/height is not a power of 2. DX9Texture will most likely not work.");
b instanceof WebGLTexture?d.setValue(0,b):(a||console.warn("Using DX9Texture with Canvas Renderer input is deprecated and will be removed. Use CanvasTexture (EX9.Texture) instead."),a=!0,void 0==f&&(f=e.createTexture(),f.context=e),e.bindTexture(e.TEXTURE_2D,f),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,b),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),d.setValue(0,f))}else delete f,
e.deleteTexture(f),d.setValue(0,void 0);this.contextChanged=!1}}};this.destroy=function(){f&&f.context.deleteTexture(f)}};VVVV.Nodes.DX9Texture.prototype=new VVVV.Core.Node;VVVV.Nodes.CanvasTextureWebGl=function(b,h){this.constructor(b,"CanvasTexture (EX9.Texture)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var c=this.addInputPin("Source",[],VVVV.PinTypes.CanvasGraphics),d=this.addOutputPin("Texture Out",[],VVVV.PinTypes.WebGlTexture),
f;this.evaluate=function(){if(this.renderContexts){var a=this.renderContexts[0];if(a){this.contextChanged&&f&&(f.context.deleteTexture(f),f=void 0);if(c.isConnected()){var e=c.getValue(0);if(!e)return;0==(e.width&e.width-1)&&0==(e.height&e.height-1)||console.log("Warning: Source renderer's width/height is not a power of 2. DX9Texture will most likely not work.");void 0==f&&(f=a.createTexture(),f.context=a);a.bindTexture(a.TEXTURE_2D,f);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,e);
a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);a.bindTexture(a.TEXTURE_2D,null);d.setValue(0,f)}else delete f,a.deleteTexture(f),d.setValue(0,void 0);this.contextChanged=!1}}};this.destroy=function(){f&&f.context.deleteTexture(f)}};VVVV.Nodes.CanvasTextureWebGl.prototype=new VVVV.Core.Node;VVVV.Nodes.VideoTexture=function(b,h){this.constructor(b,"VideoTexture (EX9.Texture VMR9)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],
original_authors:["VVVV Group"],credits:[],compatibility_issues:["Only supports power-of-2 sized videos","Has no output pins for meta data"]};var c=this.addInputPin("Video",[],this),d=this.addOutputPin("Texture Out",[],VVVV.PinTypes.WebGlTexture),f;this.evaluate=function(){if(this.renderContexts){var a=this.renderContexts[0];if(a)if(c.isConnected()){var e=c.getValue(0);0==(e.videoWidth&e.videoWidth-1)&&0==(e.videoHeight&e.videoHeight-1)||console.log("Warning: Video width/height is not a power of 2. VideoTexture will most likely not work.");
if(void 0==f||this.contextChanged)f=a.createTexture();a.bindTexture(a.TEXTURE_2D,f);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,e);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST);a.bindTexture(a.TEXTURE_2D,null);d.setValue(0,f);this.contextChanged=!1}else delete f,a.deleteTexture(f),d.setValue(0,void 0)}}};VVVV.Nodes.VideoTexture.prototype=new VVVV.Core.Node;VVVV.Nodes.VertexBufferJoin=function(b,h){this.constructor(b,
"VertexBuffer (EX9.Geometry Join)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var c=this.addInputPin("Position XYZ",[0,0,0],VVVV.PinTypes.Value),d=this.addInputPin("Normal XYZ",[0,0,0],VVVV.PinTypes.Value),f=this.addInputPin("Texture Coordinate 0 XY",[0,0],VVVV.PinTypes.Value),a=this.addInputPin("Apply",[1],VVVV.PinTypes.Value),e=this.addOutputPin("Vertex Buffer",[],VVVV.PinTypes.WebGlResource),l=null,k=[],n=[],q=
[],p;this.evaluate=function(){var b=this.renderContexts[0];if(b&&.5<=a.getValue(0)){p=this.getMaxInputSliceCount();for(var g=0;g<p;g++)k[g]=c.getValue(g),n[g]=f.getValue(g),q[g]=d.getValue(g);k.length=n.length=q.length=p;l||(l=new VVVV.Types.VertexBuffer(b,k),l.create());l.setSubBuffer("POSITION",3,k);l.setSubBuffer("TEXCOORD0",2,n);l.setSubBuffer("NORMAL",3,q);l.update();e.setValue(0,l)}}};VVVV.Nodes.VertexBufferJoin.prototype=new VVVV.Core.Node;VVVV.Nodes.MeshJoin=function(b,h){this.constructor(b,
"Mesh (EX9.Geometry Join)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var c=this.addInputPin("Vertex Buffer",[],VVVV.PinTypes.WebGlResource),d=this.addInputPin("Indices",[0],VVVV.PinTypes.Value),f=this.addInputPin("Apply",[1],VVVV.PinTypes.Value),a=this.addOutputPin("Mesh",[],VVVV.PinTypes.WebGlResource),e=null;this.evaluate=function(){var b=this.renderContexts[0];b&&(.5<=f.getValue(0)&&(c.isConnected()?(e||(e=new VVVV.Types.Mesh(b,
c.getValue(0),d.values)),(d.pinIsChanged()||this.contextChanged)&&e.update(d.values),(d.pinIsChanged()||c.pinIsChanged()||this.contextChanged)&&a.setValue(0,e)):(a.setValue(0,void 0),delete e)),this.contextChanged=!1)}};VVVV.Nodes.MeshJoin.prototype=new VVVV.Core.Node;VVVV.Nodes.Grid=function(b,h){this.constructor(b,"Grid (EX9.Geometry)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var c=this.addInputPin("Resolution X",
[2],VVVV.PinTypes.Value),d=this.addInputPin("Resolution Y",[2],VVVV.PinTypes.Value),f=this.addOutputPin("Mesh",[],VVVV.PinTypes.WebGlResource),a=null;this.evaluate=function(){if(this.renderContexts){var e=this.renderContexts[0];if(e){for(var b=parseInt(c.getValue(0)),g=parseInt(d.getValue(0)),h=[],k=[],p=[],m=0,x=0;x<g;x++)for(var v=0;v<b;v++)h.push(parseFloat(v)/(b-1)-.5),h.push(.5-parseFloat(x)/(g-1)),h.push(0),m++,k.push(0),k.push(0),k.push(1),p.push(parseFloat(v)/(b-1)),p.push(parseFloat(x)/(g-
1));m=new VVVV.Types.VertexBuffer(e,h);m.create();m.setSubBuffer("POSITION",3,h);m.setSubBuffer("TEXCOORD0",2,p);m.setSubBuffer("NORMAL",3,k);m.update();h=[];for(x=0;x<g-1;x++)for(v=0;v<b-1;v++)k=v+b*x,h.push(k),h.push(k+1),h.push(k+b+1),h.push(k+b+1),h.push(k+b),h.push(k);a=new VVVV.Types.Mesh(e,m,h);a.update(h);f.setValue(0,a)}}}};VVVV.Nodes.Grid.prototype=new VVVV.Core.Node;VVVV.Nodes.Sphere=function(b,h){this.constructor(b,"Sphere (EX9.Geometry)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],
original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var c=this.addInputPin("Radius",[.5],VVVV.PinTypes.Value),d=this.addInputPin("Resolution X",[15],VVVV.PinTypes.Value),f=this.addInputPin("Resolution Y",[15],VVVV.PinTypes.Value),a=this.addOutputPin("Mesh",[],VVVV.PinTypes.WebGlResource),e=null;this.evaluate=function(){if(this.renderContexts){var b=this.renderContexts[0];if(b){for(var g=parseInt(d.getValue(0)),h=parseInt(f.getValue(0)),k=c.getValue(0),p=[],m=[],x=[],v=0;v<h+1;v++)for(var z=
Math.cos(-parseFloat(v)/h*Math.PI),w=0;w<g;w++){var y=Math.cos(parseFloat(w)/g*2*Math.PI)*Math.cos(Math.asin(z)),u=Math.sin(parseFloat(w)/g*2*Math.PI)*Math.cos(Math.asin(z));p.push(y*k);p.push(z*k);p.push(u*k);m.push(y);m.push(z);m.push(u);x.push(parseFloat(w)/g);x.push(parseFloat(v)/h)}k=new VVVV.Types.VertexBuffer(b,p);k.create();k.setSubBuffer("POSITION",3,p);k.setSubBuffer("TEXCOORD0",2,x);k.setSubBuffer("NORMAL",3,m);k.update();p=[];for(v=0;v<h;v++)for(w=0;w<g;w++)m=g*v,x=w+m,p.push(x),p.push((x+
1)%g+m),p.push((x+1)%g+g+m),p.push((x+1)%g+g+m),p.push(x+g),p.push(x);e=new VVVV.Types.Mesh(b,k,p);e.update(p);a.setValue(0,e)}}}};VVVV.Nodes.Sphere.prototype=new VVVV.Core.Node;VVVV.Nodes.Cylinder=function(b,h){this.constructor(b,"Cylinder (EX9.Geometry)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var c=this.addInputPin("Radius 1",[.5],VVVV.PinTypes.Value),d=this.addInputPin("Radius 2",[.5],VVVV.PinTypes.Value),f=
this.addInputPin("Length",[1],VVVV.PinTypes.Value),a=this.addInputPin("Cycles",[1],VVVV.PinTypes.Value),e=this.addInputPin("Caps",[1],VVVV.PinTypes.Value),l=this.addInputPin("Resolution X",[15],VVVV.PinTypes.Value),k=this.addInputPin("Resolution Y",[1],VVVV.PinTypes.Value),n=this.addOutputPin("Mesh",[],VVVV.PinTypes.WebGlResource),q=null;this.evaluate=function(){if(this.renderContexts){var b=this.renderContexts[0];if(b){var g=parseInt(l.getValue(0)),h=parseInt(k.getValue(0)),v=c.getValue(0),z=d.getValue(0),
w=f.getValue(0),y=a.getValue(0),u=[],A=[],t=[];u.push(0);u.push(w/2);u.push(0);A.push(0);A.push(1);A.push(0);t.push(0);t.push(0);u.push(0);u.push(-w/2);u.push(0);A.push(0);A.push(-1);A.push(0);t.push(0);t.push(0);for(var B=0;B<h+1;B++)for(var C=parseFloat(B)/h,D=(C-.5)*-w,E=0;E<g+1;E++){var G=Math.cos(parseFloat(E)/g*2*Math.PI*y-Math.PI*y-Math.PI/2),L=Math.sin(parseFloat(E)/g*2*Math.PI*y-Math.PI*y-Math.PI/2),J=C*z+(1-C)*v;u.push(G*J);u.push(D);u.push(L*J);A.push(G);A.push(0);A.push(L);t.push(parseFloat(E)/
g);t.push(parseFloat(B)/h)}v=new VVVV.Types.VertexBuffer(b,u);v.create();v.setSubBuffer("POSITION",3,u);v.setSubBuffer("TEXCOORD0",2,t);v.setSubBuffer("NORMAL",3,A);v.update();u=[];if(.5<e.getValue(0))for(C=0;2>C;C++)for(E=0;E<g;E++)u.push(C),u.push(2+E+C+C*h*(g+1)),u.push(2+E+(1-C)+C*h*(g+1));for(B=0;B<h;B++)for(E=0;E<g;E++)C=E+(g+1)*B+2,u.push(C),u.push(C+1),u.push(C+g+2),u.push(C+g+2),u.push(C+g+1),u.push(C);q=new VVVV.Types.Mesh(b,v,u);q.update(u);n.setValue(0,q)}}}};VVVV.Nodes.Cylinder.prototype=
new VVVV.Core.Node;VVVV.Nodes.BlendWebGLAdvanced=function(b,h){function c(a){switch(a){case "One":return"ONE";case "Zero":return"ZERO";case "SrcAlpha":return"SRC_ALPHA";case "InvSrcAlpha":return"ONE_MINUS_SRC_ALPHA";case "DestAlpha":return"DST_ALPHA";case "InvDestAlpha":return"ONE_MINUS_DST_ALPHA";case "SrcColor":return"SRC_COLOR";case "InvSrcColor":return"ONE_MINUS_SRC_COLOR";case "DestColor":return"DST_COLOR";case "InvDestColor":return"ONE_MINUS_DST_COLOR"}return null}this.constructor(b,"Blend (EX9.RenderState Advanced)",
h);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var d=this.addInputPin("Render State In",[],VVVV.PinTypes.WebGlRenderState),f=this.addInputPin("Alpha Blending",[1],VVVV.PinTypes.Value),a=this.addInputPin("Source Blend Mode",["SrcAlpha"],VVVV.PinTypes.Enum),e=this.addInputPin("Destination Blend Mode",["SrcAlpha"],VVVV.PinTypes.Enum);a.enumOptions=e.enumOptions="One Zero SrcAlpha InvSrcAlpha DestAlpha InvDestAlpha SrcColor InvSrcColor DestColor InvDestColor".split(" ");
var l=this.addOutputPin("Render State Out",[],VVVV.PinTypes.WebGlRenderState),k=[];this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++)void 0==k[g]&&(k[g]=new VVVV.Types.WebGlRenderState),k[g].copy_attributes(d.getValue(g)),k[g].alphaBlending=.5<f.getValue(g),k[g].srcBlendMode=c(a.getValue(g)),k[g].destBlendMode=c(e.getValue(g)),l.setValue(g,k[g]);l.setSliceCount(b)}};VVVV.Nodes.BlendWebGLAdvanced.prototype=new VVVV.Core.Node;VVVV.Nodes.BlendWebGL=function(b,h){this.constructor(b,
"Blend (EX9.RenderState)",h);this.meta={authors:["Matthias Zauner, woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var c=this.addInputPin("Render State In",[],VVVV.PinTypes.WebGlRenderState),d=this.addInputPin("Draw Mode",["Blend"],VVVV.PinTypes.Enum);d.enumOptions=["Add","Blend","ColorAsAlphaAdd","ColorAsAlphaBlend","Multiply"];var f=this.addOutputPin("Render State Out",[],VVVV.PinTypes.WebGlRenderState),a=[];this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),
g=0;g<b;g++){void 0==a[g]&&(a[g]=new VVVV.Types.WebGlRenderState);a[g].copy_attributes(c.getValue(g));switch(d.getValue(g)){case "Add":a[g].srcBlendMode="SRC_ALPHA";a[g].destBlendMode="ONE";break;case "Blend":a[g].srcBlendMode="SRC_ALPHA";a[g].destBlendMode="ONE_MINUS_SRC_ALPHA";break;case "ColorAsAlphaAdd":a[g].srcBlendMode="SRC_COLOR";a[g].destBlendMode="ONE";break;case "ColorAsAlphaBlend":a[g].srcBlendMode="SRC_COLOR";a[g].destBlendMode="ONE_MINUS_SRC_COLOR";break;case "Multiply":a[g].srcBlendMode=
"ZERO",a[g].destBlendMode="SRC_COLOR"}f.setValue(g,a[g])}f.setSliceCount(b)}};VVVV.Nodes.BlendWebGL.prototype=new VVVV.Core.Node;VVVV.Nodes.FillWebGL=function(b,h){this.constructor(b,"Fill (EX9.RenderState)",h);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["does not actually draw wireframe, because this is not supported in WebGL, but makes renderer use gl.LINE instead of gl.TRIANGLES when drawing"]};var c=this.addInputPin("Render State In",
[],VVVV.PinTypes.WebGlRenderState),d=this.addInputPin("Fill Mode",["Solid"],VVVV.PinTypes.Enum);d.enumOptions=["Point","Solid","WireFrame"];var f=this.addOutputPin("Render State Out",[],VVVV.PinTypes.WebGlRenderState),a=[];this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++){void 0==a[g]&&(a[g]=new VVVV.Types.WebGlRenderState);a[g].copy_attributes(c.getValue(g));switch(d.getValue(g)){case "Point":a[g].polygonDrawMode="POINTS";break;case "Solid":a[g].polygonDrawMode="TRIANGLES";
break;case "WireFrame":a[g].polygonDrawMode="LINES"}f.setValue(g,a[g])}f.setSliceCount(b)}};VVVV.Nodes.FillWebGL.prototype=new VVVV.Core.Node;VVVV.Nodes.ZWriteEnableWebGL=function(b,h){function c(a){switch(a){case "Never":return"NEVER";case "Less":return"LESS";case "LessEqual":return"LEQUAL";case "Equal":return"EQUAL";case "NotEqual":return"NOTEQUAL";case "Greater":return"GREATER";case "GreaterEqual":return"GEQUAL";case "Always":return"ALWAYS"}return null}this.constructor(b,"ZWriteEnable (EX9.RenderState)",
h);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var d=this.addInputPin("Render State In",[],VVVV.PinTypes.WebGlRenderState),f=this.addInputPin("ZWrite Enable",[1],VVVV.PinTypes.Value),a=this.addInputPin("Compare Function",["Always"],VVVV.PinTypes.Enum);a.enumOptions="Never Less LessEqual Equal NotEqual Greater GreaterEqual Always".split(" ");var e=this.addInputPin("Depth Bias",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Render State Out",
[],VVVV.PinTypes.WebGlRenderState),k=[];this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++)void 0==k[g]&&(k[g]=new VVVV.Types.WebGlRenderState),k[g].copy_attributes(d.getValue(g)),k[g].enableZWrite=.5<f.getValue(g),k[g].depthFunc=c(a.getValue(g)),k[g].depthOffset=e.getValue(0),l.setValue(g,k[g]);l.setSliceCount(b)}};VVVV.Nodes.ZWriteEnableWebGL.prototype=new VVVV.Core.Node;VVVV.Nodes.CullWebGL=function(b,h){this.constructor(b,"Cull (EX9.RenderState)",h);this.meta={authors:["Matthias Zauner"],
original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var c=this.addInputPin("Render State In",[],VVVV.PinTypes.WebGlRenderState),d=this.addInputPin("Culling",["None"],VVVV.PinTypes.Enum);d.enumOptions=["None","Clockwise","Counterclockwise"];var f=this.addOutputPin("Render State Out",[],VVVV.PinTypes.WebGlRenderState),a=[];this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++)void 0==a[g]&&(a[g]=new VVVV.Types.WebGlRenderState),a[g].copy_attributes(c.getValue(g)),
"Clockwise"==d.getValue(g)?a[g].cullFace="CW":"Counterclockwise"==d.getValue(g)?a[g].cullFace="CCW":a[g].cullFace=void 0,f.setValue(g,a[g]);f.setSliceCount(b)}};VVVV.Nodes.CullWebGL.prototype=new VVVV.Core.Node;VVVV.Nodes.GenericShader=function(b,h){this.constructor(b,"GenericShader (EX9.Effect)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.shaderFile="";var c=this.addInputPin("Render State",[],VVVV.PinTypes.WebGlRenderState),
d=this.addInputPin("Mesh",[],VVVV.PinTypes.WebGlResource),f=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),a=this.addInputPin("Technique",[""],VVVV.PinTypes.Enum);a.enumOptions=[""];this.addOutputPin("Layer",[],VVVV.PinTypes.WebGlResource);var e=[],l=null,r,n=!1,q=[],p=this;this.initialize=function(){var a=["Render State","Mesh","Transform","Technique"];_(p.inputPins).each(function(b){0>a.indexOf(b.pinname)&&(b.unvalidated=!0,q.push(b))});void 0==VVVV.ShaderCodeResources[p.shaderFile]?(VVVV.ShaderCodeResources[p.shaderFile]=
new VVVV.Types.ShaderCodeResource,VVVV.ShaderCodeResources[p.shaderFile].addRelatedNode(p),k.ajax({url:VVVV.Helpers.prepareFilePath(p.shaderFile,p.parentPatch),async:!1,dataType:"text",success:function(a){VVVV.ShaderCodeResources[p.shaderFile].setSourceCode(a)},error:function(){console.log("ERROR: Could not load shader file "+p.shaderFile.replace("%VVVV%",VVVV.Root));VVVV.onNotImplemented("Could not load shader file "+p.shaderFile.replace("%VVVV%",VVVV.Root))}})):VVVV.ShaderCodeResources[p.shaderFile].addRelatedNode(p)};
this.shaderSourceUpdated=function(a){r=a;l||(l=new VVVV.Types.ShaderProgram);p.addUniformPins();p.setupShader();_(p.inputPins).each(function(a){a.markPinAsChanged()});n=!0;l.isSetup=!1;this.parentPatch.afterUpdate()};this.addUniformPins=function(){l.extractSemantics(r);for(var a=[],b=0;b<q.length;b++)l.uniformSpecs[q[b].pinname.replace(/ /g,"_")]||(p.removeInputPin(q[b].pinname),a.push(b));for(b=0;b<a.length;b++)q.splice(a[b],1);_(l.uniformSpecs).each(function(a){if("VIEW"!=a.semantic&&"PROJECTION"!=
a.semantic&&"WORLD"!=a.semantic&&"VIEWPROJECTION"!=a.semantic&&"WORLDVIEW"!=a.semantic&&"WORLDVIEWPROJECTION"!=a.semantic){var b=VVVV.PinTypes.Value,c=[];switch(a.type){case "mat":b=VVVV.PinTypes.Transform;break;case "samplerCube":case "sampler":b=VVVV.PinTypes.WebGlTexture;break;default:"COLOR"==a.semantic?(b=VVVV.PinTypes.Color,c=[new VVVV.Types.Color("1.0, 1.0, 1.0, 1.0")]):c=[0],a.defaultValue&&(c="COLOR"!=a.semantic?_(a.defaultValue.split(",")).map(function(a){return parseFloat(a)}):[new VVVV.Types.Color(a.defaultValue)])}for(var e=
0;e<q.length;e++)if(q[e].pinname==a.varname.replace(/_/g," ")){q[e].dimensions=a.dimension;q[e].unvalidated&&!q[e].isConnected()&&(q[e].values="Color"==b.typeName?p.defaultPinValues[q[e].pinname]?_(p.defaultPinValues[q[e].pinname]).map(function(a){return new VVVV.Types.Color(a)}):c:p.defaultPinValues[q[e].pinname]?p.defaultPinValues[q[e].pinname].slice():c);q[e].typeName!=b.typeName&&(a=q[e].values.slice(),c=q[e].getSliceCount(),q[e].setType(b),q[e].unvalidated&&b.primitive&&!q[e].isConnected()&&
(q[e].values=a,q[e].setSliceCount(c)),q[e].isConnected()&&!q[e].unvalidated&&(q[e].connectionChanged(),q[e].links[0].destroy()));q[e].unvalidated=!1;return}b=p.addInputPin(a.varname.replace(/_/g," "),c,b);b.dimensions=a.dimension;q.push(b)}})};this.setupShader=function(){var b=a.getValue(0),b=b.replace(/^\s*/,"").replace(/\s*$/,""),c=new RegExp(/(vertex_shader|fragment_shader)\{([^\}]+)\}/g);a.enumOptions=[];for(var e;null!=(e=c.exec(r));)a.enumOptions=a.enumOptions.concat(e[2].replace(/\s/g,"").split(","));
a.enumOptions=a.enumOptions.filter(function(a,b,c){return c.indexOf(a)===b});0==a.enumOptions.length&&a.enumOptions.push("");if(""==b||0>a.enumOptions.indexOf(b))b=a.enumOptions[0],a.setValue(0,b);var d=new RegExp("vertex_shader(\\{([a-zA-Z0-9]+,\\s*)*"+b+"(,\\s*[a-zA-Z0-9]+)*\\})?:([\\s\\S]*?)(vertex_shader|fragment_shader)"),c=new RegExp("fragment_shader(\\{([a-zA-Z0-9]+,\\s*)*"+b+"(,\\s*[a-zA-Z0-9]+)*\\})?:([\\s\\S]*?)(vertex_shader|fragment_shader)");e=/STARTOFSTRING((\r?\n|.)*?)(vertex_shader|fragment_shader)/.exec("STARTOFSTRING"+
r);var f=e[1];void 0==(e=d.exec(r+"\nfragment_shader"))?console.log("ERROR: No vertex shader code for technique "+b+" found"):(d=e[4],void 0==(e=c.exec(r+"\nfragment_shader"))?console.log("ERROR: No fragment shader code for technique "+b+" found"):(l.setFragmentShader(f+e[4]),l.setVertexShader(f+d)))};this.evaluate=function(){if(this.renderContexts){var b=this.renderContexts[0];if(b&&l){if(!l.isSetup||this.contextChanged||a.pinIsChanged())this.setupShader(),l.setup(b)?VVVV.ShaderCodeResources[p.shaderFile].definingNode&&
VVVV.ShaderCodeResources[p.shaderFile].definingNode.showStatus("success","Successfully compiled"):VVVV.ShaderCodeResources[p.shaderFile].definingNode&&VVVV.ShaderCodeResources[p.shaderFile].definingNode.showStatus("error",l.log);var g=0;_(this.inputPins).each(function(a){var b=a.getSliceCount();a=a.pinname.replace(/ /g,"_");l.uniformSpecs[a]&&"vec"==l.uniformSpecs[a].type&&"COLOR"!=l.uniformSpecs[a].semantic&&(b=parseInt(b/l.uniformSpecs[a].dimension));b>g&&(g=b)});d.isConnected()&&void 0!=d.getValue(0)||
(g=0);var h=e.length;if(this.contextChanged||n)h=0;g<h&&e.splice(g,h-g);for(var k=h;k<g;k++)e[k]=new VVVV.Types.Layer,e[k].mesh=d.getValue(0),e[k].shader=l,_(l.uniformSpecs).each(function(a){e[k].uniformNames.push(a.varname);e[k].uniforms[a.varname]={uniformSpec:a,value:void 0}});if(d.pinIsChanged())for(k=0;k<g;k++)e[k].mesh=d.getValue(0);for(k=0;k<g;k++)e[k].shader=l;for(b=0;b<q.length;b++){var r=q[b].pinname.replace(/ /g,"_");if(q[b].pinIsChanged()||h<g)for(k=0;k<g;k++)if("vec"==l.uniformSpecs[r].type)if("COLOR"==
l.uniformSpecs[r].semantic)e[k].uniforms[r].value=q[b].getValue(k).rgba;else{var y=q[b].getValue(k,q[b].dimensions);e[k].uniforms[r].value=new Float32Array(y)}else y=q[b].getValue(k),e[k].uniforms[r].value=y}if(c.pinIsChanged()||h<g)for(b=0;b<g;b++)c.isConnected()?e[b].renderState=c.getValue(b):e[b].renderState=VVVV.DefaultRenderState;if(f.pinIsChanged()||h<g)for(b=0;b<g;b++)h=this.inputPins.Transform.getValue(b),e[b].uniforms[e[b].shader.uniformSemanticMap.WORLD].value=h;this.outputPins.Layer.setSliceCount(g);
for(b=0;b<g;b++)this.outputPins.Layer.setValue(b,e[b]);n=this.contextChanged=!1}}};this.openUIWindow=function(){VVVV.ShaderCodeResources[p.shaderFile].definingNode&&VVVV.ShaderCodeResources[p.shaderFile].definingNode.openUIWindow()}};VVVV.Nodes.GenericShader.prototype=new VVVV.Core.Node;VVVV.Nodes.Quad=function(b,h){this.constructor(b,"Quad (DX9)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["No Sampler States","No texture coord mapping",
"No enable pin","Transprent pixels are discarded by default"]};this.auto_evaluate=!1;var c=this.addInputPin("Render State",[],VVVV.PinTypes.WebGlRenderState);this.addInputPin("Transform",[],VVVV.PinTypes.Transform);this.addInputPin("Texture",[],VVVV.PinTypes.WebGlTexture);this.addInputPin("Texture Transform",[],VVVV.PinTypes.Transform);this.addInputPin("Color",[],VVVV.PinTypes.Color);this.addOutputPin("Layer",[],VVVV.PinTypes.WebGlResource);var d=[],f=null,a=null;this.evaluate=function(){if(this.renderContexts){var b=
this.renderContexts[0];if(b){if(this.contextChanged){var g=[.5,.5,0,-.5,.5,0,.5,-.5,0,-.5,-.5,0],h=new VVVV.Types.VertexBuffer(b,g);h.create();h.setSubBuffer("POSITION",3,g);h.setSubBuffer("TEXCOORD0",2,[1,0,0,0,1,1,0,1]);h.update();f=new VVVV.Types.Mesh(b,h,[0,1,2,1,3,2]);f.update([0,1,2,1,3,2]);g="#ifdef GL_ES\nprecision mediump float;\n#endif\n";g+="uniform vec4 col : COLOR = {1.0, 1.0, 1.0, 1.0}; varying vec2 vs2psTexCd; uniform sampler2D Samp0; void main(void) { gl_FragColor = col*texture2D(Samp0, vs2psTexCd); if (gl_FragColor.a==0.0) discard; }";
a=new VVVV.Types.ShaderProgram;a.extractSemantics(g+"attribute vec3 PosO : POSITION; attribute vec2 TexCd : TEXCOORD0; uniform mat4 tW : WORLD; uniform mat4 tV : VIEW; uniform mat4 tP : PROJECTION; uniform mat4 tTex; varying vec2 vs2psTexCd; void main(void) { gl_Position = tP * tV * tW * vec4(PosO, 1.0); vs2psTexCd = (tTex * vec4(TexCd.xy-.5, 0.0, 1.0)).xy+.5; }");a.setFragmentShader(g);a.setVertexShader("attribute vec3 PosO : POSITION; attribute vec2 TexCd : TEXCOORD0; uniform mat4 tW : WORLD; uniform mat4 tV : VIEW; uniform mat4 tP : PROJECTION; uniform mat4 tTex; varying vec2 vs2psTexCd; void main(void) { gl_Position = tP * tV * tW * vec4(PosO, 1.0); vs2psTexCd = (tTex * vec4(TexCd.xy-.5, 0.0, 1.0)).xy+.5; }");
a.setup(b)}b=this.getMaxInputSliceCount();g=d.length;this.contextChanged&&(g=0);b<g&&d.splice(b,g-b);for(var k=g;k<b;k++)d[k]=new VVVV.Types.Layer,d[k].mesh=f,d[k].shader=a,_(a.uniformSpecs).each(function(a){d[k].uniformNames.push(a.varname);d[k].uniforms[a.varname]={uniformSpec:a,value:void 0}});var q=this.inputPins.Color.pinIsChanged(),p=this.inputPins.Transform.pinIsChanged(),h=this.inputPins.Texture.pinIsChanged(),m=this.inputPins["Texture Transform"].pinIsChanged();if(q||g<b)for(q=0;q<b;q++){var x=
this.inputPins.Color.getValue(q);d[q].uniforms.col.value=x.rgba}if(c.pinIsChanged()||g<b)for(q=0;q<b;q++)c.isConnected()?d[q].renderState=c.getValue(q):d[q].renderState=VVVV.DefaultRenderState;if(p||g<b)for(q=0;q<b;q++)p=this.inputPins.Transform.getValue(q),d[q].uniforms[d[q].shader.uniformSemanticMap.WORLD].value=p;if(h||g<b)for(q=0;q<b;q++)d[q].uniforms.Samp0.value=this.inputPins.Texture.getValue(q);if(m||g<b)for(q=0;q<b;q++)p=this.inputPins["Texture Transform"].getValue(q),d[q].uniforms.tTex.value=
p;this.outputPins.Layer.setSliceCount(b);for(q=0;q<b;q++)this.outputPins.Layer.setValue(q,d[q]);this.contextChanged=!1}}}};VVVV.Nodes.Quad.prototype=new VVVV.Core.Node;VVVV.Nodes.GridSegment=function(b,h){this.constructor(b,"GridSegment (DX9)",h);this.auto_nil=!1;this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var c=this.addInputPin("Render State",[],VVVV.PinTypes.WebGlRenderState);this.addInputPin("Transform",[],VVVV.PinTypes.Transform);this.addInputPin("Texture",
[],VVVV.PinTypes.WebGlTexture);this.addInputPin("Texture Transform",[],VVVV.PinTypes.Transform);this.addInputPin("Color",[],VVVV.PinTypes.Color);var d=this.addInputPin("Cycles",[1],VVVV.PinTypes.Value),f=this.addInputPin("Inner Radius",[0],VVVV.PinTypes.Value),a=this.addInputPin("Resolution X",[6],VVVV.PinTypes.Value),e=this.addInputPin("Resolution Y",[2],VVVV.PinTypes.Value);this.addOutputPin("Layer",[],VVVV.PinTypes.WebGlResource);var k=[],r=null;this.evaluate=function(){if(this.renderContexts){var b=
this.renderContexts[0];if(b){if(this.contextChanged){var g;g="#ifdef GL_ES\nprecision mediump float;\n#endif\n";g+="uniform vec4 col : COLOR = {1.0, 1.0, 1.0, 1.0}; varying vec2 vs2psTexCd; uniform sampler2D Samp0; void main(void) { gl_FragColor = col*texture2D(Samp0, vs2psTexCd); if (gl_FragColor.a==0.0) discard; }";r=new VVVV.Types.ShaderProgram;r.extractSemantics(g+"attribute vec3 PosO : POSITION; attribute vec2 TexCd : TEXCOORD0; uniform mat4 tW : WORLD; uniform mat4 tV : VIEW; uniform mat4 tP : PROJECTION; uniform mat4 tTex; varying vec2 vs2psTexCd; void main(void) { gl_Position = tP * tV * tW * vec4(PosO, 1.0); vs2psTexCd = (tTex * vec4(TexCd.xy-.5, 0.0, 1.0)).xy+.5; }");
r.setFragmentShader(g);r.setVertexShader("attribute vec3 PosO : POSITION; attribute vec2 TexCd : TEXCOORD0; uniform mat4 tW : WORLD; uniform mat4 tV : VIEW; uniform mat4 tP : PROJECTION; uniform mat4 tTex; varying vec2 vs2psTexCd; void main(void) { gl_Position = tP * tV * tW * vec4(PosO, 1.0); vs2psTexCd = (tTex * vec4(TexCd.xy-.5, 0.0, 1.0)).xy+.5; }");r.setup(b)}g=this.getMaxInputSliceCount();var h=k.length;if(this.contextChanged||a.pinIsChanged()||e.pinIsChanged()||d.pinIsChanged()||f.pinIsChanged())h=
0;g<h&&k.splice(g,h-g);for(var m=h;m<g;m++){k[m]=new VVVV.Types.Layer;for(var x=parseInt(a.getValue(m)),v=parseInt(e.getValue(m)),z=d.getValue(m),w=f.getValue(m),y=[],u=[],A=[],t=0,B=0;B<v;B++)for(var C=0;C<x;C++){var D=parseFloat(C)/(x-1),D=.25-D*z,D=6.28318530718*D,E=parseFloat(B)/(v-1),E=w*(1-E)+E;y.push(Math.sin(D)*E*.5);y.push(Math.cos(D)*E*.5);y.push(0);t++;u.push(0);u.push(0);u.push(1);A.push(parseFloat(C)/(x-1));A.push(parseFloat(B)/(v-1))}z=new VVVV.Types.VertexBuffer(b,y);z.create();z.setSubBuffer("POSITION",
3,y);z.setSubBuffer("TEXCOORD0",2,A);z.setSubBuffer("NORMAL",3,u);z.create();y=[];for(B=0;B<v-1;B++)for(C=0;C<x-1;C++)u=C+x*B,y.push(u),y.push(u+1),y.push(u+x+1),y.push(u+x+1),y.push(u+x),y.push(u);k[m].mesh=new VVVV.Types.Mesh(b,z,y);k[m].mesh.update(y);k[m].shader=r;_(r.uniformSpecs).each(function(a){k[m].uniformNames.push(a.varname);k[m].uniforms[a.varname]={uniformSpec:a,value:void 0}})}B=this.inputPins.Color.pinIsChanged();v=this.inputPins.Transform.pinIsChanged();b=this.inputPins.Texture.pinIsChanged();
x=this.inputPins["Texture Transform"].pinIsChanged();if(B||h<g)for(B=0;B<g;B++)C=this.inputPins.Color.getValue(B),k[B].uniforms.col.value=C.rgba;if(c.pinIsChanged()||h<g)for(B=0;B<g;B++)c.isConnected()?k[B].renderState=c.getValue(B):k[B].renderState=VVVV.DefaultRenderState;if(v||h<g)for(B=0;B<g;B++)v=this.inputPins.Transform.getValue(B),k[B].uniforms[k[B].shader.uniformSemanticMap.WORLD].value=v;if(b||h<g)for(B=0;B<g;B++)k[B].uniforms.Samp0.value=this.inputPins.Texture.getValue(B);if(x||h<g)for(B=
0;B<g;B++)v=this.inputPins["Texture Transform"].getValue(B),k[B].uniforms.tTex.value=v;this.outputPins.Layer.setSliceCount(g);for(B=0;B<g;B++)this.outputPins.Layer.setValue(B,k[B]);this.contextChanged=!1}}}};VVVV.Nodes.GridSegment.prototype=new VVVV.Core.Node;VVVV.Nodes.Group=function(b,h){this.constructor(b,"Group (EX9)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var c=[],d=this.addInputPin("Enabled",[1],VVVV.PinTypes.Value),
f=this.addInvisiblePin("Layer Template Count",[2],VVVV.PinTypes.Value),a=this.addOutputPin("Layer",[],VVVV.PinTypes.WebGlResource);this.initialize=function(){var a=Math.max(2,f.getValue(0));VVVV.Helpers.dynamicPins(this,c,a,function(a){return this.addInputPin("Layer "+(a+1),[],VVVV.PinTypes.WebGlResource)})};this.evaluate=function(){f.pinIsChanged()&&this.initialize();var b=0;if(.5<d.getValue(0))for(var g=0;g<c.length;g++)for(var h=0;h<c[g].getSliceCount();h++)a.setValue(b++,c[g].getValue(h));a.setSliceCount(b)}};
VVVV.Nodes.Group.prototype=new VVVV.Core.Node;VVVV.Nodes.RendererWebGL=function(g,h){function c(){function a(b){switch(b.which){case 1:VVVV.MousePositions._all.lb[0]=0;VVVV.MousePositions[g].lb[0]=0;break;case 2:VVVV.MousePositions._all.mb[0]=0;VVVV.MousePositions[g].mb[0]=0;break;case 3:VVVV.MousePositions._all.rb[0]=0,VVVV.MousePositions[g].rb[0]=0}}function b(a,c){for(var e=a.originalEvent.changedTouches.length;e--;){var d=2*(a.originalEvent.changedTouches[e].pageX-k(c).offset().left)/k(c).width()-
1,f=-(2*(a.originalEvent.changedTouches[e].pageY-k(c).offset().top)/k(c).height()-1);VVVV.MousePositions._all.x[a.originalEvent.changedTouches[e].identifier]=VVVV.MousePositions[c.id].x[a.originalEvent.changedTouches[e].identifier]=d;VVVV.MousePositions._all.y[a.originalEvent.changedTouches[e].identifier]=VVVV.MousePositions[c.id].y[a.originalEvent.changedTouches[e].identifier]=f}}k(u).detach("mousemove");k(u).detach("mousedown");k(u).detach("mouseup");VVVV.MousePositions[g]={x:[0],y:[0],wheel:[0],
lb:[0],mb:[0],rb:[0]};k(u).mousemove(function(a){var b=2*(a.pageX-k(this).offset().left)/k(this).width()-1;a=-(2*(a.pageY-k(this).offset().top)/k(this).height()-1);VVVV.MousePositions._all.x[0]=b;VVVV.MousePositions._all.y[0]=a;VVVV.MousePositions[g].x[0]=b;VVVV.MousePositions[g].y[0]=a});k(u).bind("mousewheel",function(a){a=a.originalEvent.wheelDelta/120;VVVV.MousePositions[g].wheel[0]+=a;VVVV.MousePositions._all.wheel[0]+=a});k(u).bind("DOMMouseScroll",function(a){a=-a.originalEvent.detail/3;VVVV.MousePositions[g].wheel[0]+=
a;VVVV.MousePositions._all.wheel[0]+=a});k(u).mousedown(function(b){switch(b.which){case 1:VVVV.MousePositions._all.lb[0]=1;VVVV.MousePositions[g].lb[0]=1;break;case 2:VVVV.MousePositions._all.mb[0]=1;VVVV.MousePositions[g].mb[0]=1;break;case 3:VVVV.MousePositions._all.rb[0]=1,VVVV.MousePositions[g].rb[0]=1}k(document).unbind("mouseup",a);k(document).mouseup(a)});k(u).bind("touchstart",function(a){for(var c=a.originalEvent.changedTouches.length;c--;)VVVV.MousePositions._all.lb[a.originalEvent.changedTouches[c].identifier]=
VVVV.MousePositions[g].lb[a.originalEvent.changedTouches[c].identifier]=1;b(a,this)});k(u).bind("touchend",function(a){for(var b=a.originalEvent.changedTouches.length;b--;)VVVV.MousePositions._all.lb[a.originalEvent.changedTouches[b].identifier]=VVVV.MousePositions[g].lb[a.originalEvent.changedTouches[b].identifier]=0});k(u).bind("touchmove",function(a){b(a,this);a.preventDefault()})}this.constructor(g,"Renderer (EX9)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],
credits:[],compatibility_issues:["Disabling Clear doesn't work in Chrome","No Fullscreen","No Enable Pin","No Aspect Ration and Viewport transform","No mouse output"]};this.addInputPin("Layers",[],VVVV.PinTypes.WebGlResource);var d=this.addInputPin("Clear",[1],VVVV.PinTypes.Value),f=this.addInputPin("Background Color",[new VVVV.Types.Color("0.0, 0.0, 0.0, 1.0")],VVVV.PinTypes.Color),a=this.addInputPin("Backbuffer Width",[0],VVVV.PinTypes.Value),e=this.addInputPin("Backbuffer Height",[0],VVVV.PinTypes.Value),
l=this.addInputPin("View",[],VVVV.PinTypes.Transform),r=this.addInputPin("Projection",[],VVVV.PinTypes.Transform),n=this.addInvisiblePin("Windowed Depthbuffer Format",["NONE"],VVVV.PinTypes.Enum);n.enumOptions=["NONE","DX16"];var q=this.addOutputPin("Actual Backbuffer Width",[0],VVVV.PinTypes.Value),p=this.addOutputPin("Actual Backbuffer Height",[0],VVVV.PinTypes.Value),m=this.addOutputPin("EX9 Out",[],VVVV.PinTypes.WebGlResource),x=0,v=0,z,w,y;mat4.create();mat4.create();var u,A=this.ctxt=void 0,
t,B,C;this.getContexts=function(){if(this.invisiblePins["Descriptive Name"]){var b=this.invisiblePins["Descriptive Name"].getValue(0);if((b=k(b).get(0))&&"CANVAS"==b.nodeName)u=k(b);else{var h=parseInt(a.getValue(0)),n=parseInt(e.getValue(0)),h=0<h?h:512,n=0<n?n:512;g="vvvv-js-generated-renderer-"+(new Date).getTime();u=k('<canvas width="'+h+'" height="'+n+'" id="'+g+'" class="vvvv-js-generated-renderer"></canvas>');b||(b="body");k(b).append(u)}if(u){c();try{A=u.get(0).getContext("experimental-webgl",
{preserveDrawingBuffer:!0}),A.viewportWidth=parseInt(u.get(0).width),A.viewportHeight=parseInt(u.get(0).height)}catch(p){console.log(p)}this.ctxt=A;m.isConnected()&&this.renderContexts&&this.renderContexts[0]?(t=this.ctxt=this.renderContexts[0],B=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,B),B.width=u.get(0).width,B.height=u.get(0).height,C=t.createTexture(),t.bindTexture(t.TEXTURE_2D,C),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),
t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,B.width,B.height,0,t.RGBA,t.UNSIGNED_SHORT_4_4_4_4,null),t.generateMipmap(t.TEXTURE_2D),b=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,b),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,B.width,B.height),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,C,0),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,b),t.bindTexture(t.TEXTURE_2D,
null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null)):this.renderContexts&&this.renderContexts[0]&&(this.renderContexts[0].deleteTexture(C),C=void 0);this.ctxt&&(x=parseInt(u.get(0).width),v=parseInt(u.get(0).height),t=this.ctxt,b=new Uint8Array([255,255,255]),t.DefaultTexture={},t.DefaultTexture["2D"]=t.createTexture(),t.bindTexture(t.TEXTURE_2D,t.DefaultTexture["2D"]),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,
t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.texImage2D(t.TEXTURE_2D,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,b),t.bindTexture(t.TEXTURE_2D,null),t.DefaultTexture.CUBE=t.createTexture(),t.bindTexture(t.TEXTURE_CUBE_MAP,t.DefaultTexture.CUBE),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),
t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.NEAREST),t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,b),t.texImage2D(t.TEXTURE_CUBE_MAP_NEGATIVE_X,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,b),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_Y,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,b),t.texImage2D(t.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,b),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_Z,
0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,b),t.texImage2D(t.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,t.RGB,1,1,0,t.RGB,t.UNSIGNED_BYTE,b),t.bindTexture(t.TEXTURE_CUBE_MAP,null),this.inputPins.Layers.markPinAsChanged(),d.markPinAsChanged(),f.markPinAsChanged(),l.markPinAsChanged(),r.markPinAsChanged())}}};this.destroy=function(){k(u).remove()};var D=!1;this.evaluate=function(){t=this.ctxt;if(this.invisiblePins["Descriptive Name"].pinIsChanged()||this.contextChanged)A&&k(A.canvas).hasClass("vvvv-js-generated-renderer")&&
k(A.canvas).remove(),this.getContexts(),this.inputPins.Layers.isConnected()&&this.inputPins.Layers.links[0].fromPin.connectionChanged();D||(q.setValue(0,x),p.setValue(0,v),D=!0);if(void 0!=t){if(a.pinIsChanged()&&(!this.renderContexts||!this.renderContexts[0])){var c=parseInt(a.getValue(0));0<c&&(x=c,k(A.canvas).attr("width",x),q.setValue(0,x))}!e.pinIsChanged()||this.renderContexts&&this.renderContexts[0]||(c=parseInt(e.getValue(0)),0<c&&(v=c,k(A.canvas).attr("height",v),p.setValue(0,v)));this.renderContexts&&
this.renderContexts[0]&&t==this.renderContexts[0]?t.bindFramebuffer(t.FRAMEBUFFER,B):t.bindFramebuffer(t.FRAMEBUFFER,null);if(this.contextChanged||f.pinIsChanged())c=f.getValue(0),t.clearColor(c.rgba[0],c.rgba[1],c.rgba[2],c.rgba[3]);t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);if(this.contextChanged||n.pinIsChanged())"NONE"==n.getValue(0)?t.disable(t.DEPTH_TEST):t.enable(t.DEPTH_TEST);r.pinIsChanged()&&(r.isConnected()?(z=mat4.create(),mat4.set(r.getValue(0),z)):(z=mat4.create(),mat4.ortho(-1,
1,-1,1,-100,100,z)),mat4.scale(z,[1,1,-1]),this.renderContexts&&this.renderContexts[0]&&mat4.scale(z,[1,-1,1]),y=mat4.create());l.pinIsChanged()&&(w=l.getValue(0));(l.pinIsChanged()||r.pinIsChanged())&&mat4.multiply(z,w,y);if(!this.contextChanged){t.viewport(0,0,x,v);var d=c=null,g=null;if(this.inputPins.Layers.isConnected()){for(var h=this.inputPins.Layers.values,u=0;u<h.length;u++)if(layer=h[u],void 0!=layer.shader){c!=layer.shader.shaderProgram&&(t.useProgram(layer.shader.shaderProgram),layer.shader.uniformSemanticMap.PROJECTION&&
0!=layer.shader.uniformSpecs[layer.shader.uniformSemanticMap.PROJECTION].position&&t.uniformMatrix4fv(layer.shader.uniformSpecs[layer.shader.uniformSemanticMap.PROJECTION].position,!1,z),layer.shader.uniformSemanticMap.VIEW&&0!=layer.shader.uniformSpecs[layer.shader.uniformSemanticMap.VIEW].position&&t.uniformMatrix4fv(layer.shader.uniformSpecs[layer.shader.uniformSemanticMap.VIEW].position,!1,w),layer.shader.uniformSemanticMap.VIEWPROJECTION&&0!=layer.shader.uniformSpecs[layer.shader.uniformSemanticMap.VIEWPROJECTION].position&&
t.uniformMatrix4fv(layer.shader.uniformSpecs[layer.shader.uniformSemanticMap.VIEWPROJECTION].position,!1,y));var H=layer.renderState;H||(H=b);H!=d&&H.apply(t);if(layer.mesh!=g||layer.shader.shaderProgram!=c)t.bindBuffer(t.ARRAY_BUFFER,layer.mesh.vertexBuffer.vbo),_(layer.mesh.vertexBuffer.subBuffers).each(function(a){layer.shader.attributeSpecs[layer.shader.attribSemanticMap[a.usage]]&&-1!=layer.shader.attributeSpecs[layer.shader.attribSemanticMap[a.usage]].position&&(t.enableVertexAttribArray(layer.shader.attributeSpecs[layer.shader.attribSemanticMap[a.usage]].position),
t.vertexAttribPointer(layer.shader.attributeSpecs[layer.shader.attribSemanticMap[a.usage]].position,a.size,t.FLOAT,!1,0,a.offset))}),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,layer.mesh.indexBuffer);for(var d=layer.uniformNames.length,I=g=0;I<d;I++){var F=layer.uniforms[layer.uniformNames[I]];if(void 0!=F.value&&!(0<u&&layer.shader.shaderProgram==c&&h[u-1].uniforms[layer.uniformNames[I]]&&F.value==h[u-1].uniforms[layer.uniformNames[I]].value)){start=(new Date).getTime();switch(F.uniformSpec.type){case "mat":t["uniformMatrix"+
F.uniformSpec.dimension+"fv"](F.uniformSpec.position,!1,F.value);break;case "vec":t["uniform"+F.uniformSpec.dimension+"fv"](F.uniformSpec.position,F.value);break;case "int":t["uniform"+F.uniformSpec.dimension+"i"](F.uniformSpec.position,F.value);break;case "float":t["uniform"+F.uniformSpec.dimension+"f"](F.uniformSpec.position,F.value);break;case "sampler":var K=F.value;K==VVVV.DefaultTexture&&(K=t.DefaultTexture["2D"]);t.activeTexture(t["TEXTURE"+g]);t.bindTexture(t["TEXTURE_"+F.uniformSpec.dimension],
K);t.uniform1i(F.uniformSpec.position,g);g++;break;case "samplerCube":K=F.value,K==VVVV.DefaultTexture&&(K=t.DefaultTexture.CUBE),t.activeTexture(t["TEXTURE"+g]),t.bindTexture(t.TEXTURE_CUBE_MAP,K),t.uniform1i(F.uniformSpec.position,g),g++}loopstart=(new Date).getTime()}}t.drawElements(t[H.polygonDrawMode],layer.mesh.numIndices,t.UNSIGNED_SHORT,0);c=layer.shader.shaderProgram;d=H;g=layer.mesh}t.bindTexture(t.TEXTURE_2D,null);t.bindTexture(t.TEXTURE_CUBE_MAP,null)}this.renderContexts&&this.renderContexts[0]&&
(t.bindTexture(t.TEXTURE_2D,C),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(this.renderContexts[0].TEXTURE_2D,null));m.setValue(0,C)}this.contextChanged=!1}}};VVVV.Nodes.RendererWebGL.prototype=new VVVV.Core.Node;VVVV.Nodes.DefineEffect=function(b,h){this.constructor(b,"DefineEffect (DX9)",h);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["Matthias Zauner"],credits:[],compatibility_issues:["Not available in classic VVVV"]};this.auto_evaluate=!1;var c=this.addInputPin("Effect Descriptor",
[""],VVVV.PinTypes.String),d=this.addInvisiblePin("Source Code",["#ifdef GL_ES\nprecision mediump float;\n#endif\n\nuniform mat4 tW : WORLD;\nuniform mat4 tV : VIEW;\nuniform mat4 tP : PROJECTION;\n\nuniform vec4 Color : COLOR = {1.0, 1.0, 1.0, 1.0};\nuniform sampler2D Texture;\nuniform mat4 Texture_Transform;\nuniform float Alpha = 1.0;\n\nvarying vec2 vs2psTexCd;\n\nvertex_shader:\n\nattribute vec3 PosO : POSITION;\nattribute vec2 TexCd : TEXCOORD0;\n\nvoid main(void) {\n gl_Position = tP * tV * tW * vec4(PosO, 1.0);\n vs2psTexCd = (Texture_Transform * vec4(TexCd, 0, 1)).xy;\n}\n\n\nfragment_shader:\n\nvoid main(void) {\n gl_FragColor = Color * texture2D(Texture, vs2psTexCd) * vec4(1.0, 1.0, 1.0, Alpha);\n}"],
VVVV.PinTypes.String),f="",a;this.evaluate=function(){if(""!=c.getValue(0)){if(c.pinIsChanged()){var b=c.getValue(0);if(""==b)return;""==f?void 0==VVVV.ShaderCodeResources["./"+b+".vvvvjs.fx"]&&(VVVV.ShaderCodeResources["./"+b+".vvvvjs.fx"]=new VVVV.Types.ShaderCodeResource):VVVV.ShaderCodeResources["./"+b+".vvvvjs.fx"]=VVVV.ShaderCodeResources[f];f="./"+b+".vvvvjs.fx";VVVV.ShaderCodeResources[f].definingNode=this;VVVV.ShaderCodeResources[f].setSourceCode(d.getValue(0));a&&k("#path",a.document).text((this.parentPatch.nodename||
"root")+" / "+(""!=f?f:"Untitled"))}d.pinIsChanged()&&VVVV.ShaderCodeResources[f]&&VVVV.ShaderCodeResources[f].setSourceCode(d.getValue(0))}};this.openUIWindow=function(){a=window.open(location.protocol+"//"+location.host+("/"==VVVV.Root[0]?"":location.pathname.replace(/\/[^\/]*$/,"")+"/")+VVVV.Root+"/code_editor.html",f+" / VVVV.js Effect Editor","location=no, width=800, height=800, toolbar=no");var b=this;window.setTimeout(function(){a.document.title=f+" / VVVV.js Effect Editor";var c=b.parentPatch.nodename||
"root",g=""!=f?f:"Untitled";k("#path",a.document).text(c+" / "+g);k("textarea",a.document).text(d.getValue(0));k("#compile_button",a.document).click(function(){""==f?b.showStatus("error","Please provide a name for this shader first"):(d.setValue(0,k("textarea",a.document).val()),0<VVVV.ShaderCodeResources[f].relatedNodes.length?(b.showStatus("notice","Compiling ..."),b.evaluate()):b.showStatus("notice","No instance of this shader found. Create a node (./"+f+") and connect it to a Renderer (EX9) to compile."))});
a.focus()},500)};this.showStatus=function(b,c){a&&(k("#status",a.document).text(c),k("#status",a.document).attr("class",b))}};VVVV.Nodes.DefineEffect.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Types.XElement=function(){this.name="root";this.data=""};VVVV.PinTypes.XElement={typeName:"XElement",reset_on_disconnect:!0,defaultValue:function(){return new VVVV.Types.XElement}};VVVV.PinTypes.XAttribute={typeName:"XAttribute",reset_on_disconnect:!0,defaultValue:function(){return{}}};VVVV.Nodes.AsXElementJSON=function(b,g){this.constructor(b,"AsXElement (JSON)",g);this.meta={authors:["Matthias Zauner"],original_authors:["herbst"],credits:[],compatibility_issues:[]};this.auto_evaluate=
!1;var h=this.addInputPin("JSON",['{"vvvv.js":"awesome"}'],VVVV.PinTypes.String),c=this.addOutputPin("Output Node",[],VVVV.PinTypes.XElement),d=this.addOutputPin("Success",[0],VVVV.PinTypes.Value),f=new VVVV.Types.XElement,a=0;this.evaluate=function(){try{f.data=JSON.parse(h.getValue(0)),a=1}catch(b){f.data={},a=0}c.setValue(0,f);d.setValue(0,a)}};VVVV.Nodes.AsXElementJSON.prototype=new VVVV.Core.Node;VVVV.Nodes.ElementXElementSplit=function(b,g){this.constructor(b,"Element (XElement Split)",g);this.meta=
{authors:["Matthias Zauner"],original_authors:["herbst"],credits:[],compatibility_issues:[]};this.auto_evaluate=!1;var h=this.addInputPin("Element",[],VVVV.PinTypes.XElement),c=this.addOutputPin("Name",[""],VVVV.PinTypes.String),d=this.addOutputPin("Value",[""],VVVV.PinTypes.String);this.addOutputPin("Deep Value",[""],VVVV.PinTypes.String);var f=this.addOutputPin("Children",[],VVVV.PinTypes.XElement),a=this.addOutputPin("Children Bin Size",[0],VVVV.PinTypes.Value);this.addOutputPin("Attributes",[],
VVVV.PinTypes.XAttribute);this.addOutputPin("Attributes Bin Size",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=h.getSliceCount(),g=0,k=0;k<b;k++){var n=h.getValue(k);c.setValue(k,n.name);var q=0;if(n.data instanceof Array){d.setValue(k,"");for(var p=0;p<n.data.length;p++){var m;m=f.getSliceCount()<=g?new VVVV.Types.XElement:f.getValue(g);m.name="item";m.data=n.data[p];f.setValue(g,m);g++;q++}}else if("object"==typeof n.data){d.setValue(k,"");for(var x in n.data)m=f.getSliceCount()<=
g?new VVVV.Types.XElement:f.getValue(g),m.name=x,m.data=n.data[x],f.setValue(g,m),g++,q++}else d.setValue(k,n.data);a.setValue(k,q)}c.setSliceCount(b);d.setSliceCount(b);f.setSliceCount(g);a.setSliceCount(b)}};VVVV.Nodes.ElementXElementSplit.prototype=new VVVV.Core.Node;VVVV.Nodes.GetElementsByName=function(b,g){function h(b,c){if(b&&b.data)if(b.data instanceof Array)for(var d=0;d<b.data.length;d++)h(b.data[d],c);else if("object"==typeof b.data)for(d in b.data){if(d==c){var g=f.getSliceCount()<=a?
new VVVV.Types.XElement:f.getValue(a);g.name=d;g.data=b.data[d];f.setValue(a,g);a++}h(b.data[d],c)}}this.constructor(b,"GetElements (XElement ByName)",g);this.meta={authors:["Matthias Zauner"],original_authors:["herbst"],credits:[],compatibility_issues:["no bin size output"]};this.auto_evaluate=!1;var c=this.addInputPin("Element",[],VVVV.PinTypes.XElement),d=this.addInputPin("Name",["myChildTagName"],VVVV.PinTypes.String),f=this.addOutputPin("Elements",[],VVVV.PinTypes.XElement),a=0;this.evaluate=
function(){for(var b=this.getMaxInputSliceCount(),g=a=0;g<b;g++)h(c.getValue(g),d.getValue(g));f.setSliceCount(a)}};VVVV.Nodes.GetElementsByName.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.Nodes.XPathXML=function(b,g){this.constructor(b,"XPath (XML)",g);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["XML Index Output Pin not implemented","Query Index Output Pin not implemented"]};this.auto_evaluate=!1;var h=this.addInputPin("XML Input",["text"],VVVV.PinTypes.String),c=this.addInputPin("XPath Query",["text"],VVVV.PinTypes.String),d=this.addInputPin("Base Element",["text"],VVVV.PinTypes.String),f=this.addOutputPin("Output",
["text"],VVVV.PinTypes.String),a=this.addOutputPin("XML Index",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Query Index",[0],VVVV.PinTypes.Value),k;this.evaluate=function(){var b=h.getValue(0),g=c.getValue(0);d.getValue(0);h.pinIsChanged()&&(k=(new DOMParser).parseFromString(b,"text/xml"));for(var b=k.evaluate(g,k,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),g=0,q;q=b.iterateNext();)q.value?f.setValue(g,q.value):q.data?f.setValue(g,q.data):f.setValue(g,""),g++;a.setValue(g,0);e.setValue(g,0);
f.setSliceCount(g);a.setSliceCount(1);e.setSliceCount(1)}};VVVV.Nodes.XPathXML.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(k){VVVV.PinTypes.Value.makeLabel=VVVV.PinTypes.String.makeLabel=function(b,g){var h=g.IOBoxRows();g.IOBoxInputPin().getSliceCount();d3.select(b).selectAll(".vvvv-node-label").remove();for(var c=0;c<h;c++)d3.select(b).append("svg:text").text(g.IOBoxInputPin().getValue(c)).attr("class","vvvv-node-label").attr("shape-rendering","crispEdges").attr("dy",function(b){return 12*c+12}).attr("dx",4).attr("font-size",10).attr("font-family","Lucida Sans Unicode")};VVVV.PinTypes.Value.openInputBox=VVVV.PinTypes.String.openInputBox=
function(b,g,h,c){$inputbox=k("<input type='text' value='"+h.getValue(c).toString().replace(/\|/g,"||").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")+"' class='pininputbox value resettable'/>");$inputbox.css("position",g.css("position"));$inputbox.css("width",g.css("width"));$inputbox.css("height",g.css("height"));$inputbox.css("left",g.css("left"));$inputbox.css("top",g.css("top"));g.replaceWith($inputbox);$inputbox.get(0).select();b.window.document.exitPointerLock=b.window.document.exitPointerLock||
b.window.document.mozExitPointerLock||b.window.document.webkitExitPointerLock;$inputbox.change(function(){"Value"==h.typeName?h.setValue(c,parseFloat(k(this).val())):h.setValue(c,k(this).val());var b=_(h.values).map(function(a){return"|"+a.toString().replace(/\|/g,"||").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")+"|"});b.length=h.getSliceCount();h.node.parentPatch.editor.update(h.node.parentPatch,"<PATCH><NODE id='"+h.node.id+"'><PIN pinname='"+h.pinname+"' values='"+b.join(",")+
"'/></NODE>")});$inputbox.keydown(function(b){13==b.which&&(k(this).change(),k(this).remove())});if("Value"==h.typeName){var d=function(b,a,c){var d=k(b).val()%1;if(!isNaN(d)){var g;g=1;if(c.altKey||0!==d)g=.01;a*=g;k(b).val(parseFloat(k(b).val())+a);k(b).change()}};$inputbox.bind("mousewheel",function(b){d(this,b.originalEvent.wheelDelta/120,b);b.preventDefault();return!1});$inputbox.bind("DOMMouseScroll",function(b){d(this,-b.originalEvent.detail/3,b);b.preventDefault();return!1});b.window.document.addEventListener("pointerlockerror",
function(b){console.log("POINTER LOCK ERROR")});$inputbox.mousedown(function(b){3==b.which&&this.requestPointerLock()});$inputbox.mouseup(function(c){3==c.which&&(b.window.document.exitPointerLock(),window.setTimeout(function(){$inputbox.remove()},100),b.state=0)});$inputbox.mousemove(function(c){b.window.document.pointerLockElement&&(b.state=6,50>Math.abs(c.originalEvent.movementY)&&d(this,Math.floor(-.5*c.originalEvent.movementY),c))})}$inputbox.bind("paste",function(b){b.stopPropagation()});$inputbox.bind("copy",
function(b){b.stopPropagation()})};VVVV.PinTypes.Enum.openInputBox=function(b,g,h,c){$inputbox=k("<select class='pininputbox value resettable'>");for(b=0;b<h.enumOptions.length;b++)$opt=k('<option value="'+h.enumOptions[b]+'">'+h.enumOptions[b]+"</option>"),h.getValue(c)==h.enumOptions[b]&&$opt.attr("selected",!0),$inputbox.append($opt);$inputbox.css("position",g.css("position"));$inputbox.css("width",g.css("width"));$inputbox.css("height",g.css("height"));$inputbox.css("left",g.css("left"));$inputbox.css("top",
g.css("top"));g.replaceWith($inputbox);$inputbox.change(function(){h.setValue(c,k(this).val());var b=_(h.values).map(function(b){return"|"+b+"|"});b.length=h.getSliceCount();h.node.parentPatch.editor.update(h.node.parentPatch,"<PATCH><NODE id='"+h.node.id+"'><PIN pinname='"+h.pinname+"' values='"+b.join(",")+"'/></NODE>");k(this).remove()})};VVVV.PinTypes.Color.makeLabel=function(b,g){var h=g.IOBoxRows();g.IOBoxInputPin().getSliceCount();d3.select(b).selectAll(".vvvv-node-label").remove();for(var c=
0;c<h;c++)d3.select(b).append("svg:rect").attr("class","vvvv-node-label").attr("height",g.getHeight()/h-8).attr("width",g.getWidth()).attr("y",12*c+4).attr("fill",function(b){b=g.IOBoxInputPin().getValue(c);var f=[0,0,0,0];if(b)for(var a=0;a<b.rgba.length;a++)f[a]=parseInt(256*b.rgba[a]);return"rgba("+f.join(",")+")"})};VVVV.PinTypes.Color.openInputBox=function(b,g,h,c){function d(a){e=a.altKey&&a.shiftKey?3:a.altKey?1:a.shiftKey?2:0}function f(b){n[e]+=.01*b;0!=e&&(n[e]=Math.min(1,Math.max(0,n[e])));
a();$inputbox.find("input[type='range']").each(function(a){k(this).val(n[a])})}function a(){l.setHSV(n[0],n[1],n[2]);l.rgba[3]=n[3];$inputbox.css("background-color","rgba("+_(l.rgba).map(function(a){return parseInt(255*a)}).join(",")+")");ibx=$inputbox;h.setValue(c,l);var a=_(h.values).map(function(a){return"|"+a.toString()+"|"});a.length=h.getSliceCount();h.node.parentPatch.editor.update(h.node.parentPatch,"<PATCH><NODE id='"+h.node.id+"'><PIN pinname='"+h.pinname+"' values='"+a.join(",")+"'/></NODE>")}
var e=0;k(b.window.document).keydown(d).keyup(d);$inputbox=k('<div class="pininputbox color resettable"></div>');$inputbox.css("position",g.css("position"));$inputbox.css("width","120px");$inputbox.css("height","66px");$inputbox.css("left",g.css("left"));$inputbox.css("top",g.offset().top-60+"px");var l=h.getValue(c);b=[];for(var r=0;r<l.rgba.length;r++)b[r]=parseInt(256*l.rgba[r]);b[3]=255;$inputbox.css("background-color","rgba("+b.join(",")+")");g.replaceWith($inputbox);var n=l.getHSV();n[3]=l.rgba[3];
for(r=0;4>r;r++)$slider=k('<input type="range" name="hsv[]" min="0" max="1" step="0.001" value="'+n[r]+'"/>'),$inputbox.append('<span class="color-component">'+"HSVA"[r]+":</div>"),$inputbox.append($slider),function(b){$slider.on("input",function(){n[b]=parseFloat(k(this).val());a()})}(r);$inputbox.on("mousewheel",function(a){f(a.originalEvent.wheelDelta/120);a.preventDefault();return!1});$inputbox.bind("DOMMouseScroll",function(a){f(-a.originalEvent.detail/3);a.preventDefault();return!1})};VVVV.Editors.BrowserEditor=
{};VVVV.Editors.BrowserEditor.PatchWindow=function(b,g,h){function c(){a.selectAll(".vvvv-node.selected").attr("class",function(a){return a.isIOBox?"vvvv-node vvvv-iobox":"vvvv-node"});p=[]}var d=this.state=0,f=0,a,e,l,r,n,q=void 0,p=[],m=0,x=location.protocol+"//"+location.host+("/"==VVVV.Root[0]?"":location.pathname.replace(/\/[^\/]*$/,"")+"/")+VVVV.Root+"/patch.html",v=!1,z=0,w=0,y=0,u=0;this.window=h?window:window.open(x,b.nodename,"location=no, width="+b.windowWidth+", height="+b.windowHeight+
", toolbar=no");var A=this;window.setTimeout(function(){for(var l=0;l<b.nodeList.length;l++)m=Math.max(m,b.nodeList[l].id);h?root=d3.select(k(h).get(0)):(A.window.document.title=b.nodename,root=d3.select(A.window.document.body));if(!h){k("body",A.window.document).on("copy",function(a){for(var b=k("<PATCH>"),c=[],d=_(p).map(function(a){return a.id}),e=0;e<p.length;e++)b.append(p[e].serialize()),_(p[e].inputPins).each(function(a){for(var b=0;b<a.links.length;b++)0<=d.indexOf(a.links[b].fromPin.node.id)&&
c.push(a.links[b])});for(e=0;e<c.length;e++)b.append(c[e].serialize());b='<!DOCTYPE PATCH SYSTEM "http://vvvv.org/versions/vvvv45beta28.1.dtd" >\r\n'+b.wrapAll("<d></d>").parent().html();b=b.replace(/<patch/g,"<PATCH");b=b.replace(/<\/patch>/g,"\n </PATCH>");b=b.replace(/<node/g,"\n <NODE");b=b.replace(/<\/node>/g,"\n </NODE>");b=b.replace(/<bounds/g,"\n <BOUNDS");b=b.replace(/<\/bounds>/g,"\n </BOUNDS>");b=b.replace(/<pin/g,"\n <PIN");b=b.replace(/<\/pin>/g,"\n </PIN>");b=b.replace(/<lonk/g,
"\n <LINK");b=b.replace(/<\/lonk>/g,"\n </LINK>");a.originalEvent.clipboardData.setData("text/plain",b);a.preventDefault();return!1});var n=0,r=0;k("body",A.window.document).mousemove(function(a){n=a.pageX;r=a.pageY});k("body",A.window.document).on("paste",function(d){d=d.originalEvent.clipboardData.getData("text/plain");if(!d.match(/^<!DOCTYPE PATCH/))return!1;$patch=k(d);var e=void 0,f=void 0;$patch.find("node bounds").each(function(){var a=parseInt(k(this).attr("left")),b=parseInt(k(this).attr("top"));
if(!e||a<e)e=a;if(!f||b<f)f=b});var h={};$patch.find("node").each(function(){m++;h[k(this).attr("id")]=m;k(this).attr("createme","pronto");k(this).attr("id",m);var a=parseInt(k(this).find("bounds").attr("left"))-e+15*n,b=parseInt(k(this).find("bounds").attr("top"))-f+15*r;k(this).find("bounds").attr("left",a);k(this).find("bounds").attr("top",b)});$patch.find("link").each(function(){k(this).attr("createme","pronto");var a=k(this).attr("srcnodeid"),b=k(this).attr("dstnodeid");k(this).attr("srcnodeid",
h[a]);k(this).attr("dstnodeid",h[b])});d=$patch.wrapAll("<d></d>").parent().html();g.update(b,d);c();var l=_(h).map(function(a){return a});a.selectAll(".vvvv-node").each(function(a){0<=l.indexOf(parseInt(a.id))&&(p.push(a),d3.select(this).attr("class","vvvv-node selected"))})})}a=root.append("svg:svg").attr("class","chart").attr("width",Math.max(b.windowWidth,b.boundingBox.width)).attr("height",Math.max(b.windowHeight,b.boundingBox.height));l=a.append("svg:rect").attr("class","background").attr("width",
Math.max(b.windowWidth,b.boundingBox.width)).attr("height",Math.max(b.windowHeight,b.boundingBox.height));if(!h){var x=function(a){v=a.shiftKey};a.on("mousemove",function(){if(1==A.state)a.select(".vvvv-link.current-link").attr("x2",function(a){return d3.event.pageX+(d3.select(this).attr("x1")<d3.event.pageX?-1:1)}).attr("y2",function(a){return d3.event.pageY+(d3.select(this).attr("y1")<d3.event.pageY?-1:1)});else if(2==A.state){var b=d3.event.pageX-d,e=d3.event.pageY-f;a.selectAll(".vvvv-node.selected").attr("transform",
function(a){return"translate("+(a.x+b)+","+(a.y+e)+")"});for(var g=0;g<p.length;g++){var h=p[g];a.selectAll(".vvvv-link line").filter(function(a){return a.fromPin.node.id==h.id}).attr("x1",function(a){return a.fromPin.x+a.fromPin.node.x+b}).attr("y1",function(a){return a.fromPin.y+a.fromPin.node.y+e});a.selectAll(".vvvv-link line").filter(function(a){return a.toPin.node.id==h.id}).attr("x2",function(a){return a.toPin.x+a.toPin.node.x+b}).attr("y2",function(a){return a.toPin.y+a.toPin.node.y+e})}}else 5==
A.state&&(y=d3.event.pageX,u=d3.event.pageY,a.select(".selection-area").attr("transform","translate("+Math.min(z,y)+", "+Math.min(w,u)+")").attr("width",Math.abs(y-z)).attr("height",Math.abs(u-w)),c(),a.selectAll(".vvvv-node").each(function(a){for(var b=[a.x,a.x+a.getWidth()],c=[a.y,a.y+a.getHeight()],d=!1,e=0;2>e;e++)for(var f=0;2>f;f++)b[e]>=Math.min(z,y)&&b[e]<=Math.max(z,y)&&c[f]>=Math.min(w,u)&&c[f]<=Math.max(w,u)&&(d=!0);d&&(d3.select(this).attr("class","vvvv-node selected"),p.push(a))}))}).on("contextmenu",
function(){1==A.state&&(a.select(".vvvv-link.current-link").remove(),k(".resettable",A.window.document).remove(),a.selectAll(".vvvv-input-pin rect, .vvvv-output-pin rect").attr("width",4).attr("height",4).attr("x",0).attr("y",0).attr("class",""),A.state=0);d3.event.stopPropagation();d3.event.preventDefault();return!1}).on("mouseup",function(){if(2==A.state){A.state=0;for(var c=d3.event.pageX-d,e=d3.event.pageY-f,h="<PATCH>",k=0;k<p.length;k++)var l=p[k],h=h+("<NODE componentmode='Node' id='"+l.id+
"'><BOUNDS type='Node' left='"+15*(c+l.x)+"' top='"+15*(e+l.y)+"' width='"+l.width+"' height='"+l.height+"'/></NODE>");g.update(b,h+"</PATCH>")}5==A.state&&(a.select(".selection-area").remove(),A.state=0)}).on("dblclick",function(){function c(a){l.empty();var b=h.find("#node_filter").val().toLowerCase();""!=b&&k(".makro",A.window.document).remove();a=VVVV.NodeNames.concat(_(VVVV.ShaderCodeResources).map(function(a,b){return b.replace("%VVVV%/effects/","")}));a=_(_(a).filter(function(a){return 0<=
VVVV.Helpers.translateOperators(a).toLowerCase().indexOf(b)})).sortBy(function(a){return a.toLowerCase().indexOf(b)});for(var d=0;d<a.length;d++)l.append(k("<option>"+a[d]+"</option>"));l.find("option").first().attr("selected",!0)}function d(){var a=h.find("#node_filter").val(),c=h.find("#new_node option:selected").val(),l="";c||!a.match(/\.fx$/)&&!a.match(/\.v4p$/)||(c=a);if(c){var n;(n=c.match(/^(.*\/([^\.]+))(\.vvvvjs)?\.fx$/))?(c=n[2]+" (EX9.Effect)",l=n[1]+".fx"):(n=c.match("([^.]+)(.vvvvjs)?.fx$"))?
(c=n[1]+" (EX9.Effect)",l="%VVVV%/effects/"+n[1]+".fx"):c.match("[^/].v4p$")&&(l=c=a);m++;c="<PATCH>"+("<NODE componentmode='Hidden' id='"+m+"' nodename='"+c+"' systemname='"+c+"' "+(""!=l?"filename='"+l+"'":"")+">");c+="<BOUNDS type='Node' left='"+15*e+"' top='"+15*f+"' width='100' height='100'/>"}else m++,c="<PATCH>"+("<NODE componentmode='Hidden' id='"+m+"' nodename='IOBox (String)' systemname='IOBox (String)'>"),c+="<BOUNDS type='Node' left='"+15*e+"' top='"+15*f+"' width='100' height='100'/>",
c+="<PIN pinname='Input String' values='|"+a+"|'/>";g.update(b,c+"</NODE>");h.remove();k(".makro",A.window.document).remove()}k("#node_selection",A.window.document).remove();var e=d3.event.pageX,f=d3.event.pageY,h=k('<div id="node_selection"><input type="text" id="node_filter"/></div>'),l=k('<select id="new_node" size="8">');h.append(l);h.css("left",e);h.css("top",f);k("body",A.window.document).append(h);h.find("input").bind("paste",function(a){a.stopPropagation()});h.find("#node_filter").get(0).focus();
c();h.find("#node_filter").keyup(function(a){if(13==a.which)d();else{if(40==a.which)return l.find("option:selected").first().next().attr("selected",!0),!1;if(38==a.which)return l.find("option:selected").first().prev().attr("selected",!0),!1;c()}});h.find("#new_node").click(d);var n=a.selectAll("g.makro").data(VVVV.Makros).enter().append("svg:g").attr("class","makro resettable").attr("transform",function(a,b){return"translate("+(e-85-b%2*85)+", "+(f+25*Math.floor(b/2))+")"}).on("click",function(a){a=
a.command.replace("{left}",15*e).replace("{top}",15*f).replace("{id}",++m);g.update(b,a);h.remove();k(".makro",A.window.document).remove()});n.append("svg:rect").attr("width",80).attr("height",20).attr("fill","#AAA");n.append("svg:text").text(function(a){return a.name}).attr("text-anchor","middle").attr("fill","#333").attr("font-size",10).attr("font-family","Lucida Sans Unicode").attr("dy",12).attr("dx",40)}).on("mousedown",function(){0==A.state&&1==d3.event.which&&(A.state=5,z=y=d3.event.pageX+1,
w=u=d3.event.pageY+1,a.append("svg:rect").attr("class","selection-area").attr("stroke","#000").attr("stroke-dasharray","2,2").attr("stroke-width",1).attr("fill","rgba(0,0,0,0)").attr("transform","translate("+z+", "+w+")").attr("width",0).attr("height",0),c())});l.on("click",function(){A.state=0;k(".resettable",A.window.document).remove();a.selectAll(".vvvv-input-pin rect, .vvvv-output-pin rect").attr("width",4).attr("height",4).attr("x",0).attr("y",0).attr("class","");k("#node_selection",A.window.document).remove();
c();q=void 0});k(A.window.document).keydown(x);k(A.window.document).keyup(x);k(A.window.document).keydown(function(d){if(46==d.which&&0<p.length){var e="<PATCH>";for(d=0;d<p.length;d++){var f=p[d],e=e+("<NODE id='"+p[d].id+"' deleteme='pronto'/>");_(f.inputPins).each(function(a){_(a.links).each(function(a){e+="<LINK deleteme='pronto' srcnodeid='"+a.fromPin.node.id+"' srcpinname='"+a.fromPin.pinname+"' dstnodeid='"+a.toPin.node.id+"' dstpinname='"+a.toPin.pinname+"'/>"})});_(f.outputPins).each(function(a){_(a.links).each(function(a){e+=
"<LINK deleteme='pronto' srcnodeid='"+a.fromPin.node.id+"' srcpinname='"+a.fromPin.pinname+"' dstnodeid='"+a.toPin.node.id+"' dstpinname='"+a.toPin.pinname+"'/>"})})}e+="</PATCH>";g.update(b,e);p=[]}else if(115!=d.which&&83!=d.which||!d.ctrlKey){if(73==d.which&&d.ctrlKey)return g.inspector?g.inspector.win.focus():g.openInspector("."),d.preventDefault(),!1;if(65==d.which&&d.ctrlKey)return c(),a.selectAll(".vvvv-node").each(function(a){p.push(a);d3.select(this).attr("class","vvvv-node selected")}),
d.preventDefault(),!1}else return g.save(b.nodename,b.toXML()),d.preventDefault(),!1});k(A.window).resize(function(){b.windowWidth=k(this).width();b.windowHeight=k(this).height();b.boundingBox.width=Math.max(b.windowWidth,b.boundingBox.width);b.boundingBox.height=Math.max(b.windowHeight,b.boundingBox.height);b.afterUpdate()})}A.drawComplete();b.afterUpdate=function(){A.drawComplete();g.inspector&&window.setTimeout(g.inspector.update,100)};b.afterEvaluate=function(){e.filter(function(a){return a.isIOBox&&
VVVV.PinTypes[a.IOBoxInputPin().typeName].makeLabel}).each(function(a){VVVV.PinTypes[a.IOBoxInputPin().typeName].makeLabel(this,a)})}},1E3);this.close=function(){this.window.close()};this.drawComplete=function(){e&&e.remove();n&&n.remove();h||b.windowWidth==k(A.window).width()&&b.windowHeight==k(A.window).height()||A.window.resizeTo(b.windowWidth,b.windowHeight);a.attr("width",Math.max(b.windowWidth,b.boundingBox.width)).attr("height",Math.max(b.windowHeight,b.boundingBox.height));a.selectAll(".background").attr("width",
Math.max(b.windowWidth,b.boundingBox.width)).attr("height",Math.max(b.windowHeight,b.boundingBox.height));var m=a.append("svg:g").attr("class","link-group");e=a.selectAll("g.vvvv-node").data(b.nodeList).enter().append("svg:g").attr("class",function(a){var b="vvvv-node";a.isIOBox&&(b+=" vvvv-iobox");0<=p.indexOf(a)&&(b+=" selected");return b}).attr("id",function(a){return"vvvv-node-"+a.id}).attr("transform",function(a){return"translate("+a.x+","+a.y+")"});e.append("svg:rect").attr("class","vvvv-node-background").attr("height",
function(a){return a.getHeight()}).attr("width",function(a){return a.getWidth()}).attr("fill",function(a){return a.isComment()?"rgba(0,0,0,0)":a.not_implemented?"rgba(255,0,0,1)":"#cdcdcd"});e.append("svg:rect").attr("class","vvvv-node-pinbar").attr("height",function(a){return a.isIOBox?2:4}).attr("fill",function(a){return a.isIOBox?"#dddddd":"#9a9a9a"}).attr("width",function(a){return a.getWidth()});e.append("svg:rect").attr("class","vvvv-node-pinbar").attr("y",function(a){return a.isIOBox?a.getHeight()-
2:a.getHeight()-4}).attr("height",function(a){return a.isIOBox?2:4}).attr("fill",function(a){return a.isIOBox?"#dddddd":"#9a9a9a"}).attr("width",function(a){return a.getWidth()});e.append("svg:g").attr("class","descriptive-name-bg");e.append("svg:text").text(function(a){return a.invisiblePins["Descriptive Name"]?a.invisiblePins["Descriptive Name"].getValue(0):null}).attr("class","vvvv-node-descriptive-name").attr("shape-rendering","crispEdges").attr("dy",function(a){return a.getHeight()+12}).attr("dx",
2).attr("font-size",10).attr("font-family","Lucida Sans Unicode").attr("fill","white");e.append("svg:text").text(function(a){return a.invisiblePins["Node Name"]&&"DefineNode (System)"==a.nodename?a.invisiblePins["Node Name"].getValue(0):null}).attr("class","vvvv-node-descriptive-name").attr("shape-rendering","crispEdges").attr("dy",function(a){return a.getHeight()+12}).attr("dx",2).attr("font-size",10).attr("font-family","Lucida Sans Unicode").attr("fill","blue");e.selectAll("g.descriptive-name-bg").append("svg:rect").attr("fill",
function(a){return void 0==a.invisiblePins["Descriptive Name"]||""==a.invisiblePins["Descriptive Name"].getValue(0)?"rgba(0,0,0,0)":"rgba(0,0,0,1)"}).attr("y",function(a){return a.getHeight()}).attr("width",5).attr("height",14);e.each(function(a){if(a.isIOBox&&VVVV.PinTypes[a.IOBoxInputPin().typeName].makeLabel){VVVV.PinTypes[a.IOBoxInputPin().typeName].makeLabel(this,a);for(var b=a.IOBoxRows(),c=a.IOBoxInputPin().getSliceCount(),d=this,e=0;e<b;e++)(function(e){var f=d3.select(d).append("svg:rect").attr("width",
a.getWidth()+2).attr("height",a.getHeight()/b-4).attr("y",12*e+2).attr("fill","rgba(0,0,0,0)");if(!h)f.on("contextmenu",function(a){if(void 0!=a.IOBoxInputPin().getValue(0)&&!a.IOBoxInputPin().isConnected()){k(".resettable",A.window.document).remove();var d=k("<input type='text'/>");k("body",A.window.document).append(d);d.css("position","absolute");d.css("left",k(this).offset().left);d.css("top",k(this).offset().top+2);d.css("width",a.getWidth());d.css("height",a.getHeight()/b-4);VVVV.PinTypes[a.IOBoxInputPin().typeName].openInputBox(A.window,
d,a.IOBoxInputPin(),e%c)}d3.event.stopPropagation();d3.event.preventDefault();return!1})})(e)}else d3.select(this).append("svg:text").text(function(a){return a.label()}).attr("class","vvvv-node-label").attr("shape-rendering","crispEdges").attr("dy",function(a,b){return 12*b+12}).attr("dx",4).attr("font-size",10).attr("font-family","Lucida Sans Unicode")});l=e.selectAll("g.vvvv-input-pin").data(function(a){return a.isSubpatch?_(a.inputPins).sortBy(function(a){return a.slavePin?a.slavePin.node.x:1}).map(function(a,
b){return a}):_(a.inputPins).map(function(a,b){return a})}).enter().append("svg:g").attr("class","vvvv-input-pin").attr("transform",function(a,b){pinOffset=0;1<_(a.node.inputPins).size()&&(pinOffset=(a.node.getWidth()-4)/(_(a.node.inputPins).size()-1));a.y=0;a.x=b*pinOffset;return"translate("+a.x+", 0)"});l.append("svg:rect").attr("width",4).attr("height",4).attr("fill",function(a){return a.node.isComment()?"rgba(0,0,0,0)":"#666666"}).on("mouseover",function(b,c){a.selectAll("#vvvv-node-"+b.node.id+
" g.vvvv-input-pin").filter(function(a,b){return b==c}).each(function(){d3.select(this).append("svg:rect").attr("class","vvvv-input-pin-highlight").attr("width",4).attr("height",4).attr("fill","rgba(0,0,0,1)").attr("y",-4);d3.select(this).append("svg:text").text(function(a){return 1<a.getSliceCount()?a.pinname+"("+a.getSliceCount()+"): "+a.getValue(0):a.pinname+": "+a.getValue(0)}).attr("dy",30).attr("font-size",10).attr("font-family","Lucida Sans Unicode").attr("fill","rgba(0,0,0,1)")})}).on("mouseout",
function(b,c){a.selectAll("#vvvv-node-"+b.node.id+" g.vvvv-input-pin text").remove();a.selectAll("#vvvv-node-"+b.node.id+" g.vvvv-input-pin rect.vvvv-input-pin-highlight").remove()});r=e.selectAll("g.vvvv-output-pin").data(function(a){return _(a.outputPins).map(function(a,b){return a})}).enter().append("svg:g").attr("class","vvvv-output-pin").attr("transform",function(a,b){pinOffset=0;1<_(a.node.outputPins).size()&&(pinOffset=(a.node.getWidth()-4)/(_(a.node.outputPins).size()-1));a.y=a.node.getHeight()-
4;a.x=b*pinOffset;return"translate("+a.x+", "+a.y+")"});r.append("svg:rect").attr("width",4).attr("height",4).attr("fill",function(a){return a.node.isComment()?"rgba(0,0,0,0)":"#666666"}).on("mouseover",function(b,c){a.selectAll("#vvvv-node-"+b.node.id+" g.vvvv-output-pin").filter(function(a,b){return b==c}).each(function(){d3.select(this).append("svg:rect").attr("class","vvvv-output-pin-highlight").attr("width",4).attr("height",4).attr("fill","rgba(0,0,0,1)").attr("y",-4);b.values.code&&(new Function("patch",
b.generateStaticCode(!1)))(b.node.parentPatch);d3.select(this).append("svg:text").text(function(a){return 1<a.getSliceCount()?a.pinname+"("+a.getSliceCount()+"): "+a.getValue(0):a.pinname+": "+a.getValue(0)}).attr("dy",30).attr("font-size",10).attr("font-family","Lucida Sans Unicode").attr("fill","rgba(0,0,0,1)")})}).on("mouseout",function(b,c){a.selectAll("#vvvv-node-"+b.node.id+" g.vvvv-output-pin text").remove();a.selectAll("#vvvv-node-"+b.node.id+" g.vvvv-output-pin rect.vvvv-output-pin-highlight").remove()});
n=m.selectAll("g.vvvv-link").data(b.linkList).enter().append("svg:g").attr("class","vvvv-link");n.append("svg:line").attr("stroke","rgba(0, 0, 0, 0)").attr("stroke-width",4).attr("x1",function(a){return a.fromPin.x+a.fromPin.node.x+2+.5}).attr("y1",function(a){return a.fromPin.y+a.fromPin.node.y+4+.5}).attr("x2",function(a){return a.toPin.x+a.toPin.node.x+2+.5}).attr("y2",function(a){return a.toPin.y+a.toPin.node.y+.5});n.append("svg:line").attr("stroke","#000").attr("stroke-width",1).attr("x1",function(a){return a.fromPin.x+
a.fromPin.node.x+2+.5}).attr("y1",function(a){return a.fromPin.y+a.fromPin.node.y+4+.5}).attr("x2",function(a){return a.toPin.x+a.toPin.node.x+2+.5}).attr("y2",function(a){return a.toPin.y+a.toPin.node.y+.5});k(".descriptive-name-bg rect",A.window.document).each(function(){k(this,A.window.document).attr("width",k(this,A.window.document).parent().next().get(0).getBBox().width+4)});h||(a.selectAll("g.vvvv-input-pin").on("contextmenu",function(a,b){if(VVVV.PinTypes[a.typeName].openInputBox&&void 0!=
a.getValue(0)&&!a.isConnected()){k(".resettable",A.window.document).remove();var c=k("<input type='text'/>");k("body",A.window.document).append(c);c.css("position","absolute");c.css("left",k(this).offset().left);c.css("top",k(this).offset().top-3);c.css("width",50);c.css("height",14);VVVV.PinTypes[a.typeName].openInputBox(A,c,a,0)}d3.event.stopPropagation();d3.event.preventDefault();return!1}),a.selectAll("g.vvvv-input-pin, g.vvvv-output-pin").on("click",function(c,d){if(1!=A.state){var e=function(a){a=
a.getUpstreamNodes();for(var b=0;b<a.length;b++)a[b]==q.node||a[b].delays_output||(h.push(a[b]),e(a[b]));return!1};q=c;A.state=1;a.append("svg:line").attr("class","vvvv-link current-link resettable").attr("stroke","#000").attr("stroke-width",1).attr("x1",c.x+c.node.x+2+.5).attr("y1",c.y+c.node.y+2+.5).attr("x2",c.x+c.node.x+2+.5).attr("y2",c.y+c.node.y+2+.5);var f=q.direction==VVVV.PinDirection.Output?"input":"output",h=[];q.node.delays_output||e(q.node);a.selectAll("g.vvvv-"+f+"-pin rect").filter(function(a){return a.typeName!=
q.typeName&&("Node"!=q.typeName||VVVV.PinTypes[a.typeName].primitive)&&("Node"!=a.typeName||VVVV.PinTypes[q.typeName].privimive)||0<=h.indexOf(a.node)||a.node==q.node?!1:!0}).attr("width",6).attr("height",6).attr("x",-1).attr("y",function(a){return a.direction==VVVV.PinDirection.Input?-2:0}).attr("class","vvvv-connection-highlight")}else{if(q.direction==VVVV.PinDirection.Input)var f=c,l=q;else f=q,l=c;if(1==k(this).find(".vvvv-connection-highlight").length){var m="<PATCH>";_(l.links).each(function(a){m+=
"<LINK deleteme='pronto' srcnodeid='"+a.fromPin.node.id+"' srcpinname='"+a.fromPin.pinname+"' dstnodeid='"+a.toPin.node.id+"' dstpinname='"+a.toPin.pinname+"'/>"});m+="<LINK createme='pronto' srcnodeid='"+f.node.id+"' srcpinname='"+f.pinname+"' dstnodeid='"+l.node.id+"' dstpinname='"+l.pinname+"'/>";m+="</PATCH>";g.update(b,m);a.select(".vvvv-link.current-link").remove();a.select(".vvvv-connection-highlight").remove();A.state=0;b.afterUpdate()}}d3.event.stopPropagation()}).on("mousedown",function(){d3.event.stopPropagation()}),
a.selectAll("g.vvvv-link").on("contextmenu",function(a){0==A.state&&g.update(b,"<PATCH><LINK deleteme='pronto' srcnodeid='"+a.fromPin.node.id+"' srcpinname='"+a.fromPin.pinname+"' dstnodeid='"+a.toPin.node.id+"' dstpinname='"+a.toPin.pinname+"'/></PATCH>");d3.event.preventDefault()}),e.on("mousedown",function(a){k(".resettable",A.window.document).remove();A.state=2;0>p.indexOf(a)&&(v||c(),d3.select(this).attr("class","vvvv-node selected"),p.push(a));d=d3.event.pageX;f=d3.event.pageY;g.inspector&&
g.inspector.setNode(a);d3.event.preventDefault();d3.event.stopPropagation();return!1}).on("contextmenu",function(a){a.isSubpatch?g.openPatch(a):a.openUIWindow&&a.openUIWindow();d3.event.preventDefault();d3.event.stopPropagation();return!1}))}};VVVV.Editors.BrowserEditor.Inspector=function(b){function g(){f=void 0;k(a.win.document).find("#pins, #values").empty();k(a.win.document).find("#pins").append('<div class="row heading">Configuration</div>');k(a.win.document).find("#values").append('<div class="row heading"></div>');
_(d.invisiblePins).each(function(a){h(a)});k(a.win.document).find("#pins").append('<div class="row heading">Input Pins</div>');k(a.win.document).find("#values").append('<div class="row heading"></div>');_(d.inputPins).each(function(a){h(a)});k(a.win.document).find("#pins").append('<div class="row heading">Output Pins</div>');k(a.win.document).find("#values").append('<div class="row heading"></div>');_(d.outputPins).each(function(a){h(a)})}function h(b){var d=k('<a class="row pin" href="#">'+b.pinname+
"</a>");k(a.win.document).find("#pins").append(d);d.click(function(d){k(a.win.document).find("a.pin.active").removeClass("active");k(this).addClass("active");VVVV.PinTypes[b.typeName].openInputBox&&c(b);d.preventDefault();return!1});VVVV.PinTypes[b.typeName].openInputBox&&b.direction!=VVVV.PinDirection.Output&&!b.isConnected()&&void 0!=b.getValue(0)?(d=k('<div class="row value"><div style="height:100%">'+b.getValue(0).toString().replace(/</g,"<").replace(/>/g,">")+"</div></div>"),d.find("div").click(function(){VVVV.PinTypes[b.typeName].openInputBox(a.win,
k(this),b,0)})):d=k('<div class="row value readonlyvalue"><div style="height:100%">'+(void 0==b.getValue(0)?"undefined":b.getValue(0).toString().replace(/</g,"<").replace(/>/g,">"))+"</div></div>");"Color"==b.typeName&&d.find("div").css("background-color","rgba("+_(b.getValue(0).rgba).map(function(a){return parseInt(255*a)}).join(",")+")");k(a.win.document).find("#values").append(d)}function c(b){var c=f!=b;f=b;var d=b.getSliceCount(),g=k('<div class="row heading"><input type="text" value="'+
d+'"/ size="3"/> Slices</div>');b.direction!=VVVV.PinDirection.Input&&g.find("input").attr("disabled",!0);var h=k(a.win.document).find("#values .row").first();0<h.length?h.replaceWith(g):k(a.win.document).find("#values").append(g);g.find("input").change(function(a){for(var b=Math.max(1,parseInt(k(this).val())),c=f.getSliceCount();c<b;c++)f.setValue(c,VVVV.PinTypes[f.typeName].defaultValue());f.setSliceCount(b);f.node.parentPatch.afterUpdate();a.preventDefault();return!1});for(g=g=0;g<d;g++)if(h=k(a.win.document).find("#values .row").eq(g+
1),c||!h.children().first().hasClass("pininputbox")){if(VVVV.PinTypes[b.typeName].openInputBox&&b.direction!=VVVV.PinDirection.Output&&!b.isConnected()&&void 0!=b.getValue(0)){var p=k('<div class="row value"><div style="height:100%">'+b.getValue(g).toString().replace(/</g,"<").replace(/>/g,">")+"</div></div>");(function(c){p.find("div").click(function(){VVVV.PinTypes[b.typeName].openInputBox(a.win,k(this),b,c)})})(g)}else p=k('<div class="row value readonlyvalue"><div style="height:100%">'+
b.getValue(g).toString().replace(/</g,"<").replace(/>/g,">")+"</div></div>");0<h.length?h.replaceWith(p):k(a.win.document).find("#values").append(p);"Color"==b.typeName&&p.find("div").css("background-color","rgba("+_(b.getValue(g).rgba).map(function(a){return parseInt(255*a)}).join(",")+")")}g++;for(h=k(a.win.document).find("#values .row");g<h.length;g++)h.eq(g).remove()}this.win=window.open(location.protocol+"//"+location.host+("/"==VVVV.Root[0]?"":location.pathname.replace(/\/[^\/]*$/,"")+
"/")+VVVV.Root+"/inspektor.html","inspektor","location=no, width=250, height=600, toolbar=no");var d,f;insw=this.win;var a=this;this.update=function(){d&&(f?c(f):g())};this.setNode=function(a){d=a;g()};this.close=function(){this.win.close()}};VVVV.Editors.BrowserEditor.Interface=function(){function b(){return"Are you sure you want to leave? Unsaved changes in your patches will be lost."}var g=[],h={};this.inspector=void 0;this.enable=function(c,f){f=f||{};this.addPatch(c);this.openPatch(c,f.selector);
if(!f.selector){var a=this;k(window).bind("beforeunload",b);k(window).unload(function(){a.disable()});this.openInspector(VVVV.Root);g[0].window?f&&f.success&&f.success():f&&f.error&&f.error()}};this.openInspector=function(b,c){if(!this.inspector){this.inspector=new VVVV.Editors.BrowserEditor.Inspector(b);var a=this;k(this.inspector.win).bind("beforeunload",function(){console.log("closing inspektor");a.inspector=void 0})}};var c=[];this.addPatch=function(b){for(var f=b.id,a=b;void 0!=(a=a.parentPatch);)f+=
"-"+a.id;if(!(0<=c.indexOf(f)))for(c.push(f),b.editor=this,f=VVVV.Helpers.prepareFilePath(b.nodename,b.parentPatch),void 0==h[f]&&(h[f]=[]),h[f].push(b),b=b.getSubPatches(),f=0;f<b.length;f++)this.addPatch(b[f])};this.removePatch=function(b){for(var c=b.getSubPatches(),a=0;a<c.length;a++)this.removePatch(c[a]);c=VVVV.Helpers.prepareFilePath(b.nodename,b.parentPatch);h[c].splice(h[c].indexOf(b),1);0==h[c].length&&delete h[c];console.log(h)};this.openPatch=function(b,c){g.push(new VVVV.Editors.BrowserEditor.PatchWindow(b,
this,c))};this.update=function(b,c){for(var a=VVVV.Helpers.prepareFilePath(b.nodename,b.parentPatch),e=h[a].length,g=0;g<e;g++)h[a][g].doLoad(c),h[a][g].afterUpdate()};this.disable=function(){for(var c=0;c<g.length;c++)g[c].close();this.inspector&&this.inspector.close();k(window).unbind("beforeunload",b)};this.save=function(b,c){var a=k("<a>save</a>");k("body").append(a);a.attr("href","data:application/octet-stream;charset=utf-8,"+encodeURIComponent(c));a.attr("download",b.replace(/.*\//,""));a[0].click();
a.remove()};this.sendUndo=function(){}};VVVV.VVVViewer=function(b,g){(new VVVV.Editors.BrowserEditor.Interface).enable(b,{selector:g})};VVVV.Editors.edit=VVVV.Editors.BrowserEditor.Interface})(vvvvjs_jquery);VVVV.Themes=VVVV.Themes||{};
VVVV.Themes.Tron={scaleX:1.2,scaleY:1.8,categoryColors:{Value:"#78B4A8",Animation:"#51de3a","3d":"#78B4A8",Boolean:"#78B4A8",Complex:"#78B4A8","2d":"#78B4A8",Spreads:"#78B4A8",String:"#d54c70",EX9:"#d6bf00",Canvas:"#d6bf00",HTML5:"#d6bf00",Transform:"#ba4b36","default":"#AAAAAA"},chart:function(k){},background:function(k){k.attr("fill","#666666")},node:function(k){k.attr("x",-1).attr("width",function(b){return b.getWidth()*VVVV.Themes.Tron.scaleX+2}).attr("rx",1).attr("ry",1).attr("stroke","rgba(127, 190, 183, 1.0)").attr("stroke-width",
1).attr("fill",function(b){return b.isComment()?"rgba(0,0,0,0)":b.not_implemented?"rgba(255,0,0,1)":"rgba(127, 190, 183, 0.6)"})},inputPinBar:function(k){k.attr("height",2).attr("fill","rgba(0,0,0,0)")},outputPinBar:function(k){k.attr("y",function(b){return b.getHeight()*VVVV.Theme.scaleY-2}).attr("height",2).attr("fill","rgba(0,0,0,0)")},descriptiveNameText:function(k){k.attr("shape-rendering","crispEdges").attr("dy",function(b){return b.getHeight()*VVVV.Theme.scaleY+12}).attr("dx",2).attr("font-size",
10).attr("font-family","Lucida Sans Unicode").attr("fill","white")},descriptiveNameBackground:function(k){k.attr("fill",function(b){return void 0==b.invisiblePins["Descriptive Name"]||""==b.invisiblePins["Descriptive Name"].getValue(0)?"rgba(0,0,0,0)":"rgba(0,0,0,1)"}).attr("y",function(b){return b.getHeight()*VVVV.Theme.scaleY}).attr("width",5).attr("height",14)},nodeLabel:function(k){k.attr("fill","white").attr("shape-rendering","crispEdges").attr("dy",function(b,g){return 18*g+19}).attr("dx",4).attr("font-size",
11).attr("font-family","Lucida Sans Unicode")},inputPin:function(k){k.attr("y",-2.5).attr("x",.5).attr("width",4).attr("height",4).attr("fill",function(b){return b.node.isComment()?"rgba(0,0,0,0)":"white"}).attr("stroke","#666").attr("stroke-width",1)},inputPinHover:function(k){k.attr("width",4).attr("height",4).attr("fill","rgba(0,0,0,1)").attr("y",-6)},inputPinValue:function(k){k.attr("dy",30).attr("font-size",10).attr("font-family","Lucida Sans Unicode").attr("fill","rgba(1,1,1,1)")},outputPin:function(k){k.attr("y",
2.5).attr("x",.5).attr("width",4).attr("height",4).attr("fill",function(b){return b.node.isComment()?"rgba(0,0,0,0)":"white"}).attr("stroke","#666").attr("stroke-width",1)},outputPinHover:function(k){k.attr("width",4).attr("height",4).attr("fill","rgba(1,1,1,1)").attr("y",6)},outputPinValue:function(k){k.attr("dy",30).attr("font-size",10).attr("font-family","Lucida Sans Unicode").attr("fill","rgba(1,1,1,1)")},connectablePin:function(k){k.attr("width",4).attr("height",3).attr("fill","rgba(1,1,1,1)").attr("y",
function(b){return b.direction==PinDirection.Input?-3:3})},link:function(k){k.append("svg:path").attr("stroke","rgba(0, 0, 0, 0)").attr("fill","rgba(0,0,0,0)").attr("stroke-width",4).attr("d",function(b){var g=(b.toPin.node.y-b.fromPin.node.y-b.fromPin.node.getHeight())*VVVV.Theme.scaleY/5;0>g&&(g=30);return"M"+(b.fromPin.x+b.fromPin.node.x*VVVV.Theme.scaleX+2+.5)+","+(b.fromPin.y+b.fromPin.node.y*VVVV.Theme.scaleY+4+.5)+" C"+(b.fromPin.x+b.fromPin.node.x*VVVV.Theme.scaleX+2+.5)+","+(b.fromPin.y+
b.fromPin.node.y*VVVV.Theme.scaleY+4+g)+" "+(b.toPin.x+b.toPin.node.x*VVVV.Theme.scaleX+2+.5)+","+(b.toPin.y+b.toPin.node.y*VVVV.Theme.scaleY-g)+" "+(b.toPin.x+b.toPin.node.x*VVVV.Theme.scaleX+2+.5)+","+(b.toPin.y+b.toPin.node.y*VVVV.Theme.scaleY+.5)});k.append("svg:path").attr("stroke","#FFF").attr("fill","rgba(0,0,0,0)").attr("stroke-width",.5).attr("d",function(b){var g=(b.toPin.node.y-b.fromPin.node.y-b.fromPin.node.getHeight())*VVVV.Theme.scaleY/5;0>g&&(g=30);return"M"+(b.fromPin.x+b.fromPin.node.x*
VVVV.Theme.scaleX+2+.5)+","+(b.fromPin.y+b.fromPin.node.y*VVVV.Theme.scaleY+4+.5)+" C"+(b.fromPin.x+b.fromPin.node.x*VVVV.Theme.scaleX+2+.5)+","+(b.fromPin.y+b.fromPin.node.y*VVVV.Theme.scaleY+4+g)+" "+(b.toPin.x+b.toPin.node.x*VVVV.Theme.scaleX+2+.5)+","+(b.toPin.y+b.toPin.node.y*VVVV.Theme.scaleY-g)+" "+(b.toPin.x+b.toPin.node.x*VVVV.Theme.scaleX+2+.5)+","+(b.toPin.y+b.toPin.node.y*VVVV.Theme.scaleY+.5)})},currentLink:function(k){k.attr("stroke","#FFF").attr("stroke-width",1)}};VVVV.Theme=VVVV.Themes.Tron;