inheritedTimeSignature property
A meter this bar inherits from an earlier one, so that add can enforce capacity on a bar that declares no TimeSignature of its own.
This is an INPUT you set, never something the engine writes. It used
to say "set automatically by LayoutEngine", and that was the package's
most dangerous engine-writes-the-model defect (ADR-005 action item 8):
add reads this field to compute the bar's capacity, so laying a score
out changed whether a public method THREW. Measured on a two-bar staff
whose bar 2 declares no meter and already holds four quarters under an
inherited 4/4:
m2.inheritedTimeSignature |
m2.add(<fifth quarter>) |
|
|---|---|---|
| fresh | null |
accepted |
after LayoutEngine.layout() |
TimeSignature(4/4) |
threw MeasureCapacityException |
LayoutEngine now DERIVES the inheritance as a value it owns and leaves
every Measure field-for-field identical; read it from
LayoutEngine.timeSignatureOf(measure), or validate a whole staff with
MeasureValidator.validateStaff(staff). Set this field yourself only to
opt a stand-alone bar into preventive validation — and note that doing so
makes add throw where it otherwise would not, which is the point.
Implementation
TimeSignature? inheritedTimeSignature;