use of com.xenoage.zong.musicxml.types.MxlKey in project Zong by Xenoage.
the class Test13a method test.
@ToDo("Zong! supports only -7 to +7, starting in measure 9, ending in measure 38")
@Test
public void test() {
MxlPart part = getFirstPart();
TraditionalKey[] expectedKeys = getExpectedKeys();
int iKey = 0;
for (int i = 8; i <= 37; i++) {
MxlMeasure measure = part.getMeasures().get(i);
for (MxlMusicDataContent data : measure.getMusicData().getContent()) {
if (data.getMusicDataContentType() == MxlMusicDataContentType.Attributes) {
// check type
MxlAttributes attr = (MxlAttributes) data;
MxlKey key = attr.getKey();
assertEquals(expectedKeys[iKey].getFifths(), key.getFifths());
assertEquals(expectedKeys[iKey].getMode(), getEnumValue("" + key.getMode(), Mode.values()));
iKey++;
}
}
}
}
use of com.xenoage.zong.musicxml.types.MxlKey in project Zong by Xenoage.
the class Test13b method test.
@Test
public void test() {
TraditionalKey[] expectedKeys = getExpectedKeys();
MxlPart part = getFirstPart();
int iKey = 0;
for (int i = 0; i <= 2; i++) {
MxlMeasure measure = part.getMeasures().get(i);
for (MxlMusicDataContent data : measure.getMusicData().getContent()) {
if (data.getMusicDataContentType() == MxlMusicDataContentType.Attributes) {
// check type
MxlAttributes attr = (MxlAttributes) data;
MxlKey key = attr.getKey();
assertEquals(expectedKeys[iKey].getFifths(), key.getFifths());
assertEquals(expectedKeys[iKey].getMode(), getEnumValue("" + key.getMode(), Mode.values()));
iKey++;
if (iKey >= expectedKeys.length)
break;
}
}
}
assertEquals("not all keys found", expectedKeys.length, iKey);
}
Aggregations