@stringsync/vexml
Version:
MusicXML to Vexflow
42 lines (41 loc) • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.System = void 0;
const measure_1 = require("./measure");
class System {
config;
log;
document;
systemRender;
measures;
constructor(config, log, document, systemRender, measures) {
this.config = config;
this.log = log;
this.document = document;
this.systemRender = systemRender;
this.measures = measures;
}
static create(config, log, document, systemRender) {
const measures = systemRender.measureRenders.map((measureRender) => measure_1.Measure.create(config, log, document, measureRender));
return new System(config, log, document, systemRender, measures);
}
/** The name of the element, which can be used as a type discriminant. */
name = 'system';
/** Returns the bounding box of the element. */
rect() {
return this.systemRender.rect;
}
/** Returns the system index that this system resides in. */
getIndex() {
return this.systemRender.key.systemIndex;
}
/** Returns the measures of the system. */
getMeasures() {
return this.measures;
}
/** Returns the max number of parts in this score. */
getPartCount() {
return Math.max(0, ...this.measures.map((measure) => measure.getPartCount()));
}
}
exports.System = System;