|
@@ -20,7 +20,6 @@ import {MusicSheetCalculator} from "./MusicSheetCalculator";
|
|
import {MidiInstrument} from "../VoiceData/Instructions/ClefInstruction";
|
|
import {MidiInstrument} from "../VoiceData/Instructions/ClefInstruction";
|
|
import {CollectionUtil} from "../../Util/CollectionUtil";
|
|
import {CollectionUtil} from "../../Util/CollectionUtil";
|
|
import {SystemLinePosition} from "./SystemLinePosition";
|
|
import {SystemLinePosition} from "./SystemLinePosition";
|
|
-import { StaffLinesInstruction } from "../VoiceData/Instructions/StaffLinesInstruction";
|
|
|
|
|
|
|
|
export class MusicSystemBuilder {
|
|
export class MusicSystemBuilder {
|
|
protected measureList: GraphicalMeasure[][];
|
|
protected measureList: GraphicalMeasure[][];
|
|
@@ -38,7 +37,6 @@ export class MusicSystemBuilder {
|
|
protected activeRhythm: RhythmInstruction[];
|
|
protected activeRhythm: RhythmInstruction[];
|
|
protected activeKeys: KeyInstruction[];
|
|
protected activeKeys: KeyInstruction[];
|
|
protected activeClefs: ClefInstruction[];
|
|
protected activeClefs: ClefInstruction[];
|
|
- protected activeStafflines: StaffLinesInstruction[];
|
|
|
|
protected globalSystemIndex: number = 0;
|
|
protected globalSystemIndex: number = 0;
|
|
protected leadSheet: boolean = false;
|
|
protected leadSheet: boolean = false;
|
|
|
|
|
|
@@ -52,7 +50,6 @@ export class MusicSystemBuilder {
|
|
this.activeRhythm = new Array(this.numberOfVisibleStaffLines);
|
|
this.activeRhythm = new Array(this.numberOfVisibleStaffLines);
|
|
this.activeKeys = new Array(this.numberOfVisibleStaffLines);
|
|
this.activeKeys = new Array(this.numberOfVisibleStaffLines);
|
|
this.activeClefs = new Array(this.numberOfVisibleStaffLines);
|
|
this.activeClefs = new Array(this.numberOfVisibleStaffLines);
|
|
- this.activeStafflines = new Array(this.numberOfVisibleStaffLines);
|
|
|
|
this.initializeActiveInstructions(this.measureList[0]);
|
|
this.initializeActiveInstructions(this.measureList[0]);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -366,7 +363,6 @@ export class MusicSystemBuilder {
|
|
keyInstruction = this.transposeKeyInstruction(keyInstruction, graphicalMeasure);
|
|
keyInstruction = this.transposeKeyInstruction(keyInstruction, graphicalMeasure);
|
|
this.activeKeys[i] = keyInstruction;
|
|
this.activeKeys[i] = keyInstruction;
|
|
this.activeRhythm[i] = <RhythmInstruction>firstSourceMeasure.FirstInstructionsStaffEntries[staffIndex].Instructions[2];
|
|
this.activeRhythm[i] = <RhythmInstruction>firstSourceMeasure.FirstInstructionsStaffEntries[staffIndex].Instructions[2];
|
|
- this.activeStafflines[i] = <StaffLinesInstruction>firstSourceMeasure.FirstInstructionsStaffEntries[staffIndex].Instructions[3];
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -440,7 +436,6 @@ export class MusicSystemBuilder {
|
|
let currentClef: ClefInstruction = undefined;
|
|
let currentClef: ClefInstruction = undefined;
|
|
let currentKey: KeyInstruction = undefined;
|
|
let currentKey: KeyInstruction = undefined;
|
|
let currentRhythm: RhythmInstruction = undefined;
|
|
let currentRhythm: RhythmInstruction = undefined;
|
|
- let currentStafflines: StaffLinesInstruction = undefined;
|
|
|
|
if (firstEntry !== undefined) {
|
|
if (firstEntry !== undefined) {
|
|
for (let idx: number = 0, len: number = firstEntry.Instructions.length; idx < len; ++idx) {
|
|
for (let idx: number = 0, len: number = firstEntry.Instructions.length; idx < len; ++idx) {
|
|
const abstractNotationInstruction: AbstractNotationInstruction = firstEntry.Instructions[idx];
|
|
const abstractNotationInstruction: AbstractNotationInstruction = firstEntry.Instructions[idx];
|
|
@@ -450,8 +445,6 @@ export class MusicSystemBuilder {
|
|
currentKey = <KeyInstruction>abstractNotationInstruction;
|
|
currentKey = <KeyInstruction>abstractNotationInstruction;
|
|
} else if (abstractNotationInstruction instanceof RhythmInstruction) {
|
|
} else if (abstractNotationInstruction instanceof RhythmInstruction) {
|
|
currentRhythm = <RhythmInstruction>abstractNotationInstruction;
|
|
currentRhythm = <RhythmInstruction>abstractNotationInstruction;
|
|
- } else if (abstractNotationInstruction instanceof StaffLinesInstruction) {
|
|
|
|
- currentStafflines = <StaffLinesInstruction>abstractNotationInstruction;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -466,17 +459,9 @@ export class MusicSystemBuilder {
|
|
currentRhythm = this.activeRhythm[visibleStaffIdx];
|
|
currentRhythm = this.activeRhythm[visibleStaffIdx];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (currentStafflines === undefined) {
|
|
|
|
- currentStafflines = this.activeStafflines[visibleStaffIdx];
|
|
|
|
- }
|
|
|
|
let clefAdded: boolean = false;
|
|
let clefAdded: boolean = false;
|
|
let keyAdded: boolean = false;
|
|
let keyAdded: boolean = false;
|
|
let rhythmAdded: boolean = false;
|
|
let rhythmAdded: boolean = false;
|
|
- //Instruction applies to entire staff, don't need to check for start
|
|
|
|
- if (currentStafflines !== undefined) {
|
|
|
|
- measure.setLineNumber(currentStafflines.NumberOfLines);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (currentClef !== undefined) {
|
|
if (currentClef !== undefined) {
|
|
measure.addClefAtBegin(currentClef);
|
|
measure.addClefAtBegin(currentClef);
|
|
clefAdded = true;
|
|
clefAdded = true;
|
|
@@ -536,8 +521,6 @@ export class MusicSystemBuilder {
|
|
this.activeKeys[visStaffIdx] = <KeyInstruction>abstractNotationInstruction;
|
|
this.activeKeys[visStaffIdx] = <KeyInstruction>abstractNotationInstruction;
|
|
} else if (abstractNotationInstruction instanceof RhythmInstruction) {
|
|
} else if (abstractNotationInstruction instanceof RhythmInstruction) {
|
|
this.activeRhythm[visStaffIdx] = <RhythmInstruction>abstractNotationInstruction;
|
|
this.activeRhythm[visStaffIdx] = <RhythmInstruction>abstractNotationInstruction;
|
|
- } else if (abstractNotationInstruction instanceof StaffLinesInstruction) {
|
|
|
|
- this.activeStafflines[visStaffIdx] = <StaffLinesInstruction>abstractNotationInstruction;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|