public class BasicMusicTimekeeper extends Object implements TimeKeeper<MeasuresBeatsTicksTimecode>
MeasuresBeatsTicksTimecode
s that allow
the position within a music score to be tracked.Constructor and Description |
---|
BasicMusicTimekeeper() |
Modifier and Type | Method and Description |
---|---|
double |
getBPM()
Returns the number of BPMs this timekeeper is running at.
|
int |
getTicksPerBeat()
Returns the number of ticks per beat
|
MeasuresBeatsTicksTimecode |
getTime()
Returns the current time.
|
void |
pause()
Pause the running of the timekeeper.
|
void |
reset()
Reset the timekeeper.
|
void |
run()
Use this method to start the time keeper running.
|
void |
seek(long timestamp)
Seek to a given timestamp.
|
void |
setBPM(float bpm)
Set the tempo of the timekeeper
|
void |
stop()
Use this method to stop the time keeper from running.
|
boolean |
supportsPause()
Returns whether the timekeeper supports pausing.
|
boolean |
supportsSeek()
Returns whether the timekeeper supports seeking.
|
public BasicMusicTimekeeper()
public void setBPM(float bpm)
bpm
- The new beats per minute.public double getBPM()
public void run()
run
in interface Runnable
run
in interface TimeKeeper<MeasuresBeatsTicksTimecode>
TimeKeeper.run()
public void pause()
pause
in interface TimeKeeper<MeasuresBeatsTicksTimecode>
TimeKeeper.pause()
public void stop()
stop
in interface TimeKeeper<MeasuresBeatsTicksTimecode>
TimeKeeper.stop()
public MeasuresBeatsTicksTimecode getTime()
getTime
in interface TimeKeeper<MeasuresBeatsTicksTimecode>
TimeKeeper.getTime()
public void seek(long timestamp)
seek
in interface TimeKeeper<MeasuresBeatsTicksTimecode>
timestamp
- The timestamp to seek toTimeKeeper.seek(long)
public void reset()
reset
in interface TimeKeeper<MeasuresBeatsTicksTimecode>
TimeKeeper.reset()
public boolean supportsPause()
supportsPause
in interface TimeKeeper<MeasuresBeatsTicksTimecode>
TimeKeeper.supportsPause()
public boolean supportsSeek()
supportsSeek
in interface TimeKeeper<MeasuresBeatsTicksTimecode>
TimeKeeper.supportsSeek()
public int getTicksPerBeat()