2009-06-25 07:16:22 -07:00
|
|
|
|
/*
|
|
|
|
|
* TimeSigTableEntry.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
|
|
|
|
using bocoree;
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
namespace Boare.Lib.Vsq {
|
|
|
|
|
#endif
|
2009-06-25 07:16:22 -07:00
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if JAVA
|
|
|
|
|
public class TimeSigTableEntry implements Comparable<TimeSigTableEntry>, Cloneable, Serializable {
|
|
|
|
|
#else
|
2009-06-25 07:16:22 -07:00
|
|
|
|
[Serializable]
|
|
|
|
|
public class TimeSigTableEntry : IComparable<TimeSigTableEntry>, ICloneable {
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#endif
|
2009-06-25 07:16:22 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// クロック数
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int Clock;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 拍子の分子
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int Numerator;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 拍子の分母
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int Denominator;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 何小節目か
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int BarCount;
|
|
|
|
|
|
|
|
|
|
public TimeSigTableEntry(
|
|
|
|
|
int clock,
|
|
|
|
|
int numerator,
|
|
|
|
|
int denominator,
|
|
|
|
|
int bar_count ) {
|
|
|
|
|
Clock = clock;
|
|
|
|
|
Numerator = numerator;
|
|
|
|
|
Denominator = denominator;
|
|
|
|
|
BarCount = bar_count;
|
|
|
|
|
}
|
|
|
|
|
|
2009-07-29 10:03:20 -07:00
|
|
|
|
public TimeSigTableEntry() {
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-07 03:44:18 -07:00
|
|
|
|
public override String ToString() {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return "{Clock=" + Clock + ", Numerator=" + Numerator + ", Denominator=" + Denominator + ", BarCount=" + BarCount + "}";
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
public Object clone() {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return new TimeSigTableEntry( Clock, Numerator, Denominator, BarCount );
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if !JAVA
|
|
|
|
|
public object Clone() {
|
|
|
|
|
return clone();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
public int compareTo( TimeSigTableEntry item ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return this.BarCount - item.BarCount;
|
|
|
|
|
}
|
2010-03-16 20:14:08 -07:00
|
|
|
|
|
|
|
|
|
#if !JAVA
|
|
|
|
|
public int CompareTo( TimeSigTableEntry item ) {
|
|
|
|
|
return compareTo( item );
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
|
|
|
|
|
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
|