CodeRelay:
Filter:
Classes (extension) | Relay classes

CodeRelay : Object
ExtensionExtension

relays code to network peers and History
Source: NMLRelays.sc

Description

When evaluating code, CodeRelay sends the code as string to all the peers in its AddrBook. This can be used to create a shared code history in collaborative live coding performances.

Class Methods

CodeRelay.new(addrBook, post: false, oscPath: '/codeRelay', encryptor, codeDumpFunc)

create a new CodeRelay

Arguments:

addrBook

an AddrBook where Peers are registered

post

a flag whether to post code to the post window. default: false

oscPath

the oscPath to use for relaying. default: '/codeRelay'

encryptor

an (optional) encryptor for codeStrings.

codeDumpFunc

an optional function to relay the code strings. default nil will be replaced by a standard function which relays to all peers in the addrBook.

Returns:

a new CodeRelay

Inherited class methods

Instance Methods

.onlyWorkingCode

.onlyWorkingCode = value

When true, coderelay sends only code that has evaluated correctly.

Returns:

a Boolean

.private

.private = value

When true, coderelay does not send code. Useful for temporary experiments that would clutter a performance history.

Returns:

a Boolean

.post

.post = value

When true, coderelay will post to post window.

Returns:

a Boolean

.free

remove coderelay by removing codeDumpFunc from interpreter and freeing its oscFunc.

Returns:

the coderelay

.addHistory

add History such that coderelay writes own code and relayed code into History.

Returns:

the coderelay

.removeHistory

remove History from coderelay.

Returns:

the coderelay

.makeOSCFunc

internal method, makes the OSCFunc that receives shared code.

Returns:

the coderelay

Inherited instance methods

Examples