Search in sources :

Example 1 with MxlLyricContent

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

the class MxlLyric method read.

/**
 * Reads and returns the lyric content of the given element,
 * or returns null if unsupported.
 */
@MaybeNull
public static MxlLyric read(XmlReader reader) {
    String number = reader.getAttribute("number");
    MxlLyricContent content = null;
    if (reader.openNextChildElement()) {
        String n = reader.getElementName();
        if (n.equals("syllabic") || n.equals("text")) {
            content = MxlSyllabicText.read(reader);
        } else if (n.equals("extend")) {
            content = MxlExtend.read();
        }
        reader.closeElement();
    }
    if (content != null) {
        return new MxlLyric(content, number);
    } else {
        return null;
    }
}
Also used : MxlLyricContent(com.xenoage.zong.musicxml.types.choice.MxlLyricContent) MaybeNull(com.xenoage.utils.annotations.MaybeNull)

Aggregations

MaybeNull (com.xenoage.utils.annotations.MaybeNull)1 MxlLyricContent (com.xenoage.zong.musicxml.types.choice.MxlLyricContent)1