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;
}
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;
}
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);
}
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);
}
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;
}
Aggregations