UNPKG

@stringsync/vexml

Version:

MusicXML to Vexflow

30 lines (29 loc) 977 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StaveDetails = void 0; const enums_1 = require("./enums"); /** * Indicates different stave types. A stave is the set of five horizontal lines where notes and other musical * symbols are placed. * * https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/staff-details/ */ class StaveDetails { element; constructor(element) { this.element = element; } /** Returns the stave type. */ getStaveType() { return this.element.first('staff-type')?.content().enum(enums_1.STAVE_TYPES) ?? 'regular'; } /** Returns the number of the stave. */ getStaveNumber() { return this.element.attr('number').withDefault(1).int(); } /** Returns the number of lines of the stave. */ getStaveLines() { return this.element.first('staff-lines')?.content().withDefault(5).int() ?? 5; } } exports.StaveDetails = StaveDetails;