use of com.xenoage.utils.kernel.Tuple2 in project Zong by Xenoage.
the class Base43e method getExpectedClefs.
static List<Tuple2<MP, Clef>> getExpectedClefs() {
List<Tuple2<MP, Clef>> clefs = alist();
clefs.add(t(atBeat(0, 0, unknown, Companion.get_0()), new Clef(ClefType.Companion.getClefTreble())));
clefs.add(t(atBeat(0, 2, unknown, Companion.get_0()), new Clef(new ClefType(ClefSymbol.C, 2))));
clefs.add(t(atBeat(1, 0, unknown, Companion.get_0()), new Clef(ClefType.Companion.getClefBass())));
clefs.add(t(atBeat(1, 1, unknown, Companion.get_0()), new Clef(ClefType.Companion.getClefTreble())));
return clefs;
}
use of com.xenoage.utils.kernel.Tuple2 in project Zong by Xenoage.
the class Test21d method test.
@Test
public void test() {
MxlPart part = getFirstPart();
List<Tuple2<MP, ? extends Direction>> expectedDirections = getExpectedDirections();
// check only directions in this test
int iDirection = 0;
for (int iMeasure = 0; iMeasure <= 1; iMeasure++) {
MxlMeasure measure = part.getMeasures().get(iMeasure);
for (MxlMusicDataContent data : measure.getMusicData().getContent()) {
if (data.getMusicDataContentType() == MxlMusicDataContentType.Direction) {
// check type
MxlDirection dir = (MxlDirection) data;
MxlDirectionTypeContent content = dir.getDirectionTypes().get(0).getContent();
if (iDirection == 0) {
// Words "Largo"
assertEquals(0, iMeasure);
assertEquals(MxlDirectionTypeContentType.Words, content.getDirectionTypeContentType());
assertEquals("Largo", ((MxlWords) content).getFormattedText().getValue());
} else if (iDirection == 1) {
// Dynamic "fp"
assertEquals(0, iMeasure);
assertEquals(MxlDirectionTypeContentType.Dynamics, content.getDirectionTypeContentType());
assertEquals(DynamicValue.fp, ((MxlDynamics) content).getElement());
} else if (iDirection == 2) {
// Dynamic "p"
assertEquals(1, iMeasure);
assertEquals(MxlDirectionTypeContentType.Dynamics, content.getDirectionTypeContentType());
assertEquals(DynamicValue.p, ((MxlDynamics) content).getElement());
}
iDirection++;
}
}
}
assertEquals("not all directions found", expectedDirections.size(), iDirection);
}
use of com.xenoage.utils.kernel.Tuple2 in project Zong by Xenoage.
the class Base21d method getExpectedDirections.
default List<Tuple2<MP, ? extends Direction>> getExpectedDirections() {
List<Tuple2<MP, ? extends Direction>> expectedDirections = alist();
Words largo = new Words(new UnformattedText("Largo"));
largo.setPositioning(Placement.Above);
expectedDirections.add(t(mp0, largo));
Dynamic fp = new Dynamic(DynamicValue.fp);
fp.setPositioning(Placement.Below);
expectedDirections.add(t(mp0, fp));
Dynamic p = new Dynamic(DynamicValue.p);
fp.setPositioning(Placement.Below);
expectedDirections.add(t(mp0.withMeasure(1), p));
return expectedDirections;
}
use of com.xenoage.utils.kernel.Tuple2 in project Zong by Xenoage.
the class Base43e method getExpectedDirections.
static List<Tuple2<MP, Direction>> getExpectedDirections() {
Wedge wedge;
List<Tuple2<MP, Direction>> directions = alist();
directions.add(t(atBeat(0, 0, unknown, Companion.get_0()), new Dynamic(DynamicValue.ffff)));
directions.add(t(atBeat(0, 0, unknown, Companion.fr(3, 4)), new Dynamic(DynamicValue.p)));
directions.add(t(atBeat(1, 0, unknown, Companion.get_0()), wedge = new Wedge(WedgeType.Crescendo)));
directions.add(t(atBeat(1, 0, unknown, Companion.fr(2, 4)), wedge.getWedgeEnd()));
return directions;
}
use of com.xenoage.utils.kernel.Tuple2 in project Zong by Xenoage.
the class Base46c method getExpectedClefs.
static List<Tuple2<MP, Clef>> getExpectedClefs() {
List<Tuple2<MP, Clef>> clefs = alist();
clefs.add(t(atBeat(0, 0, unknown, Companion.get_0()), new Clef(ClefType.Companion.getClefTreble())));
clefs.add(t(atBeat(0, 2, unknown, Companion.get_0()), new Clef(new ClefType(ClefSymbol.C, 2))));
clefs.add(t(atBeat(0, 3, unknown, Companion.fr(2, 4)), new Clef(ClefType.Companion.getClefTreble())));
return clefs;
}
Aggregations