|
@@ -21,6 +21,8 @@ export class VexFlowPedal extends GraphicalPedal {
|
|
|
public startVfVoiceEntry: VexFlowVoiceEntry;
|
|
|
public endVfVoiceEntry: VexFlowVoiceEntry;
|
|
|
public endMeasure: GraphicalMeasure;
|
|
|
+ public ChangeBegin: boolean = false;
|
|
|
+ public ChangeEnd: boolean = false;
|
|
|
private line: number = -3;
|
|
|
|
|
|
public EndSymbolPositionAndShape: BoundingBox = undefined;
|
|
@@ -31,6 +33,8 @@ export class VexFlowPedal extends GraphicalPedal {
|
|
|
*/
|
|
|
constructor(pedal: Pedal, parent: BoundingBox, openBegin: boolean = false, openEnd: boolean = false) {
|
|
|
super(pedal, parent);
|
|
|
+ this.ChangeBegin = pedal.ChangeBegin;
|
|
|
+ this.ChangeEnd = pedal.ChangeEnd;
|
|
|
switch (this.pedalSymbol) {
|
|
|
case MusicSymbol.PEDAL_SYMBOL:
|
|
|
//This renders the pedal symbols in VF.
|
|
@@ -68,6 +72,9 @@ export class VexFlowPedal extends GraphicalPedal {
|
|
|
* @param graphicalStaffEntry the staff entry that holds the start note
|
|
|
*/
|
|
|
public setStartNote(graphicalStaffEntry: GraphicalStaffEntry): boolean {
|
|
|
+ if(!graphicalStaffEntry){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
for (const gve of graphicalStaffEntry.graphicalVoiceEntries) {
|
|
|
const vve: VexFlowVoiceEntry = (gve as VexFlowVoiceEntry);
|
|
|
if (vve?.vfStaveNote) {
|
|
@@ -122,12 +129,12 @@ export class VexFlowPedal extends GraphicalPedal {
|
|
|
pedalMarking.setLine(this.line);
|
|
|
pedalMarking.setCustomText(this.DepressText, this.ReleaseText);
|
|
|
//If our end note is at the end of a stave, set that value
|
|
|
- if(this.endVfVoiceEntry?.parentStaffEntry?.parentMeasure?.parentSourceMeasure?.VerticalSourceStaffEntryContainers?.last() ===
|
|
|
- this.endVfVoiceEntry?.parentVoiceEntry?.ParentSourceStaffEntry?.VerticalContainerParent){
|
|
|
+ if(this.endVfVoiceEntry?.parentStaffEntry === this.endVfVoiceEntry?.parentStaffEntry?.parentMeasure?.staffEntries.last() ||
|
|
|
+ !this.endVfVoiceEntry){
|
|
|
(pedalMarking as any).EndsStave = true;
|
|
|
}
|
|
|
- (pedalMarking as any).ChangeBegin = this.getPedal.ChangeBegin;
|
|
|
- (pedalMarking as any).ChangeEnd = this.getPedal.ChangeEnd;
|
|
|
+ (pedalMarking as any).ChangeBegin = this.ChangeBegin;
|
|
|
+ (pedalMarking as any).ChangeEnd = this.ChangeEnd;
|
|
|
return pedalMarking;
|
|
|
}
|
|
|
}
|