use of com.xenoage.zong.core.music.direction.DynamicValue 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;
}
use of com.xenoage.zong.core.music.direction.DynamicValue in project Zong by Xenoage.
the class DynamicsReader method read.
public static Dynamic read(MxlDynamics mxlDynamics, StaffDetails staffDetails) {
DynamicValue type = mxlDynamics.getElement();
Positioning positioning = new PositioningReader(staffDetails).readFromAny(mxlDynamics);
Dynamic dynamics = new Dynamic(type);
dynamics.setPositioning(positioning);
return dynamics;
}
Aggregations