use of com.xenoage.zong.core.util.BeamIterator in project Zong by Xenoage.
the class BeamsSpacer method compute.
public Map<Beam, BeamSpacing> compute(Score score, Notations notations, FramesSpacing frames) {
Map<Beam, BeamSpacing> ret = map();
BeamIterator itB = new BeamIterator(score);
for (Beam beam : itB) {
MP mp = itB.getMp();
int staffLinesCount = score.getStaff(mp).getLinesCount();
val frame = frames.getFrame(mp.measure);
val system = frame.getSystem(mp.measure);
val beamNotation = (BeamNotation) notations.get(beam);
ret.put(beam, beamSpacer.compute(beamNotation, system, score));
}
return ret;
}
use of com.xenoage.zong.core.util.BeamIterator 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