Search in sources :

Example 1 with MxlTimeContent

use of com.xenoage.zong.musicxml.types.choice.MxlTimeContent in project Zong by Xenoage.

the class MxlTime method read.

/**
 * Returns null, if the time signature is unsupported.
 */
@MaybeNull
public static MxlTime read(XmlReader reader) {
    MxlTimeSymbol symbol = MxlTimeSymbol.read(reader);
    MxlTimeContent content = null;
    if (reader.openNextChildElement()) {
        String n = reader.getElementName();
        switch(n) {
            case "beats":
                content = MxlNormalTime.read(reader);
                break;
            case "senza-misura":
                content = MxlSenzaMisura.read();
                reader.closeElement();
                break;
            default:
                reader.closeElement();
                break;
        }
    }
    if (content != null)
        return new MxlTime(content, symbol);
    else
        return null;
}
Also used : MxlTimeContent(com.xenoage.zong.musicxml.types.choice.MxlTimeContent) MxlTimeSymbol(com.xenoage.zong.musicxml.types.enums.MxlTimeSymbol) MaybeNull(com.xenoage.utils.annotations.MaybeNull)

Aggregations

MaybeNull (com.xenoage.utils.annotations.MaybeNull)1 MxlTimeContent (com.xenoage.zong.musicxml.types.choice.MxlTimeContent)1 MxlTimeSymbol (com.xenoage.zong.musicxml.types.enums.MxlTimeSymbol)1