public abstract class Bead
extends java.lang.Object
message(Bead)
method. Implementations of Bead handle these messages by subclassing the messageReceived(Bead)
method. BeadArray
can be used to gather Beads into groups, which is useful for defining message channels in a system.
Pausing: the method pause(boolean)
toggles the pause mode of a Bead. Beads are unpaused by default. A paused Bead will no longer respond to incoming messages.
Deleting: The method kill()
deletes a Bead. Deleted Beads are automatically removed from BeadArray
s. The method setKillListener(Bead)
allows you to specify another Bead that gets notified when this Bead is killed.
UGens: An important subclass of Bead is UGen
. When a UGen is paused, it does not calculate audio. When it is deleted, it is automatically removed from any signal chains.Constructor and Description |
---|
Bead()
Instantiates a new bead.
|
Modifier and Type | Method and Description |
---|---|
Bead |
getKillListener()
Gets this Bead's kill listener.
|
java.lang.String |
getName()
Gets the Bead's name.
|
boolean |
isDeleted()
Determines if this Bead is deleted.
|
boolean |
isPaused()
Checks if this Bead is paused.
|
void |
kill()
Stops this Bead, and flags it as deleted.
|
void |
message(Bead message)
Send this Bead a message.
|
protected void |
messageReceived(Bead message)
Responds to an incoming message.
|
void |
pause(boolean paused)
Toggle the paused state of the Bead.
|
void |
setKillListener(Bead killListener)
Sets this Bead's kill listener.
|
void |
setName(java.lang.String name)
Sets the Bead's name.
|
void |
start()
Shortcut for pause(false).
|
java.lang.String |
toString()
Returns a String specifying the Bead's class and it's name.
|
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the new name.public java.lang.String toString()
toString
in class java.lang.Object
public final void message(Bead message)
message
- the Bead is the message.protected void messageReceived(Bead message)
message
- the messagepublic void start()
public void kill()
BeadArray
s. Calling this method for the first time
also causes the killListener to be notified.public boolean isPaused()
public void pause(boolean paused)
paused
- true to pause Bead.public void setKillListener(Bead killListener)
killListener
- the new kill listener.public Bead getKillListener()
public boolean isDeleted()