Search in sources :

Example 1 with MxlStartStopContinue

use of com.xenoage.zong.musicxml.types.enums.MxlStartStopContinue in project Zong by Xenoage.

the class MxlSlurOrTied method read.

@MaybeNull
public static MxlSlurOrTied read(XmlReader reader) {
    // element type
    MxlElementType elementType = null;
    String eName = reader.getElementName();
    if (elemNameSlur.equals(eName))
        elementType = MxlElementType.Slur;
    else if (elemNameTied.equals(eName))
        elementType = MxlElementType.Tied;
    else
        throw reader.dataException("slur or tied expected");
    // type
    MxlStartStopContinue type = MxlStartStopContinue.read(reader.getAttribute("type"));
    if (type == MxlStartStopContinue.Continue && elementType == MxlElementType.Tied)
        throw reader.dataException("tied can not be continued");
    // other members
    Integer number = reader.getAttributeInt("number");
    if (elementType == MxlElementType.Slur)
        number = notNull(number, defaultNumberForSlur);
    MxlPosition position = MxlPosition.read(reader);
    MxlPlacement placement = MxlPlacement.read(reader);
    MxlBezier bezier = MxlBezier.read(reader);
    return new MxlSlurOrTied(elementType, type, number, position, placement, bezier);
}
Also used : MxlPosition(com.xenoage.zong.musicxml.types.attributes.MxlPosition) MxlPlacement(com.xenoage.zong.musicxml.types.enums.MxlPlacement) MxlStartStopContinue(com.xenoage.zong.musicxml.types.enums.MxlStartStopContinue) MaybeNull(com.xenoage.utils.annotations.MaybeNull)

Aggregations

MaybeNull (com.xenoage.utils.annotations.MaybeNull)1 MxlPosition (com.xenoage.zong.musicxml.types.attributes.MxlPosition)1 MxlPlacement (com.xenoage.zong.musicxml.types.enums.MxlPlacement)1 MxlStartStopContinue (com.xenoage.zong.musicxml.types.enums.MxlStartStopContinue)1