use of com.xenoage.zong.io.midi.out.repetitions.VoltaGroup.VoltaStartMeasure in project Zong by Xenoage.
the class VoltaGroupFinder method findVoltaGroup.
/**
* Collects all consecutive {@link Volta}s starting at the given measure
* into a {@link VoltaGroup}.
*/
private VoltaGroup findVoltaGroup(int startMeasure) {
CList<VoltaStartMeasure> voltasMeasures = clist();
val scoreHeader = score.getHeader();
for (int measure = startMeasure; measure < score.getMeasuresCount(); ) {
Volta volta = scoreHeader.getColumnHeader(measure).getVolta();
if (volta != null) {
voltasMeasures.add(new VoltaStartMeasure(volta, measure));
measure += volta.getLength();
} else {
break;
}
}
return new VoltaGroup(voltasMeasures.close());
}
use of com.xenoage.zong.io.midi.out.repetitions.VoltaGroup.VoltaStartMeasure in project Zong by Xenoage.
the class VoltaGroups method getVoltaAt.
/**
* Gets the {@link Volta} and its start measure over the given measure.
*/
@MaybeNull
public VoltaStartMeasure getVoltaAt(int measure) {
val group = getVoltaGroupAt(measure);
if (group == null)
return null;
VoltaStartMeasure volta = null;
for (val v : group.voltasStartMeasures) {
volta = v;
if (measure < v.startMeasure + v.volta.getLength())
break;
}
return volta;
}
Aggregations