|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.beadsproject.beads.core.Bead
public abstract class Bead
Bead is an abstract class which defines basic behaviour such as starting and stopping, pausing and handling messages.
Messages: A Bead can send a message to another Bead using themessage(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 Summary | |
---|---|
Bead()
Instantiates a new bead. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Bead()
Method Detail |
---|
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.
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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |