use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.
the class Test32b method getFontSize.
private float getFontSize(Score score, int wordsIndex) {
MP mp = expectedTexts.get(wordsIndex).get1();
FormattedText text = getTextAt(score, mp);
return getFontSize(text);
}
use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.
the class Test32b method testStyle.
@Test
public void testStyle() {
Score score = getScore();
for (int i = 0; i < expectedTexts.size(); ) {
MP mp = expectedTexts.get(i).get1();
List<Direction> directions = score.getMeasure(mp).getDirections().getAll(mp.beat);
assertTrue("" + mp, directions.size() > 0);
for (val direction : directions) {
assertTrue("" + mp, direction instanceof Words);
check((Words) direction, expectedTexts.get(i).get2(), mp);
i++;
}
}
}
use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.
the class Test13b method test.
@Test
public void test() {
Score score = getScore();
TraditionalKey[] expectedKeys = getExpectedKeys();
MP mp = mp0;
for (int iKey : range(expectedKeys)) {
ColumnHeader column = score.getColumnHeader(mp.measure);
TraditionalKey key = (TraditionalKey) column.getKeys().get(mp.beat);
assertNotNull("mp " + mp, key);
assertEquals("mp " + mp, expectedKeys[iKey].getFifths(), key.getFifths());
assertEquals("mp " + mp, expectedKeys[iKey].getMode(), key.getMode());
mp = mp.withBeat(mp.beat.add(Companion.fr(1, 4)));
if (mp.beat.compareTo(Companion.get_1()) >= 0) {
mp = mp.withMeasure(mp.measure + 1).withBeat(Companion.get_0());
}
}
}
use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.
the class Test21b method test.
@Test
public void test() {
Score score = getScore();
MP mp = mp0;
for (int i = 0; i < expectedChordsCount; i++) {
Chord chord = (Chord) score.getVoice(mp).getElementAt(mp.beat);
assertEquals(expectedChord.getNotes(), chord.getNotes());
assertEquals(expectedChord.getDuration(), chord.getDuration());
mp = mp.withBeat(mp.beat.add(Companion.fr(1, 4)));
if (mp.beat.compareTo(Companion.get_1()) >= 0) {
mp = mp.withMeasure(mp.measure + 1).withBeat(Companion.get_0());
}
}
}
use of com.xenoage.zong.core.position.MP in project Zong by Xenoage.
the class Test42a method test.
@Test
public void test() {
Staff staff = getFirstStaff();
// test chords
for (int iMeasure : range(2)) {
for (int iVoice : range(2)) {
MP mpVoice = atVoice(0, iMeasure, iVoice);
Voice expectedVoice = expectedStaff.getVoice(mpVoice);
Voice voice = staff.getVoice(mpVoice);
assertEqualsVoice(expectedVoice, voice, mpVoice);
}
}
// test slurs
assertSlurBetween(getVoiceChords(staff.getVoice(atVoice(0, 1, 0))), 1, 2, SlurType.Slur);
assertSlurBetween(getVoiceChords(staff.getVoice(atVoice(0, 1, 1))), 1, 2, SlurType.Slur);
}
Aggregations