Search in sources :

Example 1 with ContinuedVolta

use of com.xenoage.zong.musiclayout.continued.ContinuedVolta in project Zong by Xenoage.

the class VoltaStamper method stampSystem.

/**
 * Creates all volta stampings in the given system, including the voltas which
 * are still open from the last system.
 * @param openVolta  input and output parameter: voltas, which are still open from the
 *                   last system. After the method returns, it contains the voltas which
 *                   are still open after this system
 */
public List<VoltaStamping> stampSystem(StaffStamping systemFirstStaff, OpenVolta openVolta, ScoreHeader header, FormattedTextStyle textStyle) {
    List<VoltaStamping> ret = alist();
    // stamp open volta
    if (openVolta.volta != null) {
        ret.add(stamp(openVolta.volta.element, systemFirstStaff, textStyle));
    }
    // stamp voltas beginning in this system
    for (int iMeasure : systemFirstStaff.system.getMeasures()) {
        ColumnHeader columnHeader = header.getColumnHeader(iMeasure);
        if (columnHeader.getVolta() != null) {
            ret.add(stamp(columnHeader.getVolta(), systemFirstStaff, textStyle));
        }
    }
    // remember open volta
    int systemEndMeasureIndex = systemFirstStaff.system.getEndMeasure();
    if (ret.size() > 0 && getLast(ret).element.getEndMeasureIndex() > systemEndMeasureIndex) {
        openVolta.volta = new ContinuedVolta(getLast(ret).element);
    } else {
        openVolta.volta = null;
    }
    return ret;
}
Also used : ColumnHeader(com.xenoage.zong.core.header.ColumnHeader) VoltaStamping(com.xenoage.zong.musiclayout.stampings.VoltaStamping) ContinuedVolta(com.xenoage.zong.musiclayout.continued.ContinuedVolta)

Aggregations

ColumnHeader (com.xenoage.zong.core.header.ColumnHeader)1 ContinuedVolta (com.xenoage.zong.musiclayout.continued.ContinuedVolta)1 VoltaStamping (com.xenoage.zong.musiclayout.stampings.VoltaStamping)1