SyncText:
Filter:
HyperDisCo (extension) | Undocumented classes

SyncText
ExtensionExtension

sync text across computers

Description

SyncText keeps a text string synchronized across computers via the internet using OSCRouterClient. This is useful for shared coding practice, for learning, performances, and other uses.

First code examples:

Class Methods

.new

make a new SyncText with

Arguments:

textID

an ID for the text (same on different computers)

userID

an ID for the local user (different on each computers)

relayAddr

An OSCRouterClient or similar to connect the SyncTexts.

.all

all known syncTexts

.defaultText

the text that a new syncText gets when no text is found online.

Instance Methods

.textID

the id for the synced text

.userID

the id for the local user/computer

.relayAddr

the relay to use for sync messages

.currText

the current synced text

.textDoc

the document that shows and edits currText

.showDoc

find or make and show a document for currText

.enableSend

.disableSend

enable and disable sync-sending on currText

.sendEnabled

flag whether currently sync-sending or not

.lock

.unlock

lock and unlock editing of currText on textDoc

.lock

flag whether editing currently locked

.sendEnabled

flag whether currently sync-sending or not

mostly for internal use (and debugging)

.incomingVersions

different versions of the synced text as last sent from synced users.

.lastReceived

the last received version of the synced text

.lastSent

the last sent version of the synced text

.docLocalID

a local ID merging textID and userID.

.requestText

ask other nodes for the current text usually not needed to do explicitly.

.setCurr

set currText by hand. usually only needed internally.

.setDocText

set text in textDoc by hand usually never needed internally.

.sendSyncText

send text to sync to otherName. usually never needed internally, happens when requested.

Arguments:

otherName

.synced

whether the text is currently synced or not. this is false when SyncText is made, and true after synced to incoming text or after timeout.

Examples