public Timesig getTimesigAt(int clock) { Timesig ret = new Timesig(); ret.numerator = 4; ret.denominator = 4; int index = 0; int c = size(); for (int i = c - 1; i >= 0; i--) { index = i; if (get(i).Clock <= clock) { break; } } ret.numerator = get(index).Numerator; ret.denominator = get(index).Denominator; return ret; }
public Timesig getTimesigAt(int clock, ByRef<Integer> bar_count) { int index = 0; int c = size(); for (int i = c - 1; i >= 0; i--) { index = i; if (get(i).Clock <= clock) { break; } } TimeSigTableEntry item = get(index); Timesig ret = new Timesig(); ret.numerator = item.Numerator; ret.denominator = item.Denominator; int diff = clock - item.Clock; int clock_per_bar = (480 * 4) / ret.denominator * ret.numerator; bar_count.value = item.BarCount + (diff / clock_per_bar); return ret; }