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;
Tie contentNode = (Tie) contentForm.getMeiNode();
return contentNode;
} else if (childForm instanceof SlurForm) {
SlurForm contentForm = (SlurForm) childForm;
Slur contentNode = (Slur) contentForm.getMeiNode();
return contentNode;
} else if (childForm instanceof FermataForm) {
FermataForm contentForm = (FermataForm) childForm;
Fermata contentNode = (Fermata) contentForm.getMeiNode();
return contentNode;
} else {
// write back a node of a currently unknown type
UnknownMeiNodeForm contentForm = (UnknownMeiNodeForm) childForm;
return contentForm.getMeiNode();
}
}