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 java.io.Serializable;
14
* TODO To change the template for this generated type comment go to
15
* Window - Preferences - Java - Code Style - Code Templates
17
public class Tempo implements Serializable{
18
private static final int SECOND_IN_MILLIS = 1000;
24
public Tempo(int value,int percent){
26
this.percent = percent;
29
public Tempo(int value){
33
public int getValue() {
37
public void setValue(int value) {
41
public int getPercent() {
45
public void setPercent(int percent) {
46
this.percent = percent;
49
public long getInMillis(){
50
double millis = (((60.00 / (double)getValue() * (double)SECOND_IN_MILLIS)) * (double)getPercent() / 100.00);
54
public long getInUSQ(){
55
double usq = (((60.00 / (double)getValue() * (double)SECOND_IN_MILLIS) * 1000.00) * (double)getPercent() / 100.00);
59
public static Tempo fromUSQ(int usq){
60
double value = ((60.00 * (double)SECOND_IN_MILLIS) / ((double)usq / 1000.00));
61
return new Tempo((int)value);
64
public Object clone(){
65
return new Tempo(getValue(),getPercent());