|
@@ -22,23 +22,23 @@ import {CollectionUtil} from "../../Util/CollectionUtil";
|
|
|
import {SystemLinePosition} from "./SystemLinePosition";
|
|
|
|
|
|
export class MusicSystemBuilder {
|
|
|
- private measureList: GraphicalMeasure[][];
|
|
|
- private graphicalMusicSheet: GraphicalMusicSheet;
|
|
|
- private currentSystemParams: SystemBuildParameters;
|
|
|
- private numberOfVisibleStaffLines: number;
|
|
|
- private rules: EngravingRules;
|
|
|
- private measureListIndex: number;
|
|
|
- private musicSystems: MusicSystem[] = [];
|
|
|
+ protected measureList: GraphicalMeasure[][];
|
|
|
+ protected graphicalMusicSheet: GraphicalMusicSheet;
|
|
|
+ protected currentSystemParams: SystemBuildParameters;
|
|
|
+ protected numberOfVisibleStaffLines: number;
|
|
|
+ protected rules: EngravingRules;
|
|
|
+ protected measureListIndex: number;
|
|
|
+ protected musicSystems: MusicSystem[] = [];
|
|
|
|
|
|
/**
|
|
|
* Does the mapping from the currently visible staves to the global staff-list of the music sheet.
|
|
|
*/
|
|
|
- private visibleStaffIndices: number[];
|
|
|
- private activeRhythm: RhythmInstruction[];
|
|
|
- private activeKeys: KeyInstruction[];
|
|
|
- private activeClefs: ClefInstruction[];
|
|
|
- private globalSystemIndex: number = 0;
|
|
|
- private leadSheet: boolean = false;
|
|
|
+ protected visibleStaffIndices: number[];
|
|
|
+ protected activeRhythm: RhythmInstruction[];
|
|
|
+ protected activeKeys: KeyInstruction[];
|
|
|
+ protected activeClefs: ClefInstruction[];
|
|
|
+ protected globalSystemIndex: number = 0;
|
|
|
+ protected leadSheet: boolean = false;
|
|
|
|
|
|
public initialize(
|
|
|
graphicalMusicSheet: GraphicalMusicSheet, measureList: GraphicalMeasure[][], numberOfStaffLines: number): void {
|
|
@@ -155,7 +155,7 @@ export class MusicSystemBuilder {
|
|
|
* @param beginInstrWidth
|
|
|
* @param endInstrWidth
|
|
|
*/
|
|
|
- private setMeasureWidth(graphicalMeasures: GraphicalMeasure[], width: number, beginInstrWidth: number, endInstrWidth: number): void {
|
|
|
+ protected setMeasureWidth(graphicalMeasures: GraphicalMeasure[], width: number, beginInstrWidth: number, endInstrWidth: number): void {
|
|
|
for (let idx: number = 0, len: number = graphicalMeasures.length; idx < len; ++idx) {
|
|
|
const measure: GraphicalMeasure = graphicalMeasures[idx];
|
|
|
measure.setWidth(width);
|
|
@@ -174,16 +174,18 @@ export class MusicSystemBuilder {
|
|
|
* @param measures
|
|
|
* @param isPartEndingSystem
|
|
|
*/
|
|
|
- private finalizeCurrentAndCreateNewSystem(measures: GraphicalMeasure[],
|
|
|
- isPartEndingSystem: boolean = false, startNewPage: boolean = false): void {
|
|
|
+ protected finalizeCurrentAndCreateNewSystem(measures: GraphicalMeasure[],
|
|
|
+ isPartEndingSystem: boolean = false, startNewPage: boolean = false): void {
|
|
|
this.currentSystemParams.currentSystem.breaksPage = startNewPage;
|
|
|
this.adaptRepetitionLineWithIfNeeded();
|
|
|
- if (!isPartEndingSystem) {
|
|
|
+ if (measures !== undefined &&
|
|
|
+ !isPartEndingSystem) {
|
|
|
this.checkAndCreateExtraInstructionMeasure(measures);
|
|
|
}
|
|
|
this.stretchMusicSystem(isPartEndingSystem);
|
|
|
this.currentSystemParams = new SystemBuildParameters();
|
|
|
- if (this.measureListIndex < this.measureList.length) {
|
|
|
+ if (measures !== undefined &&
|
|
|
+ this.measureListIndex < this.measureList.length) {
|
|
|
this.currentSystemParams.currentSystem = this.initMusicSystem();
|
|
|
}
|
|
|
}
|
|
@@ -194,7 +196,7 @@ export class MusicSystemBuilder {
|
|
|
* one at the next system.
|
|
|
* (this should be refactored at some point to not use a combined end/start line but always separated lines)
|
|
|
*/
|
|
|
- private adaptRepetitionLineWithIfNeeded(): void {
|
|
|
+ protected adaptRepetitionLineWithIfNeeded(): void {
|
|
|
const systemMeasures: MeasureBuildParameters[] = this.currentSystemParams.systemMeasures;
|
|
|
if (systemMeasures.length >= 1) {
|
|
|
const measures: GraphicalMeasure[] =
|
|
@@ -213,7 +215,7 @@ export class MusicSystemBuilder {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private addMeasureToSystem(
|
|
|
+ protected addMeasureToSystem(
|
|
|
graphicalMeasures: GraphicalMeasure[], measureStartLine: SystemLinesEnum, measureEndLine: SystemLinesEnum,
|
|
|
totalMeasureWidth: number, currentMeasureBeginInstructionsWidth: number, currentVarWidth: number, currentMeasureEndInstructionsWidth: number
|
|
|
): void {
|
|
@@ -232,7 +234,7 @@ export class MusicSystemBuilder {
|
|
|
* Initialize a new [[MusicSystem]].
|
|
|
* @returns {MusicSystem}
|
|
|
*/
|
|
|
- private initMusicSystem(): MusicSystem {
|
|
|
+ protected initMusicSystem(): MusicSystem {
|
|
|
const musicSystem: MusicSystem = MusicSheetCalculator.symbolFactory.createMusicSystem(this.globalSystemIndex++, this.rules);
|
|
|
this.musicSystems.push(musicSystem);
|
|
|
this.layoutSystemStaves(musicSystem);
|
|
@@ -249,12 +251,12 @@ export class MusicSystemBuilder {
|
|
|
* Get the width the system should have for a given page width.
|
|
|
* @returns {number}
|
|
|
*/
|
|
|
- private getFullPageSystemWidth(): number {
|
|
|
+ protected getFullPageSystemWidth(): number {
|
|
|
return this.graphicalMusicSheet.ParentMusicSheet.pageWidth - this.rules.PageLeftMargin
|
|
|
- this.rules.PageRightMargin - this.rules.SystemLeftMargin - this.rules.SystemRightMargin;
|
|
|
}
|
|
|
|
|
|
- private layoutSystemStaves(musicSystem: MusicSystem): void {
|
|
|
+ protected layoutSystemStaves(musicSystem: MusicSystem): void {
|
|
|
const systemWidth: number = this.getFullPageSystemWidth();
|
|
|
const boundingBox: BoundingBox = musicSystem.PositionAndShape;
|
|
|
boundingBox.BorderLeft = 0.0;
|
|
@@ -309,7 +311,7 @@ export class MusicSystemBuilder {
|
|
|
* @param relativeYPosition
|
|
|
* @param staff
|
|
|
*/
|
|
|
- private addStaffLineToMusicSystem(musicSystem: MusicSystem, relativeYPosition: number, staff: Staff): void {
|
|
|
+ protected addStaffLineToMusicSystem(musicSystem: MusicSystem, relativeYPosition: number, staff: Staff): void {
|
|
|
if (musicSystem !== undefined) {
|
|
|
const staffLine: StaffLine = MusicSheetCalculator.symbolFactory.createStaffLine(musicSystem, staff);
|
|
|
musicSystem.StaffLines.push(staffLine);
|
|
@@ -347,7 +349,7 @@ export class MusicSystemBuilder {
|
|
|
* Initialize the active Instructions from the first [[SourceMeasure]] of first [[SourceMusicPart]].
|
|
|
* @param measureList
|
|
|
*/
|
|
|
- private initializeActiveInstructions(measureList: GraphicalMeasure[]): void {
|
|
|
+ protected initializeActiveInstructions(measureList: GraphicalMeasure[]): void {
|
|
|
const firstSourceMeasure: SourceMeasure = this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();
|
|
|
if (firstSourceMeasure !== undefined) {
|
|
|
this.visibleStaffIndices = this.graphicalMusicSheet.getVisibleStavesIndicesFromSourceMeasure(measureList);
|
|
@@ -365,7 +367,7 @@ export class MusicSystemBuilder {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private transposeKeyInstruction(keyInstruction: KeyInstruction, graphicalMeasure: GraphicalMeasure): KeyInstruction {
|
|
|
+ protected transposeKeyInstruction(keyInstruction: KeyInstruction, graphicalMeasure: GraphicalMeasure): KeyInstruction {
|
|
|
if (this.graphicalMusicSheet.ParentMusicSheet.Transpose !== 0
|
|
|
&& graphicalMeasure.ParentStaff.ParentInstrument.MidiInstrumentId !== MidiInstrument.Percussion
|
|
|
&& MusicSheetCalculator.transposeCalculator !== undefined
|
|
@@ -385,7 +387,7 @@ export class MusicSystemBuilder {
|
|
|
* @param isFirstSourceMeasure
|
|
|
* @returns {number}
|
|
|
*/
|
|
|
- private addBeginInstructions(measures: GraphicalMeasure[], isSystemFirstMeasure: boolean, isFirstSourceMeasure: boolean): number {
|
|
|
+ protected addBeginInstructions(measures: GraphicalMeasure[], isSystemFirstMeasure: boolean, isFirstSourceMeasure: boolean): number {
|
|
|
const measureCount: number = measures.length;
|
|
|
if (measureCount === 0) {
|
|
|
return 0;
|
|
@@ -411,7 +413,7 @@ export class MusicSystemBuilder {
|
|
|
* @param measures
|
|
|
* @returns {number}
|
|
|
*/
|
|
|
- private addEndInstructions(measures: GraphicalMeasure[]): number {
|
|
|
+ protected addEndInstructions(measures: GraphicalMeasure[]): number {
|
|
|
const measureCount: number = measures.length;
|
|
|
if (measureCount === 0) {
|
|
|
return 0;
|
|
@@ -428,8 +430,8 @@ export class MusicSystemBuilder {
|
|
|
return totalEndInstructionLengthX;
|
|
|
}
|
|
|
|
|
|
- private AddInstructionsAtMeasureBegin(firstEntry: SourceStaffEntry, measure: GraphicalMeasure,
|
|
|
- visibleStaffIdx: number, isFirstSourceMeasure: boolean, isSystemStartMeasure: boolean): number {
|
|
|
+ protected AddInstructionsAtMeasureBegin(firstEntry: SourceStaffEntry, measure: GraphicalMeasure,
|
|
|
+ visibleStaffIdx: number, isFirstSourceMeasure: boolean, isSystemStartMeasure: boolean): number {
|
|
|
let instructionsLengthX: number = 0;
|
|
|
let currentClef: ClefInstruction = undefined;
|
|
|
let currentKey: KeyInstruction = undefined;
|
|
@@ -485,7 +487,7 @@ export class MusicSystemBuilder {
|
|
|
return instructionsLengthX;
|
|
|
}
|
|
|
|
|
|
- private addInstructionsAtMeasureEnd(lastEntry: SourceStaffEntry, measure: GraphicalMeasure): number {
|
|
|
+ protected addInstructionsAtMeasureEnd(lastEntry: SourceStaffEntry, measure: GraphicalMeasure): number {
|
|
|
if (lastEntry === undefined || lastEntry.Instructions === undefined || lastEntry.Instructions.length === 0) {
|
|
|
return 0;
|
|
|
}
|
|
@@ -506,7 +508,7 @@ export class MusicSystemBuilder {
|
|
|
* @param measure
|
|
|
* @param graphicalMeasures
|
|
|
*/
|
|
|
- private updateActiveClefs(measure: SourceMeasure, graphicalMeasures: GraphicalMeasure[]): void {
|
|
|
+ protected updateActiveClefs(measure: SourceMeasure, graphicalMeasures: GraphicalMeasure[]): void {
|
|
|
for (let visStaffIdx: number = 0, len: number = graphicalMeasures.length; visStaffIdx < len; visStaffIdx++) {
|
|
|
const staffIndex: number = this.visibleStaffIndices[visStaffIdx];
|
|
|
const firstEntry: SourceStaffEntry = measure.FirstInstructionsStaffEntries[staffIndex];
|
|
@@ -551,7 +553,7 @@ export class MusicSystemBuilder {
|
|
|
* Check if an extra Instruction [[Measure]] is needed.
|
|
|
* @param measures
|
|
|
*/
|
|
|
- private checkAndCreateExtraInstructionMeasure(measures: GraphicalMeasure[]): void {
|
|
|
+ protected checkAndCreateExtraInstructionMeasure(measures: GraphicalMeasure[]): void {
|
|
|
const firstStaffEntries: SourceStaffEntry[] = measures[0].parentSourceMeasure.FirstInstructionsStaffEntries;
|
|
|
const visibleInstructionEntries: SourceStaffEntry[] = [];
|
|
|
for (let idx: number = 0, len: number = measures.length; idx < len; ++idx) {
|
|
@@ -591,7 +593,7 @@ export class MusicSystemBuilder {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private addExtraInstructionMeasure(visStaffIdx: number, keyInstruction: KeyInstruction, rhythmInstruction: RhythmInstruction): number {
|
|
|
+ protected addExtraInstructionMeasure(visStaffIdx: number, keyInstruction: KeyInstruction, rhythmInstruction: RhythmInstruction): number {
|
|
|
const currentSystem: MusicSystem = this.currentSystemParams.currentSystem;
|
|
|
const measures: GraphicalMeasure[] = [];
|
|
|
const measure: GraphicalMeasure = MusicSheetCalculator.symbolFactory.createExtraGraphicalMeasure(currentSystem.StaffLines[visStaffIdx]);
|
|
@@ -615,7 +617,7 @@ export class MusicSystemBuilder {
|
|
|
* Add all current vertical Measures to currentSystem.
|
|
|
* @param graphicalMeasures
|
|
|
*/
|
|
|
- private addStaveMeasuresToSystem(graphicalMeasures: GraphicalMeasure[]): void {
|
|
|
+ protected addStaveMeasuresToSystem(graphicalMeasures: GraphicalMeasure[]): void {
|
|
|
if (graphicalMeasures[0] !== undefined) {
|
|
|
const gmeasures: GraphicalMeasure[] = [];
|
|
|
for (let i: number = 0; i < graphicalMeasures.length; i++) {
|
|
@@ -635,7 +637,7 @@ export class MusicSystemBuilder {
|
|
|
* Return the width of the corresponding [[SystemLine]] and set the corresponding [[SystemLineEnum]].
|
|
|
* @returns {SystemLinesEnum}
|
|
|
*/
|
|
|
- private getMeasureStartLine(): SystemLinesEnum {
|
|
|
+ protected getMeasureStartLine(): SystemLinesEnum {
|
|
|
const thisMeasureBeginsLineRep: boolean = this.thisMeasureBeginsLineRepetition();
|
|
|
if (thisMeasureBeginsLineRep) {
|
|
|
const isSystemStartMeasure: boolean = this.currentSystemParams.IsSystemStartMeasure();
|
|
@@ -650,7 +652,7 @@ export class MusicSystemBuilder {
|
|
|
return SystemLinesEnum.None;
|
|
|
}
|
|
|
|
|
|
- private getMeasureEndLine(): SystemLinesEnum {
|
|
|
+ protected getMeasureEndLine(): SystemLinesEnum {
|
|
|
let sourceMeasure: SourceMeasure = undefined;
|
|
|
try {
|
|
|
sourceMeasure = this.measureList[this.measureListIndex][0].parentSourceMeasure;
|
|
@@ -690,7 +692,7 @@ export class MusicSystemBuilder {
|
|
|
* @param isSystemStartMeasure
|
|
|
* @returns {number}
|
|
|
*/
|
|
|
- private getLineWidth(measure: GraphicalMeasure, systemLineEnum: SystemLinesEnum, isSystemStartMeasure: boolean): number {
|
|
|
+ protected getLineWidth(measure: GraphicalMeasure, systemLineEnum: SystemLinesEnum, isSystemStartMeasure: boolean): number {
|
|
|
let width: number = measure.getLineWidth(systemLineEnum);
|
|
|
if (systemLineEnum === SystemLinesEnum.DotsBoldBoldDots) {
|
|
|
width /= 2;
|
|
@@ -701,7 +703,7 @@ export class MusicSystemBuilder {
|
|
|
return width;
|
|
|
}
|
|
|
|
|
|
- private previousMeasureEndsLineRepetition(): boolean {
|
|
|
+ protected previousMeasureEndsLineRepetition(): boolean {
|
|
|
if (this.measureListIndex === 0) {
|
|
|
return false;
|
|
|
}
|
|
@@ -718,7 +720,7 @@ export class MusicSystemBuilder {
|
|
|
* Check if at this [[Measure]] starts a [[Repetition]].
|
|
|
* @returns {boolean}
|
|
|
*/
|
|
|
- private thisMeasureBeginsLineRepetition(): boolean {
|
|
|
+ protected thisMeasureBeginsLineRepetition(): boolean {
|
|
|
for (let idx: number = 0, len: number = this.measureList[this.measureListIndex].length; idx < len; ++idx) {
|
|
|
const measure: GraphicalMeasure = this.measureList[this.measureListIndex][idx];
|
|
|
if (measure.beginsWithLineRepetition()) {
|
|
@@ -732,7 +734,7 @@ export class MusicSystemBuilder {
|
|
|
* Check if a [[Repetition]] starts at the next [[Measure]].
|
|
|
* @returns {boolean}
|
|
|
*/
|
|
|
- private nextMeasureBeginsLineRepetition(): boolean {
|
|
|
+ protected nextMeasureBeginsLineRepetition(): boolean {
|
|
|
const nextMeasureIndex: number = this.measureListIndex + 1;
|
|
|
if (nextMeasureIndex >= this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length
|
|
|
|| !this.measureList[nextMeasureIndex]) {
|
|
@@ -751,7 +753,7 @@ export class MusicSystemBuilder {
|
|
|
* Check if this [[Measure]] is a [[Repetition]] ending.
|
|
|
* @returns {boolean}
|
|
|
*/
|
|
|
- private thisMeasureEndsLineRepetition(): boolean {
|
|
|
+ protected thisMeasureEndsLineRepetition(): boolean {
|
|
|
for (let idx: number = 0, len: number = this.measureList[this.measureListIndex].length; idx < len; ++idx) {
|
|
|
const measure: GraphicalMeasure = this.measureList[this.measureListIndex][idx];
|
|
|
if (measure.endsWithLineRepetition()) {
|
|
@@ -765,7 +767,7 @@ export class MusicSystemBuilder {
|
|
|
* Check if a [[Repetition]] starts at the next [[Measure]].
|
|
|
* @returns {boolean}
|
|
|
*/
|
|
|
- private nextMeasureBeginsWordRepetition(): boolean {
|
|
|
+ protected nextMeasureBeginsWordRepetition(): boolean {
|
|
|
const nextMeasureIndex: number = this.measureListIndex + 1;
|
|
|
if (nextMeasureIndex >= this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length ||
|
|
|
nextMeasureIndex > this.measureList.length - 1) {
|
|
@@ -784,7 +786,7 @@ export class MusicSystemBuilder {
|
|
|
* Check if this [[Measure]] is a [[Repetition]] ending.
|
|
|
* @returns {boolean}
|
|
|
*/
|
|
|
- private thisMeasureEndsWordRepetition(): boolean {
|
|
|
+ protected thisMeasureEndsWordRepetition(): boolean {
|
|
|
for (let idx: number = 0, len: number = this.measureList[this.measureListIndex].length; idx < len; ++idx) {
|
|
|
const measure: GraphicalMeasure = this.measureList[this.measureListIndex][idx];
|
|
|
if (measure.endsWithWordRepetition()) {
|
|
@@ -798,11 +800,11 @@ export class MusicSystemBuilder {
|
|
|
* Check if the next [[Measure]] has a [[KeyInstruction]] change.
|
|
|
* @returns {boolean}
|
|
|
*/
|
|
|
- private nextMeasureHasKeyInstructionChange(): boolean {
|
|
|
+ protected nextMeasureHasKeyInstructionChange(): boolean {
|
|
|
return this.getNextMeasureKeyInstruction() !== undefined;
|
|
|
}
|
|
|
|
|
|
- private getNextMeasureKeyInstruction(): KeyInstruction {
|
|
|
+ protected getNextMeasureKeyInstruction(): KeyInstruction {
|
|
|
if (this.measureListIndex < this.measureList.length - 1) {
|
|
|
for (let visIndex: number = 0; visIndex < this.measureList[this.measureListIndex].length; visIndex++) {
|
|
|
const sourceMeasure: SourceMeasure = this.measureList[this.measureListIndex + 1][visIndex].parentSourceMeasure;
|
|
@@ -821,7 +823,7 @@ export class MusicSystemBuilder {
|
|
|
* @param systemVarWidth
|
|
|
* @returns {number}
|
|
|
*/
|
|
|
- private calculateXScalingFactor(systemFixWidth: number, systemVarWidth: number): number {
|
|
|
+ protected calculateXScalingFactor(systemFixWidth: number, systemVarWidth: number): number {
|
|
|
if (Math.abs(systemVarWidth - 0) < 0.00001 || Math.abs(systemFixWidth - 0) < 0.00001) {
|
|
|
return 1.0;
|
|
|
}
|
|
@@ -836,7 +838,7 @@ export class MusicSystemBuilder {
|
|
|
* Stretch the whole System so that no white space is left at the end.
|
|
|
* @param isPartEndingSystem
|
|
|
*/
|
|
|
- private stretchMusicSystem(isPartEndingSystem: boolean): void {
|
|
|
+ protected stretchMusicSystem(isPartEndingSystem: boolean): void {
|
|
|
let scalingFactor: number = this.calculateXScalingFactor(
|
|
|
this.currentSystemParams.currentSystemFixWidth, this.currentSystemParams.currentSystemVarWidth
|
|
|
);
|
|
@@ -894,7 +896,7 @@ export class MusicSystemBuilder {
|
|
|
* If the last [[MusicSystem]] doesn't need stretching, then this method decreases the System's Width,
|
|
|
* the [[StaffLine]]'s Width and the 5 [[StaffLine]]s length.
|
|
|
*/
|
|
|
- private decreaseMusicSystemBorders(): void {
|
|
|
+ protected decreaseMusicSystemBorders(): void {
|
|
|
const currentSystem: MusicSystem = this.currentSystemParams.currentSystem;
|
|
|
const bb: BoundingBox = CollectionUtil.last(currentSystem.StaffLines[0].Measures).PositionAndShape;
|
|
|
const width: number = bb.RelativePosition.x + bb.Size.width;
|
|
@@ -913,7 +915,7 @@ export class MusicSystemBuilder {
|
|
|
* This method checks the distances between any two consecutive StaffLines of a System and if needed, shifts the lower one down.
|
|
|
* @param musicSystem
|
|
|
*/
|
|
|
- private optimizeDistanceBetweenStaffLines(musicSystem: MusicSystem): void {
|
|
|
+ protected optimizeDistanceBetweenStaffLines(musicSystem: MusicSystem): void {
|
|
|
// don't perform any y-spacing in case of a StaffEntryLink (in both StaffLines)
|
|
|
if (!musicSystem.checkStaffEntriesForStaffEntryLink()) {
|
|
|
for (let i: number = 0; i < musicSystem.StaffLines.length - 1; i++) {
|
|
@@ -940,7 +942,7 @@ export class MusicSystemBuilder {
|
|
|
* @param index
|
|
|
* @param value
|
|
|
*/
|
|
|
- private updateStaffLinesRelativePosition(musicSystem: MusicSystem, index: number, value: number): void {
|
|
|
+ protected updateStaffLinesRelativePosition(musicSystem: MusicSystem, index: number, value: number): void {
|
|
|
for (let i: number = index; i < musicSystem.StaffLines.length; i++) {
|
|
|
musicSystem.StaffLines[i].PositionAndShape.RelativePosition.y += value;
|
|
|
}
|
|
@@ -953,7 +955,7 @@ export class MusicSystemBuilder {
|
|
|
* (for now only one long page is used per music sheet, as we scroll down and have no page flips)
|
|
|
* @returns {GraphicalMusicPage}
|
|
|
*/
|
|
|
- private createMusicPage(): GraphicalMusicPage {
|
|
|
+ protected createMusicPage(): GraphicalMusicPage {
|
|
|
const page: GraphicalMusicPage = new GraphicalMusicPage(this.graphicalMusicSheet);
|
|
|
this.graphicalMusicSheet.MusicPages.push(page);
|
|
|
page.PageNumber = this.graphicalMusicSheet.MusicPages.length; // caution: page number = page index + 1
|
|
@@ -965,7 +967,7 @@ export class MusicSystemBuilder {
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
- private addSystemToPage(page: GraphicalMusicPage, system: MusicSystem): void {
|
|
|
+ protected addSystemToPage(page: GraphicalMusicPage, system: MusicSystem): void {
|
|
|
page.MusicSystems.push(system);
|
|
|
system.Parent = page;
|
|
|
}
|
|
@@ -973,7 +975,7 @@ export class MusicSystemBuilder {
|
|
|
/** Calculates the relative Positions of all MusicSystems.
|
|
|
*
|
|
|
*/
|
|
|
- private calculateMusicSystemsRelativePositions(): void {
|
|
|
+ protected calculateMusicSystemsRelativePositions(): void {
|
|
|
let currentPage: GraphicalMusicPage = this.createMusicPage();
|
|
|
let currentYPosition: number = 0;
|
|
|
// xPosition is always fixed
|