AddrBook is essentially a dictionary of Peer instances, which represent participants or nodes in a networked music system. AddrBook is not a singleton, and a given system could use multiple instances of it to represent different subgroups, etc. Most objects in Utopia take an AddrBook as an argument, and respond to changes in it when appropriate. An AddrBook is generally used as a (possibly dynamic) collection of intended recipients for one or more types of communication.
Create a new instance.
An AddrBook
Remove a Peer from this AddrBook, specified by name.
name |
A Symbol corresponding to the name of the Peer to remove. |
Add a Peer to this AddrBook which represents the localhost.
mePeer |
An optional Peer to add as me. If nil this method will automatically create a Peer, whose name var will be set using the 'whoami' command line utility. |
Send an OSC message to one of the Peers in this AddrBook.
name |
A Symbol corresponding to the name of the Peer to whom the message should be sent. |
... msg |
One or more additional arguments comprising the OSC message to send. |
Send an OSC message to all of the Peers in this AddrBook.
... msg |
One or more arguments comprising the OSC message to send. |
Send an OSC bundle to all of the Peers in this AddrBook.
time |
The timestamp for the bundle, specified as some number of seconds into the future. A nil time indicates 'as soon as possible'. |
... msg |
One or more Arrays consisting of the OSC messages in the bundle. |
Send an OSC message to all of the Peers in this AddrBook, except for the one specified by name.
name |
A Symbol corresponding to the name of the Peer to whom the message should not be sent. |
... msg |
One or more arguments comprising the OSC message to send. |
Look up a Peer by name.
name |
A Symbol corresponding to the name of the Peer to look up. |
A Peer if one with the specified name is found, otherwise nil.
Get the names of the Peers in this AddrBook.
Get all the currently online Peers in this AddrBook
A Set containing the Peers in this AddrBook which are currently online.
Get all the addresses of the Peers in this AddrBook
Test to see if this AddrBook includes the supplied address, or an equivalent one in the case of the local computer (e.g. loopback address will match externally visible ones).
addr |
A NetAddr to check for. |
A Boolean indicating if the the NetAddr matches one in this AddrBook.
Get all Peers excluding the named Peer.
name |
A Symbol corresponding to the name of the Peer to exclude. |
A PeerGroup.
Returns this.