forked from zauner/vvvv.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvvvv.min.js
564 lines (564 loc) · 291 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
var VVVV_ENV="production",vvvvjs_jquery=$.noConflict();$=vvvvjs_jquery;
(function(h){h.ajaxPrefilter(function(b,g,d){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:{},onNotImplemented:function(b){console.log("Warning: "+b+" is not implemented.")},loadCounter:0,loadScript:function(b,g){var d=document.getElementsByTagName("head")[0],e=document.createElement("script");e.async=!1;e.src=VVVV.Root+"/"+b;g&&e.addEventListener("load",
g);VVVV.loadCounter++;d.appendChild(e)},init:function(b,g,d){function e(){var c=new VVVV.Core.Patch("");_(VVVV.Nodes).each(function(a){var k=new a(0,c);"development"==VVVV_ENV&&console.log("Registering "+k.nodename);VVVV.NodeLibrary[k.nodename.toLowerCase()]=a;VVVV.NodeNames.push(k.nodename)});"development"==VVVV_ENV&&console.log("done ...");VVVV.MainLoops=[];h("link[rel='VVVV'], script[language='VVVV']").each(function(a){var c="href";"SCRIPT"==h(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.'),
c="src");c=new VVVV.Core.Patch(h(this).attr(c),function(){var a=new VVVV.Core.MainLoop(this);VVVV.MainLoops.push(a)});VVVV.Patches[a]=c});"function"===typeof d&&d.call()}VVVV.Root=b||"./";"development"==VVVV_ENV&&console.log("loading vvvv.js ...");if("development"==VVVV_ENV){document.getElementsByTagName("head");var f=function(c){c.target.removeEventListener("load",f);0>=--VVVV.loadCounter&&e()};0==h("script[src*=thirdparty]").length&&VVVV.loadScript("thirdparty.js",f);0==h("script[src*=underscore]").length&&
VVVV.loadScript("lib/underscore/underscore-min.js",f);0!=h('script[src*="d3.js"]').length||"full"!=g&&"vvvviewer"!=g||VVVV.loadScript("lib/d3-v3/d3.v3.min.js",f);0!=h("script[src*=glMatrix]").length||"full"!=g&&"run"!=g||VVVV.loadScript("lib/glMatrix-0.9.5.min.js",f);if(0==h('script[src*="vvvv.core.js"]').length){VVVV.loadScript("core/vvvv.core.js",f);if("run"==g||"full"==g)VVVV.loadScript("mainloop/vvvv.mainloop.js",f),VVVV.loadScript("mainloop/vvvv.dominterface.js",f),VVVV.loadScript("types/vvvv.shared_types.js",
f),VVVV.loadScript("nodes/vvvv.nodes.value.js",f),VVVV.loadScript("nodes/vvvv.nodes.string.js",f),VVVV.loadScript("nodes/vvvv.nodes.boolean.js",f),VVVV.loadScript("nodes/vvvv.nodes.color.js",f),VVVV.loadScript("nodes/vvvv.nodes.spreads.js",f),VVVV.loadScript("nodes/vvvv.nodes.spectral.js",f),VVVV.loadScript("nodes/vvvv.nodes.animation.js",f),VVVV.loadScript("nodes/vvvv.nodes.network.js",f),VVVV.loadScript("nodes/vvvv.nodes.system.js",f),VVVV.loadScript("nodes/vvvv.nodes.canvas.js",f),VVVV.loadScript("nodes/vvvv.nodes.html5.js",
f),VVVV.loadScript("nodes/vvvv.nodes.transform.js",f),VVVV.loadScript("nodes/vvvv.nodes.vectors.js",f),VVVV.loadScript("nodes/vvvv.nodes.webgl.js",f),VVVV.loadScript("nodes/vvvv.nodes.complex.js",f),VVVV.loadScript("nodes/vvvv.nodes.enumerations.js",f),VVVV.loadScript("nodes/vvvv.nodes.2d.js",f),VVVV.loadScript("nodes/vvvv.nodes.3d.js",f),VVVV.loadScript("nodes/vvvv.nodes.node.js",f),VVVV.loadScript("nodes/vvvv.nodes.astronomy.js",f),VVVV.loadScript("nodes/vvvv.nodes.xml.js",f),VVVV.loadScript("nodes/vvvv.nodes.differential.js",
f);VVVV.loadScript("editors/vvvv.editors.browser_editor.js",f)}}"production"==VVVV_ENV&&e()}}})(vvvvjs_jquery);(function(h){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"},cloneValues:function(b){return b.data.values.slice()},increaseSize:function(b,g){}};VVVV.PinTypes.Value={typeName:"Value",reset_on_disconnect:!1,defaultValue:function(){return 0},primitive:!0,cloneValues:function(b){return new Float64Array(b.data.values)},increaseSize:function(b,
g){for(var d=new Float64Array(g+100),e=b.data.values.length;e--;)d[e]=b.data.values[e];b.data.values=d}};VVVV.PinTypes.String={typeName:"String",reset_on_disconnect:!1,defaultValue:function(){return""},primitive:!0,cloneValues:function(b){return b.data.values.slice()},increaseSize:function(b,g){}};VVVV.PinTypes.Enum={typeName:"Enum",reset_on_disconnect:!1,defaultValue:function(){return""},primitive:!0,cloneValues:function(b){return b.data.values.slice()},increaseSize:function(b,g){}};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,d,e){for(var f=g.length;f<d;f++)g[f]=e.call(b,f);for(f=d;f<g.length;f++)b.removeInputPin(g[f].pinname);g.length=d;b.parentPatch.afterUpdate()}};VVVV.Core={Pin:function(b,g,d,e,f){this.direction=g;this.pinname=b;this.links=[];this.data={values:[],changed:!0,sliceCount:0};this.node=e;this.reset_on_disconnect=this.active=!1;this.masterPin=this.slavePin=void 0;this.connectionChangedHandlers={};this.enumOptions=[];this.getValue=function(c,a){if(!a||1==a)return this.data.values[c%this.data.sliceCount];
for(var f=[],e=0;e<a;e++)f.push(this.data.values[(c*a+e)%this.data.sliceCount]);return f};this.setValue=function(c,a){this.direction!=VVVV.PinDirection.Output&&this.isConnected()||(c>this.data.values.length-1&&VVVV.PinTypes[this.typeName].increaseSize(this,c),this.data.values[c]=a,c>this.data.sliceCount-1&&(this.data.sliceCount=c+1),this.primitive&&this.data.values[c]==a||this.markPinAsChanged());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.data.changed=!0};this.pinIsChanged=function(){return this.data.changed};this.connect=function(c){this.data=c.data;if(this.direction==VVVV.PinDirection.Output){c=this.links.length;for(var a=0;a<c;a++)this.links[a].toPin.data=this.data}this.slavePin&&(this.slavePin.data=this.data);this.markPinAsChanged()};this.disconnect=function(){this.data=
"V"==this.typeName[0]?{values:new Float64Array(this.data.values),changed:!0,sliceCount:this.data.sliceCount}:{values:this.data.values.slice(0),changed:!0,sliceCount:this.data.sliceCount}};this.isConnected=function(){return 0<this.links.length||this.masterPin&&this.masterPin.isConnected()};this.getSliceCount=function(){return this.data.sliceCount};this.setSliceCount=function(c){this.data.sliceCount!=c&&(this.direction!=VVVV.PinDirection.Output&&this.isConnected()||(this.data.sliceCount=c),this.markPinAsChanged())};
this.setType=function(c){if(c.typeName!=this.typeName){var a=this;delete this.connectionChangedHandlers.nodepin;delete this.connectionChangedHandlers.webglresource;_(c.connectionChangedHandlers).each(function(f,k){a.connectionChangedHandlers[k]=c.connectionChangedHandlers[k]});this.typeName=c.typeName;this.defaultValue=c.defaultValue;this.direction==VVVV.PinDirection.Input&&(this.defaultValue&&!this.isConnected())&&(this.setValue(0,this.defaultValue()),this.setSliceCount(1));if("Value"==c.typeName){var f=
this.getSliceCount();this.data.values=new Float64Array(_(this.data.values).map(function(a){return parseFloat(a)}));this.setSliceCount(f)}void 0!=c.reset_on_disconnect&&(this.reset_on_disconnect=c.reset_on_disconnect)}};void 0==f&&(f=VVVV.PinTypes.Generic,this.unvalidated=!0);this.setType(f);if(d&&0<d.length)for(b=d.length;b--;)this.setValue(b,d[b]);this.reset=function(){this.data.values=[];this.slavePin&&(this.slavePin.data=this.data);this.defaultValue?(this.setValue(0,this.defaultValue()),this.setSliceCount(1)):
this.data={values:d.slice(0),changed:!0,sliceCount:d.length};this.markPinAsChanged()};this.connectionChanged=function(){var c=this;_(this.connectionChangedHandlers).each(function(a){c.f=a;c.f()})}},Node:function(b,g,d){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=d)&&(this.parentPatch.nodeMap[b]=this);this.addDefault=function(e,f){this.defaultPinValues[e]=f};this.addInputPin=function(e,f,c){c=c||VVVV.PinTypes.Generic;f=new VVVV.Core.Pin(e,VVVV.PinDirection.Input,f,this,c);this.inputPins[e]=f;this.parentPatch&&(this.parentPatch.pinMap[this.id+"_in_"+e]=f);this.applyPinValuesFromXML(e);return f};this.addOutputPin=function(e,f,c){c=c||VVVV.PinTypes.Generic;f=new VVVV.Core.Pin(e,VVVV.PinDirection.Output,f,
this,c);this.outputPins[e]=f;this.parentPatch&&(this.parentPatch.pinMap[this.id+"_out_"+e]=f);return f};this.removeInputPin=function(e){if(this.inputPins[e]){var f=this.inputPins[e].links[0];f&&(f.fromPin.connectionChanged(),f.destroy());delete this.inputPins[e];this.dirty=!0}};this.removeOutputPin=function(e){if(this.outputPins[e]){for(var f=this.outputPins[e].links.length,c=0;c<f;c++){var a=this.outputPins[e].links[c];a.toPin.connectionChanged();a.destroy()}delete this.outputPins[e];this.dirty=
!0}};this.addInvisiblePin=function(e,f,c){c=c||VVVV.PinTypes.Generic;f=new VVVV.Core.Pin(e,VVVV.PinDirection.Configuration,f,this,c);this.invisiblePins[e]=f;this.parentPatch.pinMap[this.id+"_inv_"+e]=f;void 0!=this.defaultPinValues[e]&&(f.data.values=this.defaultPinValues[e],f.data.changed=!0);return f};this.IOBoxType=function(){var e=/^IOBox \((.*)\)/.exec(this.nodename);return e&&1<e.length?e[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 e=this.nodename.replace(/\s\(.+\)/,"");return e=VVVV.Helpers.translateOperators(e)};this.getWidth=function(){var e;e=100==this.width||0==this.width?this.isIOBox?60:Math.max(18,6*(this.label().length+2)):this.width/15;return e=
Math.max(e,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 e=[];_(this.inputPins).each(function(f){0<f.links.length&&e.push(f.links[0].fromPin.node)});return e};this.getDownstreamNodes=function(){var e=[];_(this.outputPins).each(function(f){for(var c=0;c<f.links.length;c++)e.push(f.links[c].toPin.node)});return e};this.findDownstreamNodes=
function(e){var f=[];_(this.outputPins).each(function(c){for(var a=0;a<c.links.length;a++)c.links[a].toPin.node.nodename==e?f.push(c.links[a].toPin.node):f=c.links[a].toPin.slavePin?f.concat(c.links[a].toPin.slavePin.node.findDownstreamNodes(e)):c.links[a].toPin.node.isIOBox&&c.links[a].toPin.node.IOBoxOutputPin().slavePin?f.concat(c.links[a].toPin.node.IOBoxOutputPin().slavePin.node.findDownstreamNodes(e)):f.concat(c.links[a].toPin.node.findDownstreamNodes(e))});return f};this.hasNilInputs=function(){var e=
!1;_(this.inputPins).each(function(f){0==f.getSliceCount()&&(e=!0)});return e};this.isDirty=function(){if(this.dirty)return!0;for(var e in this.inputPins)if(this.inputPins[e].data.changed)return!0;for(e in this.invisiblePins)if(this.invisiblePins[e].data.changed)return!0;return!1};this.getMaxInputSliceCount=function(){var e=0,f;for(f in this.inputPins)this.inputPins[f].getSliceCount()>e&&(e=this.inputPins[f].data.sliceCount);return e};this.applyPinValuesFromXML=function(e){if(this.inputPins[e]){var f=
this.inputPins[e];e=this.defaultPinValues[e];if(void 0!=e&&(!f.reset_on_disconnect||1<e.length||""!=e[0])){for(var c=0;c<e.length;c++)f.data.values[c]!=e[c]&&("Color"==f.typeName?f.setValue(c,new VVVV.Types.Color(e[c])):"Value"==f.typeName?f.setValue(c,parseFloat(e[c])):f.setValue(c,e[c]));f.setSliceCount(e.length)}}};this.registerInterfacePin=function(){var e=this;if(this.isIOBox&&this.parentPatch.parentPatch&&""!=this.invisiblePins["Descriptive Name"].getValue(0)){var f=this.invisiblePins["Descriptive Name"].getValue(0);
this.IOBoxInputPin().connectionChangedHandlers.subpatchpins=function(){if(0<this.links.length&&this.masterPin){"development"==VVVV_ENV&&console.log("deleting "+f+" input pin because node has input connection...");for(var c=0;c<this.masterPin.links.length;c++)this.masterPin.links[c].destroy();this.disconnect();e.parentPatch.removeInputPin(f);this.masterPin=void 0}0==e.IOBoxOutputPin().links.length&&(e.IOBoxOutputPin().slavePin?e.IOBoxOutputPin().slavePin.pinname!=f&&("development"==VVVV_ENV&&console.log("renaming "+
e.IOBoxOutputPin().slavePin.pinname+" to "+f),e.parentPatch.outputPins[f]=e.parentPatch.outputPins[e.IOBoxOutputPin().slavePin.pinname],e.parentPatch.removeOutputPin(e.IOBoxOutputPin().slavePin.pinname),e.IOBoxOutputPin().slavePin.pinname=f):("development"==VVVV_ENV&&console.log("interfacing output pin detected: "+f),c=e.parentPatch.outputPins[f],void 0==c&&(c=e.parentPatch.addOutputPin(f,e.IOBoxOutputPin().data.values)),c.setType(VVVV.PinTypes[e.IOBoxOutputPin().typeName]),e.IOBoxOutputPin().slavePin=
c,c.masterPin=e.IOBoxOutputPin(),c.connect(e.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 "+f+" output pin because node "+e.id+" has output connection...");for(var c=0;c<this.slavePin.links.length;c++)this.slavePin.links[c].destroy();this.slavePin.disconnect();e.parentPatch.removeOutputPin(f);
this.slavePin=void 0}if(0==e.IOBoxInputPin().links.length)if(e.IOBoxInputPin().masterPin)e.IOBoxInputPin().masterPin.pinname!=f&&(console.log("renaming "+e.IOBoxInputPin().masterPin.pinname+" to "+f),e.parentPatch.inputPins[f]=e.parentPatch.inputPins[e.IOBoxInputPin().masterPin.pinname],e.parentPatch.removeInputPin(e.IOBoxInputPin().masterPin.pinname),e.IOBoxInputPin().masterPin.pinname=f);else{"development"==VVVV_ENV&&console.log("interfacing input pin detected: "+f);c=e.parentPatch.inputPins[f];
void 0==c&&("development"==VVVV_ENV&&console.log("creating new input pin at parent patch, using IOBox values"),c=e.parentPatch.addInputPin(f,e.IOBoxInputPin().data.values));var a=VVVV.PinTypes[e.IOBoxInputPin().typeName].cloneValues(c);c.setType(VVVV.PinTypes[e.IOBoxInputPin().typeName]);c.unvalidated&&VVVV.PinTypes[c.typeName].primitive&&!c.isConnected()&&(c.data.values=a,c.data.changed=!0);c.unvalidated=!1;c.slavePin=e.IOBoxInputPin();e.IOBoxInputPin().masterPin=c;e.IOBoxInputPin().connect(c)}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(e){e.setValue(0,"not calculated")})};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 e=h("<NODE>");e.attr("id",this.id);e.attr("nodename",this.nodename);e.attr("systemname",this.nodename);this.shaderFile&&e.attr("filename",this.shaderFile.replace(".vvvvjs.fx",".fx").replace("%VVVV%/effects","%VVVV%/lib/nodes/effects"));this.isSubpatch&&(e.attr("filename",this.nodename),e.attr("systemname",this.nodename.match("(.*).v4p$")[1]));this.isIOBox?e.attr("componentmode","InABox"):e.attr("componentmode","Hidden");var f=
h("<BOUNDS>");this.isIOBox?f.attr("type","Box"):f.attr("type","Node");f.attr("left",parseInt(15*this.x));f.attr("top",parseInt(15*this.y));f.attr("width",parseInt(this.width));f.attr("height",parseInt(this.height));e.append(f);var c=this;_(this.inputPins).each(function(a){var f=h("<PIN>");f.attr("pinname",a.pinname);f.attr("visible","1");(!a.isConnected()||a.masterPin)&&(VVVV.PinTypes[a.typeName].primitive&&c.defaultPinValues[a.pinname])&&f.attr("values",_(c.defaultPinValues[a.pinname]).map(function(a){return"|"+
a.toString().replace(/\|/g,"||")+"|"}).join(","));e.append(f)});_(this.invisiblePins).each(function(a){var c=h("<PIN>");c.attr("pinname",a.pinname);c.attr("visible","0");VVVV.PinTypes[a.typeName].primitive&&c.attr("values",_(a.data.values).map(function(a){return"|"+a.toString().replace(/\|/g,"||")+"|"}).join(","));e.append(c)});return e}},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 d=this.toPin.getSliceCount();d--;)this.toPin.node.defaultPinValues[this.toPin.pinname][d]=this.toPin.data.values[d]}};this.serialize=function(){var d=h("<LONK>");d.attr("srcnodeid",this.fromPin.node.id);
d.attr("srcpinname",this.fromPin.pinname);d.attr("dstnodeid",this.toPin.node.id);d.attr("dstpinname",this.toPin.pinname);return d}},Patch:function(b,g,d,e,f){function c(a){if(void 0==a)return[];if("45_26">=this.vvvv_version)return separator=/\|/.test(a)?"|":",",a.split(separator).filter(function(a,c){return""!=a});for(var c=[],f="",k=!1,e=a.length,m=0;m<e;m++)","!=a[m]||k?"|"==a[m]?"|"!=a[m+1]||m+1==a.length-1?k=!k:f+=a[++m]:f+=a[m]:(c.push(f),f="");c.push(f);return c}function a(){var a=window.location.hash.match("#([^/]+)/"+
l.ressource+"$");a&&(console.log("launching editor ..."),(new VVVV.Editors[a[1]]).enable(l))}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.evaluationRecipe=[];this.mainloop=void 0;this.success=g;this.error=d;this.editor=void 0;this.setupObject();e&&(this.parentPatch=e);f&&(this.id=f);var k=!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 m={},q={},t={},n={};var l=this;this.doLoad=function(a,f){function k(a){"complete"==d&&(q={});h(a).find('link[deleteme="pronto"]').each(function(){for(var a=
!1,c=0;c<l.linkList.length;c++)l.linkList[c].fromPin.node.id==h(this).attr("srcnodeid")&&(l.linkList[c].fromPin.pinname==h(this).attr("srcpinname")&&l.linkList[c].toPin.node.id==h(this).attr("dstnodeid")&&l.linkList[c].toPin.pinname==h(this).attr("dstpinname"))&&(a=l.linkList[c]);if(a){"development"==VVVV_ENV&&console.log("removing "+a.fromPin.pinname+" -> "+a.toPin.pinname);var c=a.fromPin,f=a.toPin;a.destroy();c.connectionChanged();f.connectionChanged();f.markPinAsChanged()}});h(a).find('link[deleteme!="pronto"]').each(function(){var a=
l.pinMap[h(this).attr("srcnodeid")+"_out_"+h(this).attr("srcpinname")],c=l.pinMap[h(this).attr("dstnodeid")+"_in_"+h(this).attr("dstpinname")];void 0==a&&l.nodeMap[h(this).attr("srcnodeid")]&&(a=l.nodeMap[h(this).attr("srcnodeid")].addOutputPin(h(this).attr("srcpinname"),void 0));void 0==c&&l.nodeMap[h(this).attr("dstnodeid")]&&(c=l.nodeMap[h(this).attr("dstnodeid")].addInputPin(h(this).attr("dstpinname"),void 0));if(a&&c){for(var f=!1,k=0;k<l.linkList.length;k++)l.linkList[k].fromPin.node.id==a.node.id&&
(l.linkList[k].fromPin.pinname==a.pinname&&l.linkList[k].toPin.node.id==c.node.id&&l.linkList[k].toPin.pinname==c.pinname)&&(f=l.linkList[k]);f||(f=new VVVV.Core.Link(a,c),a.connectionChanged(),c.connectionChanged(),l.linkList.push(f),c.connect(a));"complete"==d&&(q[a.node.id+"_"+a.pinname+"-"+c.node.id+"_"+c.pinname]=f)}});"complete"==d&&(_(m).each(function(a,c){if(void 0==q[c]){"development"==VVVV_ENV&&console.log("removing "+a.fromPin.pinname+" -> "+a.toPin.pinname);var f=a.fromPin,k=a.toPin;a.destroy();
f.connectionChanged();k.connectionChanged();k.markPinAsChanged();k.reset_on_disconnect&&k.reset()}}),m={},_(q).each(function(a,c){m[c]=a}))}var e=this;do e.dirty=!0;while(e=e.parentPatch);if(e=/^<!DOCTYPE\s+PATCH\s+SYSTEM\s+"(.+)\\(.+)\.dtd/.exec(a))l.vvvv_version=e[2].replace(/[a-zA-Z]+/,"_");var d="diff";if(/\s<PATCH/.test(a)||"45_26">=l.vvvv_version)d="complete","development"==VVVV_ENV&&console.log("complete: "+this.nodename);e=h(a).find('bounds[type="Window"]').first();0<e.length&&(l.windowWidth=
e.attr("width")/15,l.windowHeight=e.attr("height")/15);"complete"==d&&(n={});h(a).find("node").each(function(){if("pronto"==h(this).attr("createme")&&void 0!=l.nodeMap[h(this).attr("id")]){var e=l.nodeMap[h(this).attr("id")];"development"==VVVV_ENV&&console.log("node renamed, so deleting node "+e.id+" / "+e.nodename);_(e.inputPins).each(function(a){_(a.links).each(function(a){a.destroy();a.fromPin.connectionChanged()})});_(e.outputPins).each(function(a){_(a.links).each(function(a){a.destroy();a.toPin.connectionChanged();
a.toPin.markPinAsChanged()})});l.nodeList.splice(l.nodeList.indexOf(e),1);delete l.nodeMap[e.id]}var m;m="InABox"==h(this).attr("componentmode")?h(this).find('bounds[type="Box"]').first():h(this).find('bounds[type="Node"]').first();var q=void 0!=l.nodeMap[h(this).attr("id")];if(q)e=l.nodeMap[h(this).attr("id")];else{var t=""!=h(this).attr("systemname")?h(this).attr("systemname"):h(this).attr("nodename");if(void 0==t)return;if(void 0!=VVVV.NodeLibrary[t.toLowerCase()])e=new (VVVV.NodeLibrary[t.toLowerCase()])(h(this).attr("id"),
l),VVVV.NodeLibrary[t.toLowerCase()].requirements&&(l.resourcesPending++,_(VVVV.NodeLibrary[t.toLowerCase()].requirements).each(function(a){void 0===VVVV.LoadedLibs[a]&&VVVV.loadScript(VVVV.ThirdPartyLibs[a],function(){l.resourcesPending--;VVVV.LoadedLibs[a]=VVVV.ThirdPartyLibs[a]})}));else if(/.fx$/.test(h(this).attr("filename")))e=new VVVV.Nodes.GenericShader(h(this).attr("id"),l),e.isShader=!0,e.shaderFile=h(this).attr("filename").replace(/\\/g,"/").replace(/\.fx$/,".vvvvjs.fx").replace("lib/nodes/",
""),e.nodename=t;else if(/.v4p$/.test(h(this).attr("filename"))){l.resourcesPending++;var g=this,e=new VVVV.Core.Patch(h(this).attr("filename"),function(){l.resourcesPending--;"development"==VVVV_ENV&&console.log(this.nodename+"invoking update links");k(a);l.editor&&l.editor.addPatch(this);if(this.auto_evaluate){var c=l;do c.auto_evaluate=!0;while(c=c.parentPatch)}this.setMainloop(l.mainloop);l.afterUpdate();l.updateEvaluationRecipe();0>=l.resourcesPending&&f&&(f(),f=void 0)},function(){l.resourcesPending--;
this.not_implemented=!0;VVVV.onNotImplemented(t);k(a);l.afterUpdate();l.updateEvaluationRecipe();0>=l.resourcesPending&&f&&(f(),f=void 0)},l,h(g).attr("id"));e.isSubpatch=!0;l.editor&&!e.editor&&l.editor.addPatch(e);l.nodeMap[e.id]=e}else e=new VVVV.Core.Node(h(this).attr("id"),t,l),e.not_implemented=!0,"diff"==d&&!0==VVVV.Config.auto_undo&&l.editor.sendUndo(),VVVV.onNotImplemented(t);"development"==VVVV_ENV&&"complete"!=d&&console.log(l.nodename+": inserted new node "+e.nodename)}if(e.auto_evaluate){g=
l;do g.auto_evaluate=!0;while(g=g.parentPatch)}if("pronto"==h(this).attr("deleteme")){"development"==VVVV_ENV&&console.log("removing node "+e.id);if(e.isSubpatch){e.editor&&e.editor.removePatch(e);g=e.getSubPatches();g.push(e);for(var b,p=0;p<g.length;p++)b=VVVV.Helpers.prepareFilePath(g[p].nodename,g[p].parentPatch),VVVV.Patches[b].splice(VVVV.Patches[b].indexOf(e),1),0==VVVV.Patches[b].length&&delete VVVV.Patches[b]}l.nodeList.splice(l.nodeList.indexOf(e),1);e.destroy();delete l.nodeMap[e.id]}0<
m.length&&(m.attr("left")&&(e.x=m.attr("left")/15,e.y=m.attr("top")/15,l.boundingBox.width=Math.max(l.boundingBox.width,e.x+100),l.boundingBox.height=Math.max(l.boundingBox.height,e.y+100)),m.attr("width")&&(e.width=m.attr("width"),e.height=m.attr("height")));/^iobox/.test(e.nodename.toLowerCase())&&(e.isIOBox=!0);q||e.setup();g=this;h(this).find("pin").each(function(){var f=h(this).attr("pinname"),k=c(h(this).attr("values"));void 0!=k&&0<k.length&&e.addDefault(f,k);if(void 0==e.outputPins[f])if(void 0!=
e.inputPins[f])e.inputPins[f].isConnected()||e.applyPinValuesFromXML(f);else if(void 0!=e.invisiblePins[f]){if(void 0!=k){for(var m=0;m<k.length;m++)e.invisiblePins[f].data.values[m]!=k[m]&&e.invisiblePins[f].setValue(m,k[m]);e.invisiblePins[f].setSliceCount(k.length)}}else 1==h(this).attr("visible")&&"Configuration"!=h(this).attr("pintype")||e.isSubpatch?"Output"==h(this).attr("pintype")||0<h(a).find("link[srcnodeid="+e.id+"]").filter("link[srcpinname='"+f.replace(/[\[\]]/,"")+"']").length?void 0==
e.outputPins[f]&&e.addOutputPin(f,k):void 0==e.inputPins[f]&&void 0==e.invisiblePins[f]&&e.addInputPin(f,k):void 0==e.inputPins[f]&&void 0==e.invisiblePins[f]&&e.addInvisiblePin(f,k)});q||(e.initialize(),l.nodeList.push(e));"complete"==d&&(n[e.id]=e)});"complete"==d&&(_(t).each(function(a,c){void 0==n[c]&&("development"==VVVV_ENV&&console.log("removing node "+a.id),l.nodeList.splice(l.nodeList.indexOf(a),1),delete l.nodeMap[a.id])}),t={},_(n).each(function(a,c){t[c]=a}));0===this.resourcesPending&&
k(a);this.updateEvaluationRecipe();0>=this.resourcesPending&&f&&(f(),f=void 0)};this.getSubPatches=function(){for(var a=[],c=0;c<this.nodeList.length;c++)this.nodeList[c].isSubpatch&&(a.push(this.nodeList[c]),a=a.concat(this.nodeList[c].getSubPatches()));return a};this.setMainloop=function(a){this.mainloop=a;for(var c=0;c<this.nodeList.length;c++)this.nodeList[c].isSubpatch&&this.nodeList[c].setMainloop(a)};this.afterEvaluate=function(){};this.afterUpdate=function(){};this.toXML=function(){var a=
h("<PATCH>"),c=h("<BOUNDS>");c.attr("type","Window");c.attr("width",parseInt(15*this.windowWidth));c.attr("height",parseInt(15*this.windowHeight));a.append(c);for(c=0;c<this.nodeList.length;c++)a.append(this.nodeList[c].serialize());for(c=0;c<this.linkList.length;c++)a.append(this.linkList[c].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.updateEvaluationRecipe=function(){function a(d){if(0>f.indexOf(d.id)){f.push(d.id);var l=d.getUpstreamNodes(),q=!1;_(l).each(function(f){void 0==c[f.id]&&(q=q||a(f))});f.pop()}q&&d.delays_output&&
e.push(d);if(!q&&0>f.indexOf(d.id)||d.delays_output){k.push(d);for(var n in d.inputPins)0==d.inputPins[n].links.length&&m.push(d.inputPins[n]);for(n in d.invisiblePins)m.push(d.invisiblePins[n]);for(n in d.outputPins)m.push(d.outputPins[n]);c[d.id]=d;return!1}return!0}this.evaluationRecipe=[];this.pinList=[];for(var c={},f=[],e=[],k=this.evaluationRecipe,m=this.pinList,d=0;d<this.nodeList.length;d++)(0==this.nodeList[d].getDownstreamNodes().length||this.nodeList[d].auto_evaluate||this.nodeList[d].delays_output)&&
void 0==c[this.nodeList[d].id]&&a(this.nodeList[d]);for(d=0;d<e.length;d++)a(e[d])};this.evaluate=function(){if(!(0<this.resourcesPending)){if(k)var a={},c=(new Date).getTime(),f=0;for(var e,m=0;m<this.evaluationRecipe.length;m++){var d=this.evaluationRecipe[m];k&&console.log(d.nodename);if(d.isDirty()||d.auto_evaluate||d.isSubpatch){k&&(c=(new Date).getTime());if(d.auto_nil&&!d.isSubpatch&&d.hasNilInputs())for(e in d.outputPins)d.outputPins[e].setSliceCount(0);else d.evaluate(),d.dirty=!1;k&&(a[d.nodename]||
(a[d.nodename]={count:0,dt:0}),f=(new Date).getTime()-c,a[d.nodename].count++,a[d.nodename].dt+=f,console.log(d.nodename+" / "+d.id+": "+f+"ms"))}}k&&(_(a).each(function(a,c){console.log(a.count+"x "+c+": "+a.dt+"ms")}),c=(new Date).getTime());this.afterEvaluate();k&&console.log("patch rendering: "+((new Date).getTime()-c)+"ms");k=!1}};this.clearChangedFlags=function(){for(var a=this.pinList.length;a--;)this.pinList[a].data.changed=!1};h(window).keydown(function(a){84==a.which&&(a.altKey&&a.ctrlKey)&&
(k=!0)});if(/\.v4p[^<>\s]*$/.test(b)){this.nodename=b;var p=this,s=b;this.parentPatch&&(s=VVVV.Helpers.prepareFilePath(b,this.parentPatch));VVVV.Patches[s]?p.doLoad(VVVV.Patches[s][0].toXML(),function(){VVVV.Patches[s].push(p);p.success&&p.success();p.afterUpdate()}):h.ajax({url:s,type:"get",dataType:"text",success:function(a){p.doLoad(a,function(){VVVV.Patches[s]=VVVV.Patches[s]||[];VVVV.Patches[s].push(p);p.success&&p.success();p.afterUpdate()})},error:function(){p.error&&p.error()}})}else this.doLoad(b,
function(){this.success&&this.success()});a();h(window).bind("hashchange",function(){a()})}};VVVV.Core.Patch.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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,d,e){for(var f=g.length;f<d;f++)g[f]=e.call(b,f);for(f=d;f<g.length;f++)b.removeInputPin(g[f].pinname);g.length=d;b.parentPatch.afterUpdate()}};VVVV.Core={Pin:function(b,g,d,e,f){this.direction=g;this.pinname=b;this.links=[];this.values=[];this.values.changedAt=0;this.node=e;this.reset_on_disconnect=this.active=!1;this.masterPin=this.slavePin=void 0;this.connectionChangedHandlers={};this.enumOptions=[];this.getValue=function(c,a){if(!a||1==a)return this.values[c%
this.values.length];for(var f=[],e=0;e<a;e++)f.push(this.values[(c*a+e)%this.values.length]);return f};this.setValue=function(c,a){this.direction!=VVVV.PinDirection.Output&&this.isConnected()||(this.values[c]=a,this.primitive&&this.values[c]==a||this.markPinAsChanged());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(c){this.values=c.values;if(this.direction==VVVV.PinDirection.Output){c=this.links.length;for(var a=0;a<c;a++)this.links[a].toPin.values=this.values}this.slavePin&&(this.slavePin.values=this.values);this.markPinAsChanged()};
this.disconnect=function(){this.values=this.values.slice(0);this.markPinAsChanged()};this.isConnected=function(){return 0<this.links.length||this.masterPin&&this.masterPin.isConnected()};this.getSliceCount=function(){return this.values.length};this.setSliceCount=function(c){this.values.length!=c&&(this.direction!=VVVV.PinDirection.Output&&this.isConnected()||(this.values.length=c),this.markPinAsChanged())};this.setType=function(c){if(c.typeName!=this.typeName){var a=this;delete this.connectionChangedHandlers.nodepin;
delete this.connectionChangedHandlers.webglresource;_(c.connectionChangedHandlers).each(function(f,e){a.connectionChangedHandlers[e]=c.connectionChangedHandlers[e]});this.typeName=c.typeName;this.defaultValue=c.defaultValue;this.direction==VVVV.PinDirection.Input&&(this.defaultValue&&!this.isConnected())&&(this.setValue(0,this.defaultValue()),this.setSliceCount(1));void 0!=c.reset_on_disconnect&&(this.reset_on_disconnect=c.reset_on_disconnect)}};void 0==f&&(f=VVVV.PinTypes.Generic);f==VVVV.PinTypes.Generic&&
(this.unvalidated=!0);this.setType(f);if(d&&0<d.length)for(b=d.length;b--;)this.setValue(b,d[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=d.slice(0),this.markPinAsChanged());this.markPinAsChanged()};this.connectionChanged=function(){var c=this;_(this.connectionChangedHandlers).each(function(a){c.f=a;c.f()})};this.generateStaticCode=function(c){for(var a="",f="if (",
e=0;e<this.values.incomingPins.length;e++)var d=this.values.incomingPins[e],f=f+("patch.nodeMap["+d.node.id+"].inputPins['"+d.pinname+"'].pinIsChanged() || "),a="Math.max(patch.nodeMap["+d.node.id+"].inputPins['"+d.pinname+"'].getSliceCount(), "+a;a+="0)";for(e=0;e<this.values.incomingPins.length-1;e++)a+=")";e="";c&&(e=f+"false) {\n");e=e+" var iii = "+(a+";\n");e+=" patch.nodeMap["+this.node.id+"].outputPins['Output'].setSliceCount(iii);";e+=" while (iii--) {\n";e+=" patch.nodeMap["+this.node.id+
"].outputPins['Output'].setValue(iii, "+this.values.code+");\n";e+=" }\n";c&&(e+="}\n");return e}},Node:function(b,g,d){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=d)&&(this.parentPatch.nodeMap[b]=this);
this.addDefault=function(e,f){this.defaultPinValues[e]=f};this.addInputPin=function(e,f,c){c=c||VVVV.PinTypes.Generic;f=new VVVV.Core.Pin(e,VVVV.PinDirection.Input,f,this,c);this.inputPins[e]=f;this.parentPatch&&(this.parentPatch.pinMap[this.id+"_in_"+e]=f);this.applyPinValuesFromXML(e);return f};this.addOutputPin=function(e,f,c){c=c||VVVV.PinTypes.Generic;f=new VVVV.Core.Pin(e,VVVV.PinDirection.Output,f,this,c);this.outputPins[e]=f;this.parentPatch&&(this.parentPatch.pinMap[this.id+"_out_"+e]=f);
return f};this.removeInputPin=function(e){if(this.inputPins[e]){var f=this.inputPins[e].links[0];f&&(f.fromPin.connectionChanged(),f.destroy());delete this.inputPins[e];this.dirty=!0}};this.removeOutputPin=function(e){if(this.outputPins[e]){for(var f=this.outputPins[e].links.length,c=0;c<f;c++){var a=this.outputPins[e].links[c];a.toPin.connectionChanged();a.destroy()}delete this.outputPins[e];this.dirty=!0}};this.addInvisiblePin=function(e,f,c){c=c||VVVV.PinTypes.Generic;f=new VVVV.Core.Pin(e,VVVV.PinDirection.Configuration,
f,this,c);this.invisiblePins[e]=f;this.parentPatch.pinMap[this.id+"_inv_"+e]=f;void 0!=this.defaultPinValues[e]&&(f.values=this.defaultPinValues[e],f.markPinAsChanged());return f};this.IOBoxType=function(){var e=/^IOBox \((.*)\)/.exec(this.nodename);return e&&1<e.length?e[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 e=this.nodename.replace(/\s\(.+\)/,"");return e=VVVV.Helpers.translateOperators(e)};this.getWidth=function(){var e;e=100==this.width||0==this.width?this.isIOBox?60:Math.max(18,6*(this.label().length+2)):this.width/15;return e=Math.max(e,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 e=[];_(this.inputPins).each(function(f){0<f.links.length&&e.push(f.links[0].fromPin.node)});return e};this.getDownstreamNodes=function(){var e=[];_(this.outputPins).each(function(f){for(var c=0;c<f.links.length;c++)e.push(f.links[c].toPin.node)});return e};this.findDownstreamNodes=function(e){var f=[];_(this.outputPins).each(function(c){for(var a=0;a<c.links.length;a++)c.links[a].toPin.node.nodename==e?f.push(c.links[a].toPin.node):
f=c.links[a].toPin.slavePin?f.concat(c.links[a].toPin.slavePin.node.findDownstreamNodes(e)):c.links[a].toPin.node.isIOBox&&c.links[a].toPin.node.IOBoxOutputPin().slavePin?f.concat(c.links[a].toPin.node.IOBoxOutputPin().slavePin.node.findDownstreamNodes(e)):f.concat(c.links[a].toPin.node.findDownstreamNodes(e))});return f};this.hasNilInputs=function(){var e=!1;_(this.inputPins).each(function(f){0==f.getSliceCount()&&(e=!0)});return e};this.isDirty=function(){if(this.dirty)return!0;for(var e in this.inputPins)if(this.inputPins[e].pinIsChanged())return!0;
for(e in this.invisiblePins)if(this.invisiblePins[e].pinIsChanged())return!0;return!1};this.getMaxInputSliceCount=function(){var e=0,f;for(f in this.inputPins)this.inputPins[f].getSliceCount()>e&&(e=this.inputPins[f].values.length);return e};this.applyPinValuesFromXML=function(e){if(this.inputPins[e]){var f=this.inputPins[e];e=this.defaultPinValues[e];if(void 0!=e&&(!f.reset_on_disconnect||1<e.length||""!=e[0])){for(var c=0;c<e.length;c++)f.values[c]!=e[c]&&("Color"==f.typeName?f.setValue(c,new VVVV.Types.Color(e[c])):
"Value"==f.typeName?f.setValue(c,parseFloat(e[c])):f.setValue(c,e[c]));f.setSliceCount(e.length)}}};this.registerInterfacePin=function(){var e=this;if(this.isIOBox&&this.parentPatch.parentPatch&&""!=this.invisiblePins["Descriptive Name"].getValue(0)){var f=this.invisiblePins["Descriptive Name"].getValue(0);this.IOBoxInputPin().connectionChangedHandlers.subpatchpins=function(){if(0<this.links.length&&this.masterPin){"development"==VVVV_ENV&&console.log("deleting "+f+" input pin because node has input connection...");
for(var c=0;c<this.masterPin.links.length;c++)this.masterPin.links[c].destroy();this.disconnect();e.parentPatch.removeInputPin(f);this.masterPin=void 0}0==e.IOBoxOutputPin().links.length&&(e.IOBoxOutputPin().slavePin?e.IOBoxOutputPin().slavePin.pinname!=f&&("development"==VVVV_ENV&&console.log("renaming "+e.IOBoxOutputPin().slavePin.pinname+" to "+f),e.parentPatch.outputPins[f]=e.parentPatch.outputPins[e.IOBoxOutputPin().slavePin.pinname],e.parentPatch.removeOutputPin(e.IOBoxOutputPin().slavePin.pinname),
e.IOBoxOutputPin().slavePin.pinname=f):("development"==VVVV_ENV&&console.log("interfacing output pin detected: "+f),c=e.parentPatch.outputPins[f],void 0==c&&(c=e.parentPatch.addOutputPin(f,e.IOBoxOutputPin().values)),c.setType(VVVV.PinTypes[e.IOBoxOutputPin().typeName]),e.IOBoxOutputPin().slavePin=c,c.masterPin=e.IOBoxOutputPin(),c.connect(e.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 "+f+" output pin because node "+e.id+" has output connection...");for(var c=0;c<this.slavePin.links.length;c++)this.slavePin.links[c].destroy();this.slavePin.disconnect();e.parentPatch.removeOutputPin(f);this.slavePin=void 0}if(0==e.IOBoxInputPin().links.length)if(e.IOBoxInputPin().masterPin)e.IOBoxInputPin().masterPin.pinname!=f&&(console.log("renaming "+e.IOBoxInputPin().masterPin.pinname+" to "+f),
e.parentPatch.inputPins[f]=e.parentPatch.inputPins[e.IOBoxInputPin().masterPin.pinname],e.parentPatch.removeInputPin(e.IOBoxInputPin().masterPin.pinname),e.IOBoxInputPin().masterPin.pinname=f);else{"development"==VVVV_ENV&&console.log("interfacing input pin detected: "+f);var a=e.parentPatch.inputPins[f];void 0==a&&("development"==VVVV_ENV&&console.log("creating new input pin at parent patch, using IOBox values"),a=e.parentPatch.addInputPin(f,e.IOBoxInputPin().values));var k=a.values.slice();a.setType(VVVV.PinTypes[e.IOBoxInputPin().typeName]);
if(a.unvalidated&&VVVV.PinTypes[a.typeName].primitive&&!a.isConnected()){if("V"==a.typeName[0])for(c=0;c<k.length;c++)a.values[c]=parseFloat(k[c]);else a.values=k;a.markPinAsChanged()}a.unvalidated=!1;a.slavePin=e.IOBoxInputPin();e.IOBoxInputPin().masterPin=a;e.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(e){e.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 e=h("<NODE>");e.attr("id",this.id);e.attr("nodename",this.nodename);e.attr("systemname",this.nodename);this.shaderFile&&e.attr("filename",this.shaderFile.replace(".vvvvjs.fx",".fx").replace("%VVVV%/effects","%VVVV%/lib/nodes/effects"));this.isSubpatch&&(e.attr("filename",this.nodename),e.attr("systemname",this.nodename.match("(.*).v4p$")[1]));this.isIOBox?e.attr("componentmode","InABox"):e.attr("componentmode","Hidden");var f=
h("<BOUNDS>");this.isIOBox?f.attr("type","Box"):f.attr("type","Node");f.attr("left",parseInt(15*this.x));f.attr("top",parseInt(15*this.y));f.attr("width",parseInt(this.width));f.attr("height",parseInt(this.height));e.append(f);var c=this;_(this.inputPins).each(function(a){var f=h("<PIN>");f.attr("pinname",a.pinname);f.attr("visible","1");(!a.isConnected()||a.masterPin)&&(VVVV.PinTypes[a.typeName].primitive&&c.defaultPinValues[a.pinname])&&f.attr("values",_(c.defaultPinValues[a.pinname]).map(function(a){return"|"+
a.toString().replace(/\|/g,"||")+"|"}).join(","));e.append(f)});_(this.invisiblePins).each(function(a){var c=h("<PIN>");c.attr("pinname",a.pinname);c.attr("visible","0");VVVV.PinTypes[a.typeName].primitive&&c.attr("values",_(a.values).map(function(a){return"|"+a.toString().replace(/\|/g,"||")+"|"}).join(","));e.append(c)});return e}},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 d=this.toPin.getSliceCount();d--;)this.toPin.node.defaultPinValues[this.toPin.pinname][d]=this.toPin.values[d]}};this.serialize=function(){var d=h("<LONK>");d.attr("srcnodeid",this.fromPin.node.id);
d.attr("srcpinname",this.fromPin.pinname);d.attr("dstnodeid",this.toPin.node.id);d.attr("dstpinname",this.toPin.pinname);return d}},Patch:function(b,g,d,e,f){function c(a){if(void 0==a)return[];if("45_26">=this.vvvv_version)return separator=/\|/.test(a)?"|":",",a.split(separator).filter(function(a,c){return""!=a});for(var c=[],f="",e=!1,k=a.length,m=0;m<k;m++)","!=a[m]||e?"|"==a[m]?"|"!=a[m+1]||m+1==a.length-1?e=!e:f+=a[++m]:f+=a[m]:(c.push(f),f="");c.push(f);return c}function a(){var a=window.location.hash.match("#([^/]+)/"+
l.ressource+"$");a&&(console.log("launching editor ..."),(new VVVV.Editors[a[1]]).enable(l))}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=d;this.editor=void 0;this.setupObject();e&&(this.parentPatch=e);f&&(this.id=f);var k=!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 m={},q={},t={},n={};var l=this;this.doLoad=function(a,f){function e(a){"complete"==d&&(q={});h(a).find('link[deleteme="pronto"]').each(function(){for(var a=
!1,c=0;c<l.linkList.length;c++)l.linkList[c].fromPin.node.id==h(this).attr("srcnodeid")&&(l.linkList[c].fromPin.pinname==h(this).attr("srcpinname")&&l.linkList[c].toPin.node.id==h(this).attr("dstnodeid")&&l.linkList[c].toPin.pinname==h(this).attr("dstpinname"))&&(a=l.linkList[c]);if(a){"development"==VVVV_ENV&&console.log("removing "+a.fromPin.pinname+" -> "+a.toPin.pinname);var c=a.fromPin,f=a.toPin;a.destroy();c.connectionChanged();f.connectionChanged();f.markPinAsChanged()}});h(a).find('link[deleteme!="pronto"]').each(function(){var a=
l.pinMap[h(this).attr("srcnodeid")+"_out_"+h(this).attr("srcpinname")],c=l.pinMap[h(this).attr("dstnodeid")+"_in_"+h(this).attr("dstpinname")];void 0==a&&l.nodeMap[h(this).attr("srcnodeid")]&&(a=l.nodeMap[h(this).attr("srcnodeid")].addOutputPin(h(this).attr("srcpinname"),void 0));void 0==c&&l.nodeMap[h(this).attr("dstnodeid")]&&(c=l.nodeMap[h(this).attr("dstnodeid")].addInputPin(h(this).attr("dstpinname"),void 0));if(a&&c){for(var f=!1,e=0;e<l.linkList.length;e++)l.linkList[e].fromPin.node.id==a.node.id&&
(l.linkList[e].fromPin.pinname==a.pinname&&l.linkList[e].toPin.node.id==c.node.id&&l.linkList[e].toPin.pinname==c.pinname)&&(f=l.linkList[e]);f||(f=new VVVV.Core.Link(a,c),a.connectionChanged(),c.connectionChanged(),l.linkList.push(f),c.connect(a));"complete"==d&&(q[a.node.id+"_"+a.pinname+"-"+c.node.id+"_"+c.pinname]=f)}});"complete"==d&&(_(m).each(function(a,c){if(void 0==q[c]){"development"==VVVV_ENV&&console.log("removing "+a.fromPin.pinname+" -> "+a.toPin.pinname);var f=a.fromPin,e=a.toPin;a.destroy();
f.connectionChanged();e.connectionChanged();e.markPinAsChanged();e.reset_on_disconnect&&e.reset()}}),m={},_(q).each(function(a,c){m[c]=a}))}var k=this;do k.dirty=!0;while(k=k.parentPatch);if(k=/^<!DOCTYPE\s+PATCH\s+SYSTEM\s+"(.+)\\(.+)\.dtd/.exec(a))l.vvvv_version=k[2].replace(/[a-zA-Z]+/,"_");var d="diff";if(/\s<PATCH/.test(a)||"45_26">=l.vvvv_version)d="complete","development"==VVVV_ENV&&console.log("complete: "+this.nodename);k=h(a).find('bounds[type="Window"]').first();0<k.length&&(l.windowWidth=
k.attr("width")/15,l.windowHeight=k.attr("height")/15);"complete"==d&&(n={});h(a).find("node").each(function(){if("pronto"==h(this).attr("createme")&&void 0!=l.nodeMap[h(this).attr("id")]){var k=l.nodeMap[h(this).attr("id")];"development"==VVVV_ENV&&console.log("node renamed, so deleting node "+k.id+" / "+k.nodename);_(k.inputPins).each(function(a){_(a.links).each(function(a){a.destroy();a.fromPin.connectionChanged()})});_(k.outputPins).each(function(a){_(a.links).each(function(a){a.destroy();a.toPin.connectionChanged();
a.toPin.markPinAsChanged()})});l.nodeList.splice(l.nodeList.indexOf(k),1);delete l.nodeMap[k.id]}var m;m="InABox"==h(this).attr("componentmode")?h(this).find('bounds[type="Box"]').first():h(this).find('bounds[type="Node"]').first();var q=void 0!=l.nodeMap[h(this).attr("id")];if(q)k=l.nodeMap[h(this).attr("id")];else{var t=""!=h(this).attr("systemname")?h(this).attr("systemname"):h(this).attr("nodename");if(void 0==t)return;if(void 0!=VVVV.NodeLibrary[t.toLowerCase()])k=new (VVVV.NodeLibrary[t.toLowerCase()])(h(this).attr("id"),
l),VVVV.NodeLibrary[t.toLowerCase()].requirements&&(l.resourcesPending++,_(VVVV.NodeLibrary[t.toLowerCase()].requirements).each(function(a){void 0===VVVV.LoadedLibs[a]&&VVVV.loadScript(VVVV.ThirdPartyLibs[a],function(){l.resourcesPending--;VVVV.LoadedLibs[a]=VVVV.ThirdPartyLibs[a]})}));else if(/.fx$/.test(h(this).attr("filename")))k=new VVVV.Nodes.GenericShader(h(this).attr("id"),l),k.isShader=!0,k.shaderFile=h(this).attr("filename").replace(/\\/g,"/").replace(/\.fx$/,".vvvvjs.fx").replace("lib/nodes/",
""),k.nodename=t;else if(/.v4p$/.test(h(this).attr("filename"))){l.resourcesPending++;var g=this,k=new VVVV.Core.Patch(h(this).attr("filename"),function(){l.resourcesPending--;"development"==VVVV_ENV&&console.log(this.nodename+"invoking update links");e(a);l.editor&&l.editor.addPatch(this);if(this.auto_evaluate){var c=l;do c.auto_evaluate=!0;while(c=c.parentPatch)}this.setMainloop(l.mainloop);l.afterUpdate();l.compile();0>=l.resourcesPending&&f&&(f(),f=void 0)},function(){l.resourcesPending--;this.not_implemented=
!0;VVVV.onNotImplemented(t);e(a);l.afterUpdate();l.compile();0>=l.resourcesPending&&f&&(f(),f=void 0)},l,h(g).attr("id"));k.isSubpatch=!0;l.editor&&!k.editor&&l.editor.addPatch(k);l.nodeMap[k.id]=k}else k=new VVVV.Core.Node(h(this).attr("id"),t,l),k.not_implemented=!0,"diff"==d&&!0==VVVV.Config.auto_undo&&l.editor.sendUndo(),VVVV.onNotImplemented(t);"development"==VVVV_ENV&&"complete"!=d&&console.log(l.nodename+": inserted new node "+k.nodename)}if(k.auto_evaluate){g=l;do g.auto_evaluate=!0;while(g=
g.parentPatch)}if("pronto"==h(this).attr("deleteme")){"development"==VVVV_ENV&&console.log("removing node "+k.id);if(k.isSubpatch&&!k.not_implemented){k.editor&&k.editor.removePatch(k);g=k.getSubPatches();g.push(k);for(var b,p=0;p<g.length;p++)b=VVVV.Helpers.prepareFilePath(g[p].nodename,g[p].parentPatch),VVVV.Patches[b].splice(VVVV.Patches[b].indexOf(k),1),0==VVVV.Patches[b].length&&delete VVVV.Patches[b]}l.nodeList.splice(l.nodeList.indexOf(k),1);k.destroy();delete l.nodeMap[k.id]}0<m.length&&(m.attr("left")&&
(k.x=m.attr("left")/15,k.y=m.attr("top")/15,l.boundingBox.width=Math.max(l.boundingBox.width,k.x+100),l.boundingBox.height=Math.max(l.boundingBox.height,k.y+100)),m.attr("width")&&(k.width=m.attr("width"),k.height=m.attr("height")));/^iobox/.test(k.nodename.toLowerCase())&&(k.isIOBox=!0);q||k.setup();g=this;h(this).find("pin").each(function(){var f=h(this).attr("pinname"),e=c(h(this).attr("values"));void 0!=e&&0<e.length&&k.addDefault(f,e);if(void 0==k.outputPins[f])if(void 0!=k.inputPins[f])k.inputPins[f].isConnected()||
k.applyPinValuesFromXML(f);else if(void 0!=k.invisiblePins[f]){if(void 0!=e){for(var m=0;m<e.length;m++)k.invisiblePins[f].values[m]!=e[m]&&k.invisiblePins[f].setValue(m,e[m]);k.invisiblePins[f].setSliceCount(e.length)}}else 1==h(this).attr("visible")&&"Configuration"!=h(this).attr("pintype")||k.isSubpatch?"Output"==h(this).attr("pintype")||0<h(a).find("link[srcnodeid="+k.id+"]").filter("link[srcpinname='"+f.replace(/[\[\]]/,"")+"']").length?void 0==k.outputPins[f]&&k.addOutputPin(f,e):void 0==k.inputPins[f]&&
void 0==k.invisiblePins[f]&&k.addInputPin(f,e):void 0==k.inputPins[f]&&void 0==k.invisiblePins[f]&&k.addInvisiblePin(f,e)});q||(k.initialize(),l.nodeList.push(k));"complete"==d&&(n[k.id]=k)});"complete"==d&&(_(t).each(function(a,c){void 0==n[c]&&("development"==VVVV_ENV&&console.log("removing node "+a.id),l.nodeList.splice(l.nodeList.indexOf(a),1),delete l.nodeMap[a.id])}),t={},_(n).each(function(a,c){t[c]=a}));0===this.resourcesPending&&e(a);this.compile();0>=this.resourcesPending&&f&&(f(),f=void 0)};
this.getSubPatches=function(){for(var a=[],c=0;c<this.nodeList.length;c++)this.nodeList[c].isSubpatch&&(a.push(this.nodeList[c]),a=a.concat(this.nodeList[c].getSubPatches()));return a};this.setMainloop=function(a){this.mainloop=a;for(var c=0;c<this.nodeList.length;c++)this.nodeList[c].isSubpatch&&this.nodeList[c].setMainloop(a)};this.afterEvaluate=function(){};this.afterUpdate=function(){};this.toXML=function(){var a=h("<PATCH>"),c=h("<BOUNDS>");c.attr("type","Window");c.attr("width",parseInt(15*
this.windowWidth));c.attr("height",parseInt(15*this.windowHeight));a.append(c);for(c=0;c<this.nodeList.length;c++)a.append(this.nodeList[c].serialize());for(c=0;c<this.linkList.length;c++)a.append(this.linkList[c].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(q){if(0>f.indexOf(q.id)){f.push(q.id);var n=q.getUpstreamNodes(),t=!1;_(n).each(function(f){void 0==c[f.id]&&(t=t||a(f))});f.pop()}t&&q.delays_output&&e.push(q);if(!t&&0>f.indexOf(q.id)||q.delays_output){if(q.getCode){q.outputPins.Output.values.incomingPins=
[];for(var g=n="("+q.getCode()+")",b;b=d.exec(n);){var p;q.inputPins[b[1]].values.code?(p=q.inputPins[b[1]].values.code,q.outputPins.Output.values.incomingPins=q.outputPins.Output.values.incomingPins.concat(q.inputPins[b[1]].values.incomingPins)):(p=q.inputPins[b[1]].isConnected()||1!=q.inputPins[b[1]].getSliceCount()?"patch.nodeMap["+q.id+"].inputPins['"+b[1]+"'].getValue(iii)":q.inputPins[b[1]].getValue(0),q.outputPins.Output.values.incomingPins.push(q.inputPins[b[1]]));g=g.replace("{"+b[1]+"}",
p)}q.outputPins.Output.values.code=g;for(n=0;n<q.outputPins.Output.links.length;n++)if(!q.outputPins.Output.links[n].toPin.node.getCode){l+=q.outputPins.Output.generateStaticCode(!0);break}}else q.not_implemented||(k.push(q),l+="var n = patch.nodeMap["+q.id+"];",l+="if ((n.isDirty() || n.auto_evaluate || n.isSubpatch) && !n.dealWithNilInput()) { n.evaluate(); n.dirty = false; }\n");for(var s in q.inputPins)0==q.inputPins[s].links.length&&m.push(q.inputPins[s]);for(s in q.invisiblePins)m.push(q.invisiblePins[s]);
for(s in q.outputPins)m.push(q.outputPins[s]);c[q.id]=q;return!1}return!0}this.evaluationRecipe=[];this.pinList=[];for(var c={},f=[],e=[],k=this.evaluationRecipe,m=this.pinList,d=RegExp(/\{([^\}]+)\}/g),l="",q=0;q<this.nodeList.length;q++)(0==this.nodeList[q].getDownstreamNodes().length||this.nodeList[q].auto_evaluate||this.nodeList[q].delays_output)&&void 0==c[this.nodeList[q].id]&&a(this.nodeList[q]);for(q=0;q<e.length;q++)a(e[q]);this.compiledFunc=new Function("patch",l)};this.evaluate=function(){if(!(0<
this.resourcesPending)){if(k)var a={},c=(new Date).getTime();this.compiledFunc(this);k&&(_(a).each(function(a,c){console.log(a.count+"x "+c+": "+a.dt+"ms")}),c=(new Date).getTime());this.afterEvaluate();k&&console.log("patch rendering: "+((new Date).getTime()-c)+"ms");k=!1}};h(window).keydown(function(a){84==a.which&&(a.altKey&&a.ctrlKey)&&(k=!0)});if(/\.v4p[^<>\s]*$/.test(b)){this.nodename=b;var p=this,s=b;this.parentPatch&&(s=VVVV.Helpers.prepareFilePath(b,this.parentPatch));VVVV.Patches[s]?p.doLoad(VVVV.Patches[s][0].toXML(),
function(){VVVV.Patches[s].push(p);p.success&&p.success();p.afterUpdate()}):h.ajax({url:s,type:"get",dataType:"text",success:function(a){p.doLoad(a,function(){VVVV.Patches[s]=VVVV.Patches[s]||[];VVVV.Patches[s].push(p);p.success&&p.success();p.afterUpdate()})},error:function(){p.error&&p.error()}})}else this.doLoad(b,function(){this.success&&this.success()});a();h(window).bind("hashchange",function(){a()})}};VVVV.Core.Patch.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){VVVV.Core.DOMInterface=function(b){function g(c){if("event"==c.property_class){var a=c.selector;"window"==a&&(a=window);"document"==a&&(a=document);h(a).each(function(a){c.values[a]=0;h(this).bind(c.property,function(){c.values[a]=1;return!1})})}}var d={},e={};b.domInterface=this;this.connect=function(c){_(d).each(function(a,f){a.node.id==c.id&&("event"==a.property_class&&h(a.selector).unbind(a.property),delete d[f])});_(e).each(function(a,f){a.node.id==c.id&&delete e[f]});var a=/([^\/]+)(\/(event|attribute|style)\/(.+))?/.exec(c.invisiblePins["Descriptive Name"].getValue(0));
if(null!=a){var f={selector:a[1],property_class:a[3],property:a[4],values:[],node:c};0!=h(f.selector).length&&(0==c.getUpstreamNodes().length?d[a[0]]=f:0==c.getDownstreamNodes().length&&(e[a[0]]=f),g(f))}};var f=this;_(b.nodeList).each(function(c){c.isIOBox&&void 0!=c.invisiblePins["Descriptive Name"]&&(f.connect(c),c.IOBoxInputPin().connectionChanged=function(){f.connect(c)})});this.populateInputConnectors=function(){var c,a;for(c in d)switch(a=d[c],a.property_class){case "event":a.values.length!=
a.node.IOBoxInputPin().values.length&&a.node.IOBoxInputPin().setSliceCount(a.values.length);for(var f=0;f<a.values.length;f++)void 0!=a.node.IOBoxInputPin().values[f]&&a.values[f]==a.node.IOBoxInputPin().values[f]||a.node.IOBoxInputPin().setValue(f,a.values[f]);break;default:for(this.fetchValuesFromDOM(a),a.values.length!=a.node.IOBoxInputPin().values.length&&a.node.IOBoxInputPin().setSliceCount(a.values.length),f=0;f<a.values.length;f++)a.node.IOBoxInputPin().getValue(f)!=a.values[f]&&a.node.IOBoxInputPin().setValue(f,
a.values[f])}};this.processOutputConnectors=function(){for(var c in e)switch(e[c].property_class){default:this.setDOMByIOBox(e[c])}for(c in d)if("event"==d[c].property_class)for(var a=0;a<d[c].values.length;a++)d[c].values[a]=0};this.fetchValuesFromDOM=function(c){c.values.length=0;h(c.selector).each(function(a){var f;if(void 0==c.property_class)switch(this.nodeName){case "INPUT":"text"==h(this).attr("type")&&(f=h(this).val());"checkbox"==h(this).attr("type")&&(f=h(this).attr("checked")?1:0);break;
default:f=h(this).text()}"attribute"==c.property_class&&(f=h(this).attr(c.property));"style"==c.property_class&&(f=h(this).css(c.property));c.values[a]=f})};this.setDOMByIOBox=function(c){var a=c.node.IOBoxOutputPin();if(a.pinIsChanged()){var a=a.getValue(0,a.getSliceCount()),f=h(c.selector).length;void 0==c.property_class&&(h(c.selector).empty(),h(c.selector).val(""));for(var e=0;e<Math.max(a.length,f);e++){var d=e%f,t=e%a.length,n=h(c.selector).eq(d);if(0!=n.length){if(void 0==c.property_class)switch(n[0].nodeName){case "INPUT":n.val(h(c.selector).eq(d).val()+
a[t]);break;default:n.html(h(c.selector).eq(d).html()+a[t])}"attribute"==c.property_class&&n.attr(c.property,a[t]);"style"==c.property_class&&n.css(c.property,a[t])}}}}}})(vvvvjs_jquery);(function(h){VVVV.fps=60;VVVV.Core.MainLoop=function(b,g){function d(){if(0==b.resourcesPending){e++;var t=(new Date).getTime();a&&(q.deltaT=t-a);a=t;f.populateInputConnectors();b.evaluate();f.processOutputConnectors();t=(new Date).getTime()-a;0==e%10&&(m&&(console.log(1/((a-k)/1E4)+"fps"),m=!1),k=a);q.frameNum++}c&&window.setTimeout(function(){window.requestAnimationFrame(d)},Math.max(0,Math.round(1E3/VVVV.fps-t)))}VVVV.fps=g||60;var e=0,f=new VVVV.Core.DOMInterface(b),c=!0,a=void 0,k=0,m=!1;this.deltaT=
1E3/VVVV.fps;this.frameNum=0;b.setMainloop(this);var q=this;this.stop=function(){c=!1};this.start=function(){c||(c=!0,d())};this.isRunning=function(){return c};d();h(window).keydown(function(a){(102==a.which||70==a.which)&&(a.altKey&&a.ctrlKey)&&(m=!0)})}})(vvvvjs_jquery);(function(h){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,d,e){g=360*((g%1+1)%1);var f=Math.floor(g/60),c=g/60-f;g=e*(1-d);var a=e*(1-d*c);d=e*(1-d*(1-c));switch(f){case 1:this.rgba[0]=a;this.rgba[1]=e;this.rgba[2]=g;break;case 2:this.rgba[0]=g;this.rgba[1]=e;this.rgba[2]=d;break;case 3:this.rgba[0]=g;this.rgba[1]=
a;this.rgba[2]=e;break;case 4:this.rgba[0]=d;this.rgba[1]=g;this.rgba[2]=e;break;case 5:this.rgba[0]=e;this.rgba[1]=g;this.rgba[2]=a;break;default:this.rgba[0]=e,this.rgba[1]=d,this.rgba[2]=g}};this.getHSV=function(){var g=this.rgba[0],d=this.rgba[1],e=this.rgba[2],f=Math.max(g,Math.max(d,e)),c=Math.min(g,Math.min(d,e)),a;f==c?a=0:f==g?a=60*(0+(d-e)/(f-c)):f==d?a=60*(2+(e-g)/(f-c)):f==e&&(a=60*(4+(g-d)/(f-c)));0>a&&(a+=360);g=0;0!=f&&(g=(f-c)/f);return[a/360,g,f]};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]}}})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("X In",[0],VVVV.PinTypes.Value),e=this.addInputPin("Y In",[0],VVVV.PinTypes.Value),f=this.addInputPin("Include Upper",[1],VVVV.PinTypes.Value),c=this.addInputPin("Include Lower",[1],VVVV.PinTypes.Value),a=this.addInputPin("Include Equal",[1],VVVV.PinTypes.Value),k=this.addOutputPin("X Out",
[0],VVVV.PinTypes.Value),m=this.addOutputPin("Y Out",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var q=0,t=0;t<e.getSliceCount();t++)for(var n=0;n<d.getSliceCount();n++)0.5>f.getValue(0)&&t>n||(0.5>c.getValue(0)&&t<n||0.5>a.getValue(0)&&t==n)||(k.setValue(q,d.getValue(n)),m.setValue(q,e.getValue(t)),q++);k.setSliceCount(q);m.setSliceCount(q)}};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 d=this.addInputPin("X",[1],VVVV.PinTypes.Value),e=this.addInputPin("Y",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Angle",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Length",[1],VVVV.PinTypes.Value);this.initialize=function(){};this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),k=0;k<a;k++){var m=d.getValue(k),q=e.getValue(k);f.setValue(k,Math.atan2(q,m)/(2*Math.PI));c.setValue(k,Math.sqrt(m*
m+q*q))}f.setSliceCount(a);c.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 d=this.addInputPin("Angle",[0],VVVV.PinTypes.Value),e=this.addInputPin("Length",[1],VVVV.PinTypes.Value),f=this.addOutputPin("X",[1],VVVV.PinTypes.Value),c=this.addOutputPin("Y",[0],VVVV.PinTypes.Value);
this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),k=0;k<a;k++){var m=d.getValue(k),q=e.getValue(k);f.setValue(k,q*Math.cos(2*m*Math.PI));c.setValue(k,q*Math.sin(2*m*Math.PI))}f.setSliceCount(a);c.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 d=this.addInputPin("X1",
[0],VVVV.PinTypes.Value),e=this.addInputPin("Y1",[0],VVVV.PinTypes.Value),f=this.addInputPin("X2",[1],VVVV.PinTypes.Value),c=this.addInputPin("Y2",[0],VVVV.PinTypes.Value),a=this.addOutputPin("X",[0],VVVV.PinTypes.Value),k=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),m=this.addOutputPin("Length",[1],VVVV.PinTypes.Value),q=this.addOutputPin("Angle",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var t=this.getMaxInputSliceCount(),n=0;n<t;n++){var l=d.getValue(n),g=e.getValue(n),b=f.getValue(n),
h=c.getValue(n),b=b-l,h=h-g;a.setValue(n,l+b/2);k.setValue(n,g+h/2);m.setValue(n,Math.sqrt(b*b+h*h));q.setValue(n,Math.atan2(h,b)/(2*Math.PI))}a.setSliceCount(t);k.setSliceCount(t);m.setSliceCount(t);q.setSliceCount(t)}};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 d=this.addInputPin("X",
[0],VVVV.PinTypes.Value),e=this.addInputPin("Y",[0],VVVV.PinTypes.Value),f=this.addInputPin("Length",[1],VVVV.PinTypes.Value),c=this.addInputPin("Angle",[0],VVVV.PinTypes.Value),a=this.addOutputPin("X1",[0],VVVV.PinTypes.Value),k=this.addOutputPin("Y1",[0],VVVV.PinTypes.Value),m=this.addOutputPin("X2",[0],VVVV.PinTypes.Value),q=this.addOutputPin("Y2",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var t=this.getMaxInputSliceCount(),n=0;n<t;n++){var l=d.getValue(n),g=e.getValue(n),b=f.getValue(n),
h=c.getValue(n)-0.5*Math.PI,w=b/2*Math.sin(h),b=-b/2*Math.cos(h);a.setValue(n,l+w);k.setValue(n,g+b);m.setValue(n,l-w);q.setValue(n,g-b)}a.setSliceCount(t);k.setSliceCount(t);m.setSliceCount(t);q.setSliceCount(t)}};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 d=this.addInputPin("X",
[0],VVVV.PinTypes.Value),e=this.addInputPin("Y",[0],VVVV.PinTypes.Value),f=this.addInputPin("Attractor X",[0],VVVV.PinTypes.Value),c=this.addInputPin("Attractor Y",[0],VVVV.PinTypes.Value),a=this.addInputPin("Attractor Strength",[1],VVVV.PinTypes.Value),k=this.addInputPin("Attractor Power",[1],VVVV.PinTypes.Value),m=this.addInputPin("Attractor Radius",[0.1],VVVV.PinTypes.Value),q=this.addOutputPin("Output X",[0],VVVV.PinTypes.Value),t=this.addOutputPin("Output Y",[0],VVVV.PinTypes.Value);this.evaluate=
function(){for(var n=Math.max(d.getSliceCount(),e.getSliceCount()),l=Math.max(f.getSliceCount(),c.getSliceCount()),g,b,h,w,x,y,u=0;u<n;u++){g=d.getValue(u);b=e.getValue(u);for(var B=0;B<l;B++)if(h=f.getValue(B),w=c.getValue(B),attractorstrength=a.getValue(B),x=k.getValue(B),y=m.getValue(B),h=g-h,w=b-w,0!=h||0!=w){var r=Math.sqrt(Math.pow(h,2)+Math.pow(w,2)),A=0;r<=y&&(y=r/y,A=attractorstrength*(Math.pow(y,x)*(0>y?-1:0<y?1:0)/y-1));g+=h*A;b+=w*A}q.setValue(u,g);t.setValue(u,b)}q.setSliceCount(n);t.setSliceCount(n)}};
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 d=this.addInputPin("X In",[0],VVVV.PinTypes.Value),e=this.addInputPin("Y In",[0],VVVV.PinTypes.Value),f=this.addOutputPin("X1 Out",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Y1 Out",[0],VVVV.PinTypes.Value),a=this.addOutputPin("X2 Out",[0],VVVV.PinTypes.Value),
k=this.addOutputPin("Y2 Out",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var m=this.getMaxInputSliceCount(),q=0,t=0;t<m;t++)for(var n=t+1;n<m;n++)f.setValue(q,d.getValue(t)),c.setValue(q,e.getValue(t)),a.setValue(q,d.getValue(n)),k.setValue(q,e.getValue(n)),q++;f.setSliceCount(q);c.setSliceCount(q);a.setSliceCount(q);k.setSliceCount(q)}};VVVV.Nodes.ConnectAll2d.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("X",[0],VVVV.PinTypes.Value),e=this.addInputPin("Y",[0],VVVV.PinTypes.Value),f=this.addInputPin("Z",[-1],VVVV.PinTypes.Value),c=this.addOutputPin("Pitch",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Yaw",[0],VVVV.PinTypes.Value),k=this.addOutputPin("Length",[1],VVVV.PinTypes.Value);
this.evaluate=function(){for(var m=this.getMaxInputSliceCount(),q=0;q<m;q++){var t=d.getValue(q),n=e.getValue(q),l=f.getValue(q),g=Math.sqrt(t*t+n*n+l*l);a.setValue(q,Math.atan2(-t,-l)/(2*Math.PI));c.setValue(q,0==g?0:Math.acos(-n/g)/(2*Math.PI)-0.25);k.setValue(q,g)}a.setSliceCount(m);c.setSliceCount(m);k.setSliceCount(m)}};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 d=this.addInputPin("Pitch",[0],VVVV.PinTypes.Value),e=this.addInputPin("Yaw",[0],VVVV.PinTypes.Value),f=this.addInputPin("Length",[1],VVVV.PinTypes.Value),c=this.addOutputPin("X",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),k=this.addOutputPin("Z",[1],VVVV.PinTypes.Value);this.evaluate=function(){for(var m=this.getMaxInputSliceCount(),q=0;q<m;q++){var t=2*(d.getValue(q)+0.25)*Math.PI,n=2*e.getValue(q)*Math.PI,
l=f.getValue(q);k.setValue(q,-l*Math.cos(n)*Math.sin(t));c.setValue(q,-l*Math.sin(n)*Math.sin(t));a.setValue(q,-l*Math.cos(t))}c.setSliceCount(m);a.setSliceCount(m);k.setSliceCount(m)}};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 d=this.addInputPin("X",[1],VVVV.PinTypes.Value),e=this.addInputPin("Y",
[0],VVVV.PinTypes.Value),f=this.addInputPin("Z",[0],VVVV.PinTypes.Value),c=this.addOutputPin("NormalizedX",[1],VVVV.PinTypes.Value),a=this.addOutputPin("NormalizedY",[0],VVVV.PinTypes.Value),k=this.addOutputPin("NormalizedZ",[0],VVVV.PinTypes.Value),m=this.addOutputPin("Input Length",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var q=this.getMaxInputSliceCount(),t=0;t<q;t++){var n=d.getValue(t),l=e.getValue(t),g=f.getValue(t),b=Math.sqrt(n*n+l*l+g*g);c.setValue(t,0==b?0:n/b);a.setValue(t,
0==b?0:l/b);k.setValue(t,0==b?0:g/b);m.setValue(t,b)}c.setSliceCount(q);a.setSliceCount(q);k.setSliceCount(q);m.setSliceCount(q)}};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 d=this.addInputPin("XYZ",[],VVVV.PinTypes.Value),e=this.addOutputPin("NormalizedXYZ",[],VVVV.PinTypes.Value),
f=this.addOutputPin("Input Length",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c/3;a++){var k=d.getValue(a,3),m=Math.sqrt(k[0]*k[0]+k[1]*k[1]+k[2]*k[2]);e.setValue(3*a,0==m?0:k[0]/m);e.setValue(3*a+1,0==m?0:k[1]/m);e.setValue(3*a+2,0==m?0:k[2]/m);f.setValue(a,m)}e.setSliceCount(3*Math.ceil(c/3));f.setSliceCount(Math.ceil(c/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 d=this.addInputPin("Input1 XYZ",[],VVVV.PinTypes.Value),e=this.addInputPin("Input2 XYZ",[],VVVV.PinTypes.Value),f=this.addOutputPin("Output XYZ",[],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c/3;a++){var k=d.getValue(a,3),m=e.getValue(a,3);f.setValue(3*a+0,k[1]*m[2]-k[2]*m[1]);f.setValue(3*a+1,-(k[0]*m[2]-k[2]*m[0]));
f.setValue(3*a+2,k[0]*m[1]-k[1]*m[0])}f.setSliceCount(3*Math.ceil(c/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 d=this.addInputPin("Input1 XYZ",[],VVVV.PinTypes.Value),e=this.addInputPin("Input2 XYZ",[],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);
this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c/3;a++){var k=d.getValue(a,3),m=e.getValue(a,3);f.setValue(a,k[0]*m[0]+k[1]*m[1]+k[2]*m[2])}f.setSliceCount(Math.ceil(c/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 d=this.addInputPin("Transform",
[],VVVV.PinTypes.Transform),e=this.addInputPin("XYZ UnTransformed",[0,0,0],VVVV.PinTypes.Value),f=this.addOutputPin("XYZ Transformed",[0,0,0],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=Math.max(d.getSliceCount(),e.getSliceCount()/3),a=0;a<c;a++){var k=e.getValue(3*a,3),m=d.getValue(a);mat4.multiplyVec3(m,k);f.setValue(3*a+0,k[0]);f.setValue(3*a+1,k[1]);f.setValue(3*a+2,k[2])}f.setSliceCount(Math.ceil(3*c))}};VVVV.Nodes.Multiply3dVector.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("Period",[1],VVVV.PinTypes.Value),e=this.addInputPin("Pause",[0],VVVV.PinTypes.Value),f=this.addInputPin("Reverse",[0],VVVV.PinTypes.Value),c=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),a=this.addInputPin("Phase",[0],VVVV.PinTypes.Value),
k=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),m=this.addOutputPin("Change",[0],VVVV.PinTypes.Value),q=this.addOutputPin("Cycles",[0],VVVV.PinTypes.Value),t=[],n=[],l=(new Date).getTime(),p=(new Date).getTime();this.evaluate=function(){var g=this.getMaxInputSliceCount();l=(new Date).getTime()-p;for(var b=0;b<g;b++){var h=d.getValue(b),x=e.getValue(b),y=f.getValue(b),u=c.getValue(b),B=a.getValue(b),r=0;void 0==t[b]&&(t[b]=0);void 0==n[b]&&(n[b]=0);0.5>x&&(0!=h&&isFinite(h))&&(dv=1/(1E3*h)*l,
0<y&&(dv*=-1),t[b]+=dv,0>t[b]&&(n[b]-=Math.ceil(-t[b]),t[b]=1+t[b],r=1),1<t[b]&&(n[b]+=Math.floor(t[b]),r=1));p=(new Date).getTime();0.5<=u&&(t[b]=0,n[b]=0,r=1);if(0.5>x||0.5<=u)k.setValue(b,(t[b]+B)%1),m.setValue(b,r),q.setValue(b,n[b]);t[b]%=1}k.setSliceCount(g);m.setSliceCount(g);q.setSliceCount(g);t.splice(g);n.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 d=this.addInputPin("Go To Position",[0],VVVV.PinTypes.Value),e=this.addInputPin("FilterTime",[1],VVVV.PinTypes.Value),f=this.addOutputPin("Position Out",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Velocity Out",[0],VVVV.PinTypes.Value);this.addOutputPin("Acceleration Out",[0],VVVV.PinTypes.Value);var a=[],k=[],m=[],q=[],t=[],n=[];this.evaluate=function(){for(var l=this.getMaxInputSliceCount(),
b=d.pinIsChanged()||e.pinIsChanged(),g=0;g<l;g++){void 0==a[g]&&(a[g]=(new Date).getTime());var h=this.parentPatch.mainloop.deltaT,w=d.getValue(g),x=e.getValue(g);void 0==q[g]&&(q[g]=w);if(w!=k[g]||x!=m[g])n[g]=void 0,k[g]=w,m[g]=x,t[g]=0<m[g]?(k[g]-q[g])/(1E3*m[g]):0;Math.abs(t[g]*h)>Math.abs(k[g]-q[g])?q[g]=k[g]:q[g]+=t[g]*h;0!=n[g]&&(f.setValue(g,q[g]),c.setValue(g,t[g]));n[g]=k[g]-q[g];a[g]=(new Date).getTime()}b&&f.getSliceCount()!=l&&(k.splice(l),m.splice(l),a.splice(l),q.splice(l),t.splice(l),
n.splice(l),f.setSliceCount(l))}};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 d=this.addInputPin("Go To Position",[0],VVVV.PinTypes.Value),e=this.addInputPin("FilterTime",[1],VVVV.PinTypes.Value),f=this.addOutputPin("Position Out",
[0],VVVV.PinTypes.Value),c=this.addOutputPin("Velocity Out",[0],VVVV.PinTypes.Value);this.addOutputPin("Acceleration Out",[0],VVVV.PinTypes.Value);var a=[],k=[],m=[],q=[];this.evaluate=function(){for(var g=this.getMaxInputSliceCount(),n=d.pinIsChanged()||e.pinIsChanged(),l=0;l<g;l++){void 0==a[l]&&(a[l]=(new Date).getTime());var b=this.parentPatch.mainloop.deltaT,s=d.getValue(l),h=e.getValue(l);void 0==k[l]&&(k[l]=s);m[l]=0<h?(s-k[l])/(1E3*h):0;Math.abs(m[l]*b)>Math.abs(s-k[l])?k[l]=s:k[l]+=m[l]*
b;0!=q[l]&&(f.setValue(l,k[l]),c.setValue(l,m[l]));q[l]=s-k[l];a[l]=(new Date).getTime()}n&&f.getSliceCount()!=g&&(a.splice(g),k.splice(g),m.splice(g),q.splice(g),f.setSliceCount(g))}};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 d=this.addInputPin("Input",
[0],VVVV.PinTypes.Value),e=this.addInputPin("Time",[1],VVVV.PinTypes.Value),f=this.addInputPin("Insert",[1],VVVV.PinTypes.Value),c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),a=[],k=Array(1024);this.evaluate=function(){var m=this.getMaxInputSliceCount();now=(new Date).getTime();var q=d.pinIsChanged();if(void 0==d.getValue(0))q&&c.setValue(0,void 0);else{if(1==f.getValue(0)&&(q||e.pinIsChanged()))for(k.pop(),k.unshift(now),q=0;q<m;q++){if(void 0==a[q]){a[q]=Array(1024);for(var g=1024;g--;)a[q][g]=
0}1024<=a[q].length&&a[q].pop();a[q].unshift(d.getValue(q))}for(q=0;q<m;q++){for(var n=now-1E3*e.getValue(q),l=!1,g=0;1024>g;g++)if(k[g]<=n){c.values[q]!=a[q][g]&&c.setValue(q,a[q][g]);l=!0;break}l||0==c.values[q]||c.setValue(q,0)}c.setSliceCount(m);a.splice(m)}}};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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addOutputPin("OnChange",[0],VVVV.PinTypes.Value),f=[];this.evaluate=function(){var c=this.getMaxInputSliceCount();if(d.pinIsChanged()){for(var a=0;a<c;a++)f[a]!=d.getValue(a)?e.setValue(a,1):1==e.getValue(a)&&e.setValue(a,0),f[a]=d.getValue(a);e.setSliceCount(c)}else{for(a=0;a<c;a++)1==e.getValue(a)&&(e.setValue(a,0),e.setSliceCount(c));f[a]=d.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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Up Edge",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Down Edge",[0],VVVV.PinTypes.Value),c=[];this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),k=0;k<a;k++)(0>=Math.round(c[k])||void 0==c[k])&&1<=Math.round(d.getValue(k))?e.setValue(k,
1):0!=e.values[k]&&e.setValue(k,0),1<=Math.round(c[k])&&0>=Math.round(d.getValue(k))?f.setValue(k,1):0!=f.values[k]&&f.setValue(k,0),c[k]=d.getValue(k);e.setSliceCount(a);f.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 d=this.addInputPin("Set",[0],VVVV.PinTypes.Value),e=this.addInputPin("Reset",
[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Inverse Output",[1],VVVV.PinTypes.Value),a=!1;this.evaluate=function(){var k=this.getMaxInputSliceCount(),m=f.getSliceCount();if(k>m)for(;m<k;m++)f.setValue(m,0),c.setValue(m,1);for(m=0;m<k;m++){var q=void 0;1<=Math.round(e.getValue(m))&&(q=0);1<=Math.round(d.getValue(m))&&(q=1);void 0!=q?(f.setValue(m,q),c.setValue(m,1-q)):a||(f.setValue(m,0),c.setValue(m,1))}f.setSliceCount(k);c.setSliceCount(k);
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 d=this.addInputPin("Set",[0],VVVV.PinTypes.Value),e=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),f=this.addInputPin("Time",[0],VVVV.PinTypes.Value),c=this.addInputPin("Retriggerable",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Output",[0],
VVVV.PinTypes.Value),k=this.addOutputPin("Inverse Output",[1],VVVV.PinTypes.Value),m=[];this.evaluate=function(){var q=this.getMaxInputSliceCount(),g=a.getSliceCount();if(q>g)for(;g<q;g++)a.setValue(g,0),k.setValue(g,1);for(g=0;g<q;g++)if(void 0==m[g]&&(m[g]=0),void 0==a.getValue(g)&&a.setValue(g,0),1==a.getValue(g)){if(m[g]+=this.parentPatch.mainloop.deltaT/1E3,1==d.getValue(g)&&1==c.getValue(g)&&(m[g]=0),m[g]>=f.getValue(g)||1==e.getValue(g))m[g]=0,a.setValue(g,0),k.setValue(g,1)}else 1==d.getValue(g)&&
(a.setValue(g,1),k.setValue(g,0));a.setSliceCount(q);k.setSliceCount(q);m.splice(q)}};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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Set",[0],VVVV.PinTypes.Value),
f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){var c=this.getMaxInputSliceCount();if(e.pinIsChanged()||d.pinIsChanged()){for(var a=0;a<c;a++)void 0==f.values[a]&&f.setValue(a,0),1<=Math.round(e.getValue(a))&&f.setValue(a,d.getValue(a));f.setSliceCount(c)}}};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 d=this.addInputPin("Input 1",[0],VVVV.PinTypes.Value),e=this.addInputPin("Default 1",[0],VVVV.PinTypes.Value),f=this.addInputPin("Initialize",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Output 1",[0],VVVV.PinTypes.Value),a=[];this.evaluate=function(){for(var k=this.getMaxInputSliceCount(),m=0;m<k;m++)0.5<f.getValue(m)||void 0==a[m]?c.setValue(m,e.getValue(m)):c.setValue(m,a[m]);for(m=0;m<k;m++)a[m]=d.getValue(m);
c.setSliceCount(k)}};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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Inverse Output",
[1],VVVV.PinTypes.Value),a=!1;this.evaluate=function(){var k=this.getMaxInputSliceCount(),m=f.getSliceCount();if(k>m)for(;m<k;m++)f.setValue(m,0),c.setValue(m,1);for(m=0;m<k;m++){var q=void 0;1<=Math.round(e.getValue(m))&&(q=0);1<=Math.round(d.getValue(m))&&(q=1-f.getValue(m));void 0!=q&&f.getValue(m)!=q?(f.setValue(m,q),c.setValue(m,1-q)):a||(f.setValue(m,0),c.setValue(m,1))}f.setSliceCount(k);c.setSliceCount(k);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 d=this.addInputPin("Up",[0],VVVV.PinTypes.Value),e=this.addInputPin("Down",[0],VVVV.PinTypes.Value),f=this.addInputPin("Minimum",[0],VVVV.PinTypes.Value),c=this.addInputPin("Maximum",[15],VVVV.PinTypes.Value),a=this.addInputPin("Increment",[1],VVVV.PinTypes.Value),k=this.addInputPin("Default",
[0],VVVV.PinTypes.Value),m=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),q=this.addInputPin("Mode",["Wrap"],VVVV.PinTypes.Enum);q.enumOptions=["Wrap","Unlimited","Clamp"];var t=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),n=this.addOutputPin("Underflow",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Overflow",[0],VVVV.PinTypes.Value),p=!1;this.evaluate=function(){for(var g=this.getMaxInputSliceCount(),b=f.pinIsChanged()||c.pinIsChanged()||k.pinIsChanged()||m.pinIsChanged()||q.pinIsChanged(),
h=0;h<g;h++)1!=l.getValue(h)&&p||l.setValue(h,0),1!=n.getValue(h)&&p||n.setValue(h,0),p||t.setValue(h,0),b=b||0.5<=d.getValue(h)||0.5<=e.getValue(h);if(b){for(h=0;h<g;h++){var b=a.getValue(h),x=h>=t.getSliceCount()?0:t.getValue(h),y=c.getValue(h),u=f.getValue(h),B=0;"Unlimited"==q.getValue(h)&&(B=1);"Clamp"==q.getValue(h)&&(B=2);switch(B){case 1:0.5<=d.getValue(h)&&(x+=b);0.5<=e.getValue(h)&&(x-=b);break;case 2:0.5<=d.getValue(h)&&(x+=b);0.5<=e.getValue(h)&&(x-=b);x>y&&(x=y,l.setValue(h,1));x<u&&
(x=u,n.setValue(h,1));break;default:0.5<=d.getValue(h)&&(x+=b),0.5<=e.getValue(h)&&(x-=b),x>y&&(x=u,l.setValue(h,1)),x<u&&(x=y,n.setValue(h,1))}t.getValue(h)!=x&&t.setValue(h,x);0.5<=m.getValue(h)&&t.setValue(h,k.getValue(h))}t.setSliceCount(g);n.setSliceCount(g);l.setSliceCount(g)}p=!0}};VVVV.Nodes.Counter.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=new Date,e=this.addOutputPin("GMT",[],VVVV.PinTypes.Value),f=this.addOutputPin("Time Zone",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Time Zone Name",
[""],VVVV.PinTypes.String);this.addOutputPin("Daylight Saving Time",[d.getTimezoneOffset()<function(a){var c=new Date(a.getFullYear(),0,1);a=new Date(a.getFullYear(),6,1);return Math.max(c.getTimezoneOffset(),a.getTimezoneOffset())}(d)?1:0],VVVV.PinTypes.Value);var a=this.addOutputPin("Current Time",[],VVVV.PinTypes.Value);this.evaluate=function(){var k=new Date,m=36E5*k.getTimezoneOffset(),d=k.getTime();e.setValue(0,d/1E3/60/60/24+25569);f.setValue(0,m/1E3/60/60);k.toString().match(/\((.+)\)$/)?
c.setValue(0,k.toString().match(/\((.+)\)$/)[1]):c.setValue(0,"n/a");a.setValue(0,(d-m)/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 d=this.addInputPin("Time",[41491.4301],VVVV.PinTypes.Value),e=this.addOutputPin("Millisecond",[0],VVVV.PinTypes.Value),
f=this.addOutputPin("Second",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Minute",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Hour",[0],VVVV.PinTypes.Value),k=this.addOutputPin("DayOfWeek",[0],VVVV.PinTypes.Value),m=this.addOutputPin("Day",[1],VVVV.PinTypes.Value),q=this.addOutputPin("Month",[1],VVVV.PinTypes.Value),t=this.addOutputPin("Year",[2E3],VVVV.PinTypes.Value);this.evaluate=function(){for(var g=this.getMaxInputSliceCount(),l=0;l<g;l++){var b=864E5*(d.getValue(l)-25569),b=new Date(b),h=
b.getMilliseconds();e.setValue(l,h);h=b.getSeconds();f.setValue(l,h);h=b.getMinutes();c.setValue(l,h);h=b.getHours();a.setValue(l,h);h=b.getDay();k.setValue(l,h);h=b.getDate();m.setValue(l,h);h=b.getMonth()+1;q.setValue(l,h);h=b.getYear()+1900;t.setValue(l,h)}e.setSliceCount(g);f.setSliceCount(g);c.setSliceCount(g);a.setSliceCount(g);k.setSliceCount(g);m.setSliceCount(g);q.setSliceCount(g);t.setSliceCount(g)}};VVVV.Nodes.GregorianAstronomySplit.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),e=[],f=this.addOutputPin("Output",[1],VVVV.PinTypes.Value);this.initialize=function(){var c=Math.max(2,d.getValue(0));VVVV.Helpers.dynamicPins(this,e,c,function(a){return this.addInputPin("Input "+(a+1),[1],VVVV.PinTypes.Value)})};this.evaluate=function(){d.pinIsChanged()&&
this.initialize();for(var c=this.getMaxInputSliceCount(),a=e.length,k,m=0;m<c;m++){k=!0;for(var g=0;g<a;g++)k=k&&0.5<=e[g].getValue(m);f.setValue(m,k?1:0)}f.setSliceCount(c)}};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 d=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),e=[],f=this.addOutputPin("Output",[1],VVVV.PinTypes.Value);
this.initialize=function(){var c=Math.max(2,d.getValue(0));VVVV.Helpers.dynamicPins(this,e,c,function(a){return this.addInputPin("Input "+(a+1),[1],VVVV.PinTypes.Value)})};this.evaluate=function(){d.pinIsChanged()&&this.initialize();for(var c=this.getMaxInputSliceCount(),a=e.length,k,m=0;m<c;m++){k=!1;for(var g=0;g<a;g++)k=k||0.5<=e[g].getValue(m);f.setValue(m,k?1:0)}f.setSliceCount(c)}};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 d=this.addInputPin("Input",[1],VVVV.PinTypes.Value),e=this.addOutputPin("Output",[1],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),c=0;c<f;c++)e.setValue(c,1-Math.round(d.getValue(c)));e.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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Bin Size",[-1],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0,k=0,m=!1,g=0;g<c||0<e.getValue(0)&&(0<k||0!=a%e.getSliceCount());g++)0==k&&(m=!1),m=m||0.5<=d.getValue(g),k++,0<e.getValue(0)?k>=e.getValue(a)&&(f.setValue(a,
m?1:0),a++,k=0):f.setValue(0,m?1:0);f.setSliceCount(a+(0<k))}};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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Bin Size",[-1],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=
this.getMaxInputSliceCount(),a=0,k=0,m=!1,g=0;g<c||0<e.getValue(0)&&(0<k||0!=a%e.getSliceCount());g++)0==k&&(m=!0),m=m&&0.5<=d.getValue(g),k++,0<e.getValue(0)?k>=e.getValue(a)&&(f.setValue(a,m?1:0),a++,k=0):f.setValue(0,m?1:0);f.setSliceCount(a+(0<k))}};VVVV.Nodes.AndSpectral.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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(d){d.fillColor.copy_to(this.fillColor);d.strokeColor.copy_to(this.strokeColor);
this.lineWidth=d.lineWidth;this.capStyle=d.capStyle;this.joinStyle=d.joinStyle;this.gradient=d.gradient;this.shadowOffsetX=d.shadowOffsetX;this.shadowOffsetY=d.shadowOffsetY;this.shadowBlur=d.shadowBlur;d.shadowColor.copy_to(this.shadowColor);this.blendMode=d.blendMode};this.apply=function(d){if("none"!=this.gradient.type){if("linear"==this.gradient.type)var e=d.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),c=0;c<f;c++){var a=this.gradient.colors[c];e.addColorStop(this.gradient.colorPositions[c],"rgba("+parseInt(255*a.rgba[0])+","+parseInt(255*a.rgba[1])+","+parseInt(255*a.rgba[2])+","+a.rgba[3]+")")}d.fillStyle=e}else d.fillStyle="rgba("+parseInt(255*this.fillColor.rgba[0])+","+parseInt(255*this.fillColor.rgba[1])+","+parseInt(255*this.fillColor.rgba[2])+","+this.fillColor.rgba[3]+")";d.strokeStyle="rgba("+parseInt(255*this.strokeColor.rgba[0])+","+parseInt(255*
this.strokeColor.rgba[1])+","+parseInt(255*this.strokeColor.rgba[2])+","+this.strokeColor.rgba[3]+")";d.lineWidth=this.lineWidth/d.canvas.height;d.lineCap=this.capStyle;d.lineJoin=this.joinStyle;d.shadowOffsetX=this.shadowOffsetX;d.shadowOffsetY=this.shadowOffsetY;d.shadowBlur=this.shadowBlur;d.shadowColor="rgba("+parseInt(255*this.shadowColor.rgba[0])+","+parseInt(255*this.shadowColor[1])+","+parseInt(255*this.shadowColor[2])+","+this.shadowColor[3]+")";d.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.PinTypes.CanvasLayer={typeName:"CanvasLayer",reset_on_disconnect:!0,defaultValue:function(){this.draw=function(){}}};VVVV.Nodes.FillCanvas=function(d,e){this.constructor(d,"Fill (Canvas VVVVjs RenderState)",e);this.meta={authors:["Matthias Zauner"],
original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.CanvasRenderState),c=this.addInputPin("Color",[new VVVV.Types.Color("1.0, 1.0, 1.0, 1.0")],VVVV.PinTypes.Color),a=this.addOutputPin("Render State Out",[],VVVV.PinTypes.CanvasRenderState),k=[];this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),d=0;d<e;d++)void 0==k[d]&&(k[d]=new VVVV.Types.CanvasRenderState),k[d].copy_attributes(f.getValue(d)),c.getValue(d).copy_to(k[d].fillColor),
a.setValue(d,k[d]);a.setSliceCount(e)}};VVVV.Nodes.FillCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.StrokeCanvas=function(d,e){this.constructor(d,"Stroke (Canvas VVVVjs RenderState)",e);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.CanvasRenderState),c=this.addInputPin("Color",[new VVVV.Types.Color("1.0, 1.0, 1.0, 1.0")],VVVV.PinTypes.Color),a=this.addInputPin("Width",[1],VVVV.PinTypes.Value),
k=this.addInputPin("Cap Style",["butt"],VVVV.PinTypes.Enum);k.enumOptions=["butt","round","square"];var m=this.addInputPin("Join Style",["miter"],VVVV.PinTypes.Enum);m.enumOptions=["miter","round","bevel"];var g=this.addOutputPin("Render State Out",[],VVVV.PinTypes.CanvasRenderState),b=[];this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),d=0;d<e;d++)void 0==b[d]&&(b[d]=new VVVV.Types.CanvasRenderState),b[d].copy_attributes(f.getValue(d)),c.getValue(d).copy_to(b[d].strokeColor),b[d].lineWidth=
a.getValue(d),b[d].capStyle=k.getValue(d),b[d].joinStyle=m.getValue(d),g.setValue(d,b[d]);g.setSliceCount(e)}};VVVV.Nodes.StrokeCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.ShadowCanvas=function(d,e){this.constructor(d,"Shadow (Canvas VVVVjs RenderState)",e);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.CanvasRenderState),c=this.addInputPin("Color",[new VVVV.Types.Color("0.0, 0.0, 0.0, 1.0")],
VVVV.PinTypes.Color),a=this.addInputPin("Offset X",[0],VVVV.PinTypes.Value),k=this.addInputPin("Offset Y",[0],VVVV.PinTypes.Value),m=this.addInputPin("Blur",[0],VVVV.PinTypes.Value),g=this.addOutputPin("Render State Out",[],VVVV.PinTypes.CanvasRenderState),b=[];this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),d=0;d<e;d++)void 0==b[d]&&(b[d]=new VVVV.Types.CanvasRenderState),b[d].copy_attributes(f.getValue(d)),b[d].shadowOffsetX=a.getValue(d),b[d].shadowOffsetY=k.getValue(d),b[d].shadowBlur=
m.getValue(d),c.getValue(d).copy_to(b[d].shadowColor),g.setValue(d,b[d]);g.setSliceCount(e)}};VVVV.Nodes.ShadowCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.BlendCanvas=function(d,e){this.constructor(d,"Blend (Canvas VVVVjs RenderState)",e);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.CanvasRenderState),c=this.addInputPin("Mode",["source-over"],VVVV.PinTypes.Enum);c.enumOptions="source-over source-out source-in source-atop destination-over destination-out destination-in destination-atop copy lighter xor".split(" ");
var a=this.addOutputPin("Render State Out",[],VVVV.PinTypes.CanvasRenderState),k=[];this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),d=0;d<e;d++)void 0==k[d]&&(k[d]=new VVVV.Types.CanvasRenderState),k[d].copy_attributes(f.getValue(d)),k[d].blendMode=c.getValue(d),a.setValue(d,k[d]);a.setSliceCount(e)}};VVVV.Nodes.BlendCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.LinearGradientCanvas=function(d,e){this.constructor(d,"LinearGradient (Canvas VVVVjs RenderState)",e);this.meta={authors:["Matthias Zauner"],
original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.CanvasRenderState),c=this.addInputPin("Start X",[0],VVVV.PinTypes.Value),a=this.addInputPin("Start Y",[0],VVVV.PinTypes.Value),k=this.addInputPin("End X",[0],VVVV.PinTypes.Value),m=this.addInputPin("End Y",[0],VVVV.PinTypes.Value),g=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),b=this.addInputPin("Color Positions",
[0,1],VVVV.PinTypes.Value),n=this.addOutputPin("Render State Out",[],VVVV.PinTypes.CanvasRenderState),l=[];this.evaluate=function(){for(var e=Math.max(f.getSliceCount(),c.getSliceCount()),e=Math.max(e,a.getSliceCount()),e=Math.max(e,k.getSliceCount()),e=Math.max(e,m.getSliceCount()),d=0;d<e;d++){void 0==l[d]&&(l[d]=new VVVV.Types.CanvasRenderState);l[d].copy_attributes(f.getValue(d));l[d].gradient={type:"linear"};l[d].gradient.startX=c.getValue(d);l[d].gradient.startY=a.getValue(d);l[d].gradient.endX=
k.getValue(d);l[d].gradient.endY=m.getValue(d);l[d].gradient.colors=[];l[d].gradient.colorPositions=[];for(var h=Math.max(g.getSliceCount(),b.getSliceCount()),w=0;w<h;w++)l[d].gradient.colors.push(g.getValue(w)),l[d].gradient.colorPositions.push(b.getValue(w));n.setValue(d,l[d])}n.setSliceCount(e)}};VVVV.Nodes.LinearGradientCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.ArcCanvas=function(d,e){this.constructor(d,"Arc (Canvas VVVVjs)",e);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],
compatibility_issues:[]};var f=this.addInputPin("Render State",[],VVVV.PinTypes.CanvasRenderState),c=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),a=this.addInputPin("Clipping Layer",[],VVVV.PinTypes.CanvasLayer),k=this.addInputPin("Radius",[1],VVVV.PinTypes.Value),m=this.addInputPin("Start Angle",[0],VVVV.PinTypes.Value),q=this.addInputPin("End Angle",[0.5],VVVV.PinTypes.Value),t=this.addInputPin("Draw Segment",[0],VVVV.PinTypes.Value),n=this.addOutputPin("Layer",[],VVVV.PinTypes.CanvasLayer),
l=[],p=function(){this.transform=mat4.create();mat4.identity(this.transform);this.startAngle=0;this.endAngle=0.5;this.strokeColor=[1,1,1,1];this.lineWidth=1;this.renderState=b;this.clippingLayer=void 0;this.drawSegment=!1;this.draw=function(a,c){this.clippingLayer&&(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.beginPath();c?g.apply(a):this.renderState.apply(a);
this.drawSegment&&(a.moveTo(0,0),a.lineTo(Math.cos(this.startAngle)*this.radius,Math.sin(this.startAngle)*this.radius));a.arc(0,0,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&&a.restore()}};this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),d=0;d<e;d++)void 0==
l[d]&&(l[d]=new p),l[d].transform=c.getValue(d),l[d].radius=k.getValue(d),l[d].startAngle=2*m.getValue(d)*Math.PI,l[d].endAngle=2*q.getValue(d)*Math.PI,l[d].renderState=f.getValue(d),l[d].drawSegment=1==t.getValue(d),a.isConnected()&&(l[d].clippingLayer=a.getValue(d));for(d=0;d<l.length;d++)n.setValue(d,l[d]);n.setSliceCount(e)}};VVVV.Nodes.ArcCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.RectangleCanvas=function(d,e){this.constructor(d,"Rectangle (Canvas VVVVjs)",e);this.meta={authors:["Matthias Zauner"],
original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State",[],VVVV.PinTypes.CanvasRenderState),c=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),a=this.addInputPin("Clipping Layer",[],VVVV.PinTypes.CanvasLayer),k=this.addInputPin("Width",[1],VVVV.PinTypes.Value),m=this.addInputPin("Height",[1],VVVV.PinTypes.Value),q=this.addInputPin("Corner Radius",[0],VVVV.PinTypes.Value),t=this.addOutputPin("Layer",[],VVVV.PinTypes.CanvasLayer),n=[],l=function(){this.transform=
mat4.create();mat4.identity(this.transform);this.renderState=b;this.clippingLayer=void 0;this.draw=function(a,c){this.clippingLayer&&(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.beginPath();c?g.apply(a):this.renderState.apply(a);var f=this.width/2,e=f-this.cornerRadius,k=this.height/2,d=k-this.cornerRadius,m=-f,b=-e,q=-k,l=-d;a.moveTo(b,
q);a.lineTo(e,q);a.arc(e,l,this.cornerRadius,1.5*Math.PI,0,!1);a.lineTo(f,d);a.arc(e,d,this.cornerRadius,0,0.5*Math.PI,!1);a.lineTo(b,k);a.arc(b,d,this.cornerRadius,0.5*Math.PI,Math.PI,!1);a.lineTo(m,l);a.arc(b,l,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&&a.restore()}};this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),d=0;d<e;d++)void 0==n[d]&&(n[d]=new l),
n[d].transform=c.getValue(d),n[d].width=k.getValue(d),n[d].height=m.getValue(d),n[d].cornerRadius=q.getValue(d),n[d].renderState=f.getValue(d),a.isConnected()&&(n[d].clippingLayer=a.getValue(d));for(d=0;d<n.length;d++)t.setValue(d,n[d]);t.setSliceCount(e)}};VVVV.Nodes.RectangleCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.TextCanvas=function(d,e){this.constructor(d,"Text (Canvas VVVVjs)",e);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State",
[],VVVV.PinTypes.CanvasRenderState),c=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),a=this.addInputPin("Clipping Layer",[],VVVV.PinTypes.CanvasLayer),k=this.addInputPin("Text",["VVVV.js"],VVVV.PinTypes.String),m=this.addInputPin("Font",["10px sans-serif"],VVVV.PinTypes.String),q=this.addInputPin("Align",["start"],VVVV.PinTypes.Enum);q.enumOptions=["start","left","end","right","center"];var t=this.addInputPin("Baseline",["alphabetic"],VVVV.PinTypes.Enum);t.enumOptions="top hanging middle alphabetic ideographic bottom".split(" ");
var n=this.addOutputPin("Layer",[],VVVV.PinTypes.CanvasLayer),l=[],h=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=void 0;this.draw=function(a,c){this.clippingLayer&&(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(0.01,-0.01);a.font="100px "+this.font;a.textAlign=this.align;a.textBaseline=this.baseline;c?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&&a.restore()}};this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),d=0;d<e;d++)void 0==l[d]&&(l[d]=new h),l[d].transform=c.getValue(d),l[d].text=k.getValue(d),l[d].font=
m.getValue(d),l[d].align=q.getValue(d),l[d].baseline=t.getValue(d),l[d].renderState=f.getValue(d),l[d].clippingLayer=a.getValue(d);for(d=0;d<l.length;d++)n.setValue(d,l[d]);n.setSliceCount(e)}};VVVV.Nodes.TextCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.BezierCurveCanvas=function(d,e){function f(a,c){a.x.splice(c);a.y.splice(c);a.c1x.splice(c);a.c1y.splice(c);a.c2x.splice(c);a.c2y.splice(c)}this.constructor(d,"BezierCurve (Canvas VVVVjs)",e);this.meta={authors:["Matthias Zauner"],original_authors:[],
credits:[],compatibility_issues:[]};var c=this.addInputPin("Render State",[],VVVV.PinTypes.CanvasRenderState),a=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),k=this.addInputPin("Clipping Layer",[],VVVV.PinTypes.CanvasLayer),m=this.addInputPin("X",[0],VVVV.PinTypes.Value),q=this.addInputPin("Y",[0],VVVV.PinTypes.Value),t=this.addInputPin("Control 1 X",[0],VVVV.PinTypes.Value),n=this.addInputPin("Control 1 Y",[0],VVVV.PinTypes.Value),l=this.addInputPin("Control 2 X",[0],VVVV.PinTypes.Value),
h=this.addInputPin("Control 2 Y",[0],VVVV.PinTypes.Value),s=this.addInputPin("BinSize",[-1],VVVV.PinTypes.Value),v=this.addOutputPin("Layer",[],VVVV.PinTypes.CanvasLayer),w=[],x=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=void 0;this.draw=function(a,c){if(!(1>this.x.length)){this.clippingLayer&&(a.save(),
this.clippingLayer.draw(a,!0),a.clip());c?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&&a.restore()}}};this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),d=0,g=0,b=0;b<e||0<s.getValue(0)&&(0<g||0<d%a.getSliceCount());b++)void 0==w[d]&&(w[d]=new x),0==g&&(w[d].renderState=c.getValue(d),w[d].transform=a.getValue(d),k.isConnected()&&(w[d].clippingLayer=k.getValue(d))),w[d].x[g]=m.getValue(b),w[d].y[g]=q.getValue(b),w[d].c1x[g]=t.getValue(b),w[d].c1y[g]=n.getValue(b),w[d].c2x[g]=l.getValue(b),w[d].c2y[g]=h.getValue(b),g++,0<s.getValue(0)&&g>=s.getValue(d)&&
(g<w[d].x.length&&f(w[d],g),d++,g=0);0>s.getValue(0)?g<w[d].x.length&&(f(w[d],g),w.splice(1)):w.splice(d);for(e=0;e<w.length;e++)v.setValue(e,w[e]);v.setSliceCount(w.length)}};VVVV.Nodes.BezierCurveCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.QuadCanvas=function(d,e){this.constructor(d,"Quad (Canvas VVVVjs)",e);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),c=this.addInputPin("Clipping Layer",
[],VVVV.PinTypes.CanvasLayer),a=this.addInputPin("Texture",[],VVVV.PinTypes.HTML5Texture),k=this.addInputPin("Color",[new VVVV.Types.Color("1.0, 1.0, 1.0, 1.0")],VVVV.PinTypes.Color),m=this.addOutputPin("Layer",[],VVVV.PinTypes.CanvasLayer),g=[],b=function(){this.transform=mat4.create();this.clippingLayer=void 0;mat4.identity(this.transform);this.texture=VVVV.PinTypes.HTML5Texture.defaultValue();this.color=[1,1,1,1];this.draw=function(a,c){this.clippingLayer&&(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(-0.5,0.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(-0.5,
-0.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(-0.5,-0.5,1,1));this.clippingLayer&&a.restore()}};this.evaluate=function(){for(var e=this.getMaxInputSliceCount(),d=0;d<e;d++)void 0==g[d]&&(g[d]=new b),g[d].transform=f.getValue(d),g[d].texture=a.getValue(d),g[d].color=k.getValue(d),c.isConnected()&&(g[d].clippingLayer=c.getValue(d));for(d=0;d<g.length;d++)m.setValue(d,
g[d]);m.setSliceCount(e)}};VVVV.Nodes.QuadCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.GroupCanvas=function(d,e){this.constructor(d,"Group (Canvas VVVVjs)",e);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var f=this.addInvisiblePin("Layer Count",[2],VVVV.PinTypes.Value),c=[],a=this.addOutputPin("Layer",[],VVVV.PinTypes.CanvasLayer);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.CanvasLayer)})};this.evaluate=function(){f.pinIsChanged()&&this.initialize();for(var e=0,d=c.length,g,b=0;b<d;b++)if(c[b].isConnected()){g=c[b].getSliceCount();for(var n=0;n<g;n++)a.setValue(e++,c[b].getValue(n))}a.setSliceCount(e)}};VVVV.Nodes.GroupCanvas.prototype=new VVVV.Core.Node;VVVV.Nodes.RendererCanvas=function(d,e){function f(a){function c(f){switch(f.which){case 1:VVVV.MousePositions._all.lb=0;VVVV.MousePositions[a.id].lb=0;break;case 2:VVVV.MousePositions._all.mb=
0;VVVV.MousePositions[a.id].mb=0;break;case 3:VVVV.MousePositions._all.rb=0,VVVV.MousePositions[a.id].rb=0}}h(a).detach("mousemove");h(a).detach("mousedown");h(a).detach("mouseup");VVVV.MousePositions[a.id]={x:0,y:0,wheel:0,lb:0,mb:0,rb:0};h(a).mousemove(function(c){var f=2*(c.pageX-h(this).offset().left)/h(this).width()-1;c=-(2*(c.pageY-h(this).offset().top)/h(this).height()-1);VVVV.MousePositions._all.x=f;VVVV.MousePositions._all.y=c;VVVV.MousePositions[a.id].x=f;VVVV.MousePositions[a.id].y=c});
h(a).bind("mousewheel",function(c){c=c.originalEvent.wheelDelta/120;VVVV.MousePositions[a.id].wheel+=c;VVVV.MousePositions._all.wheel+=c});h(a).bind("DOMMouseScroll",function(c){c=-c.originalEvent.detail/3;VVVV.MousePositions[a.id].wheel+=c;VVVV.MousePositions._all.wheel+=c});h(a).mousedown(function(f){switch(f.which){case 1:VVVV.MousePositions._all.lb=1;VVVV.MousePositions[a.id].lb=1;break;case 2:VVVV.MousePositions._all.mb=1;VVVV.MousePositions[a.id].mb=1;break;case 3:VVVV.MousePositions._all.rb=
1,VVVV.MousePositions[a.id].rb=1}h(document).unbind("mouseup",c);h(document).mouseup(c)})}this.constructor(d,"Renderer (Canvas VVVVjs)",e);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var c=this.addInputPin("Layers",[],VVVV.PinTypes.CanvasLayer);this.addInputPin("Clear",[1],VVVV.PinTypes.Value);var a=this.addInputPin("Background Color",[new VVVV.Types.Color("0.0, 0.0, 0.0, 1.0")],VVVV.PinTypes.Color),k=this.addInputPin("Backbuffer Width",
[0],VVVV.PinTypes.Value),m=this.addInputPin("Backbuffer Height",[0],VVVV.PinTypes.Value),g=this.addInputPin("View",[],VVVV.PinTypes.Transform),t=this.addOutputPin("Canvas Out",[]),n,l,p,s=[0,0,0,1],v,w=mat4.create(),x;this.getContext=function(){var a=this.invisiblePins["Descriptive Name"].getValue(0);if((a=h(a).get(0))&&"CANVAS"==a.nodeName)v=a;else{var c=parseInt(k.getValue(0)),e=parseInt(m.getValue(0));v=h('<canvas width="'+(0<c?c:512)+'" height="'+(0<e?e:512)+'" id="vvvv-js-generated-renderer-'+
(new Date).getTime()+'" class="vvvv-js-generated-renderer"></canvas>');a||(a="body");h(a).append(v);v=v.get(0)}l=v.width;p=v.height;v&&v.getContext&&(f(v),n=v.getContext("2d"),v.ctx=n,n.restoreView=function(){n.setTransform(w[0],w[1],w[4],w[5],w[12],w[13])})};this.destroy=function(){h(v).remove()};this.evaluate=function(){this.invisiblePins["Descriptive Name"].pinIsChanged()&&(h(v).hasClass("vvvv-js-generated-renderer")&&h(v).remove(),this.getContext());if(n){if(k.pinIsChanged()||m.pinIsChanged()){var f=
parseInt(k.getValue(0)),e=parseInt(m.getValue(0));0<f&&(l=f,h(v).attr("width",l));0<e&&(p=e,h(v).attr("height",p));x=mat4.create([l/2,0,0,0,0,-p/2,0,0,0,0,1,0,l/2,p/2,0,1]);mat4.multiply(x,g.getValue(0),w)}a.pinIsChanged()&&(f=a.getValue(0),s[0]=parseInt(255*f.rgba[0]),s[1]=parseInt(255*f.rgba[1]),s[2]=parseInt(255*f.rgba[2]),s[3]=f.rgba[3]);b.apply(n);n.setTransform(1,0,0,1,0,0);1>s[3]&&n.clearRect(0,0,l,p);n.fillStyle="rgba("+s[0]+","+s[1]+","+s[2]+","+s[3]+")";n.fillRect(0,0,l,p);g.pinIsChanged()&&
mat4.multiply(x,g.getValue(0),w);n.restoreView();if(c.isConnected())for(f=0;f<c.getSliceCount();f++)c.getValue(f).draw(n);t.setValue(0,v);v.loaded=!0}}};VVVV.Nodes.RendererCanvas.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("Red",[1],VVVV.PinTypes.Value),e=this.addInputPin("Green",[1],VVVV.PinTypes.Value),f=this.addInputPin("Blue",[1],VVVV.PinTypes.Value),
c=this.addInputPin("Alpha",[1],VVVV.PinTypes.Value),a=this.addOutputPin("Output",[],VVVV.PinTypes.Color),k=[];this.evaluate=function(){for(var m=this.getMaxInputSliceCount(),g=0;g<m;g++)k[g]||(k[g]=new VVVV.Types.Color("0.0,0.0,0.0,0.0")),k[g].rgba[0]=d.getValue(g)||0,k[g].rgba[1]=e.getValue(g)||0,k[g].rgba[2]=f.getValue(g)||0,k[g].rgba[3]=c.getValue(g)||0,a.setValue(g,k[g]);k.length=m;a.setSliceCount(m)}};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 d=this.addInputPin("Hue",[0.33],VVVV.PinTypes.Value),e=this.addInputPin("Saturation",[0],VVVV.PinTypes.Value),f=this.addInputPin("Value",[1],VVVV.PinTypes.Value),c=this.addInputPin("Alpha",[1],VVVV.PinTypes.Value),a=this.addOutputPin("Output",[],VVVV.PinTypes.Color),k=[],m,q,t,n;this.evaluate=function(){for(var g=this.getMaxInputSliceCount(),b=0;b<g;b++)m=d.getValue(b),
q=e.getValue(b),t=f.getValue(b),n=c.getValue(b),k[b]||(k[b]=new VVVV.Types.Color("0.0, 0.0, 0.0, 0.0")),k[b].setHSV(m,q,t),k[b].rgba[3]=n,a.setValue(b,k[b]);k.length=g;a.setSliceCount(g)}};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 d=this.addInputPin("Color Input",[new VVVV.Types.Color("0.0, 1.0, 0.0, 1.0")],
VVVV.PinTypes.Color),e=this.addOutputPin("Color Output",[],VVVV.PinTypes.Color);this.addInvisiblePin("Rows",[1],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),c=0;c<f;c++)e.setValue(c,d.getValue(c));e.setSliceCount(f)}};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 d=this.addInputPin("Input",[new VVVV.Types.Color("0.0, 0.0, 0.0, 0.0")],VVVV.PinTypes.Color),e=this.addInputPin("Alpha",[1],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[],VVVV.PinTypes.Color),c=[];this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),k=0;k<a;k++){var m=d.getValue(k),g=e.getValue(k);c[k]||(c[k]=new VVVV.Types.Color("0.0, 0.0, 0.0, 0.0"));c[k].rgba[0]=m.rgba[0];c[k].rgba[1]=m.rgba[1];c[k].rgba[2]=m.rgba[2];c[k].rgba[3]=g;f.setValue(k,c[k])}c.length=a;f.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 d=this.addInputPin("Switch",[0],VVVV.PinTypes.Value),e=[];e[0]=this.addInputPin("Input 1",[],VVVV.PinTypes.Color);e[1]=this.addInputPin("Input 2",[],VVVV.PinTypes.Color);var f=this.addOutputPin("Output",[],VVVV.PinTypes.Color);this.addInvisiblePin("Input Count",
[2],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++)f.setValue(a,e[Math.round(Math.abs(d.getValue(a)))%e.length].getValue(a));f.setSliceCount(c)}};VVVV.Nodes.SwitchColorInput.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("Input Real",[0],VVVV.PinTypes.Value),e=this.addInputPin("Input Imagiary",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0.5],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++)f.setValue(a,Math.sqrt(Math.pow(d.getValue(a),2)+Math.pow(e.getValue(a),
2)));f.setSliceCount(c)}};VVVV.Nodes.Abs.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("Position In",[0],VVVV.PinTypes.Value),e=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Position Out",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Velocity Out",[0],VVVV.PinTypes.Value),a=[];this.evaluate=function(){dt=this.parentPatch.mainloop.deltaT/
1E3;for(var k=this.getMaxInputSliceCount(),m=0;m<k;m++){void 0==a[m]&&(a[m]=0);var g=d.getValue(m);a[m]+=g*dt;0.5<=e.getValue(m)&&(a[m]=0);f.setValue(m,a[m]);c.setValue(m,g)}f.setSliceCount(k);c.setSliceCount(k);a.splice(k)}};VVVV.Nodes.Integrate.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("String Value",[],VVVV.PinTypes.String),e=this.addOutputPin("Enum",[],VVVV.PinTypes.Enum);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),c=0;c<f;c++)e.setValue(c,d.getValue(c));e.setSliceCount(f)}};VVVV.Nodes.String2Enum.prototype=
new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("Filename",[],VVVV.PinTypes.String),e=this.addOutputPin("Texture Out",[],VVVV.PinTypes.HTML5Texture),f=this.addOutputPin("Width",[0],
VVVV.PinTypes.Value),c=this.addOutputPin("Height",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Up and Running",[0],VVVV.PinTypes.Value),k=[],m=!1;this.evaluate=function(){var g=this.getMaxInputSliceCount();if(d.pinIsChanged()){for(var b=0;b<g;b++){var n=VVVV.Helpers.prepareFilePath(d.getValue(b),this.parentPatch);0===n.indexOf("http://")&&void 0!==VVVV.ImageProxyPrefix&&(n=VVVV.ImageProxyPrefix+encodeURI(n));if(void 0==k[b]||k[b].origSrc!=n)k[b]=new Image,k[b].loaded=!1,k[b].origSrc=n,k[b].onload=
function(a){return function(){m=k[a].loaded=!0}}(b),k[b].src=n,a.setValue(b,0),e.setValue(b,k[b])}k.length=g;e.setSliceCount(g);f.setSliceCount(g);c.setSliceCount(g);a.setSliceCount(g)}if(m){for(b=0;b<g;b++)e.setValue(b,k[b]),f.setValue(b,k[b].width),c.setValue(b,k[b].height),a.setValue(b,k[b].loaded?1:0);m=!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 d=["NETWORK_EMPTY","NETWORK_IDLE","NETWORK_LOADING","NETWORK_NO_SOURCE"],e=["HAVE_NOTHING","HAVE_METADATA","HAVE_FUTURE_DATA","HAVE_ENOUGH_DATA","HAVE_CURRENT_DATA"],f=this.addInputPin("Play",[1],VVVV.PinTypes.Value),c=this.addInputPin("Loop",[0],VVVV.PinTypes.Value),a=this.addInputPin("Start Time",[0],VVVV.PinTypes.Value),k=this.addInputPin("End Time",[-1],VVVV.PinTypes.Value),m=this.addInputPin("Do Seek",[0],VVVV.PinTypes.Value),
q=this.addInputPin("Seek Position",[0],VVVV.PinTypes.Value),t=this.addInputPin("Filename",["http://html5doctor.com/demos/video-canvas-magic/video.ogg"],VVVV.PinTypes.String),n=this.addOutputPin("Video",[],this),l=this.addOutputPin("Audio",[],this),p=this.addOutputPin("Duration",[0],VVVV.PinTypes.Value),s=this.addOutputPin("Position",[0],VVVV.PinTypes.Value),v=this.addOutputPin("Video Width",[0],VVVV.PinTypes.Value),w=this.addOutputPin("Video Height",[0],VVVV.PinTypes.Value),x=this.addOutputPin("Network Status",
[""],VVVV.PinTypes.String),y=this.addOutputPin("Ready Status",[""],VVVV.PinTypes.String),u=[];this.evaluate=function(){var g=this.getMaxInputSliceCount();if(t.pinIsChanged())for(var b=0;b<g;b++){filename=VVVV.Helpers.prepareFilePath(t.getValue(b),this.parentPatch);if(void 0==u[b]){var A=h('<video style="display:none"><source src="" type=video/ogg></video>');h("body").append(A);u[b]=A[0];u[b].volume=0;A=function(a){return function(){}}(b);u[b].onprogress=A;u[b].oncanplay=A;u[b].oncanplaythrough=A}filename!=
u[b].currentSrc&&(h(u[b]).find("source").first().attr("src",filename),u[b].load(),0.5<f.getValue(b)?u[b].play():u[b].pause(),u[b].loaded=!0,n.setValue(b,u[b]),l.setValue(b,u[b]))}if(f.pinIsChanged())for(b=0;b<g;b++)0.5<f.getValue(b)?u[b].play():u[b].pause();if(m.pinIsChanged())for(b=0;b<g;b++)u[b%u.length].loaded&&0.5<=m.getValue(b)&&(u[b%u.length].currentTime=q.getValue(b),0.5<f.getValue(b)&&u[b].play());for(b=0;b<g;b++){if(!u[b].paused){n.setValue(b,u[b]);l.setValue(b,u[b]);p.getValue(b)!=u[b].duration&&
p.setValue(b,u[b].duration);s.setValue(b,u[b].currentTime);var A=k.getValue(b),z=a.getValue(b);u[b].currentTime<z&&(u[b].currentTime=z);if(u[b].currentTime>=u[b].duration||0<=A&&u[b].currentTime>=A)0.5<=c.getValue(b)?u[b].currentTime=z:u[b].pause()}if(u[b].videoWidth!=v.getValue(b)||u[b].videoHeight!=w.getValue(b))v.setValue(b,u[b].videoWidth),w.setValue(b,u[b].videoHeight);x.getValue(b)!=d[u[b].networkState]&&x.setValue(b,d[u[b].networkState]);y.getValue(b)!=e[u[b].readyState]&&y.setValue(b,e[u[b].readyState])}n.setSliceCount(g);
l.setSliceCount(g)}};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 d=this.addInputPin("Audio",[],this),e=this.addInputPin("Volume",[0.5],VVVV.PinTypes.Value);this.evaluate=function(){var f=this.getMaxInputSliceCount();if(e.pinIsChanged())for(var c=0;c<f;c++)d.getValue(c).volume=Math.max(0,Math.min(1,e.getValue(c)))}};
VVVV.Nodes.AudioOutHTML5.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("URL",["http://localhost"],VVVV.PinTypes.String),e=this.addInputPin("Name",[""],VVVV.PinTypes.String),f=this.addInputPin("Value",[""],VVVV.PinTypes.String),c=this.addInputPin("Refresh",
[0],VVVV.PinTypes.Value),a=this.addOutputPin("Status",[""],VVVV.PinTypes.String),k=this.addOutputPin("Body",[""],VVVV.PinTypes.String),m=this.addOutputPin("Fail",[0],VVVV.PinTypes.Value),q=this.addOutputPin("Success",[0],VVVV.PinTypes.Value),t,n,l,p=!1;this.evaluate=function(){this.getMaxInputSliceCount();var g=d.pinIsChanged()||e.pinIsChanged()||f.pinIsChanged()||c.pinIsChanged()&&1==c.getValue(0);1==q.getValue(0)&&q.setValue(0,0);1==m.getValue(0)&&m.setValue(0,0);p&&(k.setValue(0,t),a.setValue(0,
void 0),q.setValue(0,n),m.setValue(0,l),p=!1);g&&(void 0==d.getValue(0)?(k.setValue(0,""),a.setValue(0,"")):h.ajax({url:d.getValue(0),type:"get",success:function(a,c,f){t=a;n=1;p=!0},error:function(a,c){t="";l=1;p=!0}}))}};VVVV.Nodes.HTTPGet.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){VVVV.PinTypes.Node={typeName:"Node",reset_on_disconnect:!0};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 d=this.addInputPin("Input Node",[],VVVV.PinTypes.Node),e=this.addOutputPin("Output Node",[],VVVV.PinTypes.Node);this.initialize=function(){d.connectionChangedHandlers.nodepin=function(){if(this.isConnected()){var f;0<this.links.length?
f=this.links[0].fromPin:this.masterPin&&(f=this.masterPin);this.setType(VVVV.PinTypes[f.typeName]);e.setType(VVVV.PinTypes[f.typeName]);e.slavePin&&e.slavePin.setType(VVVV.PinTypes[f.typeName])}else e.isConnected()||(this.setType(VVVV.PinTypes.Node),e.setType(VVVV.PinTypes.Node),e.slavePin&&e.slavePin.setType(VVVV.PinTypes.Node))};e.connectionChangedHandlers.nodepin=function(){if(this.isConnected()){var f;0<this.links.length?f=this.links[0].toPin:this.slavePin&&(f=this.slavePin);this.setType(VVVV.PinTypes[f.typeName]);
d.setType(VVVV.PinTypes[f.typeName]);d.masterPin&&d.masterPin.setType(VVVV.PinTypes[f.typeName])}else d.isConnected()||(this.setType(VVVV.PinTypes.Node),d.setType(VVVV.PinTypes.Node),d.masterPin&&d.masterPin.setType(VVVV.PinTypes.Node))}};this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),c=0;c<f;c++)e.setValue(c,d.getValue(c));e.setSliceCount(f)}};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 d=this.addInputPin("Switch",[0],VVVV.PinTypes.Value),e=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),f=[],c=this.addOutputPin("Output",[],VVVV.PinTypes.Node);this.initialize=function(){for(var a=e.getValue(0),c=f.length;c<a;c++)f[c]=this.addInputPin("Input "+(c+1),[],VVVV.PinTypes.Node);f.length=a};this.evaluate=function(){e.pinIsChanged()&&
this.initialize();if(void 0==d.getValue(0))c.setValue(0,void 0);else{for(var a=f[Math.round(Math.abs(d.getValue(0)))%f.length],k=a.getSliceCount(),m=0;m<k;m++)c.setValue(m,a.getValue(m));c.setSliceCount(k)}}};VVVV.Nodes.SwitchNodeInput.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){VVVV.Nodes.ClothVerlet=function(b,g){this.constructor(b,"Cloth (Verlet)",g);this.meta={authors:["Matthias Zauner"],original_authors:[],credits:["http://codepen.io/Astralized/pen/xanrB"],compatibility_issues:[]};this.auto_evaluate=!0;var d=this.addInputPin("Resolution X",[20],VVVV.PinTypes.Value),e=this.addInputPin("Resolution Y",[20],VVVV.PinTypes.Value),f=this.addInputPin("Zipfel Index",[0],VVVV.PinTypes.Value),c=this.addInputPin("Zipfel XYZ",[0,0,0],VVVV.PinTypes.Value);this.addInputPin("Do Pull Zipfel",
[0],VVVV.PinTypes.Value);var a=this.addInputPin("Zipfel Force",[1E3],VVVV.PinTypes.Value),k=this.addInputPin("Pin Index",[0],VVVV.PinTypes.Value);this.addInputPin("Pin Position XYZ",[0,0,0],VVVV.PinTypes.Value);var m=this.addOutputPin("X",[0,0],VVVV.PinTypes.Value),q=this.addOutputPin("Y",[0,0],VVVV.PinTypes.Value),t=this.addOutputPin("Z",[0,0],VVVV.PinTypes.Value);this.addOutputPin("Debug",[0],VVVV.PinTypes.Value);var n=25,l=25,h,s=function(a,c,f){this.x=a;this.y=c;this.z=f;this.px=a;this.py=c;this.pz=
f;this.vz=this.vy=this.vx=0;this.pin_z=this.pin_y=this.pin_x=null;this.constraints=[]};s.prototype.update=function(a){null!=this.pin_x?(this.px=this.x,this.py=this.y,this.pz=this.z):(this.add_force(0,-500,0),a*=a,nx=this.x+0.99*(this.x-this.px)+this.vx/2*a,ny=this.y+0.99*(this.y-this.py)+this.vy/2*a,nz=this.z+0.99*(this.z-this.pz)+this.vz/2*a,this.px=this.x,this.py=this.y,this.pz=this.z,this.x=nx,this.y=ny,this.z=nz,this.vy=this.vx=this.vz=0)};s.prototype.resolve_constraints=function(){if(null!=this.pin_x&&
null!=this.pin_y&&null!=this.pin_z)this.x=this.pin_x,this.y=this.pin_y,this.z=this.pin_z;else for(var a=this.constraints.length;a--;)this.constraints[a].resolve()};s.prototype.attach=function(a){this.constraints.push(new v(this,a))};s.prototype.add_force=function(a,c,f){this.vx+=a;this.vy+=c;this.vz+=f};s.prototype.pin=function(a,c,f){this.pin_x=a;this.pin_y=c;this.pin_z=f};s.prototype.unpin=function(){this.pin_x=this.pin_y=this.pin_z=null};var v=function(a,c){this.p1=a;this.p2=c;this.length=7};v.prototype.resolve=
function(){var a=this.p1.x-this.p2.x,c=this.p1.y-this.p2.y,f=this.p1.z-this.p2.z,e=Math.sqrt(a*a+c*c+f*f),e=(this.length-e)/e,a=0.5*a*e,c=0.5*c*e,f=0.5*f*e;this.p1.x+=a;this.p1.y+=c;this.p1.z+=f;this.p2.x-=a;this.p2.y-=c;this.p2.z-=f};var w=function(){this.points=[];for(var a=7*-l/2,c=7*n/2,f=0;f<=n;f++)for(var e=0;e<=l;e++){var k=new s(a+7*e,c-7*f,0);0!=e&&k.attach(this.points[this.points.length-1]);0!=f&&k.attach(this.points[e+(f-1)*(l+1)]);this.points.push(k)}};w.prototype.update=function(){for(var a=
2;a--;)for(var c=this.points.length;c--;)this.points[c].resolve_constraints();for(a=this.points.length;a--;)this.points[a].update(1/60)};this.evaluate=function(){if(d.pinIsChanged()||e.pinIsChanged())l=parseInt(d.getValue(0)),n=parseInt(e.getValue(0)),h=new w;var g,b;if(k.pinIsChanged()){for(b=h.points.length;b--;)null!==h.points[b].pin_x&&h.points[b].unpin();for(b=k.getSliceCount();b--;)g=h.points[k.getValue(b)],g.pin(g.x,g.y,g.z)}var s;for(b=f.getSliceCount();b--;)zipfelpos1=c.getValue(b,3),g=h.points[f.getValue(b)],
s=a.getValue(b),g.add_force((100*zipfelpos1[0]-g.x)*s,(100*zipfelpos1[1]-g.y)*s,(100*zipfelpos1[2]-g.z)*s);h.update(1/30);for(b=0;b<h.points.length;b++)m.setValue(b,h.points[b].x/100),q.setValue(b,h.points[b].y/100),t.setValue(b,h.points[b].z/100);m.setSliceCount(h.points.length);q.setSliceCount(h.points.length);t.setSliceCount(h.points.length)}};VVVV.Nodes.ClothVerlet.prototype=new VVVV.Core.Node;VVVV.Nodes.DynamicGrid=function(b,g){this.constructor(b,"DynamicGrid (EX9.Geometry)",g);this.auto_nil=
!1;this.meta={authors:["Matthias Zauner"],original_authors:[],credits:[],compatibility_issues:[]};var d=this.addInputPin("Resolution X",[2],VVVV.PinTypes.Value),e=this.addInputPin("Resolution Y",[2],VVVV.PinTypes.Value),f=this.addInputPin("X",[-0.5,0.5,-0.5,0.5],VVVV.PinTypes.Value),c=this.addInputPin("Y",[0.5,0.5,-0.5,-0.5],VVVV.PinTypes.Value),a=this.addInputPin("Z",[0],VVVV.PinTypes.Value),k=this.addInputPin("Compute Normals",[0],VVVV.PinTypes.Value),m=this.addOutputPin("Mesh",[],VVVV.PinTypes.WebGlResource),
q,h=null,n,l,p,s=0,v=0,w=0,x=vec3.create([0,0,0]),y=vec3.create([0,0,0]),u=vec3.create([0,0,0]),B=!1;this.evaluate=function(){if(this.renderContexts){var b=this.renderContexts[0];if(b){if(!B||this.contextChanged)q=new VVVV.Types.VertexBuffer(b,n),q.create(),h=new VVVV.Types.Mesh(b,q),B=!0;var b=parseInt(d.getValue(0)),g=parseInt(e.getValue(0));if(this.contextChanged||f.getSliceCount()!=s||c.getSliceCount()!=v||a.getSliceCount()!=w)n=new Float32Array(3*b*g),l=new Float32Array(3*b*g),p=new Float32Array(2*
b*g),s=f.getSliceCount(),v=c.getSliceCount(),w=a.getSliceCount();for(var z=0,D=0;D<g;D++)for(var C=0;C<b;C++)n[3*z]=f.getValue(z),n[3*z+1]=c.getValue(z),n[3*z+2]=a.getValue(z),p[2*z]=parseFloat(C)/(b-1),p[2*z+1]=parseFloat(D)/(g-1),z++;if(0.5<=k.getValue(0))for(D=z=0;D<g;D++)for(C=0;C<b;C++)0!=z%(b-1)?(y[0]=n[3*(z+1)]-n[3*z],y[1]=n[3*(z+1)+1]-n[3*z+1],y[2]=n[3*(z+1)+2]-n[3*z+2],u[0]=n[3*(z+b)]-n[3*z],u[1]=n[3*(z+b)+1]-n[3*z+1],u[2]=n[3*(z+b)+2]-n[3*z+2]):(y[0]=n[3*(z-1)]-n[3*z],y[1]=n[3*(z-1)+1]-
n[3*z+1],y[2]=n[3*(z-1)+2]-n[3*z+2],u[0]=n[3*(z-b)]-n[3*z],u[1]=n[3*(z-b)+1]-n[3*z+1],u[2]=n[3*(z-b)+2]-n[3*z+2]),vec3.cross(y,u,x),l[3*z]=x[0],l[3*z+1]=x[1],l[3*z+2]=x[2],z++;0==q.length?(q.setSubBuffer("POSITION",3,n),q.setSubBuffer("TEXCOORD0",2,p),q.setSubBuffer("NORMAL",3,l)):(q.updateSubBuffer("POSITION",n),q.updateSubBuffer("TEXCOORD0",p),q.updateSubBuffer("NORMAL",l));q.update();if(d.pinIsChanged()||e.pinIsChanged()||this.contextChanged){z=[];for(D=0;D<g-1;D++)for(C=0;C<b-1;C++){var F=C+b*
D;z.push(F);z.push(F+1);z.push(F+b+1);z.push(F+b+1);z.push(F+b);z.push(F)}h.update(z)}m.setValue(0,h);this.contextChanged=!1}}}};VVVV.Nodes.DynamicGrid.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Bin Size",[-1],VVVV.PinTypes.Value),f=this.addOutputPin("Center",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Width",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Minimum",[0],VVVV.PinTypes.Value),k=this.addOutputPin("Maximum",
[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0,h=0,n,l,p,s=0;s<b||0<e.getValue(0)&&(0<h||0!=g%e.getSliceCount());s++)n=d.getValue(s),0==h&&(center=l=p=n,width=0),l=Math.min(n,l),p=Math.max(n,p),h++,0<e.getValue(0)&&h>=e.getValue(g)&&(a.setValue(g,l),k.setValue(g,p),f.setValue(g,l+(p-l)/2),c.setValue(g,Math.abs(p-l)),g++,h=0);-1==e.getValue(0)&&(a.setValue(g,l),k.setValue(g,p),f.setValue(g,l+(p-l)/2),c.setValue(g,Math.abs(p-l)));f.setSliceCount(g+(0<h));
c.setSliceCount(g+(0<h));a.setSliceCount(g+(0<h));k.setSliceCount(g+(0<h))}};VVVV.Nodes.BoundsSpectral.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Bin Size",[1],VVVV.PinTypes.Value),f=this.addInputPin("Index",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=f.getSliceCount(),k,b,g=0,h=0;h<a;h++)if(b=e.getValue(h),
k=d.getValue(Math.round(f.getValue(h)),b),1<b)for(b=0;b<k.length;b++)c.setValue(g,k[b]),g++;else c.setValue(h,k),g++;c.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 d=this.addInputPin("Spread",[0],VVVV.PinTypes.Value),e=this.addInputPin("Input",[0],VVVV.PinTypes.Value),
f=this.addInputPin("Index",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=d.getSliceCount(),k=0;k<a;k++)c.setValue(k,d.getValue(k));size=Math.max(e.getSliceCount(),f.getSliceCount());for(k=0;k<size;k++)c.setValue(f.getValue(k)%a,e.getValue(k));c.setSliceCount(a)}};VVVV.Nodes.SetSliceSpreads.prototype=new VVVV.Core.Node;VVVV.Nodes.RandomSpread=function(b,g){function d(e){var f=[],c=0,a=0;(function(a){for(var c=0;256>c;c++)f[c]=c;for(var e=
0,c=0;256>c;c++){var e=(e+f[c]+a.charCodeAt(c%a.length))%256,d=f[c];f[c]=f[e];f[e]=d}})(e);this.getRandomNumber=function(){for(var e=0,d=1,b=0;8>b;b++){c=(c+1)%256;a=(a+f[c])%256;var g=f[c];f[c]=f[a];f[a]=g;e+=f[(f[c]+f[a])%256]*d;d*=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 e=parseInt(this.inputPins["Spread Count"].getValue(0)),f=this.inputPins.Input.getValue(0),c=this.inputPins.Width.getValue(0),
a=parseInt(this.inputPins["Random Seed"].getValue(0));rng=new d(a.toString());this.outputPins.Output.setSliceCount(e);for(a=0;a<e;a++)this.outputPins.Output.setValue(a,rng.getRandomNumber()*c-c/2+f)}};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 d=_(this.inputPins.Input.values).map(function(f,c){return[f,c]}),d=_(d).sortBy(function(f){return f[0]}),e=0;e<d.length;e++)this.outputPins.Output.setValue(e,d[e][0]),this.outputPins["Former Index"].setValue(e,d[e][1]);this.outputPins.Output.setSliceCount(d.length);this.outputPins["Former Index"].setSliceCount(d.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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Width",[1],VVVV.PinTypes.Value),f=this.addInputPin("Alignment",["Centered"],VVVV.PinTypes.Enum);f.enumOptions=["Centered","Block","LeftJustified","RightJustified"];var c=this.addInputPin("Phase",[0],VVVV.PinTypes.Value),
a=this.addInputPin("Spread Count",[1],VVVV.PinTypes.Value),k=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0,h=0;h<b;h++){var n=parseInt(a.getValue(h)),l=e.getValue(h),p=c.getValue(h),s=d.getValue(h),v=f.getValue(h);""==v&&(v="Centered");var w=l/n;"Block"==v&&(w=l/(n-1));var x=w/2;if("Block"==v||"LeftJustified"==v)x=0;"RightJustified"==v&&(x=w);for(var y,u=0;u<n;u++)y=u*w+x,"Block"!=v&&0!=l&&(y=(y+p*l)%l),y=s-l/2+y,k.setValue(g,
y),g++}k.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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Default",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){if(d.pinIsChanged()||e.pinIsChanged()){var c=
d;0==d.getSliceCount()&&(c=e);for(var a=0;a<c.values.length;a++)f.setValue(a,c.getValue(a));f.setSliceCount(c.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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Column Count",[0],VVVV.PinTypes.Value),
f=this.addInputPin("Row Count",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=parseInt(e.getValue(0)),k=parseInt(f.getValue(0)),b=a*k,g=0;g<b;g++)c.setValue(g%a*k+parseInt(g/a),d.getValue(g));c.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 d=this.addInputPin("[ From ..",[0],VVVV.PinTypes.Value),e=this.addInputPin(".. To [",[1],VVVV.PinTypes.Value),f=this.addInputPin("Phase",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),k=0,b=0;b<a;b++){var g=Math.round(d.getValue(b)),h=Math.round(e.getValue(b)),n=f.getValue(b),l=h-g,p=Math.abs(l);if(g<=h)for(h=0;h<p;h++,k++){var s=parseFloat(h)-p*n,s=Math.round(s)%l;0>s&&(s=
l+s);s+=g;c.setValue(k,s)}else for(h=p;0<h;h--,k++)s=parseFloat(h)-p*n,s=Math.round(s)%l,0>l&&(s*=-1),0>s&&(s=l-s),s+=g,c.setValue(k,s)}c.setSliceCount(k)}};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 d=
2*Math.PI,e=0,f=0;f<this.getMaxInputSliceCount();f++)for(var c=this.xIn.getValue(f),a=this.yIn.getValue(f),k=0.5*this.widthIn.getValue(f),b=0.5*this.heightIn.getValue(f),g=this.factorIn.getValue(f),h=this.phaseIn.getValue(f)*d,n=parseInt(this.sprcntIn.getValue(f)),l=0;l<n;l++){var p=h+d*(l/n)*g,s=c+Math.cos(p)*k,p=a+Math.sin(p)*b;this.xOut.setValue(e,s);this.yOut.setValue(e,p);e++}this.xOut.setSliceCount(e);this.yOut.setSliceCount(e)}};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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=d.getSliceCount(),c=0;c<f;c++){var a=d.getValue(c);e.setValue(f-c-1,a)}e.setSliceCount(f)}};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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Input Bin Size",[-1],VVVV.PinTypes.Value),f=this.addInputPin("Offset",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Output Bin Size",[2],VVVV.PinTypes.Value);this.evaluate=function(){var k=
d.getSliceCount(),b=Math.max(e.getSliceCount(),f.getSliceCount()),g=0,h=0,n=[];if(0<b)for(;g<b||h<k;){var l=parseInt(e.getValue(g));0>l&&(l=parseInt(Math.round(k/parseFloat(Math.abs(l)))));h+=l;n[g]=l;g++}n.splice(g);for(h=b=k=0;h<g;h++){l=n[h];a.setValue(h,l+1);for(var p=f.getValue(h),s=0;s<l;s++)c.setValue(b,p),b++,p+=d.getValue(k+s);k+=l;c.setValue(b,p);b++}c.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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Input Bin Size",[-1],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Output Bin Size",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Offset",[0],VVVV.PinTypes.Value);this.evaluate=function(){var k=d.getSliceCount(),
b=e.getSliceCount(),g=0,h=0,n=[];if(0<b)for(;g<b||h<k;){var l=parseInt(e.getValue(g));0>l&&(l=parseInt(Math.round(k/parseFloat(Math.abs(l)))));h+=l;n[g]=l;g++}n.splice(g);for(h=b=k=0;h<g;h++){var l=n[h]-1,p=d.getValue(k);c.setValue(h,l);a.setValue(h,p);for(var s=0;s<l;s++){var v=d.getValue(k+s+1);f.setValue(b,v-p);p=v;b++}k+=l+1}f.setSliceCount(b);c.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 d=[],e=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),f=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value);this.initialize=function(){var c=Math.max(2,f.getValue(0));VVVV.Helpers.dynamicPins(this,d,c,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){f.pinIsChanged()&&this.initialize();
for(var c=0,a=0;a<d.length;a++)for(var k=0;k<d[a].getSliceCount();k++)e.setValue(c++,d[a].getValue(k));e.setSliceCount(c)}};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 d=this.addInputPin("Input",[0.5],VVVV.PinTypes.Value),e=this.addInputPin("Intervals",[0],VVVV.PinTypes.Value),
f=this.addOutputPin("Index",[0],VVVV.PinTypes.Value),c=0;this.evaluate=function(){var a=d.getSliceCount(),k=e.getSliceCount();if(e.pinIsChanged()){c=void 0;for(var b=0;b<k;b++)if(e.getValue(b)<c||void 0==c)c=e.getValue(b)}for(b=0;b<a;b++){var g=d.getValue(b);if(g<c)f.setValue(b,-1);else{for(var h=0;h<k-1&&!(g>=e.getValue(h)&&g<e.getValue(h+1));h++);f.setValue(b,h)}}f.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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Insert",[0],VVVV.PinTypes.Value),f=this.addInputPin("Frame Count",[1],VVVV.PinTypes.Value),c=this.addInputPin("Reset",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Output",[],VVVV.PinTypes.Value),k=this.addOutputPin("Output Bin Size",[],VVVV.PinTypes.Value),m=[],h=[];this.evaluate=function(){var b=
e.getValue(0),g=f.getValue(0),l=c.getValue(0),p=!1;if(0.5<=b&&0.5>l){b=d.getSliceCount();for(p=b-1;0<=p;p--)m.unshift(d.getValue(p));h.unshift(b);p=!0}if(f.pinIsChanged()||p){for(p=currFrameCount=h.length;p>g;p--)m.splice(-h[p-1]);h.splice(g);p=!0}if(p){for(p=0;p<m.length;p++)a.setValue(p,m[p]);for(p=0;p<h.length;p++)k.setValue(p,h[p]);a.setSliceCount(m.length);a.setSliceCount(h.length)}0.5<=l&&(a.setSliceCount(0),k.setSliceCount(0))}};VVVV.Nodes.QueueSpreads.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=0;d<this.inputPins["Input String"].getSliceCount();d++)this.outputPins["Output String"].setValue(d,this.inputPins["Input String"].getValue(d))}};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 d=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),e=this.addInputPin("Switch",[0],
VVVV.PinTypes.Value),f=[],c=this.addOutputPin("Output",["text"],VVVV.PinTypes.String);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),["text"],VVVV.PinTypes.String)})};this.evaluate=function(){d.pinIsChanged()&&this.initialize();for(var a=this.getMaxInputSliceCount(),k=0;k<a;k++)c.setValue(k,f[Math.round(Math.abs(e.getValue(k)))%f.length].getValue(k));c.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 d=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),e=[],f=this.addInputPin("Intersperse String",[""],VVVV.PinTypes.String),c=this.addOutputPin("Output",["texttext"],VVVV.PinTypes.String);this.initialize=function(){var a=Math.max(2,
d.getValue(0));VVVV.Helpers.dynamicPins(this,e,a,function(a){return this.addInputPin("Input "+(a+1),["text"],VVVV.PinTypes.String)})};this.evaluate=function(){d.pinIsChanged()&&this.initialize();for(var a=this.getMaxInputSliceCount(),k=0;k<a;k++){var b=[],g=f.getValue(k);void 0==g&&(g="");for(var h=0;h<e.length;h++)b.push(e[h].getValue(k));c.setValue(k,b.join(g))}c.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 d=this.addInputPin("Input",["text"],VVVV.PinTypes.String);this.addInputPin("Bin Size",[1],VVVV.PinTypes.Value);var e=this.addInputPin("Index",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",["text"],VVVV.PinTypes.String);this.evaluate=function(){for(var c=0;c<e.values.length;c++)f.setValue(c,d.getValue(Math.round(e.getValue(c))));f.setSliceCount(e.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 d=this.addInputPin("Input",[],VVVV.PinTypes.String),e=this.addInputPin("Default",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++){var k=d.getValue(a);/^\s*-?[0-9.e]+\s*$/.test(k)?
f.setValue(a,k):f.setValue(a,e.getValue(a))}f.setSliceCount(c)}};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 d=this.addInputPin("Input",["text"],VVVV.PinTypes.String);this.addInputPin("Reverse Sorting",[0],VVVV.PinTypes.Value);var e=this.addOutputPin("Output",["text"],VVVV.PinTypes.String),
f=this.addOutputPin("Former Index",[0],VVVV.PinTypes.Value);this.initialize=function(){};this.evaluate=function(){for(var c=_(d.values).map(function(a,c){return[a,c]}),c=_(c).sortBy(function(a){return a[0]}),a=0;a<c.length;a++)e.setValue(a,c[a][0]),f.setValue(a,c[a][1]);e.setSliceCount(c.length);f.setSliceCount(c.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 d=this.addInputPin("Input",["text"],VVVV.PinTypes.String),e=this.addOutputPin("Count",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),c=0;c<f;c++){var a=d.getValue(c);e.setValue(c,a.length)}e.setSliceCount(f)}};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 d=this.addInputPin("Input",["text"],VVVV.PinTypes.String),e=this.addInputPin("Filter",["text"],VVVV.PinTypes.String),f=this.addInputPin("Comparison",["Matches"],VVVV.PinTypes.Enum);f.enumOptions=["Matches","Contains","MatchesAny","ContainsAny"];var c=this.addInputPin("Case Sensitive",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Hits",[0],VVVV.PinTypes.Value),k=this.addOutputPin("Input Index",[0],VVVV.PinTypes.Value),m=this.addOutputPin("Filter Index",
[0],VVVV.PinTypes.Value),h=this.addOutputPin("Found At Position",[0],VVVV.PinTypes.Value);this.evaluate=function(){var b=this.getMaxInputSliceCount();a.setSliceCount(b);var g=f.getValue(0);c.getValue(0);for(var l=0,p=0;p<b;p++){var s=d.getValue(p),v=1;if("MatchesAny"==g||"ContainsAny"==g)v=e.getSliceCount();for(var w=0,x=0;x<v;x++){var y=e.getValue(x+p),u=[];if("Matches"==g||"MatchesAny"==g)y==s&&u.push(-1);else for(var y=RegExp(y,"gi"),B;B=y.exec(s);)u.push(B.index);for(y=0;y<u.length;y++)k.setValue(l,
p%d.getSliceCount()),m.setValue(l,(p+x)%e.getSliceCount()),h.setValue(l,u[y]+1),l++,w++}a.setValue(p,w)}k.setSliceCount(l);m.setSliceCount(l);h.setSliceCount(l)}};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 d=this.addInputPin("Input",["text"],VVVV.PinTypes.String),
e=this.addInputPin("Intersperse",["None"],VVVV.PinTypes.Enum);e.enumOptions="None Space Comma CommaPlusSpace Semicolon Colon Pipe UnixPath DosPath Dash NewLineAutoDetection Dot UnderScore Minus".split(" ");var f=this.addInputPin("Intersperse String",[""],VVVV.PinTypes.String),c=this.addInputPin("Ignore between",["Double"],VVVV.PinTypes.Enum);c.enumOptions=["Single","Double"];var a=this.addInputPin("Keep Quotes",[0],VVVV.PinTypes.Value),k=this.addOutputPin("Output",["text"],VVVV.PinTypes.String),m=
this.addOutputPin("Former Index",[0],VVVV.PinTypes.Value),h={None:"",Space:" ",Comma:",",CommaPlusSpace:", ",Semicolon:";",Colon:":",Pipe:"|",UnixPath:"/",DosPath:"\\",Dash:"-",NewLineAutoDetection:"\n",Dot:".",UnderScore:"_",Minus:"-"},t={Single:"'",Double:'"'};this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0,p=0;p<b;p++){var s=d.getValue(p),v=h[e.getValue(p)],w=f.getValue(p),x=t[c.getValue(p)],y=a.getValue(p);""==v&&(v=w);""==v&&(v=void 0);s=s.split(v);v=s.length;x=RegExp("[^"+
x+"]*","g");for(w=0;w<v;w++)1==y?k.setValue(g,s[w]):k.setValue(g,s[w].match(x).join("")),m.setValue(g,p),g++}k.setSliceCount(g);m.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 d=this.addInputPin("Input 1",[""],VVVV.PinTypes.String),e=this.addInputPin("Input 2",[""],VVVV.PinTypes.String),
f=this.addInputPin("Case Sensitive",[1],VVVV.PinTypes.Value),c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Inverse Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var k=this.getMaxInputSliceCount(),b=0;b<k;b++){var g=d.getValue(b),h=e.getValue(b),n=f.getValue(b),g=g==h||0==n&&g.toLowerCase()==h.toLowerCase()?1:0;c.setValue(b,g);a.setValue(b,1-g)}c.setSliceCount(k);a.setSliceCount(k)}};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 d=this.addInputPin("Input",[""],VVVV.PinTypes.String),e=this.addInputPin("Select",[1],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[""],VVVV.PinTypes.String),c=this.addOutputPin("Former Slice",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),k=0,b=0;b<a;b++)for(var g=0;g<e.getValue(b);g++)f.setValue(k,
d.getValue(b)),c.setValue(k,b),k++;f.setSliceCount(k);c.setSliceCount(k)}};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 d=this.addInputPin("Input",["text"],VVVV.PinTypes.String),e=this.addOutputPin("Output",["text"],VVVV.PinTypes.String);
this.evaluate=function(){for(var f=this.getMaxInputSliceCount(),c=0;c<f;c++)d.getValue(c)?e.setValue(c,d.getValue(c).trim()):e.setValue(c,void 0);e.setSliceCount(f)}};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 d=this.addInputPin("Input",["text"],VVVV.PinTypes.String),e=this.addInputPin("Default",
["text"],VVVV.PinTypes.String),f=this.addOutputPin("Output",["text"],VVVV.PinTypes.String);this.evaluate=function(){if(d.pinIsChanged()||e.pinIsChanged()){var c=d;0==d.getSliceCount()&&(c=e);for(var a=0;a<c.values.length;a++)f.setValue(a,c.getValue(a));f.setSliceCount(c.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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Characters before Comma",[1],VVVV.PinTypes.Value),f=this.addInputPin("Characters after Comma",[0],VVVV.PinTypes.Value),c=this.addInputPin("Thousands Symbol",["None"],VVVV.PinTypes.Enum);c.enumOptions=["None","Dot","Comma","Space"];var a=this.addInputPin("Comma Symbol",
["Dot"],VVVV.PinTypes.Enum);a.enumOptions=["Dot","Comma"];var k=this.addInputPin("Leading Zeroes",[0],VVVV.PinTypes.Value),m=this.addOutputPin("Output",["0"],VVVV.PinTypes.String),h={Dot:".",Comma:",",None:"",Space:" "};this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++){var l=d.getValue(g),p=parseInt(e.getValue(g)),s=parseInt(f.getValue(g)),v=c.getValue(g),w=a.getValue(g),x=k.getValue(g),p=p+s+(0<s),l=l.toFixed(s),x=x=0.5<=x?"0":" ",l=l+"",l=l.length>=p?l:Array(p-l.length+
1).join(x)+l,l=l.replace(".",h[w]).replace(/\B(?=(\d{3})+(?!\d))/g,h[v]);m.setValue(g,l)}m.setSliceCount(b)}};VVVV.Nodes.FormatValueString.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){VVVV.Nodes.MouseGlobal=function(b,g){this.constructor(b,"Mouse (System Global)",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 d=this.addOutputPin("X",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Mouse Wheel",[0],VVVV.PinTypes.Value),c=
this.addOutputPin("Left Button",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Middle Button",[0],VVVV.PinTypes.Value),k=this.addOutputPin("Right Button",[0],VVVV.PinTypes.Value),m=0,q=0,t=0,n=0,l=0,p=0;h(document).mousemove(function(a){m=2*a.pageX/parseInt(h("body").css("width"))-1;q=-(2*a.pageY/parseInt(h("body").css("height"))-1)});h(document).bind("mousewheel",function(a){t+=a.originalEvent.wheelDelta/120});h(document).bind("DOMMouseScroll",function(a){t+=-a.originalEvent.detail/3});h(document).mousedown(function(a){switch(a.which){case 1:n=
1;break;case 2:l=1;break;case 3:p=1}});h(document).mouseup(function(a){switch(a.which){case 1:n=0;break;case 2:l=0;break;case 3:p=0}});this.evaluate=function(){d.getValue(0)!=m&&d.setValue(0,m);e.getValue(0)!=q&&e.setValue(0,q);f.getValue(0)!=t&&f.setValue(0,t);c.getValue(0)!=n&&c.setValue(0,n);a.getValue(0)!=l&&a.setValue(0,l);k.getValue(0)!=p&&k.setValue(0,p)}};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 d=this.addOutputPin("X",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Mouse Wheel",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Left Button",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Middle Button",[0],
VVVV.PinTypes.Value),k=this.addOutputPin("Right Button",[0],VVVV.PinTypes.Value);this.evaluate=function(){d.getValue(0)!=VVVV.MousePositions._all.x&&d.setValue(0,VVVV.MousePositions._all.x);e.getValue(0)!=VVVV.MousePositions._all.y&&e.setValue(0,VVVV.MousePositions._all.y);f.getValue(0)!=VVVV.MousePositions._all.wheel&&f.setValue(0,VVVV.MousePositions._all.wheel);c.getValue(0)!=VVVV.MousePositions._all.lb&&c.setValue(0,VVVV.MousePositions._all.lb);a.getValue(0)!=VVVV.MousePositions._all.mb&&a.setValue(0,
VVVV.MousePositions._all.mb);k.getValue(0)!=VVVV.MousePositions._all.rb&&k.setValue(0,VVVV.MousePositions._all.rb)}};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 d=this.addInputPin("File",[0],VVVV.PinTypes.String),e=this.addInputPin("Do Execute",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Result",[""],VVVV.PinTypes.String);this.evaluate=function(){if(1<=Math.round(e.getValue(0))){var c=eval(d.getValue(0));c instanceof Array||c instanceof Object||(c=[c]);if(void 0!=c)for(var a=0;a<c.length;a++)f.setValue(a,c[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 d=this.addOutputPin("ResolutionXY",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Working AreaXY",[0],VVVV.PinTypes.Value),f=0,c=0,a=0,k=0;h(document).ready(function(){c=h(window).innerHeight();f=h(window).innerWidth();k=h(document).height();
a=h(document).width()});h(window).resize(function(){c=h(window).innerHeight();f=h(window).innerWidth();k=h(document).height();a=h(document).width()});this.evaluate=function(){if(d.getValue(0)!=f||d.getValue(1)!=c)d.setValue(0,f),d.setValue(1,c);if(e.getValue(0)!=a||e.getValue(1)!=k)e.setValue(0,a),e.setValue(1,k)}};VVVV.Nodes.ScreenInfo.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=[];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 e=this.trIn.isConnected()?this.getMaxInputSliceCount():Math.max(this.xIn.getSliceCount(),this.yIn.getSliceCount(),this.zIn.getSliceCount());if(e>d.length)for(var f=d.length;f++<e;)d.push(mat4.create());else e<d.length&&(d.length=e);for(f=0;f<e;f++){var c=this.inputPins["Transform In"].getValue(f),a=this.inputPins.X.getValue(f),k=this.inputPins.Y.getValue(f),
b=this.inputPins.Z.getValue(f);mat4.rotate(c,2*k*Math.PI,[0,1,0],d[f]);mat4.rotate(d[f],2*a*Math.PI,[1,0,0]);mat4.rotate(d[f],2*b*Math.PI,[0,0,1]);this.trOut.setValue(f,d[f])}this.trOut.setSliceCount(e)}};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 d=[];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 e=this.trIn.isConnected()?this.getMaxInputSliceCount():Math.max(this.xIn.getSliceCount(),this.yIn.getSliceCount(),this.zIn.getSliceCount());if(e>d.length)for(var f=d.length;f++<e;)d.push(mat4.create());else e<d.length&&(d.length=e);for(f=
0;f<e;f++){var c=this.xIn.getValue(f),a=this.yIn.getValue(f),k=this.zIn.getValue(f);mat4.translate(this.trIn.getValue(f),[c,a,k],d[f]);this.trOut.setValue(f,d[f])}this.trOut.setSliceCount(e)}};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 d=[];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 e=this.trIn.isConnected()?this.getMaxInputSliceCount():Math.max(this.xIn.getSliceCount(),this.yIn.getSliceCount(),this.zIn.getSliceCount());if(e>d.length)for(var f=d.length;f++<e;)d.push(mat4.create());else e<d.length&&(d.length=e);for(f=
0;f<e;f++){var c=this.inputPins.X.getValue(f),a=this.inputPins.Y.getValue(f),k=this.inputPins.Z.getValue(f);mat4.scale(this.trIn.getValue(f),[c,a,k],d[f]);this.trOut.setValue(f,d[f])}this.trOut.setSliceCount(e)}};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 d=[];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 e=this.trIn.isConnected()?this.getMaxInputSliceCount():this.xyzIn.getSliceCount();if(e>d.length)for(var f=d.length;f++<e;)d.push(mat4.create());else e<d.length&&(d.length=e);for(f=0;f<e;f++){var c=this.inputPins.XYZ.getValue(f);mat4.scale(this.trIn.getValue(f),[c,c,c],d[f]);this.trOut.setValue(f,d[f])}this.trOut.setSliceCount(e)}};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 d=[],e=[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 f=this.trIn.isConnected()?this.getMaxInputSliceCount():Math.max(this.xIn.getSliceCount(),this.yIn.getSliceCount(),this.zIn.getSliceCount());if(f>d.length)for(var c=d.length;c++<f;)d.push(mat4.create());else f<d.length&&(d.length=f);for(c=0;c<f;c++){var a=2*this.inputPins.X.getValue(c),k=2*this.inputPins.Y.getValue(c),b=2*this.inputPins.Z.getValue(c);e[3]=a;e[7]=k;e[11]=b;mat4.multiply(this.inputPins["Transform In"].getValue(c),e,d[c]);this.trOut.setValue(c,
d[c])}this.trOut.setSliceCount(f)}};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 d=[];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 e=this.getMaxInputSliceCount();if(e>d.length)for(var f=d.length;f++<e;)d.push(mat4.create());else e<d.length&&(d.length=e);for(f=
0;f<e;f++){var c=this.inputPins.TranslateX.getValue(f),a=this.inputPins.TranslateY.getValue(f),k=this.inputPins.ScaleX.getValue(f),b=this.inputPins.ScaleY.getValue(f),g=this.inputPins.Rotate.getValue(f),h=this.inputPins.CenterX.getValue(f),n=this.inputPins.CenterY.getValue(f);mat4.translate(this.inputPins["Transform In"].getValue(f),[c,a,0],d[f]);mat4.rotate(d[f],2*g*Math.PI,[0,0,1]);mat4.scale(d[f],[k,b,1]);mat4.translate(d[f],[-h,-n,0]);this.trOut.setValue(f,d[f])}this.trOut.setSliceCount(e)}};
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 d=[];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 e=this.trIn.isConnected()?this.getMaxInputSliceCount():Math.max(this.wIn.getSliceCount(),this.hIn.getSliceCount(),this.sIn.getSliceCount(),this.alignmentIn.getSliceCount());if(e>d.length)for(var f=d.length;f++<e;)d.push(mat4.create());else e<d.length&&
(d.length=e);for(f=0;f<e;f++){var c=this.inputPins["Aspect Width"].getValue(f),a=this.inputPins["Aspect Height"].getValue(f),k=this.inputPins["Uniform Scale"].getValue(f),b=k,g=k;switch(this.alignmentIn.getValue(f)){case "FitIn":c>a?g*=a/c:b*=c/a;break;case "FitWidth":g*=a/c;b*=a/c;break;case "FitHeight":b*=c/a;g*=c/a;break;case "FitOut":c<a?g*=a/c:b*=c/a}mat4.scale(this.inputPins["Transform In"].getValue(f),[b,g,k],d[f]);this.trOut.setValue(f,d[f])}this.trOut.setSliceCount(e)}};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",[0.25],VVVV.PinTypes.Value);this.addInputPin("Near Plane",[0.05],VVVV.PinTypes.Value);this.addInputPin("Far Plane",[100],VVVV.PinTypes.Value);this.addOutputPin("Transform Out",
[],VVVV.PinTypes.Transform);this.evaluate=function(){var d=this.inputPins.FOV.getValue(0),e=this.inputPins["Near Plane"].getValue(0),f=this.inputPins["Far Plane"].getValue(0),c=mat4.create();mat4.identity(c);mat4.perspective(360*d,1,e,f,c);this.inputPins["Transform In"].isConnected()&&(d=this.inputPins["Transform In"].getValue(0),mat4.multiply(d,c,c));this.outputPins["Transform Out"].setValue(0,c)}};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 d=[],e=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform),f=this.addInputPin("Source",[],VVVV.PinTypes.Transform),c=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform);this.evaluate=function(){var a=this.getMaxInputSliceCount();if(a>d.length)for(var k=d.length;k++<a;)d.push(mat4.create());else a<d.length&&(d.length=a);for(k=0;k<a;k++)mat4.set(f.getValue(k),
d[k]),mat4.multiply(e.getValue(k),mat4.inverse(d[k],d[k]),d[k]),c.setValue(k,d[k]);c.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 d=this.addInputPin("Transform In",[],VVVV.PinTypes.Transform),e=this.addInputPin("Position XYZ",[0,0,0],VVVV.PinTypes.Value),
f=this.addInputPin("LookAt XYZ",[0,0,1],VVVV.PinTypes.Value),c=this.addInputPin("UpVector XYZ",[0,1,0],VVVV.PinTypes.Value),a=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform),k=mat4.create();mat4.identity(k);mat4.scale(k,[-1,1,-1]);var m=[];this.evaluate=function(){var b=Math.max(d.getSliceCount(),Math.max(e.getSliceCount()/3,Math.max(f.getSliceCount()/3,c.getSliceCount()/3))),b=Math.ceil(b);if(b>m.length)for(var g=m.length;g++<b;)m.push(mat4.create());else b<m.length&&(m.length=b);for(g=
0;g<b;g++){var h=e.getValue(g,3),l=f.getValue(g,3),p=c.getValue(g,3);mat4.lookAt(h,l,p,m[g]);mat4.multiply(k,m[g],m[g]);d.isConnected()&&mat4.multiply(d.getValue(g),m[g],m[g]);a.setValue(g,m[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 d=this.addInputPin("Transform In",
[],VVVV.PinTypes.Transform),e=this.addInputPin("Position X",[0],VVVV.PinTypes.Value),f=this.addInputPin("Position Y",[0],VVVV.PinTypes.Value),c=this.addInputPin("Position Z",[0],VVVV.PinTypes.Value),a=this.addInputPin("LookAt X",[0],VVVV.PinTypes.Value),k=this.addInputPin("LookAt Y",[0],VVVV.PinTypes.Value),m=this.addInputPin("LookAt Z",[1],VVVV.PinTypes.Value),h=this.addInputPin("UpVector X",[0],VVVV.PinTypes.Value),t=this.addInputPin("UpVector Y",[1],VVVV.PinTypes.Value),n=this.addInputPin("UpVector Z",
[0],VVVV.PinTypes.Value),l=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform),p=mat4.create();mat4.identity(p);mat4.scale(p,[-1,1,-1]);var s=[],v=vec3.create(),w=vec3.create(),x=vec3.create();this.evaluate=function(){var g=this.getMaxInputSliceCount();if(g>s.length)for(var b=s.length;b++<g;)s.push(mat4.create());else g<s.length&&(s.length=g);for(b=0;b<g;b++)v[0]=e.getValue(b),v[1]=f.getValue(b),v[2]=c.getValue(b),w[0]=a.getValue(b),w[1]=k.getValue(b),w[2]=m.getValue(b),x[0]=h.getValue(b),
x[1]=t.getValue(b),x[2]=n.getValue(b),mat4.lookAt(v,w,x,s[b]),mat4.multiply(p,s[b],s[b]),d.isConnected()&&mat4.multiply(d.getValue(b),s[b],s[b]),l.setValue(b,s[b]);l.setSliceCount(g)}};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 d=[],e=2;this.trOut=this.addOutputPin("Transform Out",[],VVVV.PinTypes.Transform);
var f=this.addInvisiblePin("Transform In Count",[2],VVVV.PinTypes.Value),c=[];this.initialize=function(){e=Math.max(2,f.getValue(0));VVVV.Helpers.dynamicPins(this,c,e,function(a){return this.addInputPin("Transform In "+(a+1),[],VVVV.PinTypes.Transform)})};this.evaluate=function(){f.pinIsChanged()&&this.initialize();var a=this.getMaxInputSliceCount();if(a>d.length)for(var k=d.length;k++<a;)d.push(mat4.create());else a<d.length&&(d.length=a);for(k=0;k<a;k++){mat4.identity(d[k]);for(var b=e-1;0<=b;b--)if(c[b].isConnected()){var g=
c[b].getValue(k);mat4.multiply(d[k],g,d[k])}this.trOut.setValue(k,d[k])}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 d=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),e=this.addInputPin("X UnTransformed",[0],VVVV.PinTypes.Value),f=this.addInputPin("Y UnTransformed",
[0],VVVV.PinTypes.Value),c=this.addInputPin("Z UnTransformed",[0],VVVV.PinTypes.Value),a=this.addOutputPin("X Transformed",[0],VVVV.PinTypes.Value),k=this.addOutputPin("Y Transformed",[0],VVVV.PinTypes.Value),m=this.addOutputPin("Z Transformed",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++){var h=d.getValue(g),l=[];l[0]=e.getValue(g);l[1]=f.getValue(g);l[2]=c.getValue(g);mat4.multiplyVec3(h,l);a.setValue(g,l[0]);k.setValue(g,l[1]);m.setValue(g,
l[2])}a.setSliceCount(b);k.setSliceCount(b);m.setSliceCount(b)}};VVVV.Nodes.ApplyTransform.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),e=[],f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.initialize=function(){var c=Math.max(2,d.getValue(0));VVVV.Helpers.dynamicPins(this,e,c,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=
function(){d.pinIsChanged()&&this.initialize();var c=this.getMaxInputSliceCount();f.setSliceCount(c);for(var a=0;a<c;a++){for(var k=e[0].getValue(a),b=1;b<e.length;b++)k+=e[b].getValue(a);f.setValue(a,k)}};this.getCode=function(){d.pinIsChanged()&&this.initialize();for(var c=[],a=0;a<e.length;a++)c.push("{Input "+(a+1)+"}");return c.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 d=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),e=[],f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.initialize=function(){var c=Math.max(2,d.getValue(0));VVVV.Helpers.dynamicPins(this,e,c,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){d.pinIsChanged()&&this.initialize();var c=this.getMaxInputSliceCount();f.setSliceCount(c);for(var a=0;a<c;a++){for(var k=
e[0].getValue(a),b=1;b<e.length;b++)k-=e[b].getValue(a);f.setValue(a,k)}};this.getCode=function(){d.pinIsChanged()&&this.initialize();for(var c=[],a=0;a<e.length;a++)c.push("{Input "+(a+1)+"}");return c.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 d=this.addInputPin("Input 1",[0],VVVV.PinTypes.Value),
e=this.addInputPin("Input 2",[0],VVVV.PinTypes.Value),f=this.addInputPin("Epsilon",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Inverse Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var k=this.getMaxInputSliceCount(),b=0;b<k;b++){var g=0;Math.abs(d.getValue(b)-e.getValue(b))<=Math.abs(f.getValue(b))&&(g=1);c.setValue(b,g);a.setValue(b,1-g)}c.setSliceCount(k);a.setSliceCount(k)}};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 d=this.addInputPin("Input 1",[0],VVVV.PinTypes.Value),e=this.addInputPin("Input 2",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++){var k=0;d.getValue(a)>e.getValue(a)&&(k=1);f.setValue(a,k)}f.setSliceCount(c)};
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 d=this.addInputPin("Input 1",[0],VVVV.PinTypes.Value),e=this.addInputPin("Input 2",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=
this.getMaxInputSliceCount(),a=0;a<c;a++){var k=0;d.getValue(a)<e.getValue(a)&&(k=1);f.setValue(a,k)}f.setSliceCount(c)};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 d=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),e=[],f=this.addOutputPin("Output",
[0],VVVV.PinTypes.Value);this.initialize=function(){var c=Math.max(2,d.getValue(0));VVVV.Helpers.dynamicPins(this,e,c,function(a){return this.addInputPin("Input "+(a+1),[1],VVVV.PinTypes.Value)})};this.evaluate=function(){d.pinIsChanged()&&this.initialize();var c=this.getMaxInputSliceCount();f.setSliceCount(c);for(var a=0;a<c;a++){for(var k=e[0].getValue(a),b=1;b<e.length;b++)k*=e[b].getValue(a);f.setValue(a,k)}};this.getCode=function(){d.pinIsChanged()&&this.initialize();for(var c=[],a=0;a<e.length;a++)c.push("{Input "+
(a+1)+"}");return c.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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Input 2",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.initialize=
function(){};this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++)0==e.getValue(a)?f.setValue(a,1):f.setValue(a,d.getValue(a)/e.getValue(a));f.setSliceCount(c)};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 d=this.inputPins["Y Input Value"].getSliceCount(),e,f=0;f<d;f++)e=parseFloat(this.inputPins["Y Input Value"].getValue(f)),isFinite(e)||(e=0),this.outputPins["Y Output Value"].setValue(f,e);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 d=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),e=this.addInputPin("Switch",[0],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)})};var c=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){d.pinIsChanged()&&this.initialize();for(var a=this.getMaxInputSliceCount(),k=0;k<a;k++)c.setValue(k,f[Math.round(Math.abs(e.getValue(k)))%f.length].getValue(k));c.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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Select",[1],VVVV.PinTypes.Value),f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Former Slice",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),k=0,b=0;b<a;b++)for(var g=0;g<e.getValue(b);g++)f.setValue(k,d.getValue(b)),c.setValue(k,b),k++;f.setSliceCount(k);c.setSliceCount(k)}};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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("SubType",["Real (MinFloat .. MaxFloat)"],VVVV.PinTypes.Enum);e.enumOptions=["Real (MinFloat .. MaxFloat)","Integer (MinInt .. MaxInt)"];var f=this.addOutputPin("Output",
[0],VVVV.PinTypes.String);this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++){subtype=e.getValue(a).match(/^(.+) \(/)[1];var b;switch(subtype){case "Real":b=d.getValue(a).toFixed(4);break;case "Integer":b=d.getValue(a).toFixed(0)}f.setValue(a,b)}f.setSliceCount(c)}};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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Whole Part",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Real Part",[0.5],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++){var b=d.getValue(a);e.setValue(a,Math.floor(b));f.setValue(a,b-Math.floor(b))}e.setSliceCount(c);f.setSliceCount(c)}};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(),e=0,f=0,c=0;c<b||0<this.inputPins["Bin Size"].getValue(0)&&(0<f||0!=e%this.inputPins["Bin Size"].getSliceCount());c++){if(0==f)var a=0;a+=this.inputPins.Input.getValue(c);
f++;0<this.inputPins["Bin Size"].getValue(0)?f>=this.inputPins["Bin Size"].getValue(e)&&(this.outputPins.Output.setValue(e,a),e++,f=0):this.outputPins.Output.setValue(0,a)}this.outputPins.Output.setSliceCount(e+(0<f))}};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 d=this.addInputPin("Input",
[0],VVVV.PinTypes.Value),e=this.addInputPin("Shape",["Linear"],VVVV.PinTypes.Enum);e.enumOptions=["Linear","Inverse","Triangle","Sine","Rectangle"];var f=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.initialize=function(){};this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++){var b=d.getValue(a);switch(e.getValue(a)){case "Linear":f.setValue(a,b);break;case "Inverse":f.setValue(a,1-b);break;case "Triangle":0.5>b?f.setValue(a,2*b):f.setValue(a,2*(1-b));break;case "Sine":inp=
6.28318530717959*((b+0.25)%1);f.setValue(a,Math.sin(inp)/2+0.5);break;case "Rectangle":0.5>b?f.setValue(a,0):f.setValue(a,1)}}f.setSliceCount(c)}};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 d=this.addInputPin("Input",[0.5],VVVV.PinTypes.Value),e=this.addInputPin("Source Minimum",
[0],VVVV.PinTypes.Value),f=this.addInputPin("Source Maximum",[1],VVVV.PinTypes.Value),c=this.addInputPin("Destination Minimum",[0],VVVV.PinTypes.Value),a=this.addInputPin("Destination Maximum",[1],VVVV.PinTypes.Value),k=this.addInputPin("Mapping",["Float"],VVVV.PinTypes.Enum);k.enumOptions=["Float","Wrap","Clamp"];var m=this.addOutputPin("Output",[0.5],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++){var h=d.getValue(g),l=e.getValue(g),p=f.getValue(g),
s=c.getValue(g),v=a.getValue(g),w=k.getValue(g);if(p==l)m.setValue(g,s);else{h-=l;p-=l;switch(w){case "Clamp":h=Math.max(0,Math.min(p,h));break;case "Wrap":h=(p+h%p)%p}m.setValue(g,h*((v-s)/p)+s)}}m.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 d=this.addOutputPin("Output",[0],
VVVV.PinTypes.Value),e=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),f=[];this.initialize=function(){var c=Math.max(2,e.getValue(0));VVVV.Helpers.dynamicPins(this,f,c,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){e.pinIsChanged()&&this.initialize();for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++){for(var b=void 0,g=0;g<f.length;g++)if(void 0==b||f[g].getValue(a)<b)b=f[g].getValue(a);d.setValue(a,b)}d.setSliceCount(c)}};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 d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),e=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),f=[];this.initialize=function(){var c=Math.max(2,e.getValue(0));VVVV.Helpers.dynamicPins(this,f,c,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};
this.evaluate=function(){e.pinIsChanged()&&this.initialize();for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++){for(var b=void 0,g=0;g<f.length;g++)if(void 0==b||f[g].getValue(a)>b)b=f[g].getValue(a);d.setValue(a,b)}d.setSliceCount(c)}};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 d=this.addOutputPin("Output",
[0],VVVV.PinTypes.Value),e=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),f=[];this.initialize=function(){var c=Math.max(2,e.getValue(0));VVVV.Helpers.dynamicPins(this,f,c,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){e.pinIsChanged()&&this.initialize();for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++){for(var b=f[0].getValue(a),g=1;g<f.length;g++)b=0==f[g].getValue(a)?0:b%f[g].getValue(a);d.setValue(a,b)}d.setSliceCount(c)}};
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 d=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),e=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),f=[];this.initialize=function(){var c=Math.max(2,e.getValue(0));VVVV.Helpers.dynamicPins(this,f,c,function(a){return this.addInputPin("Input "+
(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){e.pinIsChanged()&&this.initialize();for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++){for(var b=f[0].getValue(a),g=1;g<f.length;g++)b=Math.pow(b,f[g].getValue(a));d.setValue(a,b)}d.setSliceCount(c)}};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 d=this.addInputPin("Enabled",[1],VVVV.PinTypes.Value),e=this.addInputPin("Is Integer",[0],VVVV.PinTypes.Value),f=this.addInputPin("Scale",[1],VVVV.PinTypes.Value),c=this.addInputPin("Prevent from doubles",[1],VVVV.PinTypes.Value),a=this.addOutputPin("Output",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),g=0;g<b;g++){var h=d.getValue(g),t=e.getValue(g),n=f.getValue(g),l=c.getValue(g),p=a.getValue(g);void 0==p&&a.setValue(g,0);if(0.5<=h){p=a.getValue(g);
do h=Math.random()*n,0.5<=t&&(h=Math.round(h));while(0.5<=l&&h==p);a.setValue(g,h)}}a.setSliceCount(b)}};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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addOutputPin("Sign Part",[0],VVVV.PinTypes.Value),f=this.addOutputPin("Absolute Part",
[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var c=this.getMaxInputSliceCount(),a=0;a<c;a++){var b=d.getValue(a);e.setValue(a,0==b?0:b/Math.abs(b));f.setValue(a,Math.abs(b))}f.setSliceCount(c)}};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 d=this.addInputPin("Switch",[0],
VVVV.PinTypes.Value),e=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),f=this.addInvisiblePin("Input Count",[2],VVVV.PinTypes.Value),c=[];this.initialize=function(){var a=Math.max(2,f.getValue(0));VVVV.Helpers.dynamicPins(this,c,a,function(a){return this.addInputPin("Input "+(a+1),[0],VVVV.PinTypes.Value)})};this.evaluate=function(){f.pinIsChanged()&&this.initialize();for(var a=this.getMaxInputSliceCount(),b,g,h,t=0;t<a;t++)b=d.getValue(t),g=((Math.floor(b)+c.length)%c.length+c.length)%c.length,
h=((Math.ceil(b)+c.length)%c.length+c.length)%c.length,b-=Math.floor(b),e.setValue(t,(1-b)*c[g].getValue(t)+b*c[h].getValue(t));e.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 d=this.addInputPin("Input",[0],VVVV.PinTypes.Value),e=this.addInputPin("Filter",[0],VVVV.PinTypes.Value),
f=this.addInputPin("Epsilon",[0],VVVV.PinTypes.Value),c=this.addInputPin("Find",["First"],VVVV.PinTypes.Enum);c.enumOptions=["First","Last","All"];var a=this.addOutputPin("Hits",[0],VVVV.PinTypes.Value),k=this.addOutputPin("Input Index",[0],VVVV.PinTypes.Value),m=this.addOutputPin("Filter Index",[0],VVVV.PinTypes.Value);this.evaluate=function(){this.getMaxInputSliceCount();var b=d.getSliceCount(),g=e.getSliceCount();a.setSliceCount(b);f.getValue(0);for(var h=c.getValue(0),l={},p=0,s=0;s<b;s++){var v=
s;"Last"==h&&(v=b-s-1);var w=d.getValue(v);if("All"!=h){if(l[w]){a.setValue(v,0);continue}l[w]=!0}for(var x=0,y=0;y<g;y++)if(filter=e.getValue(y),filter==w){k.setValue(p,v);m.setValue(p,y);p++;x++;break}a.setValue(v,x)}k.setSliceCount(p);m.setSliceCount(p)}};VVVV.Nodes.Sift.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){function b(){function b(a){return 0<a?parseInt(a):parseInt(a-1)}function d(a,c,f,e,b){return a[0]*c+a[1]*f+a[2]*e+a[3]*b}var e=[[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]],f=[[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]],c=[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],a=[[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,f){var d,h,n;n=0.5*(Math.sqrt(3)-1);n*=a+f;var l=b(a+n),p=b(f+n),s=(3-Math.sqrt(3))/6;n=(l+p)*s;d=a-(l-n);var v=f-(p-n),w,x;d>v?(w=1,x=0):(w=0,x=1);h=d-w+s;var y=v-x+s;n=d-1+2*s;var s=v-1+2*s,u=l&255,p=p&255,l=c[u+c[p]]%12;w=c[u+w+c[p+x]]%12;x=c[u+1+c[p+1]]%12;p=0.5-d*d-v*v;0>p?d=0:(p*=p,d=p*p*(e[l][0]*d+e[l][1]*v));v=0.5-h*h-y*y;0>v?h=0:(v*=v,h=v*v*(e[w][0]*h+e[w][1]*y));y=0.5-n*n-s*s;0>y?n=0:
(y*=y,n=y*y*(e[x][0]*n+e[x][1]*s));return 70*(d+h+n)};this.noise3d=function(a,f,d){var h,n,l,p=(a+f+d)*(1/3),s=b(a+p),v=b(f+p),w=b(d+p),p=1/6;l=(s+v+w)*p;h=a-(s-l);n=f-(v-l);var x=d-(w-l),y,u,B,r,A,z;h>=n?n>=x?(y=1,B=u=0,A=r=1,z=0):(h>=x?(y=1,B=u=0):(u=y=0,B=1),r=1,A=0,z=1):n<x?(u=y=0,B=1,r=0,z=A=1):h<x?(y=0,u=1,r=B=0,z=A=1):(y=0,u=1,B=0,A=r=1,z=0);var D=h-y+p,C=n-u+p,F=x-B+p;l=h-r+2*p;a=n-A+2*p;var J=x-z+2*p;d=h-1+3*p;f=n-1+3*p;var p=x-1+3*p,s=s&255,H=v&255,M=w&255,v=c[s+c[H+c[M]]]%12,w=c[s+y+c[H+
u+c[M+B]]]%12;r=c[s+r+c[H+A+c[M+z]]]%12;s=c[s+1+c[H+1+c[M+1]]]%12;A=0.6-h*h-n*n-x*x;0>A?h=0:(A*=A,h=A*A*(e[v][0]*h+e[v][1]*n+e[v][2]*x));n=0.6-D*D-C*C-F*F;0>n?n=0:(n*=n,n=n*n*(e[w][0]*D+e[w][1]*C+e[w][2]*F));D=0.6-l*l-a*a-J*J;0>D?l=0:(D*=D,l=D*D*(e[r][0]*l+e[r][1]*a+e[r][2]*J));a=0.6-d*d-f*f-p*p;0>a?d=0:(a*=a,d=a*a*(e[s][0]*d+e[s][1]*f+e[s][2]*p));return 32*(h+n+l+d)};this.noise4d=function(e,m,h,t){var n=(Math.sqrt(5)-1)/4,l=(5-Math.sqrt(5))/20,p,s,v,n=(e+m+h+t)*n,w=b(e+n),x=b(m+n),y=b(h+n),u=b(t+
n),n=(w+x+y+u)*l;p=e-(w-n);s=m-(x-n);var B=h-(y-n),r=t-(u-n);t=(p>s?32:0)+(p>B?16:0)+(s>B?8:0)+(p>r?4:0)+(s>r?2:0)+(B>r?1:0);var A,z,D,C,F,J,H,M,G,L,E,I;A=3<=a[t][0]?1:0;z=3<=a[t][1]?1:0;D=3<=a[t][2]?1:0;C=3<=a[t][3]?1:0;F=2<=a[t][0]?1:0;J=2<=a[t][1]?1:0;H=2<=a[t][2]?1:0;M=2<=a[t][3]?1:0;G=1<=a[t][0]?1:0;L=1<=a[t][1]?1:0;E=1<=a[t][2]?1:0;I=1<=a[t][3]?1:0;var O=p-A+l,P=s-z+l,Q=B-D+l,R=r-C+l;v=p-F+2*l;var K=s-J+2*l,S=B-H+2*l,T=r-M+2*l,n=p-G+3*l;e=s-L+3*l;var U=B-E+3*l,V=r-I+3*l;t=p-1+4*l;h=s-1+4*l;
m=B-1+4*l;var l=r-1+4*l,w=w&255,x=x&255,N=y&255,u=u&255,y=c[w+c[x+c[N+c[u]]]]%32;A=c[w+A+c[x+z+c[N+D+c[u+C]]]]%32;F=c[w+F+c[x+J+c[N+H+c[u+M]]]]%32;G=c[w+G+c[x+L+c[N+E+c[u+I]]]]%32;u=c[w+1+c[x+1+c[N+1+c[u+1]]]]%32;x=0.6-p*p-s*s-B*B-r*r;0>x?p=0:(x*=x,p=x*x*d(f[y],p,s,B,r));s=0.6-O*O-P*P-Q*Q-R*R;0>s?s=0:(s*=s,s=s*s*d(f[A],O,P,Q,R));B=0.6-v*v-K*K-S*S-T*T;0>B?v=0:(B*=B,v=B*B*d(f[F],v,K,S,T));K=0.6-n*n-e*e-U*U-V*V;0>K?n=0:(K*=K,n=K*K*d(f[G],n,e,U,V));e=0.6-t*t-h*h-m*m-l*l;0>e?t=0:(e*=e,t=e*e*d(f[u],t,h,
m,l));return 27*(p+s+v+n+t)}}VVVV.Nodes.Join2dVector=function(b,d){this.constructor(b,"Vector (2d Join)",d);this.meta={authors:["Julien Vulliet"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var e=this.addInputPin("X",[0],VVVV.PinTypes.Value),f=this.addInputPin("Y",[0],VVVV.PinTypes.Value),c=this.addOutputPin("XY",[0,0],VVVV.PinTypes.Value);this.evaluate=function(){var a=this.getMaxInputSliceCount();c.setSliceCount(2*a);for(var b=0;b<a;b++)c.setValue(2*b,e.getValue(b)),c.setValue(2*
b+1,f.getValue(b))}};VVVV.Nodes.Join2dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Join3dVector=function(b,d){this.constructor(b,"Vector (3d Join)",d);this.meta={authors:["Julien Vulliet"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var e=this.addInputPin("X",[0],VVVV.PinTypes.Value),f=this.addInputPin("Y",[0],VVVV.PinTypes.Value),c=this.addInputPin("Z",[0],VVVV.PinTypes.Value),a=this.addOutputPin("XYZ",[0,0,0],VVVV.PinTypes.Value);this.evaluate=function(){var b=this.getMaxInputSliceCount();
a.setSliceCount(3*b);for(var d=0;d<b;d++)a.setValue(3*d,e.getValue(d)),a.setValue(3*d+1,f.getValue(d)),a.setValue(3*d+2,c.getValue(d))}};VVVV.Nodes.Join3dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Join4dVector=function(b,d){this.constructor(b,"Vector (4d Join)",d);this.meta={authors:["Julien Vulliet"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var e=this.addInputPin("X",[0],VVVV.PinTypes.Value),f=this.addInputPin("Y",[0],VVVV.PinTypes.Value),c=this.addInputPin("Z",[0],
VVVV.PinTypes.Value),a=this.addInputPin("W",[0],VVVV.PinTypes.Value),k=this.addOutputPin("XYZW",[0,0,0,1],VVVV.PinTypes.Value);this.evaluate=function(){var b=this.getMaxInputSliceCount();k.setSliceCount(4*b);for(var d=0;d<b;d++)k.setValue(4*d,e.getValue(d)),k.setValue(4*d+1,f.getValue(d)),k.setValue(4*d+2,c.getValue(d)),k.setValue(4*d+3,a.getValue(d))}};VVVV.Nodes.Join4dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Split2dVector=function(b,d){this.constructor(b,"Vector (2d Split)",d);this.meta={authors:["Julien Vulliet"],
original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var e=this.addInputPin("XY",[0],VVVV.PinTypes.Value),f=this.addOutputPin("X",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Y",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var a=this.getMaxInputSliceCount(),b=0,d=0;d<a;d+=2)f.setValue(b,e.getValue(d)),c.setValue(b,e.getValue(d+1)),b++;f.setSliceCount(b);c.setSliceCount(b)}};VVVV.Nodes.Split2dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Split3dVector=function(b,d){this.constructor(b,
"Vector (3d Split)",d);this.meta={authors:["Julien Vulliet"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var e=this.addInputPin("XYZ",[0],VVVV.PinTypes.Value),f=this.addOutputPin("X",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Z",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),d=0,g=0;g<b;g+=3)f.setValue(d,e.getValue(g)),c.setValue(d,e.getValue(g+1)),a.setValue(d,e.getValue(g+2)),
d++;f.setSliceCount(d);c.setSliceCount(d);a.setSliceCount(d)}};VVVV.Nodes.Split3dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Split4dVector=function(b,d){this.constructor(b,"Vector (4d Split)",d);this.meta={authors:["Julien Vulliet"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[""]};var e=this.addInputPin("XYZW",[0,0,0,1],VVVV.PinTypes.Value),f=this.addOutputPin("X",[0],VVVV.PinTypes.Value),c=this.addOutputPin("Y",[0],VVVV.PinTypes.Value),a=this.addOutputPin("Z",[0],VVVV.PinTypes.Value),
k=this.addOutputPin("W",[0],VVVV.PinTypes.Value);this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),d=0,g=0;g<b;g+=4)f.setValue(d,e.getValue(g)),c.setValue(d,e.getValue(g+1)),a.setValue(d,e.getValue(g+2)),k.setValue(d,e.getValue(g+3)),d++;f.setSliceCount(d);c.setSliceCount(d);a.setSliceCount(d);k.setSliceCount(d)}};VVVV.Nodes.Split4dVector.prototype=new VVVV.Core.Node;VVVV.Nodes.Simplex2d=function(g,d){this.constructor(g,"Simplex (2d)",d);this.meta={authors:["woei"],original_authors:["tonfilm"],
credits:[],compatibility_issues:[]};var e=this.addInputPin("Position Input XY",[0.5,0.5],VVVV.PinTypes.Value),f=this.addInputPin("Octaves",[0],VVVV.PinTypes.Value),c=this.addInputPin("Frequency",[1],VVVV.PinTypes.Value),a=this.addInputPin("Persistance",[0.5],VVVV.PinTypes.Value),k=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),h=new b;this.evaluate=function(){for(var b=Math.ceil(Math.max(0.5*e.getSliceCount())),d=parseInt(f.getValue(0)),g=c.getValue(0),l=a.getValue(0),p=0;p<b;p++){for(var s=
e.getValue(2*p),v=e.getValue(2*p+1),w=0,x=0;x<=d;x++)var y=Math.pow(g,x),w=w+h.noise2d(s*y,v*y)*Math.pow(l,x);k.setValue(p,w)}k.setSliceCount(b)}};VVVV.Nodes.Simplex2d.prototype=new VVVV.Core.Node;VVVV.Nodes.Simplex3d=function(g,d){this.constructor(g,"Simplex (3d)",d);this.meta={authors:["woei"],original_authors:["tonfilm"],credits:[],compatibility_issues:[]};var e=this.addInputPin("Position Input XYZ",[0.5,0.5,0.5],VVVV.PinTypes.Value),f=this.addInputPin("Octaves",[0],VVVV.PinTypes.Value),c=this.addInputPin("Frequency",
[1],VVVV.PinTypes.Value),a=this.addInputPin("Persistance",[0.5],VVVV.PinTypes.Value),k=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),h=new b;this.evaluate=function(){for(var b=Math.ceil(Math.max(e.getSliceCount()/3)),d=parseInt(f.getValue(0)),g=c.getValue(0),l=a.getValue(0),p=0;p<b;p++){for(var s=e.getValue(3*p),v=e.getValue(3*p+1),w=e.getValue(3*p+2),x=0,y=0;y<=d;y++)var u=Math.pow(g,y),x=x+h.noise3d(s*u,v*u,w*u)*Math.pow(l,y);k.setValue(p,x)}k.setSliceCount(b)}};VVVV.Nodes.Simplex3d.prototype=
new VVVV.Core.Node;VVVV.Nodes.Simplex4d=function(g,d){this.constructor(g,"Simplex (4d)",d);this.meta={authors:["woei"],original_authors:["tonfilm"],credits:[],compatibility_issues:[]};var e=this.addInputPin("Position Input XYZW",[0.5,0.5,0.5,0.5],VVVV.PinTypes.Value),f=this.addInputPin("Octaves",[0],VVVV.PinTypes.Value),c=this.addInputPin("Frequency",[1],VVVV.PinTypes.Value),a=this.addInputPin("Persistance",[0.5],VVVV.PinTypes.Value),k=this.addOutputPin("Output",[0],VVVV.PinTypes.Value),h=new b;this.evaluate=
function(){for(var b=Math.ceil(Math.max(e.getSliceCount()/3)),d=parseInt(f.getValue(0)),g=c.getValue(0),l=a.getValue(0),p=0;p<b;p++){for(var s=e.getValue(4*p),v=e.getValue(4*p+1),w=e.getValue(4*p+2),x=e.getValue(4*p+3),y=0,u=0;u<=d;u++)var B=Math.pow(g,u),y=y+h.noise4d(s*B,v*B,w*B,x*B)*Math.pow(l,u);k.setValue(p,y)}k.setSliceCount(b)}};VVVV.Nodes.Simplex4d.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){VVVV.ShaderCodeResources={};VVVV.Types.ShaderCodeResource=function(){var b="";this.relatedNodes=[];this.definingNode=void 0;this.setSourceCode=function(d){b=d;for(d=0;d<this.relatedNodes.length;d++)this.relatedNodes[d].shaderSourceUpdated(b)};this.addRelatedNode=function(d){this.relatedNodes.push(d);""!=b&&d.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,d){this.vbo=void 0;this.subBuffers={};this.length=0;this.setSubBuffer=function(e,f,c){this.subBuffers[e]={usage:e,data:new Float32Array(c),size:f,offset:this.length};this.length+=this.subBuffers[e].data.byteLength};this.updateSubBuffer=function(e,f){this.subBuffers[e].data=
new Float32Array(f)};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(e){b.bufferSubData(b.ARRAY_BUFFER,e.offset,e.data)})}};VVVV.Types.Mesh=function(b,d,e){this.vertexBuffer=d;this.indexBuffer=b.createBuffer();this.update=function(f){b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.indexBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,new Uint16Array(f),b.DYNAMIC_DRAW);
this.numIndices=f.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 d=this.node,e=d.findDownstreamNodes("Renderer (EX9)");d.renderContexts||
(d.renderContexts=[]);void 0==d.contextChanged&&(d.contextChanged=!1);for(var f=0;f<e.length;f++)d.contextChanged|=!d.renderContexts[f]||d.renderContexts[f].canvas.id!=e[f].ctxt.id,d.renderContexts[f]=e[f].ctxt,d.dirty=!0;d.renderContexts.length!=e.length&&(d.renderContexts.length=e.length,d.contextChanged=!0,d.dirty=!0);d.isSubpatch||_(d.inputPins).each(function(c){var a;c.markPinAsChanged();"Renderer (EX9)"!=d.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="",d="",e,f;this.isSetup=!1;this.shaderProgram=void 0;this.log="";var c=this;this.extractSemantics=function(a){c.attributeSpecs={};c.attribSemanticMap={};c.uniformSpecs={};c.uniformSemanticMap={};for(var f=/(uniform|attribute) ([a-zA-Z]+)([0-9xD]*) ([a-zA-Z0-9_]+)( : ([A-Z0-9]+))?( = \{?([^;\}]+)\}?)?;/g,
e;e=f.exec(a);)"attribute"!=e[1]||c.attributeSpecs[e[4]]?"uniform"!=e[1]||c.uniformSpecs[e[4]]||(c.uniformSpecs[e[4]]={varname:e[4],semantic:e[6],position:0,type:e[2],defaultValue:e[8],dimension:""==e[3]?1:e[3]},void 0!=e[6]&&(c.uniformSemanticMap[e[6]]=e[4])):(c.attributeSpecs[e[4]]={varname:e[4],semantic:e[6],position:0},void 0!=e[6]&&(c.attribSemanticMap[e[6]]=e[4]))};this.setVertexShader=function(a){b=a};this.setFragmentShader=function(a){d=a};this.setup=function(a){this.log="";e=a.createShader(a.VERTEX_SHADER);
a.shaderSource(e,b.replace(/((uniform|attribute) [a-zA-Z0-9]+ [a-zA-Z0-9_]+)[^;]*/g,"$1"));a.compileShader(e);a.getShaderParameter(e,a.COMPILE_STATUS)||(this.log=a.getShaderInfoLog(e),console.log(this.log));f=a.createShader(a.FRAGMENT_SHADER);a.shaderSource(f,d.replace(/((uniform|attribute) [a-zA-Z0-9]+ [a-zA-Z0-9_]+)[^;]*/g,"$1"));a.compileShader(f);a.getShaderParameter(f,a.COMPILE_STATUS)||(this.log=a.getShaderInfoLog(f),console.log(this.log));this.shaderProgram=a.createProgram();a.attachShader(this.shaderProgram,
e);a.attachShader(this.shaderProgram,f);a.linkProgram(this.shaderProgram);a.getProgramParameter(this.shaderProgram,a.LINK_STATUS)||console.log("Could not initialise shaders");_(this.attributeSpecs).each(function(f){f.position=a.getAttribLocation(c.shaderProgram,f.varname)});_(this.uniformSpecs).each(function(f){f.position=a.getUniformLocation(c.shaderProgram,f.varname)});this.isSetup=!0;return""==this.log}};VVVV.Nodes.FileTexture=function(b,d){this.constructor(b,"FileTexture (EX9.Texture)",d);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 e=this.addInputPin("Filename",[""],VVVV.PinTypes.String),f=this.addOutputPin("Texture Out",[],VVVV.PinTypes.WebGlTexture),c=this.addInvisiblePin("Type",["Texture"],VVVV.PinTypes.Enum);c.enumOptions=["Texture","Cube Texture"];
var a=[];this.evaluate=function(){if(this.renderContexts){var b=this.renderContexts[0];if(b){if(this.contextChanged){for(var d=0;d<a.length;d++)a[d].context.deleteTexture(a[d]);a=[]}if(e.pinIsChanged()||c.pinIsChanged()||this.contextChanged){for(var g=c.getValue(0),t=this.getMaxInputSliceCount(),d=0;d<t;d++){var n=VVVV.Helpers.prepareFilePath(e.getValue(d),this.parentPatch);0===n.indexOf("http://")&&void 0!==VVVV.ImageProxyPrefix&&(n=VVVV.ImageProxyPrefix+encodeURI(n));a[d]=b.createTexture();a[d].context=
b;"Texture"==g?(a[d].image=new Image,a[d].image.onload=function(c){return function(){b.bindTexture(b.TEXTURE_CUBE_MAP,null);b.bindTexture(b.TEXTURE_2D,a[c]);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,a[c].image);b.generateMipmap(b.TEXTURE_2D);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR_MIPMAP_NEAREST);b.bindTexture(b.TEXTURE_2D,null);f.setValue(c,a[c])}}(d),a[d].image.src=n):"Cube Texture"==g&&(a[d].image=new Image,
a[d].image.onload=function(c){return function(){var e=[{face:b.TEXTURE_CUBE_MAP_POSITIVE_X,offset:[2,1]},{face:b.TEXTURE_CUBE_MAP_NEGATIVE_X,offset:[0,1]},{face:b.TEXTURE_CUBE_MAP_POSITIVE_Y,offset:[1,0]},{face:b.TEXTURE_CUBE_MAP_NEGATIVE_Y,offset:[1,2]},{face:b.TEXTURE_CUBE_MAP_POSITIVE_Z,offset:[1,1]},{face:b.TEXTURE_CUBE_MAP_NEGATIVE_Z,offset:[3,1]}];b.bindTexture(b.TEXTURE_CUBE_MAP,a[c]);var d=h('<canvas style="display:none" width="'+this.width/4+'" height="'+this.height/3+'"></canvas>');h("body").append(d);
for(var g=d.get(0).getContext("2d"),m=0;6>m;m++)g.save(),g.translate(-this.width/4*e[m].offset[0],-this.height/3*e[m].offset[1]),g.drawImage(this,0,0),b.texImage2D(e[m].face,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,d.get(0)),b.texParameteri(b.TEXTURE_CUBE_MAP,b.TEXTURE_MAG_FILTER,b.NEAREST),b.texParameteri(b.TEXTURE_CUBE_MAP,b.TEXTURE_MIN_FILTER,b.NEAREST),g.restore();b.bindTexture(b.TEXTURE_CUBE_MAP,null);d.remove();f.setValue(c,a[c])}}(d),a[d].image.src=n);f.setValue(d,VVVV.defaultTexture)}f.setSliceCount(t)}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,d){this.constructor(b,"DX9Texture (EX9.Texture)",d);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:["Using WebGL renderer as source doesnt work correctly in Chrome."]};var e=this.addInputPin("Source",[],VVVV.PinTypes.WebGlResource),f=this.addOutputPin("Texture Out",
[],VVVV.PinTypes.WebGlTexture),c;this.evaluate=function(){if(this.renderContexts){var a=this.renderContexts[0];if(a){this.contextChanged&&c&&(c.context.deleteTexture(c),c=void 0);if(e.isConnected()){var b=e.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?f.setValue(0,b):(void 0==c&&(c=a.createTexture(),c.context=a),a.bindTexture(a.TEXTURE_2D,
c),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,b),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),f.setValue(0,c))}else delete c,a.deleteTexture(c),f.setValue(0,void 0);this.contextChanged=!1}}};this.destroy=function(){c&&c.context.deleteTexture(c)}};VVVV.Nodes.DX9Texture.prototype=new VVVV.Core.Node;VVVV.Nodes.VideoTexture=function(b,d){this.constructor(b,"VideoTexture (EX9.Texture VMR9)",
d);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 e=this.addInputPin("Video",[],this),f=this.addOutputPin("Texture Out",[],VVVV.PinTypes.WebGlTexture),c;this.evaluate=function(){if(this.renderContexts){var a=this.renderContexts[0];if(a)if(e.isConnected()){var b=e.getValue(0);0==(b.videoWidth&b.videoWidth-1)&&0==(b.videoHeight&b.videoHeight-1)||
console.log("Warning: Video width/height is not a power of 2. VideoTexture will most likely not work.");if(void 0==c||this.contextChanged)c=a.createTexture();a.bindTexture(a.TEXTURE_2D,c);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,b);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);f.setValue(0,c);this.contextChanged=!1}else delete c,a.deleteTexture(c),f.setValue(0,void 0)}}};VVVV.Nodes.VideoTexture.prototype=
new VVVV.Core.Node;VVVV.Nodes.VertexBufferJoin=function(b,d){this.constructor(b,"VertexBuffer (EX9.Geometry Join)",d);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var e=this.addInputPin("Position XYZ",[0,0,0],VVVV.PinTypes.Value),f=this.addInputPin("Normal XYZ",[0,0,0],VVVV.PinTypes.Value),c=this.addInputPin("Texture Coordinate 0 XY",[0,0],VVVV.PinTypes.Value),a=this.addInputPin("Apply",[1],VVVV.PinTypes.Value),k=this.addOutputPin("Vertex Buffer",
[],VVVV.PinTypes.WebGlResource),h=null,q=[],t=[],n=[],l;this.evaluate=function(){var b=this.renderContexts[0];if(b&&0.5<=a.getValue(0)){l=this.getMaxInputSliceCount();for(var d=0;d<l;d++)q[d]=e.getValue(d),t[d]=c.getValue(d),n[d]=f.getValue(d);q.length=t.length=n.length=l;h||(h=new VVVV.Types.VertexBuffer(b,q),h.create());h.setSubBuffer("POSITION",3,q);h.setSubBuffer("TEXCOORD0",2,t);h.setSubBuffer("NORMAL",3,n);h.update();k.setValue(0,h)}}};VVVV.Nodes.VertexBufferJoin.prototype=new VVVV.Core.Node;
VVVV.Nodes.MeshJoin=function(b,d){this.constructor(b,"Mesh (EX9.Geometry Join)",d);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var e=this.addInputPin("Vertex Buffer",[],VVVV.PinTypes.WebGlResource),f=this.addInputPin("Indices",[0],VVVV.PinTypes.Value),c=this.addInputPin("Apply",[1],VVVV.PinTypes.Value),a=this.addOutputPin("Mesh",[],VVVV.PinTypes.WebGlResource),k=null;this.evaluate=function(){var b=this.renderContexts[0];
b&&(0.5<=c.getValue(0)&&(e.isConnected()?(k||(k=new VVVV.Types.Mesh(b,e.getValue(0),f.values)),(f.pinIsChanged()||this.contextChanged)&&k.update(f.values),(f.pinIsChanged()||e.pinIsChanged()||this.contextChanged)&&a.setValue(0,k)):(a.setValue(0,void 0),delete k)),this.contextChanged=!1)}};VVVV.Nodes.MeshJoin.prototype=new VVVV.Core.Node;VVVV.Nodes.Grid=function(b,d){this.constructor(b,"Grid (EX9.Geometry)",d);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],
credits:[],compatibility_issues:[]};var e=this.addInputPin("Resolution X",[2],VVVV.PinTypes.Value),f=this.addInputPin("Resolution Y",[2],VVVV.PinTypes.Value),c=this.addOutputPin("Mesh",[],VVVV.PinTypes.WebGlResource),a=null;this.evaluate=function(){if(this.renderContexts){var b=this.renderContexts[0];if(b){for(var d=parseInt(e.getValue(0)),g=parseInt(f.getValue(0)),h=[],n=[],l=[],p=0,s=0;s<g;s++)for(var v=0;v<d;v++)h.push(parseFloat(v)/(d-1)-0.5),h.push(0.5-parseFloat(s)/(g-1)),h.push(0),p++,n.push(0),
n.push(0),n.push(1),l.push(parseFloat(v)/(d-1)),l.push(parseFloat(s)/(g-1));p=new VVVV.Types.VertexBuffer(b,h);p.create();p.setSubBuffer("POSITION",3,h);p.setSubBuffer("TEXCOORD0",2,l);p.setSubBuffer("NORMAL",3,n);p.update();h=[];for(s=0;s<g-1;s++)for(v=0;v<d-1;v++)n=v+d*s,h.push(n),h.push(n+1),h.push(n+d+1),h.push(n+d+1),h.push(n+d),h.push(n);a=new VVVV.Types.Mesh(b,p,h);a.update(h);c.setValue(0,a)}}}};VVVV.Nodes.Grid.prototype=new VVVV.Core.Node;VVVV.Nodes.Sphere=function(b,d){this.constructor(b,
"Sphere (EX9.Geometry)",d);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var e=this.addInputPin("Radius",[0.5],VVVV.PinTypes.Value),f=this.addInputPin("Resolution X",[15],VVVV.PinTypes.Value),c=this.addInputPin("Resolution Y",[15],VVVV.PinTypes.Value),a=this.addOutputPin("Mesh",[],VVVV.PinTypes.WebGlResource),k=null;this.evaluate=function(){if(this.renderContexts){var b=this.renderContexts[0];if(b){for(var d=parseInt(f.getValue(0)),
g=parseInt(c.getValue(0)),h=e.getValue(0),l=[],p=[],s=[],v=0;v<g+1;v++)for(var w=Math.cos(-parseFloat(v)/g*Math.PI),x=0;x<d;x++){var y=Math.cos(2*(parseFloat(x)/d)*Math.PI)*Math.cos(Math.asin(w)),u=Math.sin(2*(parseFloat(x)/d)*Math.PI)*Math.cos(Math.asin(w));l.push(y*h);l.push(w*h);l.push(u*h);p.push(y);p.push(w);p.push(u);s.push(parseFloat(x)/d);s.push(parseFloat(v)/g)}h=new VVVV.Types.VertexBuffer(b,l);h.create();h.setSubBuffer("POSITION",3,l);h.setSubBuffer("TEXCOORD0",2,s);h.setSubBuffer("NORMAL",
3,p);h.update();l=[];for(v=0;v<g;v++)for(x=0;x<d;x++)p=d*v,s=x+p,l.push(s),l.push((s+1)%d+p),l.push((s+1)%d+d+p),l.push((s+1)%d+d+p),l.push(s+d),l.push(s);k=new VVVV.Types.Mesh(b,h,l);k.update(l);a.setValue(0,k)}}}};VVVV.Nodes.Sphere.prototype=new VVVV.Core.Node;VVVV.Nodes.Cylinder=function(b,d){this.constructor(b,"Cylinder (EX9.Geometry)",d);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var e=this.addInputPin("Radius 1",
[0.5],VVVV.PinTypes.Value),f=this.addInputPin("Radius 2",[0.5],VVVV.PinTypes.Value),c=this.addInputPin("Length",[1],VVVV.PinTypes.Value),a=this.addInputPin("Cycles",[1],VVVV.PinTypes.Value),k=this.addInputPin("Caps",[1],VVVV.PinTypes.Value),h=this.addInputPin("Resolution X",[15],VVVV.PinTypes.Value),q=this.addInputPin("Resolution Y",[1],VVVV.PinTypes.Value),t=this.addOutputPin("Mesh",[],VVVV.PinTypes.WebGlResource),n=null;this.evaluate=function(){if(this.renderContexts){var b=this.renderContexts[0];
if(b){var d=parseInt(h.getValue(0)),g=parseInt(q.getValue(0)),v=e.getValue(0),w=f.getValue(0),x=c.getValue(0),y=a.getValue(0),u=[],B=[],r=[];u.push(0);u.push(x/2);u.push(0);B.push(0);B.push(1);B.push(0);r.push(0);r.push(0);u.push(0);u.push(-x/2);u.push(0);B.push(0);B.push(-1);B.push(0);r.push(0);r.push(0);for(var A=0;A<g+1;A++)for(var z=parseFloat(A)/g,D=(z-0.5)*-x,C=0;C<d+1;C++){var F=Math.cos(2*(parseFloat(C)/d)*Math.PI*y-Math.PI*y-Math.PI/2),J=Math.sin(2*(parseFloat(C)/d)*Math.PI*y-Math.PI*y-Math.PI/
2),H=z*w+(1-z)*v;u.push(F*H);u.push(D);u.push(J*H);B.push(F);B.push(0);B.push(J);r.push(parseFloat(C)/d);r.push(parseFloat(A)/g)}v=new VVVV.Types.VertexBuffer(b,u);v.create();v.setSubBuffer("POSITION",3,u);v.setSubBuffer("TEXCOORD0",2,r);v.setSubBuffer("NORMAL",3,B);v.update();u=[];if(0.5<k.getValue(0))for(z=0;2>z;z++)for(C=0;C<d;C++)u.push(z),u.push(2+C+z+z*g*(d+1)),u.push(2+C+(1-z)+z*g*(d+1));for(A=0;A<g;A++)for(C=0;C<d;C++)z=C+(d+1)*A+2,u.push(z),u.push(z+1),u.push(z+d+2),u.push(z+d+2),u.push(z+
d+1),u.push(z);n=new VVVV.Types.Mesh(b,v,u);n.update(u);t.setValue(0,n)}}}};VVVV.Nodes.Cylinder.prototype=new VVVV.Core.Node;VVVV.Nodes.BlendWebGLAdvanced=function(b,d){function e(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)",d);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.WebGlRenderState),c=this.addInputPin("Alpha Blending",[1],VVVV.PinTypes.Value),a=this.addInputPin("Source Blend Mode",["SrcAlpha"],VVVV.PinTypes.Enum),k=this.addInputPin("Destination Blend Mode",["SrcAlpha"],VVVV.PinTypes.Enum);
a.enumOptions=k.enumOptions="One Zero SrcAlpha InvSrcAlpha DestAlpha InvDestAlpha SrcColor InvSrcColor DestColor InvDestColor".split(" ");var h=this.addOutputPin("Render State Out",[],VVVV.PinTypes.WebGlRenderState),q=[];this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),d=0;d<b;d++)void 0==q[d]&&(q[d]=new VVVV.Types.WebGlRenderState),q[d].copy_attributes(f.getValue(d)),q[d].alphaBlending=0.5<c.getValue(d),q[d].srcBlendMode=e(a.getValue(d)),q[d].destBlendMode=e(k.getValue(d)),h.setValue(d,
q[d]);h.setSliceCount(b)}};VVVV.Nodes.BlendWebGLAdvanced.prototype=new VVVV.Core.Node;VVVV.Nodes.BlendWebGL=function(b,d){this.constructor(b,"Blend (EX9.RenderState)",d);this.meta={authors:["Matthias Zauner, woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var e=this.addInputPin("Render State In",[],VVVV.PinTypes.WebGlRenderState),f=this.addInputPin("Draw Mode",["Blend"],VVVV.PinTypes.Enum);f.enumOptions=["Add","Blend","ColorAsAlphaAdd","ColorAsAlphaBlend","Multiply"];var c=
this.addOutputPin("Render State Out",[],VVVV.PinTypes.WebGlRenderState),a=[];this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),d=0;d<b;d++){void 0==a[d]&&(a[d]=new VVVV.Types.WebGlRenderState);a[d].copy_attributes(e.getValue(d));switch(f.getValue(d)){case "Add":a[d].srcBlendMode="SRC_ALPHA";a[d].destBlendMode="ONE";break;case "Blend":a[d].srcBlendMode="SRC_ALPHA";a[d].destBlendMode="ONE_MINUS_SRC_ALPHA";break;case "ColorAsAlphaAdd":a[d].srcBlendMode="SRC_COLOR";a[d].destBlendMode="ONE";
break;case "ColorAsAlphaBlend":a[d].srcBlendMode="SRC_COLOR";a[d].destBlendMode="ONE_MINUS_SRC_COLOR";break;case "Multiply":a[d].srcBlendMode="ZERO",a[d].destBlendMode="SRC_COLOR"}c.setValue(d,a[d])}c.setSliceCount(b)}};VVVV.Nodes.BlendWebGL.prototype=new VVVV.Core.Node;VVVV.Nodes.FillWebGL=function(b,d){this.constructor(b,"Fill (EX9.RenderState)",d);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 e=this.addInputPin("Render State In",[],VVVV.PinTypes.WebGlRenderState),f=this.addInputPin("Fill Mode",["Solid"],VVVV.PinTypes.Enum);f.enumOptions=["Point","Solid","WireFrame"];var c=this.addOutputPin("Render State Out",[],VVVV.PinTypes.WebGlRenderState),a=[];this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),d=0;d<b;d++){void 0==a[d]&&(a[d]=new VVVV.Types.WebGlRenderState);a[d].copy_attributes(e.getValue(d));switch(f.getValue(d)){case "Point":a[d].polygonDrawMode="POINTS";break;
case "Solid":a[d].polygonDrawMode="TRIANGLES";break;case "WireFrame":a[d].polygonDrawMode="LINES"}c.setValue(d,a[d])}c.setSliceCount(b)}};VVVV.Nodes.FillWebGL.prototype=new VVVV.Core.Node;VVVV.Nodes.ZWriteEnableWebGL=function(b,d){function e(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)",d);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var f=this.addInputPin("Render State In",[],VVVV.PinTypes.WebGlRenderState),c=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 k=this.addInputPin("Depth Bias",[0],VVVV.PinTypes.Value),
h=this.addOutputPin("Render State Out",[],VVVV.PinTypes.WebGlRenderState),q=[];this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),d=0;d<b;d++)void 0==q[d]&&(q[d]=new VVVV.Types.WebGlRenderState),q[d].copy_attributes(f.getValue(d)),q[d].enableZWrite=0.5<c.getValue(d),q[d].depthFunc=e(a.getValue(d)),q[d].depthOffset=k.getValue(0),h.setValue(d,q[d]);h.setSliceCount(b)}};VVVV.Nodes.ZWriteEnableWebGL.prototype=new VVVV.Core.Node;VVVV.Nodes.CullWebGL=function(b,d){this.constructor(b,"Cull (EX9.RenderState)",
d);this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var e=this.addInputPin("Render State In",[],VVVV.PinTypes.WebGlRenderState),f=this.addInputPin("Culling",["None"],VVVV.PinTypes.Enum);f.enumOptions=["None","Clockwise","Counterclockwise"];var c=this.addOutputPin("Render State Out",[],VVVV.PinTypes.WebGlRenderState),a=[];this.evaluate=function(){for(var b=this.getMaxInputSliceCount(),d=0;d<b;d++)void 0==a[d]&&(a[d]=new VVVV.Types.WebGlRenderState),
a[d].copy_attributes(e.getValue(d)),"Clockwise"==f.getValue(d)?a[d].cullFace="CW":"Counterclockwise"==f.getValue(d)?a[d].cullFace="CCW":a[d].cullFace=void 0,c.setValue(d,a[d]);c.setSliceCount(b)}};VVVV.Nodes.CullWebGL.prototype=new VVVV.Core.Node;VVVV.Nodes.GenericShader=function(b,d){this.constructor(b,"GenericShader (EX9.Effect)",d);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};this.shaderFile="";var e=this.addInputPin("Render State",
[],VVVV.PinTypes.WebGlRenderState),f=this.addInputPin("Mesh",[],VVVV.PinTypes.WebGlResource),c=this.addInputPin("Transform",[],VVVV.PinTypes.Transform),a=this.addInputPin("Technique",[""],VVVV.PinTypes.Enum);a.enumOptions=[""];this.addOutputPin("Layer",[],VVVV.PinTypes.WebGlResource);var k=[],m=null,q,t=!1,n=[],l=this;this.initialize=function(){var a=["Render State","Mesh","Transform","Technique"];_(l.inputPins).each(function(c){0>a.indexOf(c.pinname)&&(c.unvalidated=!0,n.push(c))});void 0==VVVV.ShaderCodeResources[l.shaderFile]?
(VVVV.ShaderCodeResources[l.shaderFile]=new VVVV.Types.ShaderCodeResource,VVVV.ShaderCodeResources[l.shaderFile].addRelatedNode(l),h.ajax({url:VVVV.Helpers.prepareFilePath(l.shaderFile,l.parentPatch),async:!1,dataType:"text",success:function(a){VVVV.ShaderCodeResources[l.shaderFile].setSourceCode(a)},error:function(){console.log("ERROR: Could not load shader file "+l.shaderFile.replace("%VVVV%",VVVV.Root));VVVV.onNotImplemented("Could not load shader file "+l.shaderFile.replace("%VVVV%",VVVV.Root))}})):
VVVV.ShaderCodeResources[l.shaderFile].addRelatedNode(l)};this.shaderSourceUpdated=function(a){q=a;m||(m=new VVVV.Types.ShaderProgram);l.addUniformPins();l.setupShader();_(l.inputPins).each(function(a){a.markPinAsChanged()});t=!0;m.isSetup=!1;this.parentPatch.afterUpdate()};this.addUniformPins=function(){m.extractSemantics(q);for(var a=[],c=0;c<n.length;c++)m.uniformSpecs[n[c].pinname.replace(/ /g,"_")]||(l.removeInputPin(n[c].pinname),a.push(c));for(c=0;c<a.length;c++)n.splice(a[c],1);_(m.uniformSpecs).each(function(a){if("VIEW"!=
a.semantic&&"PROJECTION"!=a.semantic&&"WORLD"!=a.semantic&&"VIEWPROJECTION"!=a.semantic&&"WORLDVIEW"!=a.semantic&&"WORLDVIEWPROJECTION"!=a.semantic){var c=VVVV.PinTypes.Value,b=[];switch(a.type){case "mat":c=VVVV.PinTypes.Transform;break;case "samplerCube":case "sampler":c=VVVV.PinTypes.WebGlTexture;break;default:"COLOR"==a.semantic?(c=VVVV.PinTypes.Color,b=[new VVVV.Types.Color("1.0, 1.0, 1.0, 1.0")]):b=[0],a.defaultValue&&(b="COLOR"!=a.semantic?_(a.defaultValue.split(",")).map(function(a){return parseFloat(a)}):
[new VVVV.Types.Color(a.defaultValue)])}for(var f=0;f<n.length;f++)if(n[f].pinname==a.varname.replace(/_/g," ")){n[f].dimensions=a.dimension;n[f].unvalidated&&!n[f].isConnected()&&(n[f].values="Color"==c.typeName?l.defaultPinValues[n[f].pinname]?_(l.defaultPinValues[n[f].pinname]).map(function(a){return new VVVV.Types.Color(a)}):b:l.defaultPinValues[n[f].pinname]?l.defaultPinValues[n[f].pinname].slice():b);n[f].typeName!=c.typeName&&(a=n[f].values.slice(),b=n[f].getSliceCount(),n[f].setType(c),n[f].unvalidated&&
(c.primitive&&!n[f].isConnected())&&(n[f].values=a,n[f].setSliceCount(b)),n[f].isConnected()&&!n[f].unvalidated&&(n[f].connectionChanged(),n[f].links[0].destroy()));n[f].unvalidated=!1;return}c=l.addInputPin(a.varname.replace(/_/g," "),b,c);c.dimensions=a.dimension;n.push(c)}})};this.setupShader=function(){var c=a.getValue(0),c=c.replace(/^\s*/,"").replace(/\s*$/,""),b=RegExp(/(vertex_shader|fragment_shader)\{([^\}]+)\}/g);a.enumOptions=[];for(var f;null!=(f=b.exec(q));)a.enumOptions=a.enumOptions.concat(f[2].replace(/\s/g,
"").split(","));a.enumOptions=a.enumOptions.filter(function(a,c,b){return b.indexOf(a)===c});0==a.enumOptions.length&&a.enumOptions.push("");if(""==c||0>a.enumOptions.indexOf(c))c=a.enumOptions[0],a.setValue(0,c);var d=RegExp("vertex_shader(\\{([a-zA-Z0-9]+,\\s*)*"+c+"(,\\s*[a-zA-Z0-9]+)*\\})?:([\\s\\S]*?)(vertex_shader|fragment_shader)"),b=RegExp("fragment_shader(\\{([a-zA-Z0-9]+,\\s*)*"+c+"(,\\s*[a-zA-Z0-9]+)*\\})?:([\\s\\S]*?)(vertex_shader|fragment_shader)");f=/STARTOFSTRING((\r?\n|.)*?)(vertex_shader|fragment_shader)/.exec("STARTOFSTRING"+
q);var e=f[1];void 0==(f=d.exec(q+"\nfragment_shader"))?console.log("ERROR: No vertex shader code for technique "+c+" found"):(d=f[4],void 0==(f=b.exec(q+"\nfragment_shader"))?console.log("ERROR: No fragment shader code for technique "+c+" found"):(m.setFragmentShader(e+f[4]),m.setVertexShader(e+d)))};this.evaluate=function(){if(this.renderContexts){var b=this.renderContexts[0];if(b&&m){if(!m.isSetup||this.contextChanged||a.pinIsChanged())this.setupShader(),m.setup(b)?VVVV.ShaderCodeResources[l.shaderFile].definingNode&&
VVVV.ShaderCodeResources[l.shaderFile].definingNode.showStatus("success","Successfully compiled"):VVVV.ShaderCodeResources[l.shaderFile].definingNode&&VVVV.ShaderCodeResources[l.shaderFile].definingNode.showStatus("error",m.log);var d=0;_(this.inputPins).each(function(a){var c=a.getSliceCount();a=a.pinname.replace(/ /g,"_");m.uniformSpecs[a]&&("vec"==m.uniformSpecs[a].type&&"COLOR"!=m.uniformSpecs[a].semantic)&&(c=parseInt(c/m.uniformSpecs[a].dimension));c>d&&(d=c)});f.isConnected()&&void 0!=f.getValue(0)||
(d=0);var g=k.length;if(this.contextChanged||t)g=0;d<g&&k.splice(d,g-d);for(var h=g;h<d;h++)k[h]=new VVVV.Types.Layer,k[h].mesh=f.getValue(0),k[h].shader=m,_(m.uniformSpecs).each(function(a){k[h].uniformNames.push(a.varname);k[h].uniforms[a.varname]={uniformSpec:a,value:void 0}});if(f.pinIsChanged())for(h=0;h<d;h++)k[h].mesh=f.getValue(0);for(h=0;h<d;h++)k[h].shader=m;for(b=0;b<n.length;b++){var q=n[b].pinname.replace(/ /g,"_");if(n[b].pinIsChanged()||g<d)for(h=0;h<d;h++)if("vec"==m.uniformSpecs[q].type)if("COLOR"==
m.uniformSpecs[q].semantic)k[h].uniforms[q].value=n[b].getValue(h).rgba;else{var y=n[b].getValue(h,n[b].dimensions);k[h].uniforms[q].value=new Float32Array(y)}else y=n[b].getValue(h),k[h].uniforms[q].value=y}if(e.pinIsChanged()||g<d)for(b=0;b<d;b++)e.isConnected()?k[b].renderState=e.getValue(b):k[b].renderState=VVVV.DefaultRenderState;if(c.pinIsChanged()||g<d)for(b=0;b<d;b++)g=this.inputPins.Transform.getValue(b),k[b].uniforms[k[b].shader.uniformSemanticMap.WORLD].value=g;this.outputPins.Layer.setSliceCount(d);
for(b=0;b<d;b++)this.outputPins.Layer.setValue(b,k[b]);t=this.contextChanged=!1}}};this.openUIWindow=function(){VVVV.ShaderCodeResources[l.shaderFile].definingNode&&VVVV.ShaderCodeResources[l.shaderFile].definingNode.openUIWindow()}};VVVV.Nodes.GenericShader.prototype=new VVVV.Core.Node;VVVV.Nodes.Quad=function(b,d){this.constructor(b,"Quad (DX9)",d);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 e=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 f=[],c=null,a=null;this.evaluate=function(){if(this.renderContexts){var b=
this.renderContexts[0];if(b){if(this.contextChanged){var d=[0.5,0.5,0,-0.5,0.5,0,0.5,-0.5,0,-0.5,-0.5,0],g=new VVVV.Types.VertexBuffer(b,d);g.create();g.setSubBuffer("POSITION",3,d);g.setSubBuffer("TEXCOORD0",2,[1,0,0,0,1,1,0,1]);g.update();c=new VVVV.Types.Mesh(b,g,[0,1,2,1,3,2]);c.update([0,1,2,1,3,2]);d="#ifdef GL_ES\nprecision highp float;\n#endif\n";d+="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(d+"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(d);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();d=f.length;this.contextChanged&&(d=0);b<d&&f.splice(b,d-b);for(var h=d;h<b;h++)f[h]=new VVVV.Types.Layer,f[h].mesh=c,f[h].shader=a,_(a.uniformSpecs).each(function(a){f[h].uniformNames.push(a.varname);f[h].uniforms[a.varname]={uniformSpec:a,value:void 0}});var n=this.inputPins.Color.pinIsChanged(),l=this.inputPins.Transform.pinIsChanged(),g=this.inputPins.Texture.pinIsChanged(),p=this.inputPins["Texture Transform"].pinIsChanged();if(n||d<b)for(n=0;n<b;n++){var s=
this.inputPins.Color.getValue(n);f[n].uniforms.col.value=s.rgba}if(e.pinIsChanged()||d<b)for(n=0;n<b;n++)e.isConnected()?f[n].renderState=e.getValue(n):f[n].renderState=VVVV.DefaultRenderState;if(l||d<b)for(n=0;n<b;n++)l=this.inputPins.Transform.getValue(n),f[n].uniforms[f[n].shader.uniformSemanticMap.WORLD].value=l;if(g||d<b)for(n=0;n<b;n++)f[n].uniforms.Samp0.value=this.inputPins.Texture.getValue(n);if(p||d<b)for(n=0;n<b;n++)l=this.inputPins["Texture Transform"].getValue(n),f[n].uniforms.tTex.value=
l;this.outputPins.Layer.setSliceCount(b);for(n=0;n<b;n++)this.outputPins.Layer.setValue(n,f[n]);this.contextChanged=!1}}}};VVVV.Nodes.Quad.prototype=new VVVV.Core.Node;VVVV.Nodes.GridSegment=function(b,d){this.constructor(b,"GridSegment (DX9)",d);this.auto_nil=!1;this.meta={authors:["woei"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var e=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 f=this.addInputPin("Cycles",[1],VVVV.PinTypes.Value),c=this.addInputPin("Inner Radius",[0],VVVV.PinTypes.Value),a=this.addInputPin("Resolution X",[6],VVVV.PinTypes.Value),k=this.addInputPin("Resolution Y",[2],VVVV.PinTypes.Value);this.addOutputPin("Layer",[],VVVV.PinTypes.WebGlResource);var h=[],q=null;this.evaluate=function(){if(this.renderContexts){var b=
this.renderContexts[0];if(b){if(this.contextChanged){var d;d="#ifdef GL_ES\nprecision highp float;\n#endif\n";d+="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; }";q=new VVVV.Types.ShaderProgram;q.extractSemantics(d+"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; }");
q.setFragmentShader(d);q.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; }");q.setup(b)}d=this.getMaxInputSliceCount();var g=h.length;if(this.contextChanged||a.pinIsChanged()||k.pinIsChanged()||f.pinIsChanged()||c.pinIsChanged())g=
0;d<g&&h.splice(d,g-d);for(var p=g;p<d;p++){h[p]=new VVVV.Types.Layer;for(var s=parseInt(a.getValue(p)),v=parseInt(k.getValue(p)),w=f.getValue(p),x=c.getValue(p),y=[],u=[],B=[],r=0,A=0;A<v;A++)for(var z=0;z<s;z++){var D=parseFloat(z)/(s-1),D=0.25-D*w,D=6.28318530718*D,C=parseFloat(A)/(v-1),C=x*(1-C)+C;y.push(0.5*Math.sin(D)*C);y.push(0.5*Math.cos(D)*C);y.push(0);r++;u.push(0);u.push(0);u.push(1);B.push(parseFloat(z)/(s-1));B.push(parseFloat(A)/(v-1))}w=new VVVV.Types.VertexBuffer(b,y);w.create();
w.setSubBuffer("POSITION",3,y);w.setSubBuffer("TEXCOORD0",2,B);w.setSubBuffer("NORMAL",3,u);w.create();y=[];for(A=0;A<v-1;A++)for(z=0;z<s-1;z++)u=z+s*A,y.push(u),y.push(u+1),y.push(u+s+1),y.push(u+s+1),y.push(u+s),y.push(u);h[p].mesh=new VVVV.Types.Mesh(b,w,y);h[p].mesh.update(y);h[p].shader=q;_(q.uniformSpecs).each(function(a){h[p].uniformNames.push(a.varname);h[p].uniforms[a.varname]={uniformSpec:a,value:void 0}})}A=this.inputPins.Color.pinIsChanged();v=this.inputPins.Transform.pinIsChanged();b=
this.inputPins.Texture.pinIsChanged();s=this.inputPins["Texture Transform"].pinIsChanged();if(A||g<d)for(A=0;A<d;A++)z=this.inputPins.Color.getValue(A),h[A].uniforms.col.value=z.rgba;if(e.pinIsChanged()||g<d)for(A=0;A<d;A++)e.isConnected()?h[A].renderState=e.getValue(A):h[A].renderState=VVVV.DefaultRenderState;if(v||g<d)for(A=0;A<d;A++)v=this.inputPins.Transform.getValue(A),h[A].uniforms[h[A].shader.uniformSemanticMap.WORLD].value=v;if(b||g<d)for(A=0;A<d;A++)h[A].uniforms.Samp0.value=this.inputPins.Texture.getValue(A);
if(s||g<d)for(A=0;A<d;A++)v=this.inputPins["Texture Transform"].getValue(A),h[A].uniforms.tTex.value=v;this.outputPins.Layer.setSliceCount(d);for(A=0;A<d;A++)this.outputPins.Layer.setValue(A,h[A]);this.contextChanged=!1}}}};VVVV.Nodes.GridSegment.prototype=new VVVV.Core.Node;VVVV.Nodes.Group=function(b,d){this.constructor(b,"Group (EX9)",d);this.auto_nil=!1;this.meta={authors:["Matthias Zauner"],original_authors:["VVVV Group"],credits:[],compatibility_issues:[]};var e=[],f=this.addInputPin("Enabled",
[1],VVVV.PinTypes.Value),c=this.addInvisiblePin("Layer Template Count",[2],VVVV.PinTypes.Value),a=this.addOutputPin("Layer",[],VVVV.PinTypes.WebGlResource);this.initialize=function(){var a=Math.max(2,c.getValue(0));VVVV.Helpers.dynamicPins(this,e,a,function(a){return this.addInputPin("Layer "+(a+1),[],VVVV.PinTypes.WebGlResource)})};this.evaluate=function(){c.pinIsChanged()&&this.initialize();var b=0;if(0.5<f.getValue(0))for(var d=0;d<e.length;d++)for(var g=0;g<e[d].getSliceCount();g++)a.setValue(b++,
e[d].getValue(g));a.setSliceCount(b)}};VVVV.Nodes.Group.prototype=new VVVV.Core.Node;VVVV.Nodes.RendererWebGL=function(g,d){function e(){function a(b){switch(b.which){case 1:VVVV.MousePositions._all.lb=0;VVVV.MousePositions[u.id].lb=0;break;case 2:VVVV.MousePositions._all.mb=0;VVVV.MousePositions[u.id].mb=0;break;case 3:VVVV.MousePositions._all.rb=0,VVVV.MousePositions[u.id].rb=0}}h(u).detach("mousemove");h(u).detach("mousedown");h(u).detach("mouseup");VVVV.MousePositions[u.id]={x:0,y:0,wheel:0,lb:0,
mb:0,rb:0};h(u).mousemove(function(a){var b=2*(a.pageX-h(this).offset().left)/h(this).width()-1;a=-(2*(a.pageY-h(this).offset().top)/h(this).height()-1);VVVV.MousePositions._all.x=b;VVVV.MousePositions._all.y=a;VVVV.MousePositions[u.id].x=b;VVVV.MousePositions[u.id].y=a});h(u).bind("mousewheel",function(a){a=a.originalEvent.wheelDelta/120;VVVV.MousePositions[u.id].wheel+=a;VVVV.MousePositions._all.wheel+=a});h(u).bind("DOMMouseScroll",function(a){a=-a.originalEvent.detail/3;VVVV.MousePositions[u.id].wheel+=
a;VVVV.MousePositions._all.wheel+=a});h(u).mousedown(function(b){switch(b.which){case 1:VVVV.MousePositions._all.lb=1;VVVV.MousePositions[u.id].lb=1;break;case 2:VVVV.MousePositions._all.mb=1;VVVV.MousePositions[u.id].mb=1;break;case 3:VVVV.MousePositions._all.rb=1,VVVV.MousePositions[u.id].rb=1}h(document).unbind("mouseup",a);h(document).mouseup(a)})}this.constructor(g,"Renderer (EX9)",d);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 f=this.addInputPin("Clear",[1],VVVV.PinTypes.Value),c=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),k=this.addInputPin("Backbuffer Height",[0],VVVV.PinTypes.Value),m=this.addInputPin("View",[],VVVV.PinTypes.Transform),q=this.addInputPin("Projection",
[],VVVV.PinTypes.Transform),t=this.addInvisiblePin("Windowed Depthbuffer Format",["NONE"],VVVV.PinTypes.Enum);t.enumOptions=["NONE","DX16"];var n=this.addOutputPin("Actual Backbuffer Width",[0],VVVV.PinTypes.Value),l=this.addOutputPin("Actual Backbuffer Height",[0],VVVV.PinTypes.Value),p=this.addOutputPin("EX9 Out",[],VVVV.PinTypes.WebGlResource),s=0,v=0,w,x,y;mat4.create();mat4.create();var u,B=this.ctxt=void 0,r,A,z;this.getContexts=function(){if(this.invisiblePins["Descriptive Name"]){var b=this.invisiblePins["Descriptive Name"].getValue(0);
if((b=h(b).get(0))&&"CANVAS"==b.nodeName)u=h(b);else{var d=parseInt(a.getValue(0)),g=parseInt(k.getValue(0));u=h('<canvas width="'+(0<d?d:512)+'" height="'+(0<g?g:512)+'" id="vvvv-js-generated-renderer-'+(new Date).getTime()+'" class="vvvv-js-generated-renderer"></canvas>');b||(b="body");h(b).append(u)}if(u){e();try{B=u.get(0).getContext("experimental-webgl",{preserveDrawingBuffer:!0}),B.viewportWidth=parseInt(u.get(0).width),B.viewportHeight=parseInt(u.get(0).height)}catch(l){console.log(l)}this.ctxt=
B;p.isConnected()&&this.renderContexts&&this.renderContexts[0]?(r=this.ctxt=this.renderContexts[0],A=r.createFramebuffer(),r.bindFramebuffer(r.FRAMEBUFFER,A),A.width=u.get(0).width,A.height=u.get(0).height,z=r.createTexture(),r.bindTexture(r.TEXTURE_2D,z),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,A.width,A.height,0,r.RGBA,r.UNSIGNED_SHORT_4_4_4_4,
null),r.generateMipmap(r.TEXTURE_2D),b=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,b),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,A.width,A.height),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,z,0),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,b),r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindFramebuffer(r.FRAMEBUFFER,null)):this.renderContexts&&this.renderContexts[0]&&(this.renderContexts[0].deleteTexture(z),
z=void 0);this.ctxt&&(s=parseInt(u.get(0).width),v=parseInt(u.get(0).height),r=this.ctxt,b=new Uint8Array([255,255,255]),r.DefaultTexture={},r.DefaultTexture["2D"]=r.createTexture(),r.bindTexture(r.TEXTURE_2D,r.DefaultTexture["2D"]),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.pixelStorei(r.UNPACK_ALIGNMENT,
1),r.texImage2D(r.TEXTURE_2D,0,r.RGB,1,1,0,r.RGB,r.UNSIGNED_BYTE,b),r.bindTexture(r.TEXTURE_2D,null),r.DefaultTexture.CUBE=r.createTexture(),r.bindTexture(r.TEXTURE_CUBE_MAP,r.DefaultTexture.CUBE),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MAG_FILTER,r.NEAREST),r.pixelStorei(r.UNPACK_ALIGNMENT,
1),r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X,0,r.RGB,1,1,0,r.RGB,r.UNSIGNED_BYTE,b),r.texImage2D(r.TEXTURE_CUBE_MAP_NEGATIVE_X,0,r.RGB,1,1,0,r.RGB,r.UNSIGNED_BYTE,b),r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_Y,0,r.RGB,1,1,0,r.RGB,r.UNSIGNED_BYTE,b),r.texImage2D(r.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,r.RGB,1,1,0,r.RGB,r.UNSIGNED_BYTE,b),r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_Z,0,r.RGB,1,1,0,r.RGB,r.UNSIGNED_BYTE,b),r.texImage2D(r.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,r.RGB,1,1,0,r.RGB,r.UNSIGNED_BYTE,b),r.bindTexture(r.TEXTURE_CUBE_MAP,
null),this.inputPins.Layers.markPinAsChanged(),f.markPinAsChanged(),c.markPinAsChanged(),m.markPinAsChanged(),q.markPinAsChanged())}}};this.destroy=function(){h(u).remove()};var D=!1;this.evaluate=function(){r=this.ctxt;if(this.invisiblePins["Descriptive Name"].pinIsChanged()||this.contextChanged)B&&h(B.canvas).hasClass("vvvv-js-generated-renderer")&&h(B.canvas).remove(),this.getContexts(),this.inputPins.Layers.isConnected()&&this.inputPins.Layers.links[0].fromPin.connectionChanged();D||(n.setValue(0,
s),l.setValue(0,v),D=!0);if(void 0!=r){if(a.pinIsChanged()&&(!this.renderContexts||!this.renderContexts[0])){var d=parseInt(a.getValue(0));0<d&&(s=d,h(B.canvas).attr("width",s),n.setValue(0,s))}!k.pinIsChanged()||this.renderContexts&&this.renderContexts[0]||(d=parseInt(k.getValue(0)),0<d&&(v=d,h(B.canvas).attr("height",v),l.setValue(0,v)));this.renderContexts&&this.renderContexts[0]&&r==this.renderContexts[0]?r.bindFramebuffer(r.FRAMEBUFFER,A):r.bindFramebuffer(r.FRAMEBUFFER,null);if(this.contextChanged||
c.pinIsChanged())d=c.getValue(0),r.clearColor(d.rgba[0],d.rgba[1],d.rgba[2],d.rgba[3]);r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT);if(this.contextChanged||t.pinIsChanged())"NONE"==t.getValue(0)?r.disable(r.DEPTH_TEST):r.enable(r.DEPTH_TEST);q.pinIsChanged()&&(q.isConnected()?(w=mat4.create(),mat4.set(q.getValue(0),w)):(w=mat4.create(),mat4.ortho(-1,1,-1,1,-100,100,w)),mat4.scale(w,[1,1,-1]),this.renderContexts&&this.renderContexts[0]&&mat4.scale(w,[1,-1,1]),y=mat4.create());m.pinIsChanged()&&(x=
m.getValue(0));(m.pinIsChanged()||q.pinIsChanged())&&mat4.multiply(w,x,y);if(!this.contextChanged){r.viewport(0,0,s,v);var f=d=null,e=null;if(this.inputPins.Layers.isConnected()){for(var g=this.inputPins.Layers.values,u=0;u<g.length;u++)if(layer=g[u],void 0!=layer.shader){d!=layer.shader.shaderProgram&&(r.useProgram(layer.shader.shaderProgram),r.uniformMatrix4fv(layer.shader.uniformSpecs[layer.shader.uniformSemanticMap.PROJECTION].position,!1,w),r.uniformMatrix4fv(layer.shader.uniformSpecs[layer.shader.uniformSemanticMap.VIEW].position,
!1,x),layer.shader.uniformSemanticMap.VIEWPROJECTION&&r.uniformMatrix4fv(layer.shader.uniformSpecs[layer.shader.uniformSemanticMap.VIEWPROJECTION].position,!1,y));var G=layer.renderState;G||(G=b);G!=f&&G.apply(r);if(layer.mesh!=e||layer.shader.shaderProgram!=d)r.bindBuffer(r.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&&
(r.enableVertexAttribArray(layer.shader.attributeSpecs[layer.shader.attribSemanticMap[a.usage]].position),r.vertexAttribPointer(layer.shader.attributeSpecs[layer.shader.attribSemanticMap[a.usage]].position,a.size,r.FLOAT,!1,0,a.offset))}),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,layer.mesh.indexBuffer);for(var f=layer.uniformNames.length,L=e=0;L<f;L++){var E=layer.uniforms[layer.uniformNames[L]];if(void 0!=E.value&&!(0<u&&layer.shader.shaderProgram==d&&g[u-1].uniforms[layer.uniformNames[L]]&&E.value==
g[u-1].uniforms[layer.uniformNames[L]].value)){start=(new Date).getTime();switch(E.uniformSpec.type){case "mat":r["uniformMatrix"+E.uniformSpec.dimension+"fv"](E.uniformSpec.position,!1,E.value);break;case "vec":r["uniform"+E.uniformSpec.dimension+"fv"](E.uniformSpec.position,E.value);break;case "int":r["uniform"+E.uniformSpec.dimension+"i"](E.uniformSpec.position,E.value);break;case "float":r["uniform"+E.uniformSpec.dimension+"f"](E.uniformSpec.position,E.value);break;case "sampler":var I=E.value;
I==VVVV.DefaultTexture&&(I=r.DefaultTexture["2D"]);r.activeTexture(r["TEXTURE"+e]);r.bindTexture(r["TEXTURE_"+E.uniformSpec.dimension],I);r.uniform1i(E.uniformSpec.position,e);e++;break;case "samplerCube":I=E.value,I==VVVV.DefaultTexture&&(I=r.DefaultTexture.CUBE),r.activeTexture(r["TEXTURE"+e]),r.bindTexture(r.TEXTURE_CUBE_MAP,I),r.uniform1i(E.uniformSpec.position,e),e++}loopstart=(new Date).getTime()}}r.drawElements(r[G.polygonDrawMode],layer.mesh.numIndices,r.UNSIGNED_SHORT,0);d=layer.shader.shaderProgram;
f=G;e=layer.mesh}r.bindTexture(r.TEXTURE_2D,null);r.bindTexture(r.TEXTURE_CUBE_MAP,null)}this.renderContexts&&this.renderContexts[0]&&(r.bindTexture(r.TEXTURE_2D,z),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(this.renderContexts[0].TEXTURE_2D,null));p.setValue(0,z)}this.contextChanged=!1}}};VVVV.Nodes.RendererWebGL.prototype=new VVVV.Core.Node;VVVV.Nodes.DefineEffect=function(b,d){this.constructor(b,"DefineEffect (DX9)",d);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 e=this.addInputPin("Effect Descriptor",[""],VVVV.PinTypes.String),f=this.addInvisiblePin("Source Code",["#ifdef GL_ES\nprecision highp 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),c="",a;this.evaluate=function(){if(""!=e.getValue(0)){if(e.pinIsChanged()){var b=e.getValue(0);if(""==b)return;""==c?void 0==VVVV.ShaderCodeResources["./"+b+".vvvvjs.fx"]&&(VVVV.ShaderCodeResources["./"+b+".vvvvjs.fx"]=new VVVV.Types.ShaderCodeResource):VVVV.ShaderCodeResources["./"+b+".vvvvjs.fx"]=VVVV.ShaderCodeResources[c];c="./"+b+".vvvvjs.fx";VVVV.ShaderCodeResources[c].definingNode=this;VVVV.ShaderCodeResources[c].setSourceCode(f.getValue(0));a&&h("#path",a.document).text((this.parentPatch.nodename||
"root")+" / "+(""!=c?c:"Untitled"))}f.pinIsChanged()&&VVVV.ShaderCodeResources[c]&&VVVV.ShaderCodeResources[c].setSourceCode(f.getValue(0))}};this.openUIWindow=function(){a=window.open(VVVV.Root+"/code_editor.html",c+" / VVVV.js Effect Editor","location=no, width=800, height=800, toolbar=no");var b=this;window.setTimeout(function(){a.document.title=c+" / VVVV.js Effect Editor";var d=b.parentPatch.nodename||"root",e=""!=c?c:"Untitled";h("#path",a.document).text(d+" / "+e);h("textarea",a.document).text(f.getValue(0));
h("#compile_button",a.document).click(function(){""==c?b.showStatus("error","Please provide a name for this shader first"):(f.setValue(0,h("textarea",a.document).val()),0<VVVV.ShaderCodeResources[c].relatedNodes.length?b.showStatus("notice","Compiling ..."):b.showStatus("notice","No instance of this shader found. Create a node (./"+c+") and connect it to a Renderer (EX9) to compile."))});a.focus()},500)};this.showStatus=function(b,c){a&&(h("#status",a.document).text(c),h("#status",a.document).attr("class",
b))}};VVVV.Nodes.DefineEffect.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){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 d=this.addInputPin("XML Input",["text"],VVVV.PinTypes.String),e=this.addInputPin("XPath Query",["text"],VVVV.PinTypes.String),f=this.addInputPin("Base Element",["text"],VVVV.PinTypes.String),c=this.addOutputPin("Output",
["text"],VVVV.PinTypes.String),a=this.addOutputPin("XML Index",[0],VVVV.PinTypes.Value),k=this.addOutputPin("Query Index",[0],VVVV.PinTypes.Value),h;this.evaluate=function(){var b=d.getValue(0),g=e.getValue(0);f.getValue(0);d.pinIsChanged()&&(h=(new DOMParser).parseFromString(b,"text/xml"));for(var b=h.evaluate(g,h,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),g=0,n;n=b.iterateNext();)n.value?c.setValue(g,n.value):n.data?c.setValue(g,n.data):c.setValue(g,""),g++;a.setValue(g,0);k.setValue(g,0);
c.setSliceCount(g);a.setSliceCount(1);k.setSliceCount(1)}};VVVV.Nodes.XPathXML.prototype=new VVVV.Core.Node})(vvvvjs_jquery);(function(h){VVVV.PinTypes.Value.makeLabel=VVVV.PinTypes.String.makeLabel=function(b,g){var d=g.IOBoxRows();g.IOBoxInputPin().getSliceCount();d3.select(b).selectAll(".vvvv-node-label").remove();for(var e=0;e<d;e++)d3.select(b).append("svg:text").text(g.IOBoxInputPin().getValue(e)).attr("class","vvvv-node-label").attr("shape-rendering","crispEdges").attr("dy",function(b){return 12*e+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,d,e){$inputbox=h("<input type='text' value='"+d.getValue(e)+"' 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();$inputbox.change(function(){d.setValue(e,parseFloat(h(this).val()));var b=_(d.values).map(function(a){return"|"+a.toString().replace(/\|/g,"||")+
"|"});b.length=d.getSliceCount();d.node.parentPatch.editor.update(d.node.parentPatch,"<PATCH><NODE id='"+d.node.id+"'><PIN pinname='"+d.pinname+"' values='"+b.join(",")+"'/></NODE>")});$inputbox.keydown(function(b){13==b.which&&(h(this).change(),h(this).remove())});if("Value"==this.typeName){var f=function(b,a,d){var f=h(b).val()%1;if(!isNaN(f)){var e;e=1;if(d.altKey||0!==f)e=0.01;a*=e;h(b).val(parseFloat(h(b).val())+a);h(b).change()}};$inputbox.bind("mousewheel",function(b){f(this,b.originalEvent.wheelDelta/
120,b);b.preventDefault();return!1});$inputbox.bind("DOMMouseScroll",function(b){f(this,-b.originalEvent.detail/3,b);b.preventDefault();return!1})}$inputbox.bind("paste",function(b){b.stopPropagation()});$inputbox.bind("copy",function(b){b.stopPropagation()})};VVVV.PinTypes.Enum.openInputBox=function(b,g,d,e){$inputbox=h("<select class='pininputbox value resettable'>");for(b=0;b<d.enumOptions.length;b++)$opt=h('<option value="'+d.enumOptions[b]+'">'+d.enumOptions[b]+"</option>"),d.getValue(e)==d.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(){d.setValue(e,h(this).val());var b=_(d.values).map(function(b){return"|"+b+"|"});b.length=d.getSliceCount();d.node.parentPatch.editor.update(d.node.parentPatch,"<PATCH><NODE id='"+d.node.id+"'><PIN pinname='"+
d.pinname+"' values='"+b.join(",")+"'/></NODE>");h(this).remove()})};VVVV.PinTypes.Color.makeLabel=function(b,g){var d=g.IOBoxRows();g.IOBoxInputPin().getSliceCount();d3.select(b).selectAll(".vvvv-node-label").remove();for(var e=0;e<d;e++)d3.select(b).append("svg:rect").attr("class","vvvv-node-label").attr("height",g.getHeight()/d-8).attr("width",g.getWidth()).attr("y",12*e+4).attr("fill",function(b){b=g.IOBoxInputPin().getValue(e);for(var c=[],a=0;a<b.rgba.length;a++)c[a]=parseInt(256*b.rgba[a]);
return"rgba("+c.join(",")+")"})};VVVV.PinTypes.Color.openInputBox=function(b,g,d,e){function f(a){k=a.altKey&&a.shiftKey?3:a.altKey?1:a.shiftKey?2:0}function c(b){t[k]+=0.01*b;0!=k&&(t[k]=Math.min(1,Math.max(0,t[k])));a();$inputbox.find("input[type='range']").each(function(a){h(this).val(t[a])})}function a(){m.setHSV(t[0],t[1],t[2]);m.rgba[3]=t[3];$inputbox.css("background-color","rgba("+_(m.rgba).map(function(a){return parseInt(255*a)}).join(",")+")");ibx=$inputbox;d.setValue(e,m);var a=_(d.values).map(function(a){return"|"+
a.toString()+"|"});a.length=d.getSliceCount();d.node.parentPatch.editor.update(d.node.parentPatch,"<PATCH><NODE id='"+d.node.id+"'><PIN pinname='"+d.pinname+"' values='"+a.join(",")+"'/></NODE>")}var k=0;h(b.window.document).keydown(f).keyup(f);$inputbox=h('<div class="pininputbox color resettable"></div>');$inputbox.css("position",g.css("position"));$inputbox.css("width","120px");$inputbox.css("height","90px");$inputbox.css("left",g.css("left"));$inputbox.css("top",g.offset().top-85+"px");var m=
d.getValue(e);b=[];for(var q=0;q<m.rgba.length;q++)b[q]=parseInt(256*m.rgba[q]);b[3]=255;$inputbox.css("background-color","rgba("+b.join(",")+")");g.replaceWith($inputbox);var t=m.getHSV();t[3]=m.rgba[3];for(q=0;4>q;q++)$slider=h('<input type="range" name="hsv[]" min="0" max="1" step="0.001" value="'+t[q]+'"/>'),$inputbox.append('<span class="color-component">'+"HSVA"[q]+":</div>"),$inputbox.append($slider),function(b){$slider.on("input",function(){t[b]=parseFloat(h(this).val());a()})}(q);$inputbox.on("mousewheel",
function(a){c(a.originalEvent.wheelDelta/120);a.preventDefault();return!1});$inputbox.bind("DOMMouseScroll",function(a){c(-a.originalEvent.detail/3);a.preventDefault();return!1})};VVVV.Editors.BrowserEditor={};VVVV.Editors.BrowserEditor.PatchWindow=function(b,g,d){function e(){a.selectAll(".vvvv-node.selected").attr("class",function(a){return a.isIOBox?"vvvv-node vvvv-iobox":"vvvv-node"});l=[]}var f=this.state=0,c=0,a,k,m,q,t,n=void 0,l=[],p=b,s=0,v=VVVV.Root+"/patch.html",w=!1,x=0,y=0,u=0,B=0;this.window=
d?window:window.open(v,b.nodename,"location=no, width="+b.windowWidth+", height="+b.windowHeight+", toolbar=no");var r=this;window.setTimeout(function(){for(var m=0;m<p.nodeList.length;m++)s=Math.max(s,p.nodeList[m].id);d?root=d3.select(h(d).get(0)):(r.window.document.title=b.nodename,root=d3.select(r.window.document.body));if(!d){h("body",r.window.document).on("copy",function(a){for(var b=h("<PATCH>"),c=[],d=_(l).map(function(a){return a.id}),f=0;f<l.length;f++)b.append(l[f].serialize()),_(l[f].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(f=0;f<c.length;f++)b.append(c[f].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 q=0,t=0;h("body",r.window.document).mousemove(function(a){q=a.pageX;t=a.pageY});h("body",r.window.document).on("paste",function(b){b=b.originalEvent.clipboardData.getData("text/plain");if(!b.match(/^<!DOCTYPE PATCH/))return!1;$patch=h(b);var c=void 0,d=void 0;$patch.find("node bounds").each(function(){var a=
parseInt(h(this).attr("left")),b=parseInt(h(this).attr("top"));if(!c||a<c)c=a;if(!d||b<d)d=b});var f={};$patch.find("node").each(function(){s++;f[h(this).attr("id")]=s;h(this).attr("createme","pronto");h(this).attr("id",s);var a=parseInt(h(this).find("bounds").attr("left"))-c+15*q,b=parseInt(h(this).find("bounds").attr("top"))-d+15*t;h(this).find("bounds").attr("left",a);h(this).find("bounds").attr("top",b)});$patch.find("link").each(function(){h(this).attr("createme","pronto");var a=h(this).attr("srcnodeid"),
b=h(this).attr("dstnodeid");h(this).attr("srcnodeid",f[a]);h(this).attr("dstnodeid",f[b])});b=$patch.wrapAll("<d></d>").parent().html();g.update(p,b);e();var k=_(f).map(function(a){return a});a.selectAll(".vvvv-node").each(function(a){0<=k.indexOf(parseInt(a.id))&&(l.push(a),d3.select(this).attr("class","vvvv-node selected"))})})}a=root.append("svg:svg").attr("class","chart").attr("width",Math.max(p.windowWidth,p.boundingBox.width)).attr("height",Math.max(p.windowHeight,p.boundingBox.height));m=a.append("svg:rect").attr("class",
"background").attr("width",Math.max(p.windowWidth,p.boundingBox.width)).attr("height",Math.max(p.windowHeight,p.boundingBox.height));d||(a.on("mousemove",function(){if(1==r.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==r.state){var b=d3.event.pageX-f,d=d3.event.pageY-c;a.selectAll(".vvvv-node.selected").attr("transform",
function(a){return"translate("+(a.x+b)+","+(a.y+d)+")"});for(var g=0;g<l.length;g++){var k=l[g];a.selectAll(".vvvv-link line").filter(function(a){return a.fromPin.node.id==k.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+d});a.selectAll(".vvvv-link line").filter(function(a){return a.toPin.node.id==k.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+d})}}else 5==
r.state&&(u=d3.event.pageX,B=d3.event.pageY,a.select(".selection-area").attr("transform","translate("+Math.min(x,u)+", "+Math.min(y,B)+")").attr("width",Math.abs(u-x)).attr("height",Math.abs(B-y)),e(),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,f=0;2>f;f++)for(var e=0;2>e;e++)b[f]>=Math.min(x,u)&&(b[f]<=Math.max(x,u)&&c[e]>=Math.min(y,B)&&c[e]<=Math.max(y,B))&&(d=!0);d&&(d3.select(this).attr("class","vvvv-node selected"),l.push(a))}))}).on("contextmenu",
function(){1==r.state&&(a.select(".vvvv-link.current-link").remove(),r.state=0);d3.event.stopPropagation();d3.event.preventDefault();return!1}).on("mouseup",function(){if(2==r.state){r.state=0;for(var b=d3.event.pageX-f,d=d3.event.pageY-c,e="<PATCH>",k=0;k<l.length;k++)var h=l[k],e=e+("<NODE componentmode='Node' id='"+h.id+"'><BOUNDS type='Node' left='"+15*(b+h.x)+"' top='"+15*(d+h.y)+"' width='"+h.width+"' height='"+h.height+"'/></NODE>");g.update(p,e+"</PATCH>")}5==r.state&&(a.select(".selection-area").remove(),
r.state=0)}).on("dblclick",function(){function a(b){e.empty();var c=f.find("#node_filter").val().toLowerCase();b=VVVV.NodeNames.concat(_(VVVV.ShaderCodeResources).map(function(a,b){return b.replace("%VVVV%/effects/","")}));b=_(_(b).filter(function(a){return 0<=VVVV.Helpers.translateOperators(a).toLowerCase().indexOf(c)})).sortBy(function(a){return a.toLowerCase().indexOf(c)});for(var d=0;d<b.length;d++)e.append(h("<option>"+b[d]+"</option>"));e.find("option").first().attr("selected",!0)}function b(){var a=
f.find("#node_filter").val(),e=f.find("#new_node option:selected").val(),k="";e||!a.match(/\.fx$/)&&!a.match(/\.v4p$/)||(e=a);if(e){var h;(h=e.match(/^(.*\/([^\.]+))(\.vvvvjs)?\.fx$/))?(e=h[2]+" (EX9.Effect)",k=h[1]+".fx"):(h=e.match("([^.]+)(.vvvvjs)?.fx$"))?(e=h[1]+" (EX9.Effect)",k="%VVVV%/effects/"+h[1]+".fx"):e.match("[^/].v4p$")&&(k=e=a);s++;e="<PATCH>"+("<NODE componentmode='Hidden' id='"+s+"' nodename='"+e+"' systemname='"+e+"' "+(""!=k?"filename='"+k+"'":"")+">");e+="<BOUNDS type='Node' left='"+
15*c+"' top='"+15*d+"' width='100' height='100'/>"}else s++,e="<PATCH>"+("<NODE componentmode='Hidden' id='"+s+"' nodename='IOBox (String)' systemname='IOBox (String)'>"),e+="<BOUNDS type='Node' left='"+15*c+"' top='"+15*d+"' width='100' height='100'/>",e+="<PIN pinname='Input String' values='|"+a+"|'/>";g.update(p,e+"</NODE>");f.remove()}h("#node_selection",r.window.document).remove();var c=d3.event.pageX,d=d3.event.pageY,f=h('<div id="node_selection"><input type="text" id="node_filter"/></div>'),
e=h('<select id="new_node" size="8">');f.append(e);f.css("left",c);f.css("top",d);h("body",r.window.document).append(f);f.find("input").bind("paste",function(a){a.stopPropagation()});f.find("#node_filter").get(0).focus();a();f.find("#node_filter").keyup(function(c){if(13==c.which)b();else{if(40==c.which)return e.find("option:selected").first().next().attr("selected",!0),!1;if(38==c.which)return e.find("option:selected").first().prev().attr("selected",!0),!1;a()}});f.find("#new_node").click(b)}).on("mousedown",
function(){0==r.state&&(r.state=5,x=u=d3.event.pageX+1,y=B=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("+x+", "+y+")").attr("width",0).attr("height",0),e())}),m.on("click",function(){r.state=0;h(".resettable",r.window.document).remove();h("#node_selection",r.window.document).remove();e();n=void 0}),m=function(a){w=a.shiftKey},h(r.window.document).keydown(m),
h(r.window.document).keyup(m),h(r.window.document).keydown(function(b){if(46==b.which&&0<l.length){var c="<PATCH>";for(b=0;b<l.length;b++){var d=l[b],c=c+("<NODE id='"+l[b].id+"' deleteme='pronto'/>");_(d.inputPins).each(function(a){_(a.links).each(function(a){c+="<LINK deleteme='pronto' srcnodeid='"+a.fromPin.node.id+"' srcpinname='"+a.fromPin.pinname+"' dstnodeid='"+a.toPin.node.id+"' dstpinname='"+a.toPin.pinname+"'/>"})});_(d.outputPins).each(function(a){_(a.links).each(function(a){c+="<LINK deleteme='pronto' srcnodeid='"+
a.fromPin.node.id+"' srcpinname='"+a.fromPin.pinname+"' dstnodeid='"+a.toPin.node.id+"' dstpinname='"+a.toPin.pinname+"'/>"})})}c+="</PATCH>";g.update(p,c);l=[]}else if(115!=b.which&&83!=b.which||!b.ctrlKey){if(73==b.which&&b.ctrlKey)return g.inspector?g.inspector.win.focus():g.openInspector("."),b.preventDefault(),!1;if(65==b.which&&b.ctrlKey)return e(),a.selectAll(".vvvv-node").each(function(a){l.push(a);d3.select(this).attr("class","vvvv-node selected")}),b.preventDefault(),!1}else return g.save(p.nodename,
p.toXML()),b.preventDefault(),!1}),h(r.window).resize(function(){p.windowWidth=h(this).width();p.windowHeight=h(this).height();p.boundingBox.width=Math.max(p.windowWidth,p.boundingBox.width);p.boundingBox.height=Math.max(p.windowHeight,p.boundingBox.height);p.afterUpdate()}));r.drawComplete();p.afterUpdate=function(){r.drawComplete();g.inspector&&window.setTimeout(g.inspector.update,100)};p.afterEvaluate=function(){k.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(){k&&k.remove();t&&t.remove();d||p.windowWidth==h(r.window).width()&&p.windowHeight==h(r.window).height()||r.window.resizeTo(p.windowWidth,p.windowHeight);a.attr("width",Math.max(p.windowWidth,p.boundingBox.width)).attr("height",Math.max(p.windowHeight,p.boundingBox.height));a.selectAll(".background").attr("width",Math.max(p.windowWidth,p.boundingBox.width)).attr("height",Math.max(p.windowHeight,p.boundingBox.height));
var b=a.append("svg:g").attr("class","link-group");k=a.selectAll("g.vvvv-node").data(p.nodeList).enter().append("svg:g").attr("class",function(a){var b="vvvv-node";a.isIOBox&&(b+=" vvvv-iobox");0<=l.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+")"});k.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"});k.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()});k.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()});k.append("svg:g").attr("class","descriptive-name-bg");k.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");k.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);k.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(),f=this,e=0;e<b;e++)(function(e){var g=d3.select(f).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(!d)g.on("contextmenu",function(a){if(void 0!=a.IOBoxInputPin().getValue(0)&&!a.IOBoxInputPin().isConnected()){h(".resettable",r.window.document).remove();var d=h("<input type='text'/>");h("body",r.window.document).append(d);d.css("position","absolute");d.css("left",h(this).offset().left);d.css("top",h(this).offset().top+2);d.css("width",a.getWidth());d.css("height",a.getHeight()/b-4);VVVV.PinTypes[a.IOBoxInputPin().typeName].openInputBox(r.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")});m=k.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)"});m.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()});q=k.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+")"});q.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()});
t=b.selectAll("g.vvvv-link").data(p.linkList).enter().append("svg:g").attr("class","vvvv-link");t.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+0.5}).attr("y1",function(a){return a.fromPin.y+a.fromPin.node.y+4+0.5}).attr("x2",function(a){return a.toPin.x+a.toPin.node.x+2+0.5}).attr("y2",function(a){return a.toPin.y+a.toPin.node.y+0.5});t.append("svg:line").attr("stroke","#000").attr("stroke-width",1).attr("x1",
function(a){return a.fromPin.x+a.fromPin.node.x+2+0.5}).attr("y1",function(a){return a.fromPin.y+a.fromPin.node.y+4+0.5}).attr("x2",function(a){return a.toPin.x+a.toPin.node.x+2+0.5}).attr("y2",function(a){return a.toPin.y+a.toPin.node.y+0.5});h(".descriptive-name-bg rect",r.window.document).each(function(){h(this,r.window.document).attr("width",h(this,r.window.document).parent().next().get(0).getBBox().width+4)});d||(a.selectAll("g.vvvv-input-pin").on("contextmenu",function(a,b){if(VVVV.PinTypes[a.typeName].openInputBox&&
void 0!=a.getValue(0)){h(".resettable",r.window.document).remove();var c=h("<input type='text'/>");h("body",r.window.document).append(c);c.css("position","absolute");c.css("left",h(this).offset().left);c.css("top",h(this).offset().top-3);c.css("width",50);c.css("height",14);VVVV.PinTypes[a.typeName].openInputBox(r,c,a,0)}d3.event.stopPropagation();d3.event.preventDefault();return!1}),a.selectAll("g.vvvv-input-pin, g.vvvv-output-pin").on("click",function(b,c){if(1!=r.state){n=b;r.state=1;a.append("svg:line").attr("class",
"vvvv-link current-link resettable").attr("stroke","#000").attr("stroke-width",1).attr("x1",b.x+b.node.x+2+0.5).attr("y1",b.y+b.node.y+2+0.5).attr("x2",b.x+b.node.x+2+0.5).attr("y2",b.y+b.node.y+2+0.5);var d=n.direction==VVVV.PinDirection.Output?"input":"output",f=[],e=function(a){a=a.getUpstreamNodes();for(var b=0;b<a.length;b++)a[b]==n.node||a[b].delays_output||(f.push(a[b]),e(a[b]));return!1};n.node.delays_output||e(n.node);a.selectAll("g.vvvv-"+d+"-pin").filter(function(a){return a.typeName!=
n.typeName&&("Node"!=n.typeName||VVVV.PinTypes[a.typeName].primitive&&("Node"!=a.typeName||VVVV.PinTypes[n.typeName].primitive))||0<=f.indexOf(a.node)||a.node==n.node?!1:!0}).append("svg:rect").attr("class","vvvv-connection-highlight resettable").attr("width",4).attr("height",3).attr("fill","rgba(0,0,0,1)").attr("y",function(a){return a.direction==VVVV.PinDirection.Input?-3:3})}else{if(n.direction==VVVV.PinDirection.Input)var d=b,k=n;else d=n,k=b;if(1==h(this).find(".vvvv-connection-highlight").length){var l=
"<PATCH>";_(k.links).each(function(a){l+="<LINK deleteme='pronto' srcnodeid='"+a.fromPin.node.id+"' srcpinname='"+a.fromPin.pinname+"' dstnodeid='"+a.toPin.node.id+"' dstpinname='"+a.toPin.pinname+"'/>"});l+="<LINK createme='pronto' srcnodeid='"+d.node.id+"' srcpinname='"+d.pinname+"' dstnodeid='"+k.node.id+"' dstpinname='"+k.pinname+"'/>";l+="</PATCH>";g.update(p,l);a.select(".vvvv-link.current-link").remove();a.select(".vvvv-connection-highlight").remove();r.state=0;p.afterUpdate()}}d3.event.stopPropagation()}).on("mousedown",
function(){d3.event.stopPropagation()}),a.selectAll("g.vvvv-link").on("contextmenu",function(a){g.update(p,"<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()}),k.on("mousedown",function(a){h(".resettable",r.window.document).remove();r.state=2;0>l.indexOf(a)&&(w||e(),d3.select(this).attr("class","vvvv-node selected"),l.push(a));f=d3.event.pageX;c=
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(){c=void 0;h(a.win.document).find("#pins, #values").empty();h(a.win.document).find("#pins").append('<div class="row heading">Configuration</div>');h(a.win.document).find("#values").append('<div class="row heading"></div>');
_(f.invisiblePins).each(function(a){d(a)});h(a.win.document).find("#pins").append('<div class="row heading">Input Pins</div>');h(a.win.document).find("#values").append('<div class="row heading"></div>');_(f.inputPins).each(function(a){d(a)});h(a.win.document).find("#pins").append('<div class="row heading">Output Pins</div>');h(a.win.document).find("#values").append('<div class="row heading"></div>');_(f.outputPins).each(function(a){d(a)})}function d(b){var c=h('<a class="row pin" href="#">'+b.pinname+
"</a>");h(a.win.document).find("#pins").append(c);c.click(function(c){h(a.win.document).find("a.pin.active").removeClass("active");h(this).addClass("active");VVVV.PinTypes[b.typeName].openInputBox&&e(b);c.preventDefault();return!1});VVVV.PinTypes[b.typeName].openInputBox&&b.direction!=VVVV.PinDirection.Output&&!b.isConnected()&&void 0!=b.getValue(0)?(c=h('<div class="row value"><div style="height:100%">'+b.getValue(0)+"</div></div>"),c.find("div").click(function(){VVVV.PinTypes[b.typeName].openInputBox(a.win,
h(this),b,0)})):c=h('<div class="row value readonlyvalue"><div style="height:100%">'+b.getValue(0)+"</div></div>");"Color"==b.typeName&&c.find("div").css("background-color","rgba("+_(b.getValue(0).rgba).map(function(a){return parseInt(255*a)}).join(",")+")");h(a.win.document).find("#values").append(c)}function e(b){var d=c!=b;c=b;var f=b.getSliceCount(),e=h('<div class="row heading"><input type="text" value="'+f+'"/ size="3"/> Slices</div>');b.direction!=VVVV.PinDirection.Input&&e.find("input").attr("disabled",
!0);var g=h(a.win.document).find("#values .row").first();0<g.length?g.replaceWith(e):h(a.win.document).find("#values").append(e);e.find("input").change(function(a){for(var b=Math.max(1,parseInt(h(this).val())),d=c.getSliceCount();d<b;d++)c.setValue(d,VVVV.PinTypes[c.typeName].defaultValue());c.setSliceCount(b);c.node.parentPatch.afterUpdate();a.preventDefault();return!1});for(e=e=0;e<f;e++)if(g=h(a.win.document).find("#values .row").eq(e+1),d||!g.children().first().hasClass("pininputbox")){if(VVVV.PinTypes[b.typeName].openInputBox&&
b.direction!=VVVV.PinDirection.Output&&!b.isConnected()&&void 0!=b.getValue(0)){var l=h('<div class="row value"><div style="height:100%">'+b.getValue(e)+"</div></div>");(function(c){l.find("div").click(function(){VVVV.PinTypes[b.typeName].openInputBox(a.win,h(this),b,c)})})(e)}else l=h('<div class="row value readonlyvalue"><div style="height:100%">'+b.getValue(e)+"</div></div>");0<g.length?g.replaceWith(l):h(a.win.document).find("#values").append(l);"Color"==b.typeName&&l.find("div").css("background-color",
"rgba("+_(b.getValue(e).rgba).map(function(a){return parseInt(255*a)}).join(",")+")")}e++;for(g=h(a.win.document).find("#values .row");e<g.length;e++)g.eq(e).remove()}this.win=window.open(b+"/inspektor.html","inspektor","location=no, width=250, height=600, toolbar=no");var f,c;insw=this.win;var a=this;this.update=function(){f&&(c?e(c):g())};this.setNode=function(a){f=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=[],d={};this.inspector=void 0;this.enable=function(d,c){c=c||{};this.addPatch(d);this.openPatch(d,c.selector);if(!c.selector){var a=this;h(window).bind("beforeunload",b);h(window).unload(function(){a.disable()});this.openInspector(VVVV.Root);g[0].window?c&&c.success&&c.success():c&&c.error&&c.error()}};this.openInspector=function(b,c){if(!this.inspector){this.inspector=new VVVV.Editors.BrowserEditor.Inspector(b);var a=this;h(this.inspector.win).bind("beforeunload",function(){console.log("closing inspektor");
a.inspector=void 0})}};var e=[];this.addPatch=function(b){for(var c=b.id,a=b;void 0!=(a=a.parentPatch);)c+="-"+a.id;if(!(0<=e.indexOf(c)))for(e.push(c),b.editor=this,c=VVVV.Helpers.prepareFilePath(b.nodename,b.parentPatch),void 0==d[c]&&(d[c]=[]),d[c].push(b),b=b.getSubPatches(),c=0;c<b.length;c++)this.addPatch(b[c])};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);d[c].splice(d[c].indexOf(b),
1);0==d[c].length&&delete d[c];console.log(d)};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=d[a].length,g=0;g<e;g++)d[a][g].doLoad(c),d[a][g].afterUpdate()};this.disable=function(){for(var d=0;d<g.length;d++)g[d].close();this.inspector&&this.inspector.close();h(window).unbind("beforeunload",b)};this.save=function(b,c){var a=h("<a>save</a>");h("body").append(a);
a.attr("href","data:application/octet-stream;charset=utf-8,"+encodeURIComponent(c));a.attr("download",b);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(h){},background:function(h){h.attr("fill","#666666")},node:function(h){h.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(h){h.attr("height",2).attr("fill","rgba(0,0,0,0)")},outputPinBar:function(h){h.attr("y",function(b){return b.getHeight()*VVVV.Theme.scaleY-2}).attr("height",2).attr("fill","rgba(0,0,0,0)")},descriptiveNameText:function(h){h.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(h){h.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(h){h.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(h){h.attr("y",-2.5).attr("x",0.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(h){h.attr("width",4).attr("height",4).attr("fill","rgba(0,0,0,1)").attr("y",-6)},inputPinValue:function(h){h.attr("dy",30).attr("font-size",10).attr("font-family","Lucida Sans Unicode").attr("fill","rgba(1,1,1,1)")},outputPin:function(h){h.attr("y",
2.5).attr("x",0.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(h){h.attr("width",4).attr("height",4).attr("fill","rgba(1,1,1,1)").attr("y",6)},outputPinValue:function(h){h.attr("dy",30).attr("font-size",10).attr("font-family","Lucida Sans Unicode").attr("fill","rgba(1,1,1,1)")},connectablePin:function(h){h.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(h){h.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+0.5)+","+(b.fromPin.y+b.fromPin.node.y*VVVV.Theme.scaleY+4+0.5)+" C"+(b.fromPin.x+b.fromPin.node.x*VVVV.Theme.scaleX+2+0.5)+","+(b.fromPin.y+
b.fromPin.node.y*VVVV.Theme.scaleY+4+g)+" "+(b.toPin.x+b.toPin.node.x*VVVV.Theme.scaleX+2+0.5)+","+(b.toPin.y+b.toPin.node.y*VVVV.Theme.scaleY-g)+" "+(b.toPin.x+b.toPin.node.x*VVVV.Theme.scaleX+2+0.5)+","+(b.toPin.y+b.toPin.node.y*VVVV.Theme.scaleY+0.5)});h.append("svg:path").attr("stroke","#FFF").attr("fill","rgba(0,0,0,0)").attr("stroke-width",0.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+0.5)+","+(b.fromPin.y+b.fromPin.node.y*VVVV.Theme.scaleY+4+0.5)+" C"+(b.fromPin.x+b.fromPin.node.x*VVVV.Theme.scaleX+2+0.5)+","+(b.fromPin.y+b.fromPin.node.y*VVVV.Theme.scaleY+4+g)+" "+(b.toPin.x+b.toPin.node.x*VVVV.Theme.scaleX+2+0.5)+","+(b.toPin.y+b.toPin.node.y*VVVV.Theme.scaleY-g)+" "+(b.toPin.x+b.toPin.node.x*VVVV.Theme.scaleX+2+0.5)+","+(b.toPin.y+b.toPin.node.y*VVVV.Theme.scaleY+0.5)})},currentLink:function(h){h.attr("stroke","#FFF").attr("stroke-width",1)}};
VVVV.Theme=VVVV.Themes.Tron;