use of com.xenoage.utils.math.Fraction in project Zong by Xenoage.
the class Context method moveCurrentBeat.
/**
* Moves the current beat within the current part and measure.
*/
public void moveCurrentBeat(Fraction beat) {
Fraction newBeat = this.mp.getBeat().add(beat);
// never step back behind 0
if (newBeat.getNumerator() < 0) {
reportError("Step back behind beat 0");
newBeat = Companion.get_0();
}
this.mp = this.mp.withBeat(newBeat);
}
use of com.xenoage.utils.math.Fraction in project Zong by Xenoage.
the class StaffTest method testMeasureFilledBeats.
public static void testMeasureFilledBeats(Fraction[] expectedMeasureFilledBeats, Staff staff) {
assertEquals(expectedMeasureFilledBeats.length, staff.getMeasures().size());
for (int i : range(expectedMeasureFilledBeats)) {
Fraction filledBeats = staff.getMeasure(i).getFilledBeats();
assertEquals("Measure " + i, expectedMeasureFilledBeats[i], filledBeats);
}
}
Aggregations