use of com.xenoage.zong.core.util.ColumnElementIterator in project Zong by Xenoage.
the class Notator method computeAll.
/**
* Computes the {@link Notation}s of all elements and returns them.
*/
public Notations computeAll(Context context) {
context.saveMp();
Score score = context.score;
Notations notations = new Notations();
// iterate over all column elements, measure elements and voice elements
ColumnElementIterator itC = new ColumnElementIterator(score);
for (ColumnElement e : itC) {
// column elements: one notation for each staff
for (int iStaff : range(context.score.getStavesCount())) {
context.mp = itC.getMp().withStaff(iStaff);
notations.add(compute(e, context, notations), iStaff);
}
}
MeasureElementIterator itM = new MeasureElementIterator(score);
for (MeasureElement e : itM) {
context.mp = itM.getMp();
notations.add(compute(e, context, notations));
}
VoiceElementIterator itV = new VoiceElementIterator(score);
for (VoiceElement e : itV) {
context.mp = itV.getMp();
notations.add(compute(e, context, notations));
}
BeamIterator itB = new BeamIterator(score);
for (Beam e : itB) {
context.mp = itB.getMp();
notations.add(compute(e, context, notations));
}
context.restoreMp();
return notations;
}
Aggregations