use of com.xenoage.zong.core.music.time.TimeType in project Zong by Xenoage.
the class Test11a method test.
@Test
public void test() {
MxlPart part = getFirstPart();
int iTime = 0;
for (int i = 0; i < part.getMeasures().size(); i++) {
MxlMeasure measure = part.getMeasures().get(i);
for (MxlMusicDataContent data : measure.getMusicData().getContent()) {
if (data.getMusicDataContentType() == MxlMusicDataContentType.Attributes) {
// check type
MxlAttributes attr = (MxlAttributes) data;
MxlNormalTime mxlTime = (MxlNormalTime) attr.getTime().getContent();
TimeType expectedTime = expectedTimes[iTime++];
assertEquals("time " + iTime, expectedTime.getNumerator(), mxlTime.getBeats());
assertEquals("time " + iTime, expectedTime.getDenominator(), mxlTime.getBeatType());
if (i == 0)
// TODO: bug in MusicXML file, should be "Cut"
assertEquals("time " + iTime, MxlTimeSymbol.Common, attr.getTime().getSymbol());
else if (i == 1)
assertEquals("time " + iTime, MxlTimeSymbol.Common, attr.getTime().getSymbol());
else
// = Normal
assertNull("time " + iTime, attr.getTime().getSymbol());
// no more time signature in this measure
break;
}
}
}
assertEquals("not all times found", expectedTimes.length, iTime);
}
Aggregations