## SCJConnection

A Class to manage JACK connections from SuperCollider.
This is just an encapsulation of calls to the jack tools jack_connect, jack_disconnect and jack_lsp. Normally these come with JACK.
This class can be used in two ways:
1. You can make connections, using the class methods .connect and .disconnect
2. You can make an instance, which defines a connection, which can then be (dis)connected using the instance methods .connect and .disconnect

    SCJConnection.connect( srcchan, deschan, src, des )

Connects srchan with deschan.
srcchan and deschan are arrays with source and destination channels. Their interpretation depends on the src and des arguments. If these are both nil, the numbers in the array are interpreted as indices in the class variable "allports" (see below). If src or des is \sc or \alsa they are interpreted as sc or alsa input or output channels. Otherwise, src or des can be strings of the jack program ports.

    SCJConnection.disconnect( srcchan, deschan, src, des )

Disconnects srchan with deschan.
Arguments as in .connect.

    SCJConnection.getconnections

Get a list of current jack connections (via jack_lsp).
List gets stored in class variable .connections

    SCJConnection.getproperties

Get a list of properties of all jack ports (via jack_lsp).
List gets stored in class variable .properties

    SCJConnection.getallports

Get a list of all jack ports (via jack_lsp).
List gets stored in class variable .allports
The above three methods get automatically called in the .initClass method.

    j = SCJConnection.new( srcchan, deschan, src, des )

Create an instance of a Jack Connection. Arguments as in the class method .connect and .disconnect.
The instance can then later be connected using the instance method .connect of .disconnect:

    j.connect

and

    j.disconnect

Other important class variables:

    SCJConnection.prepend

the prepend to the program call for jack_connect, jack_disconnect, and jack_lsp.
Needed when the programs are not in the search path.

    SCJConnection.alsadef

    SCJConnection.scdef

The defaults for alsa and sc ports, when the src and des arguments are used. These are initialised in .initClass with standard values.