strange tractor
Javascript Argument library

The following standardised library for handling argument setup is being implemented using the new #include mechanism.

This library provides the same argument and attribute parsing as non-javascript patchers. Arguments are read in order, and associated with the correct variable. Attributes (named @ATTRIBUTE/value pairs) are properly named and declared, and behave the same way as patcher attributes.

Syntax example
-----------------------------------------------
include("<argHandler>");

args = new argHandler;
// note - declare arguments in order;
var ARG1 = 100;
args.setUpArgument("ARG1");
// match declaration with setUpArgument line

var ARG2 = 0;
args.setUpArgument("ARG2");

// note - attributes can be declared in any order;
var ATTR1 = 100;
args.setUpAttribute("ATTR1");
// match declaration with setUpAttribute line

args.argumentParser(jsarguments);
// required : reads supplied arguments

args.reportAttributes();
// posts all attributes as per a non-js patcher

-----------------------------------------------

Note : the nature of argument and attribute handling requires eval() calls. These are minimised as much as possible, to one per argumentParser() call, and one per reportAttributes() call. argumentParser() is only called when the js/jsui object is initialised, and reportAttributes() should only be used within the standardised getstate() function call.


Javascript Inlet/Outlet library

The following standardised library for handling inlet and outlet setup is being implemented using the new #include mechanism.

Syntax example
-----------------------------------------------
include("<IOletHandler>");

iolet = new IOletHandler;
// note - declare inlets and outlets in order!
iolet.declareInlet("inlet1");
iolet.declareOutlet("outlet1");
iolet.declareOutlet("outlet2");

iolet.setupIOlets();

-----------------------------------------------