use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.
the class Test21e method test.
@Test
public void test() {
Score score = getScore();
// 4/4 time in first measure (implicit)
assertEquals(Companion.fr(4, 4), score.getColumnHeader(0).getTime().getType().getMeasureBeats());
// first measure has only a 1/4 chord and a total length of 1/4
assertEquals(1, score.getVoice(mp0).getElements().size());
assertEquals(Companion.fr(1, 4), score.getVoice(mp0).getElement(0).getDuration());
assertEquals(Companion.fr(1, 4), score.getMeasure(mp0).getFilledBeats());
// second measure has two 1/4 chords and total length of 2/4
MP m2 = mp0.withMeasure(1);
assertEquals(2, score.getVoice(m2).getElements().size());
assertEquals(Companion.fr(1, 4), score.getVoice(m2).getElement(0).getDuration());
assertEquals(Companion.fr(1, 4), score.getVoice(m2).getElement(1).getDuration());
assertEquals(Companion.fr(2, 4), score.getMeasure(m2).getFilledBeats());
}
use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.
the class Test42b method testVoiceElements.
private void testVoiceElements() {
for (int iStaff : range(2)) {
for (int iMeasure : range(2)) {
MP mpVoice = atVoice(iStaff, iMeasure, 0);
Voice expectedVoice = expectedStaves[iStaff].getVoice(mpVoice);
Voice voice = score.getVoice(mpVoice);
assertEqualsVoice(expectedVoice, voice, mpVoice);
}
}
}
use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.
the class Test46e method testVoiceElements.
private void testVoiceElements() {
for (int iMeasure : range(2)) {
Measure expectedMeasure = expectedStaff.getMeasure(iMeasure);
Measure measure = score.getMeasure(atMeasure(0, iMeasure));
int expectedVoicesCount = expectedMeasure.getVoices().size();
assertEquals(expectedVoicesCount, measure.getVoices().size());
for (int iVoice : range(expectedVoicesCount)) {
MP mpVoice = atVoice(0, iMeasure, iVoice);
Voice expectedVoice = expectedStaff.getVoice(mpVoice);
Voice voice = score.getVoice(mpVoice);
assertEqualsVoice(expectedVoice, voice, mpVoice);
}
}
}
use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.
the class Test61a method test.
@Test
public void test() {
for (int iMeasure : range(3)) {
for (int iElement : range(iMeasure == 2 ? 3 : 4)) {
MP mp = MP.atElement(0, iMeasure, 0, iElement);
Chord chord = ChordTest.getChordAt(score, mp);
assertEqualsChordLyrics(expectedLyrics[iMeasure * 4 + iElement], chord, mp);
}
}
}
use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.
the class Test61b method test.
@Test
public void test() {
for (int iMeasure : range(2)) {
for (int iElement : range(4)) {
MP mp = MP.atElement(0, iMeasure, 0, iElement);
Chord chord = ChordTest.getChordAt(score, mp);
assertEqualsChordLyrics(expectedLyrics[iMeasure * 4 + iElement], chord, mp);
}
}
}
Aggregations