Search in sources :

Example 1 with MxlMode

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

the class MxlKey method read.

/**
 * Returns null, if the key is unsupported.
 */
@MaybeNull
public static MxlKey read(XmlReader reader) {
    Integer fifths = null;
    MxlMode mode = null;
    while (reader.openNextChildElement()) {
        String eName = reader.getElementName();
        if (eName.equals("fifths")) {
            fifths = Parser.parseIntegerNull(reader.getText());
        } else if (eName.equals(MxlMode.elemName)) {
            mode = MxlMode.read(reader);
        }
        reader.closeElement();
    }
    if (fifths != null)
        return new MxlKey(fifths, mode);
    else
        return null;
}
Also used : MxlMode(com.xenoage.zong.musicxml.types.enums.MxlMode) MaybeNull(com.xenoage.utils.annotations.MaybeNull)

Aggregations

MaybeNull (com.xenoage.utils.annotations.MaybeNull)1 MxlMode (com.xenoage.zong.musicxml.types.enums.MxlMode)1