use of com.xenoage.zong.musicxml.types.enums.MxlPlacement in project Zong by Xenoage.
the class MxlDirection method read.
/**
* Returns null, when no supported content was found.
*/
@MaybeNull
public static MxlDirection read(XmlReader reader) {
// attributes
MxlPlacement placement = MxlPlacement.read(reader);
// elements
List<MxlDirectionType> directionTypes = alist();
Integer staff = null;
MxlSound sound = null;
while (reader.openNextChildElement()) {
String n = reader.getElementName();
switch(n) {
case MxlDirectionType.elemName:
MxlDirectionType directionType = MxlDirectionType.read(reader);
if (directionType != null)
directionTypes.add(directionType);
break;
case "staff":
staff = reader.getTextInt();
break;
case MxlSound.elemName:
sound = MxlSound.read(reader);
break;
}
reader.closeElement();
}
if (directionTypes.size() > 0) {
return new MxlDirection(directionTypes, staff, sound, placement);
} else {
return null;
}
}
use of com.xenoage.zong.musicxml.types.enums.MxlPlacement in project Zong by Xenoage.
the class ArticulationReader method readArticulation.
private static Articulation readArticulation(MxlArticulationsContent mxlAC) {
MxlArticulationsContentType mxlACType = mxlAC.getArticulationsContentType();
ArticulationType type = Equivalents.articulations.getBy2(mxlACType);
if (type == null)
return null;
Articulation articulation = new Articulation(type);
// read placement
MxlPlacement mxlPlacement = mxlAC.getEmptyPlacement().getPlacement();
articulation.setPlacement(PositioningReader.readPlacement(mxlPlacement));
return articulation;
}
Aggregations