@stringsync/vexml
Version:
MusicXML to Vexflow
37 lines (36 loc) • 1.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Slur = void 0;
const enums_1 = require("./enums");
/**
* Most slurs are represented with two <slur> elements: one with a start type, and one with a stop type.
*
* See https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/slur/
*/
class Slur {
element;
constructor(element) {
this.element = element;
}
/** Returns the type of slur. Defaults to null. */
getType() {
return this.element.attr('type').enum(enums_1.START_STOP_CONTINUE);
}
/** Returns the placement of the slur. Defaults to null. */
getPlacement() {
return this.element.attr('placement').enum(enums_1.ABOVE_BELOW);
}
/** Returns the orientation of the slur. Defaults to null. */
getOrientation() {
return this.element.attr('orientation').enum(enums_1.OVER_UNDER);
}
/** Returns the number of the slur. Defaults to 1. */
getNumber() {
return this.element.attr('number').withDefault(1).int();
}
/** Returns the line type of the slur. Defaults to solid. */
getLineType() {
return this.element.attr('line-type').withDefault('solid').enum(enums_1.LINE_TYPES);
}
}
exports.Slur = Slur;