Connection represents a dependency connection between two objects. When the Object: -changed method of the left-hand object is called, the Object: -update method of the right-hand object is called.
Creating a connection using:
is roughly equivalent to calling
Connections operate on top of the existing changed/update/addDependant functionality, so they can interoperate with other SuperCollider functionality based around these methods (for example, SimpleController).
Create a new Connection between object
and dependant
.
object |
Object that will be broadcasting changes. |
dependant |
Object that will be receiving notification of changes. |
autoConnect |
If |
When traceAll == true
, all new Connections will be created with tracing turned on. See Connection: -traceNote that this will not turn on tracing for Connections that have already been created.
Turn off tracing on all Connections that are currently being traced. See Connection: -trace
Execute function func
and trace ALL connections created during that function, ONLY for the duration of the function. If traceAll == true
, all created connections will continue to be traced after the function is finished, otherwise they will not.
When connected == true
, Object: -changed messages will be passed from the object to the dependant.
connect |
Boolean. |
Synonym for connection.connected = true;
Synonym for connection.connected = false;
Execute function func
- disconnect the Connection for the duration, and return it to it's previous state after func is done. Note that, if the connection was already disconnected, the connection will remain in a disconnected state.
Permanently disconnect the connection. This will free up resources and ensure all objects will be garbage collected. Connections cannot be reconnected after freeing.
Insert an UpdateTransform between the object and it's dependant.
func |
A Function to be used as the argument to the UpdateTransform constructor. |
Insert an UpdateFilter between the object and it's dependant.
filter |
A Function or Symbol, to be used as the argument to the UpdateFilter constructor. |
Disconnect the connection the next time a signal is recieved.
shouldFree |
If |
Insert an DeferredUpdater between the object and it's dependant.
delta, clock, force |
Arguments passed along to the DeferredUpdater constructor. |
Insert an CollapsedUpdater between the object and it's dependant.
delta, clock, force |
Arguments passed along to the CollapsedUpdater constructor. |
Enable or disable tracing for this connection. When tracing a connection, all signals passed from the object to the dependant will be displayed in the post window even if the Connection is currently disconnected.
⋯⋯
indicates that the signal was passed along (e.g. connected == true);
⋰⋰
indicates that the signal was not passed along (e.g. connected == false);
Turn tracing on for this connection for the duration of func