|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.beadsproject.beads.core.Bead
net.beadsproject.beads.events.Pattern
public class Pattern
A Pattern is a Bead
that responds to integer events by
generating other integer events and forwarding them to a BeadArray
of listeners. Typically, Patterns are used with Clocks
.
Bead
messages that implement IntegerBead
. An incoming integer causes Pattern's internal counter to increment if it is a multiple of hop
. If the internal counter reaches loop
, it returns to zero. In this
way, Pattern can be quicly maniuplated to play back at different speeds and loop lengths in
response to a regular Clock
.
Nested Class Summary | |
---|---|
static class |
Pattern.ContinuousPlayMode
|
Constructor Summary | |
---|---|
Pattern()
Instantiates a new empty pattern. |
Method Summary | |
---|---|
void |
addEvent(int key,
int value)
Adds an event consisting of a integer key and an integer value. |
void |
addListener(Bead listener)
Adds a listener. |
void |
clear()
Clears the pattern data. |
Pattern.ContinuousPlayMode |
getContinuousPlayMode()
|
java.util.ArrayList<java.lang.Integer> |
getEventAtIndex(int index)
|
java.util.ArrayList<java.lang.Integer> |
getEventAtStep(int index)
Gets the event at the given integer index. |
java.util.Set<java.lang.Integer> |
getEvents()
|
int |
getHop()
Gets the hop size. |
int |
getLastIndex()
|
int |
getLoop()
Gets the loop length. |
void |
messageReceived(Bead message)
Handles a message. |
void |
removeEvent(int key,
int value)
Removes the event with the given integer key. |
void |
removeListener(Bead listener)
Removes a listener. |
void |
reset()
Resets the pattern's current index to zero. |
void |
setContinuousPlayMode(Pattern.ContinuousPlayMode continuousPlayMode)
|
void |
setHop(int hop)
Sets the hop size. |
void |
setLoop(int loop)
Sets the loop length and activates loop mode. |
void |
setNoLoop()
Deactivates loop mode. |
Methods inherited from class net.beadsproject.beads.core.Bead |
---|
getKillListener, getName, isDeleted, isPaused, kill, message, pause, setKillListener, setName, start, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Pattern()
Method Detail |
---|
public void reset()
public void addListener(Bead listener)
listener
- the new listener.public void removeListener(Bead listener)
listener
- the listener.public Pattern.ContinuousPlayMode getContinuousPlayMode()
public void setContinuousPlayMode(Pattern.ContinuousPlayMode continuousPlayMode)
public void addEvent(int key, int value)
key
- the key.value
- the value.public void removeEvent(int key, int value)
key
- the key.public void clear()
public void messageReceived(Bead message)
IntegerBead
. Checks to see if it should do anything for the given integer, and forwards any resulting integer to its listeners.
messageReceived
in class Bead
message
- the messageBead.message(Bead)
public java.util.ArrayList<java.lang.Integer> getEventAtStep(int index)
index
- the index.
public java.util.ArrayList<java.lang.Integer> getEventAtIndex(int index)
public int getLastIndex()
public java.util.Set<java.lang.Integer> getEvents()
public int getLoop()
public void setLoop(int loop)
loop
- the loop length.public void setNoLoop()
public int getHop()
public void setHop(int hop)
hop
- the hop size.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |