2
* Created on 29-nov-2005
4
* TODO To change the template for this generated file go to
5
* Window - Preferences - Java - Code Style - Code Templates
7
package org.herac.tuxguitar.song.models;
9
import org.herac.tuxguitar.song.factory.TGFactory;
14
* TODO To change the template for this generated type comment go to
15
* Window - Preferences - Java - Code Style - Code Templates
17
public abstract class TGTempo {
18
private static final int SECOND_IN_MILLIS = 1000;
26
public int getValue() {
30
public void setValue(int value) {
34
public long getInMillis(){
35
double millis = (60.00 / getValue() * SECOND_IN_MILLIS);
39
public long getInUSQ(){
40
double usq = ((60.00 / getValue() * SECOND_IN_MILLIS) * 1000.00);
44
public static TGTempo fromUSQ(TGFactory factory,int usq){
45
double value = ((60.00 * SECOND_IN_MILLIS) / (usq / 1000.00));
46
TGTempo tempo = factory.newTempo();
47
tempo.setValue((int)value);
51
public TGTempo clone(TGFactory factory){
52
TGTempo tempo = factory.newTempo();
57
public void copy(TGTempo tempo){
58
tempo.setValue(getValue());