|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopenpiano.control.MidiTimer
public class MidiTimer
MidiTimer is the central clock of the application. It controls the speed of notes and sets their position
| Constructor Summary | |
|---|---|
MidiTimer(Controller controller,
SlidePanel slidePanel,
LinkedList<Bpm> bpmList,
int tpb,
float factor)
Constructs a new MidiTimer based on conditions from a MIDI file |
|
| Method Summary | |
|---|---|
float |
getBeatsPerMinuteFactor()
Returns the current beats per minute factor |
long |
getElapsedTicks()
Returns the elapsed ticks of the current MIDI file |
long |
getTicksPerBeat()
Returns the ticks per beat defined in the MIDI file |
long |
getTicksPerSecond()
Returns the ticks per second defined in the MIDI file |
void |
initTimer()
Initializes the MidiTimer |
boolean |
isRunning()
Returns true if the MidiTimer thread is running |
void |
run()
Updates the application according to the time passed by. |
void |
seek(boolean seek,
float factor)
Sets the seek mode and speed. |
void |
setElapsedTicks(float ticks)
Sets the actual position in the MIDI file |
void |
startTimer()
Starts the MidiTimer |
void |
stopTimer()
Stops the MidiTimer |
void |
updateBpm()
Updates beats per minutes according to the position |
void |
updateBpm(float factor)
Updates beats per minutes according to the position based on a given factor |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MidiTimer(Controller controller,
SlidePanel slidePanel,
LinkedList<Bpm> bpmList,
int tpb,
float factor)
controller - the main controller of the applicationslidePanel - the panel containing the position sliderbpmList - a list of timed speed-changing events according to the MIDI filetpb - the amount of ticks per beat according to the MIDI filefactor - a speed factor for beats per minute| Method Detail |
|---|
public float getBeatsPerMinuteFactor()
public long getElapsedTicks()
public long getTicksPerBeat()
public long getTicksPerSecond()
public void initTimer()
public boolean isRunning()
public void run()
run in interface Runnable
public void seek(boolean seek,
float factor)
seek - true if seeking, false if resumefactor - speed-factor of seekingpublic void setElapsedTicks(float ticks)
ticks - current tick positionpublic void startTimer()
public void stopTimer()
public void updateBpm()
public void updateBpm(float factor)
factor - speed-factor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||