Search in sources :

Example 1 with MxlPlacement

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

the class MxlEmptyPlacement method read.

public static MxlEmptyPlacement read(XmlReader reader) {
    MxlPrintStyle printStyle = MxlPrintStyle.read(reader);
    MxlPlacement placement = MxlPlacement.read(reader);
    if (printStyle != noPrintStyle || placement != Unknown)
        return new MxlEmptyPlacement(printStyle, placement);
    else
        return noEmptyPlacement;
}
Also used : MxlPlacement(com.xenoage.zong.musicxml.types.enums.MxlPlacement)

Example 2 with MxlPlacement

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

the class MxlEmptyTrillSound method read.

public static MxlEmptyTrillSound read(XmlReader reader) {
    MxlPrintStyle printStyle = MxlPrintStyle.read(reader);
    MxlPlacement placement = MxlPlacement.read(reader);
    if (printStyle != noPrintStyle || placement != Unknown)
        return new MxlEmptyTrillSound(printStyle, placement);
    else
        return noEmptyTrillSound;
}
Also used : MxlPlacement(com.xenoage.zong.musicxml.types.enums.MxlPlacement)

Example 3 with MxlPlacement

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

the class MxlAccidentalMark method read.

@NonNull
public static MxlAccidentalMark read(XmlReader reader) {
    MxlPrintStyle printStyle = MxlPrintStyle.read(reader);
    MxlPlacement placement = MxlPlacement.read(reader);
    MxlAccidentalText accidentalText = MxlAccidentalText.read(reader);
    return new MxlAccidentalMark(accidentalText, printStyle, placement);
}
Also used : MxlAccidentalText(com.xenoage.zong.musicxml.types.enums.MxlAccidentalText) MxlPlacement(com.xenoage.zong.musicxml.types.enums.MxlPlacement) MxlPrintStyle(com.xenoage.zong.musicxml.types.attributes.MxlPrintStyle) NonNull(com.xenoage.utils.annotations.NonNull)

Example 4 with MxlPlacement

use of com.xenoage.zong.musicxml.types.enums.MxlPlacement 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)

Example 5 with MxlPlacement

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

the class MxlDynamics method read.

/**
 * Reads the given element and returns it, or returns null if
 * the element is empty or not supported.
 */
@MaybeNull
public static MxlDynamics read(XmlReader reader) {
    // attributes
    MxlPrintStyle printStyle = MxlPrintStyle.read(reader);
    MxlPlacement placement = MxlPlacement.read(reader);
    // get first element
    if (false == reader.openNextChildElement())
        // dynamics element may be empty according to schema
        return null;
    String childText = reader.getElementName();
    reader.closeElement();
    DynamicValue element = getEnumValue(childText, DynamicValue.values());
    if (element != null)
        return new MxlDynamics(element, printStyle, placement);
    else
        return null;
}
Also used : MxlPlacement(com.xenoage.zong.musicxml.types.enums.MxlPlacement) MxlPrintStyle(com.xenoage.zong.musicxml.types.attributes.MxlPrintStyle) DynamicValue(com.xenoage.zong.core.music.direction.DynamicValue) MaybeNull(com.xenoage.utils.annotations.MaybeNull)

Aggregations

MxlPlacement (com.xenoage.zong.musicxml.types.enums.MxlPlacement)7 MaybeNull (com.xenoage.utils.annotations.MaybeNull)3 MxlPrintStyle (com.xenoage.zong.musicxml.types.attributes.MxlPrintStyle)2 NonNull (com.xenoage.utils.annotations.NonNull)1 Articulation (com.xenoage.zong.core.music.annotation.Articulation)1 ArticulationType (com.xenoage.zong.core.music.annotation.ArticulationType)1 DynamicValue (com.xenoage.zong.core.music.direction.DynamicValue)1 MxlPosition (com.xenoage.zong.musicxml.types.attributes.MxlPosition)1 MxlArticulationsContentType (com.xenoage.zong.musicxml.types.choice.MxlArticulationsContent.MxlArticulationsContentType)1 MxlAccidentalText (com.xenoage.zong.musicxml.types.enums.MxlAccidentalText)1 MxlStartStopContinue (com.xenoage.zong.musicxml.types.enums.MxlStartStopContinue)1