|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cycling74.max.MaxClock
public class MaxClock
Used to delay the execution of a block of code. Java implementation of a pdclock.
import com.cycling74.max.*;
class clocktest extends MaxObject implements Executable {
MaxClock clock;
float value;
public clocktest() {
clock = new MaxClock(this);
}
public void inlet(float f) {
value = f;
// ask to call execute after 250ms
clock.delay(250);
}
// this is called after 250ms
public void execute() {
outlet(0, value)
}
}
| Constructor Summary | |
|---|---|
MaxClock()
Creates a pdclock without an executable. |
|
MaxClock(Executable e)
Creates a pdclock with an executable e. |
|
MaxClock(Object o,
String methodName)
Creates a pdclock with a specific method on a object. |
|
| Method Summary | |
|---|---|
void |
delay(double time)
Time to wait until next tick. |
protected void |
finalize()
|
Executable |
getExecutable()
Returns the Executable for this clock. |
static double |
getTime()
Returns pure-data time in milliseconds. |
void |
release()
Release the clock from pure-data. |
void |
setExecutable(Executable e)
Set the Executable for this clock. |
void |
tick()
The method to override if no Executable is provided. |
void |
unset()
Cancels the last delay call. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MaxClock()
public MaxClock(Executable e)
e.
e - the executable to execute when the clock will be triggerd.
public MaxClock(Object o,
String methodName)
o - the object that holds the methodmethodName - the name of the method to execute when the clock
will be triggerd.| Method Detail |
|---|
public Executable getExecutable()
public void setExecutable(Executable e)
e - the Executable to call for this clockpublic void tick()
protected void finalize()
throws Throwable
finalize in class ObjectThrowablepublic static double getTime()
public void delay(double time)
time - in milisecondspublic void release()
public void unset()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||