|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.beadsproject.beads.core.TimeStamp
public class TimeStamp
TimeStamps store time with respect to the current AudioContext
. Specifically, the TimeStamp stores a time step and an index into a buffer.
Field Summary | |
---|---|
AudioContext |
context
The context. |
int |
index
The index into the sample frame. |
long |
timeStep
The time step (AudioContext's count of sample frames). |
Constructor Summary | |
---|---|
TimeStamp(AudioContext context,
long timeInSamples)
Instantiates a new TimeStamp with the given time step, context and buffer index. |
|
TimeStamp(AudioContext context,
long timeStep,
int index)
Instantiates a new TimeStamp with the given time step, context and buffer index. |
Method Summary | |
---|---|
static TimeStamp |
add(AudioContext ac,
TimeStamp a,
TimeStamp b)
|
double |
getTimeMS()
Gets the time of the TimeStamp in milliseconds. |
long |
getTimeSamples()
Gets the time in samples. |
boolean |
isAfter(TimeStamp other)
|
boolean |
isBefore(TimeStamp other)
|
double |
since(TimeStamp oldest)
|
static TimeStamp |
subtract(AudioContext ac,
TimeStamp a,
TimeStamp b)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final AudioContext context
public final long timeStep
public final int index
Constructor Detail |
---|
public TimeStamp(AudioContext context, long timeStep, int index)
AudioContext.generateTimeStamp(int)
to generate a
TimeStamp for the current time.
context
- the AudioContext.timeStep
- the time step.index
- the index.public TimeStamp(AudioContext context, long timeInSamples)
AudioContext.generateTimeStamp(int)
to generate a
TimeStamp for the current time.
context
- the AudioContext.timeStep
- the time step.index
- the index.Method Detail |
---|
public double getTimeMS()
public long getTimeSamples()
public double since(TimeStamp oldest)
public boolean isBefore(TimeStamp other)
public boolean isAfter(TimeStamp other)
public static TimeStamp subtract(AudioContext ac, TimeStamp a, TimeStamp b)
public static TimeStamp add(AudioContext ac, TimeStamp a, TimeStamp b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |