@stringsync/vexml
Version:
MusicXML to Vexflow
32 lines (31 loc) • 1.02 kB
JavaScript
import { ABOVE_BELOW, LINE_TYPES, OVER_UNDER, TIED_TYPES } from './enums';
/**
* The <tied> element represents the notated tie.
*
* See https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/tied/.
*/
export class Tied {
element;
constructor(element) {
this.element = element;
}
/** Returns the type of tie. Defaults to null. */
getType() {
return this.element.attr('type').enum(TIED_TYPES);
}
/** Returns the placement of the tie. Defaults to null. */
getPlacement() {
return this.element.attr('placement').enum(ABOVE_BELOW);
}
getOrientation() {
return this.element.attr('orientation').enum(OVER_UNDER);
}
/** Returns the number of the tie. Defaults to 1. */
getNumber() {
return this.element.attr('number').withDefault(1).int();
}
/** Returns the line type of the tie. Defaults to solid. */
getLineType() {
return this.element.attr('line-type').withDefault('solid').enum(LINE_TYPES);
}
}