2009-06-25 07:16:22 -07:00
|
|
|
|
/*
|
|
|
|
|
* TempoTableEntry.cs
|
|
|
|
|
* Copyright (c) 2008-2009 kbinani
|
|
|
|
|
*
|
|
|
|
|
* This file is part of Boare.Lib.Vsq.
|
|
|
|
|
*
|
|
|
|
|
* Boare.Lib.Vsq is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the BSD License.
|
|
|
|
|
*
|
|
|
|
|
* Boare.Lib.Vsq is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
*/
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if JAVA
|
|
|
|
|
package org.kbinani.vsq;
|
2009-06-25 07:16:22 -07:00
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
import java.io.*;
|
|
|
|
|
#else
|
|
|
|
|
using System;
|
2009-09-07 03:44:18 -07:00
|
|
|
|
|
2009-06-25 07:16:22 -07:00
|
|
|
|
namespace Boare.Lib.Vsq {
|
2009-09-07 03:44:18 -07:00
|
|
|
|
using boolean = System.Boolean;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#endif
|
2009-09-07 03:44:18 -07:00
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if JAVA
|
|
|
|
|
public class TempoTableEntry implements Comparable<TempoTableEntry>, Cloneable, Serializable {
|
|
|
|
|
#else
|
2009-06-25 07:16:22 -07:00
|
|
|
|
[Serializable]
|
|
|
|
|
public class TempoTableEntry : IComparable<TempoTableEntry>, ICloneable {
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#endif
|
2009-06-25 07:16:22 -07:00
|
|
|
|
public int Clock;
|
|
|
|
|
public int Tempo;
|
|
|
|
|
public double Time;
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
public Object clone() {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return new TempoTableEntry( Clock, Tempo, Time );
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if !JAVA
|
|
|
|
|
public object Clone() {
|
|
|
|
|
return clone();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-06-25 07:16:22 -07:00
|
|
|
|
public TempoTableEntry( int clock, int _tempo, double _time ) {
|
|
|
|
|
this.Clock = clock;
|
|
|
|
|
this.Tempo = _tempo;
|
|
|
|
|
this.Time = _time;
|
|
|
|
|
}
|
|
|
|
|
|
2009-07-29 10:03:20 -07:00
|
|
|
|
public TempoTableEntry() {
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
public int compareTo( TempoTableEntry entry ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return this.Clock - entry.Clock;
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if !JAVA
|
|
|
|
|
public int CompareTo( TempoTableEntry entry ) {
|
|
|
|
|
return compareTo( entry );
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-09-07 03:44:18 -07:00
|
|
|
|
public boolean Equals( TempoTableEntry entry ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
if ( this.Clock == entry.Clock ) {
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if !JAVA
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#endif
|