Search in sources :

Example 1 with UnformattedText

use of com.xenoage.zong.core.text.UnformattedText 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;
}
Also used : Dynamic(com.xenoage.zong.core.music.direction.Dynamic) Tuple2(com.xenoage.utils.kernel.Tuple2) Words(com.xenoage.zong.core.music.direction.Words) UnformattedText(com.xenoage.zong.core.text.UnformattedText) Direction(com.xenoage.zong.core.music.direction.Direction)

Example 2 with UnformattedText

use of com.xenoage.zong.core.text.UnformattedText in project Zong by Xenoage.

the class MeasureElementIteratorTest method createTestScore.

/**
 * Test score with 4 staves and 4 measures. In staves 1 and 3, the measures 1 and 3 have each
 * three words with text "staff x, measure y, element z" on beats 1/4 and 2/4
 */
public static Score createTestScore() {
    Score score = new Score();
    Cursor cursor = new Cursor(score, MP.mp0, true);
    for (int staff : new int[] { 1, 3 }) {
        for (int measure : new int[] { 1, 3 }) {
            cursor.setMp(atElement(staff, measure, 0, 0));
            for (int element : range(2)) {
                cursor.write(new Rest(Companion.fr(1, 4)));
                cursor.write((MeasureElement) new Words(new UnformattedText("staff " + staff + ", measure " + measure + ", element " + element)));
            }
        }
    }
    return score;
}
Also used : Score(com.xenoage.zong.core.Score) Rest(com.xenoage.zong.core.music.rest.Rest) Words(com.xenoage.zong.core.music.direction.Words) UnformattedText(com.xenoage.zong.core.text.UnformattedText) Cursor(com.xenoage.zong.io.selection.Cursor)

Aggregations

Words (com.xenoage.zong.core.music.direction.Words)2 UnformattedText (com.xenoage.zong.core.text.UnformattedText)2 Tuple2 (com.xenoage.utils.kernel.Tuple2)1 Score (com.xenoage.zong.core.Score)1 Direction (com.xenoage.zong.core.music.direction.Direction)1 Dynamic (com.xenoage.zong.core.music.direction.Dynamic)1 Rest (com.xenoage.zong.core.music.rest.Rest)1 Cursor (com.xenoage.zong.io.selection.Cursor)1