return null;
}
return contentNode;
} else if (childForm instanceof ReadingForm) {
Rdg contentNode;
ReadingForm contentForm = (ReadingForm) childForm;
if (!saveAllVariants && !contentForm.isActive()) {
// ignore this very reading
return null;
}
contentNode = (Rdg) contentForm.getMeiNode();
contentNode.getSources().clear();
for (SourceBindingWrapper sbw : contentForm
.getSourceBindingWrappers()) { // insert the wrapped sources
contentNode.getSources().add(sbw.getSource().getId());
}
if (contentNode.getSources().isEmpty())
contentNode.unsetSources();
contentNode.getMRestsAndKeySigsAndProports().clear();
for (BasicElement contentChildForm : contentForm.getChildren()) {
contentNode.getMRestsAndKeySigsAndProports().add(
handleScoreChild(contentChildForm, saveAllVariants));
}
return contentNode;
} else if (childForm instanceof LayerForm) {
LayerForm contentForm = (LayerForm) childForm;
Layer contentNode = (Layer) contentForm.getMeiNode();
contentNode.getBarLinesAndSyllablesAndGaps().clear();
for (BasicElement contentChildForm : contentForm.getChildren()) {
contentNode.getBarLinesAndSyllablesAndGaps().add(
handleScoreChild(contentChildForm, saveAllVariants));
}
return contentNode;
} else if (childForm instanceof ChordGroupForm) {
ChordGroupForm contentForm = (ChordGroupForm) childForm;
Chord contentNode = (Chord) contentForm.getMeiNode();
contentNode.getRestoresAndArticsAndUnclears().clear();
for (BasicElement contentChildForm : contentForm.getChildren()) {
contentNode.getRestoresAndArticsAndUnclears().add(
handleScoreChild(contentChildForm, saveAllVariants));
}
if(contentNode.getArtics().isEmpty()) {
contentNode.unsetArtics();
}
return contentNode;
} else if (childForm instanceof BeamGroupForm) {
BeamGroupForm contentForm = (BeamGroupForm) childForm;
Beam contentNode = (Beam) contentForm.getMeiNode();
contentNode.getFTremsAndChordsAndDamages().clear();
for (BasicElement contentChildForm : contentForm.getChildren()) {
contentNode.getFTremsAndChordsAndDamages().add(
handleScoreChild(contentChildForm, saveAllVariants));
}
return contentNode;
} else if (childForm instanceof NoteForm) {
NoteForm contentForm = (NoteForm) childForm;
Note contentNode = (Note) contentForm.getMeiNode();
if (contentNode.getArtics().isEmpty())
contentNode.unsetArtics();
return contentNode;
} else if (childForm instanceof RestForm) {
RestForm contentForm = (RestForm) childForm;
Rest contentNode = (Rest) contentForm.getMeiNode();
return contentNode;
} else if (childForm instanceof MRestForm) {
MRestForm contentForm = (MRestForm) childForm;
MRest contentNode = (MRest) contentForm.getMeiNode();
return contentNode;
} else if (childForm instanceof SpaceForm) {
SpaceForm contentForm = (SpaceForm) childForm;
Space contentNode = (Space) contentForm.getMeiNode();
return contentNode;
} else if (childForm instanceof DynamForm) {
DynamForm contentForm = (DynamForm) childForm;
Dynam contentNode = (Dynam) contentForm.getMeiNode();
for (BasicElement contentChildForm : contentForm.getChildren()) {
contentNode.getContent().add(
handleScoreChild(contentChildForm, saveAllVariants));
}
return contentNode;
} else if (childForm instanceof TieForm) {
TieForm contentForm = (TieForm) childForm;