|
@@ -10,15 +10,10 @@ import { IUserDisplayInteractionListener } from "../Common/Interfaces/IUserDispl
|
|
import { PlaybackManager } from "../Playback";
|
|
import { PlaybackManager } from "../Playback";
|
|
|
|
|
|
export class SheetRenderingManager extends AbstractZoomView implements IZoomView {
|
|
export class SheetRenderingManager extends AbstractZoomView implements IZoomView {
|
|
- // protected phonicScoreInterface: IPhonicScoreInterface; // TODO MB: remove this
|
|
|
|
protected musicSheetDrawer: MusicSheetDrawer;
|
|
protected musicSheetDrawer: MusicSheetDrawer;
|
|
protected graphicalMusicSheet: GraphicalMusicSheet;
|
|
protected graphicalMusicSheet: GraphicalMusicSheet;
|
|
protected mainViewingRegion: ScreenViewingRegion = ScreenViewingRegion.createWithDefaults();
|
|
protected mainViewingRegion: ScreenViewingRegion = ScreenViewingRegion.createWithDefaults();
|
|
- // protected display: IMusicSheetDisplay;
|
|
|
|
- // protected renderingFinished: EventWaitHandle = new EventWaitHandle(true, EventResetMode.ManualReset);
|
|
|
|
- // protected newRedrawWanted: EventWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset);
|
|
|
|
protected tryAgainToRenderCount: number = 0;
|
|
protected tryAgainToRenderCount: number = 0;
|
|
- //private toImageMusicSheetDrawer: MusicSheetDrawer;
|
|
|
|
private yOffsetMouseDown: number = Number.MIN_VALUE;
|
|
private yOffsetMouseDown: number = Number.MIN_VALUE;
|
|
private unlockCursorDistancePixel: number = 50.0;
|
|
private unlockCursorDistancePixel: number = 50.0;
|
|
private relativeTopPosition: number = 0.06;
|
|
private relativeTopPosition: number = 0.06;
|
|
@@ -35,16 +30,6 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
this.lockRanges = true;
|
|
this.lockRanges = true;
|
|
this.TopBarHeightInPixel = 70;
|
|
this.TopBarHeightInPixel = 70;
|
|
this.BottomBarHeightInPixel = 0;
|
|
this.BottomBarHeightInPixel = 0;
|
|
- // this.phonicScoreInterface = phonicScoreInterface;
|
|
|
|
- // this.display = display;
|
|
|
|
- // this.musicSheetDrawer =
|
|
|
|
- // new PsMusicSheetDrawer(phonicScoreInterface, display.Renderer, display.Renderer, FontInfo.Info, false, phonicScoreInterface.HasSoundOutput);
|
|
|
|
- // this.toImageMusicSheetDrawer =
|
|
|
|
- // new PsMusicSheetDrawer(phonicScoreInterface, display.PreviewImageRenderer, display.PreviewImageRenderer, FontInfo.Info, true, false);
|
|
|
|
- //this.toImageMusicSheetDrawer.splitScreenLineColor = -1;
|
|
|
|
- // TODO MB: Commented following 2 lines because paintingThreadLoop is to be removed. Do we need to convert this somehow?
|
|
|
|
- // const redrawPreparationThread: Task = new Task(this.paintingThreadLoop);
|
|
|
|
- // redrawPreparationThread.Start();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public addListener(listener: IUserDisplayInteractionListener): void {
|
|
public addListener(listener: IUserDisplayInteractionListener): void {
|
|
@@ -58,8 +43,6 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
return this.graphicalMusicSheet !== undefined;
|
|
return this.graphicalMusicSheet !== undefined;
|
|
}
|
|
}
|
|
protected unitPosTouched(PosInUnits: PointF2D, relPosX: number, relPosY: number): void {
|
|
protected unitPosTouched(PosInUnits: PointF2D, relPosX: number, relPosY: number): void {
|
|
- // lock(this.mainViewingRegion)
|
|
|
|
- // {
|
|
|
|
// Pass mouse click to click listener
|
|
// Pass mouse click to click listener
|
|
if (!this.SingleTouchDisabled) {
|
|
if (!this.SingleTouchDisabled) {
|
|
const relPos: PointF2D = new PointF2D(relPosX, relPosY);
|
|
const relPos: PointF2D = new PointF2D(relPosX, relPosY);
|
|
@@ -68,11 +51,8 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
listener.userDisplayInteraction(relPos, PosInUnits, InteractionType.SingleTouch);
|
|
listener.userDisplayInteraction(relPos, PosInUnits, InteractionType.SingleTouch);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // }
|
|
|
|
}
|
|
}
|
|
protected unitPosDoubleTouched(PosInUnits: PointF2D, relPosX: number, relPosY: number): void {
|
|
protected unitPosDoubleTouched(PosInUnits: PointF2D, relPosX: number, relPosY: number): void {
|
|
- // lock(this.mainViewingRegion)
|
|
|
|
- // {
|
|
|
|
if (!this.DoubleTouchDisabled) {
|
|
if (!this.DoubleTouchDisabled) {
|
|
const relPos: PointF2D = new PointF2D(relPosX, relPosY);
|
|
const relPos: PointF2D = new PointF2D(relPosX, relPosY);
|
|
this.handleUserDisplayInteraction(relPos, PosInUnits, InteractionType.DoubleTouch);
|
|
this.handleUserDisplayInteraction(relPos, PosInUnits, InteractionType.DoubleTouch);
|
|
@@ -80,22 +60,16 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
listener.userDisplayInteraction(relPos, PosInUnits, InteractionType.DoubleTouch);
|
|
listener.userDisplayInteraction(relPos, PosInUnits, InteractionType.DoubleTouch);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // }
|
|
|
|
}
|
|
}
|
|
protected unitPosTouchDown(PosInUnits: PointF2D, relPosX: number, relPosY: number): void {
|
|
protected unitPosTouchDown(PosInUnits: PointF2D, relPosX: number, relPosY: number): void {
|
|
- // lock(this.mainViewingRegion)
|
|
|
|
- // {
|
|
|
|
const relPos: PointF2D = new PointF2D(relPosX, relPosY);
|
|
const relPos: PointF2D = new PointF2D(relPosX, relPosY);
|
|
this.handleUserDisplayInteraction(relPos, PosInUnits, InteractionType.TouchDown);
|
|
this.handleUserDisplayInteraction(relPos, PosInUnits, InteractionType.TouchDown);
|
|
for (const listener of this.listeners) {
|
|
for (const listener of this.listeners) {
|
|
listener.userDisplayInteraction(new PointF2D(relPosX, relPosY), PosInUnits, InteractionType.TouchDown);
|
|
listener.userDisplayInteraction(new PointF2D(relPosX, relPosY), PosInUnits, InteractionType.TouchDown);
|
|
}
|
|
}
|
|
this.yOffsetMouseDown = PosInUnits.y;
|
|
this.yOffsetMouseDown = PosInUnits.y;
|
|
- // }
|
|
|
|
}
|
|
}
|
|
protected unitPosTouchUp(PosInUnits: PointF2D, relPosX: number, relPosY: number): void {
|
|
protected unitPosTouchUp(PosInUnits: PointF2D, relPosX: number, relPosY: number): void {
|
|
- // lock(this.mainViewingRegion)
|
|
|
|
- // {
|
|
|
|
const relPos: PointF2D = new PointF2D(relPosX, relPosY);
|
|
const relPos: PointF2D = new PointF2D(relPosX, relPosY);
|
|
this.handleUserDisplayInteraction(relPos, PosInUnits, InteractionType.TouchUp);
|
|
this.handleUserDisplayInteraction(relPos, PosInUnits, InteractionType.TouchUp);
|
|
for (const listener of this.listeners) {
|
|
for (const listener of this.listeners) {
|
|
@@ -105,18 +79,14 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
this.unlockFromCursorIfNecessary(PosInUnits);
|
|
this.unlockFromCursorIfNecessary(PosInUnits);
|
|
}
|
|
}
|
|
this.yOffsetMouseDown = Number.MIN_VALUE;
|
|
this.yOffsetMouseDown = Number.MIN_VALUE;
|
|
- // }
|
|
|
|
}
|
|
}
|
|
protected unitPosMove(PosInUnits: PointF2D, relPosX: number, relPosY: number): void {
|
|
protected unitPosMove(PosInUnits: PointF2D, relPosX: number, relPosY: number): void {
|
|
- // lock(this.mainViewingRegion)
|
|
|
|
- // {
|
|
|
|
const relPos: PointF2D = new PointF2D(relPosX, relPosY);
|
|
const relPos: PointF2D = new PointF2D(relPosX, relPosY);
|
|
this.handleUserDisplayInteraction(relPos, PosInUnits, InteractionType.Move);
|
|
this.handleUserDisplayInteraction(relPos, PosInUnits, InteractionType.Move);
|
|
for (const listener of this.listeners) {
|
|
for (const listener of this.listeners) {
|
|
listener.userDisplayInteraction(new PointF2D(relPosX, relPosY), PosInUnits, InteractionType.Move);
|
|
listener.userDisplayInteraction(new PointF2D(relPosX, relPosY), PosInUnits, InteractionType.Move);
|
|
}
|
|
}
|
|
this.unlockFromCursorIfNecessary(PosInUnits);
|
|
this.unlockFromCursorIfNecessary(PosInUnits);
|
|
- // }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public get MainViewingRegion(): ScreenViewingRegion {
|
|
public get MainViewingRegion(): ScreenViewingRegion {
|
|
@@ -124,28 +94,16 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
}
|
|
}
|
|
public TopBarHeightInPixel: number;
|
|
public TopBarHeightInPixel: number;
|
|
public BottomBarHeightInPixel: number;
|
|
public BottomBarHeightInPixel: number;
|
|
- // public setRenderers(windowRenderer: IMusicSheetRenderer, previewRenderer: IImageRenderer): void {
|
|
|
|
- // this.musicSheetDrawer.setRenderer(windowRenderer);
|
|
|
|
- // this.toImageMusicSheetDrawer.setRenderer(previewRenderer);
|
|
|
|
- // }
|
|
|
|
public setMusicSheet(musicSheet: GraphicalMusicSheet): void {
|
|
public setMusicSheet(musicSheet: GraphicalMusicSheet): void {
|
|
- // this.musicSheetDrawer.disposeAllBackbuffers();
|
|
|
|
this.graphicalMusicSheet = musicSheet;
|
|
this.graphicalMusicSheet = musicSheet;
|
|
this.adaptDisplayLimitsToSheet();
|
|
this.adaptDisplayLimitsToSheet();
|
|
- // this.setYOffset(
|
|
|
|
- // EngravingRules.Rules.TitleTopDistance - this.topBarHeightInUnits() - this.relativeTopPosition * this.heightWithoutTopBottomBarsInUnits(),
|
|
|
|
- // true);
|
|
|
|
this.setYOffset(0, true);
|
|
this.setYOffset(0, true);
|
|
- // this.redraw();
|
|
|
|
}
|
|
}
|
|
public viewportXChanged(offsetX: number, rangeX: number): void {
|
|
public viewportXChanged(offsetX: number, rangeX: number): void {
|
|
if (this.graphicalMusicSheet === undefined) {
|
|
if (this.graphicalMusicSheet === undefined) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- // lock(this.mainViewingRegion)
|
|
|
|
- // {
|
|
|
|
this.horizontalViewportChanged(offsetX, rangeX);
|
|
this.horizontalViewportChanged(offsetX, rangeX);
|
|
- // }
|
|
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* Sets the vertical position and viewing height of the displayed area on the music score.
|
|
* Sets the vertical position and viewing height of the displayed area on the music score.
|
|
@@ -157,28 +115,18 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
if (this.yOffsetMouseDown <= Number.MIN_VALUE + 0.5) {
|
|
if (this.yOffsetMouseDown <= Number.MIN_VALUE + 0.5) {
|
|
this.yOffsetMouseDown = offsetY;
|
|
this.yOffsetMouseDown = offsetY;
|
|
}
|
|
}
|
|
- // lock(this.mainViewingRegion)
|
|
|
|
- // {
|
|
|
|
this.verticalViewportChanged(offsetY, rangeY);
|
|
this.verticalViewportChanged(offsetY, rangeY);
|
|
- // }
|
|
|
|
}
|
|
}
|
|
public displaySizeChanged(width: number, height: number): void {
|
|
public displaySizeChanged(width: number, height: number): void {
|
|
super.viewSizeChanged(width, height);
|
|
super.viewSizeChanged(width, height);
|
|
- //TODO: Don't think we need these for web?
|
|
|
|
- //this.TopBarHeightInPixel = topBarHeightInPixel;
|
|
|
|
- //this.BottomBarHeightInPixel = bottomBarHeightInPixel;
|
|
|
|
- // this.musicSheetDrawer.disposeAllBackbuffers();
|
|
|
|
if (Math.abs(width - 0) < 0.0000001 || Math.abs(height - 0) < 0.0000001) {
|
|
if (Math.abs(width - 0) < 0.0000001 || Math.abs(height - 0) < 0.0000001) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- // lock(this.mainViewingRegion)
|
|
|
|
- // {
|
|
|
|
if (this.graphicalMusicSheet !== undefined) {
|
|
if (this.graphicalMusicSheet !== undefined) {
|
|
this.graphicalMusicSheet.EnforceRedrawOfMusicSystems(); // probably not necessary, already handled by OSMD
|
|
this.graphicalMusicSheet.EnforceRedrawOfMusicSystems(); // probably not necessary, already handled by OSMD
|
|
}
|
|
}
|
|
this.mainViewingRegion.DisplaySizeInPixel = new SizeF2D (width, height);
|
|
this.mainViewingRegion.DisplaySizeInPixel = new SizeF2D (width, height);
|
|
this.adaptDisplayLimitsToSheet();
|
|
this.adaptDisplayLimitsToSheet();
|
|
- // }
|
|
|
|
}
|
|
}
|
|
public calcDisplayYPosition(system: MusicSystem): number {
|
|
public calcDisplayYPosition(system: MusicSystem): number {
|
|
return system.PositionAndShape.AbsolutePosition.y + system.PositionAndShape.BorderMarginTop -
|
|
return system.PositionAndShape.AbsolutePosition.y + system.PositionAndShape.BorderMarginTop -
|
|
@@ -196,51 +144,17 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
system: MusicSystem, resetOccurred: boolean, smoothAnimation: boolean): void {
|
|
system: MusicSystem, resetOccurred: boolean, smoothAnimation: boolean): void {
|
|
const positionY: number = this.calcDisplayYPosition(system);
|
|
const positionY: number = this.calcDisplayYPosition(system);
|
|
this.setYPosition(positionY, smoothAnimation);
|
|
this.setYPosition(positionY, smoothAnimation);
|
|
- // this.redraw();
|
|
|
|
}
|
|
}
|
|
public setXPosition(positionXInUnits: number, animated: boolean): void {
|
|
public setXPosition(positionXInUnits: number, animated: boolean): void {
|
|
- // lock(this.mainViewingRegion)
|
|
|
|
- // {
|
|
|
|
if (this.LockDisplayToCursor) {
|
|
if (this.LockDisplayToCursor) {
|
|
this.setXOffset(positionXInUnits, animated);
|
|
this.setXOffset(positionXInUnits, animated);
|
|
}
|
|
}
|
|
- // }
|
|
|
|
}
|
|
}
|
|
public setYPosition(positionYInUnits: number, animated: boolean): void {
|
|
public setYPosition(positionYInUnits: number, animated: boolean): void {
|
|
- // lock(this.mainViewingRegion)
|
|
|
|
- // {
|
|
|
|
if (this.LockDisplayToCursor) {
|
|
if (this.LockDisplayToCursor) {
|
|
this.setYOffset(positionYInUnits, animated);
|
|
this.setYOffset(positionYInUnits, animated);
|
|
}
|
|
}
|
|
- // }
|
|
|
|
- }
|
|
|
|
- public clearBackbuffers(): void {
|
|
|
|
- // this.musicSheetDrawer.disposeAllBackbuffers();
|
|
|
|
- }
|
|
|
|
- // public redraw(): void {
|
|
|
|
- // this.newRedrawWanted.Set();
|
|
|
|
- // }
|
|
|
|
- // public render(): void {
|
|
|
|
- // // lock(this.display.Renderer)
|
|
|
|
- // // {
|
|
|
|
- // try {
|
|
|
|
- // this.display.Renderer.prepareDrawing();
|
|
|
|
- // this.display.Renderer.draw();
|
|
|
|
- // } catch (ex) {
|
|
|
|
- // log.error("SheetRenderingManager.render", "Renderer PrepareDrawing or draw", ex);
|
|
|
|
- // throw ex;
|
|
|
|
- // } finally {
|
|
|
|
- // try {
|
|
|
|
- // this.display.Renderer.finalizeDrawing();
|
|
|
|
- // } catch (ex) {
|
|
|
|
- // log.error("SheetRenderingManager.render", "Renderer FinalizeDrawing", ex);
|
|
|
|
- // throw ex;
|
|
|
|
- // } finally {
|
|
|
|
- // this.renderingFinished.Set();
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // // }
|
|
|
|
- // }
|
|
|
|
|
|
+ }
|
|
public get DrawingParameters(): DrawingParameters {
|
|
public get DrawingParameters(): DrawingParameters {
|
|
return this.musicSheetDrawer.drawingParameters;
|
|
return this.musicSheetDrawer.drawingParameters;
|
|
}
|
|
}
|
|
@@ -257,21 +171,12 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
return (this.mainViewingRegion.ViewRegionInUnits.height - this.topBarHeightInUnits() - this.bottomBarHeightInUnits()) *
|
|
return (this.mainViewingRegion.ViewRegionInUnits.height - this.topBarHeightInUnits() - this.bottomBarHeightInUnits()) *
|
|
(1 - 2 * this.relativeTopPosition);
|
|
(1 - 2 * this.relativeTopPosition);
|
|
}
|
|
}
|
|
- // public freeMemory(): void {
|
|
|
|
- // this.display.Renderer.freeMemory();
|
|
|
|
- // }
|
|
|
|
- // public Dispose(): void {
|
|
|
|
- // super.dispose();
|
|
|
|
- // }
|
|
|
|
public getClickPosition(relativePositionX: number, relativePositionY: number): PointF2D {
|
|
public getClickPosition(relativePositionX: number, relativePositionY: number): PointF2D {
|
|
return this.mainViewingRegion.transformToUnitCoordinates(new PointF2D(relativePositionX, relativePositionY));
|
|
return this.mainViewingRegion.transformToUnitCoordinates(new PointF2D(relativePositionX, relativePositionY));
|
|
}
|
|
}
|
|
public graphicalObjectIsVisible(boundingBox: BoundingBox): boolean {
|
|
public graphicalObjectIsVisible(boundingBox: BoundingBox): boolean {
|
|
const isCompletelyInside: boolean = false;
|
|
const isCompletelyInside: boolean = false;
|
|
- // lock(this.mainViewingRegion)
|
|
|
|
- // {
|
|
|
|
return this.mainViewingRegion.isVisible(boundingBox, isCompletelyInside);
|
|
return this.mainViewingRegion.isVisible(boundingBox, isCompletelyInside);
|
|
- // }
|
|
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* sets the size of the maximal musicpage seen including the extensions on top resp. bottom
|
|
* sets the size of the maximal musicpage seen including the extensions on top resp. bottom
|
|
@@ -298,7 +203,6 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
protected horizontalViewportChanged(offsetX: number, rangeX: number): void {
|
|
protected horizontalViewportChanged(offsetX: number, rangeX: number): void {
|
|
if (this.mainViewingRegion.WidthInUnits !== rangeX) {
|
|
if (this.mainViewingRegion.WidthInUnits !== rangeX) {
|
|
this.mainViewingRegion.WidthInUnits = rangeX;
|
|
this.mainViewingRegion.WidthInUnits = rangeX;
|
|
- // this.redraw();
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -320,7 +224,6 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
this.mainViewingRegion.RegionSizeInPixel.height /
|
|
this.mainViewingRegion.RegionSizeInPixel.height /
|
|
this.mainViewingRegion.ViewRegionInUnits.height);
|
|
this.mainViewingRegion.ViewRegionInUnits.height);
|
|
if (ydiff > this.unlockCursorDistancePixel) {
|
|
if (ydiff > this.unlockCursorDistancePixel) {
|
|
- // this.phonicScoreInterface.requestLockDisplayToCursor(false);
|
|
|
|
this.LockDisplayToCursor = false;
|
|
this.LockDisplayToCursor = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -335,210 +238,30 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
case InteractionType.TouchDown:
|
|
case InteractionType.TouchDown:
|
|
case InteractionType.SingleTouch:
|
|
case InteractionType.SingleTouch:
|
|
case InteractionType.DoubleTouch: {
|
|
case InteractionType.DoubleTouch: {
|
|
- // switch (this.Tool) {
|
|
|
|
- // case PsTool.None: {
|
|
|
|
- // if (this.graphicalMusicSheet === undefined || this.renderingManager.TouchMoving) {
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // // check for activity symbol clicked
|
|
|
|
- // if (positionOnMusicSheet.x < 10) {
|
|
|
|
- // const activitySymbol: StaffLineActivitySymbol =
|
|
|
|
- // this.graphicalMusicSheet.getClickedObject<StaffLineActivitySymbol>(positionOnMusicSheet);
|
|
|
|
- // if (activitySymbol !== undefined) {
|
|
|
|
- // const instrument: Instrument = activitySymbol.parentStaffLine.ParentStaff.ParentInstrument;
|
|
|
|
- // switch (this.Mode) {
|
|
|
|
- // case PsMode.Following: {
|
|
|
|
- // // KeyValuePair<int, bool> parameters = new KeyValuePair<int, bool>(
|
|
|
|
- // // activitySymbol.ParentStaffLine.ParentStaff.Id,
|
|
|
|
- // // !activitySymbol.ParentStaffLine.ParentStaff.Following
|
|
|
|
- // // );
|
|
|
|
- // instrument.setInstrumentParameter(
|
|
|
|
- // InstrumentParameters.Follow,
|
|
|
|
- // !activitySymbol.parentStaffLine.ParentStaff.following
|
|
|
|
- // );
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // case PsMode.Midi: {
|
|
|
|
- // if (this.PitchMonitorEnabled) {
|
|
|
|
- // const pitchMonitorEnabled: boolean = !activitySymbol.parentStaffLine.ParentStaff.PitchMonitor;
|
|
|
|
- // //KeyValuePair<int, bool> parameters = new KeyValuePair<int, bool>(
|
|
|
|
- // // activitySymbol.ParentStaffLine.ParentStaff.Id,
|
|
|
|
- // // !activitySymbol.ParentStaffLine.ParentStaff.PitchMonitor);
|
|
|
|
- // instrument.setInstrumentParameter(InstrumentParameters.PitchMonitor, pitchMonitorEnabled);
|
|
|
|
-
|
|
|
|
- // //if (pitchMonitorEnabled) {
|
|
|
|
- // // // switch off all other instruments so that only one will be active
|
|
|
|
- // // foreach (var instr in this.graphicalMusicSheet.ParentMusicSheet.Instruments) {
|
|
|
|
- // // if (instr != instrument) {
|
|
|
|
- // // instr.setInstrumentParameter(InstrumentParameters.PitchMonitor, false);
|
|
|
|
- // // }
|
|
|
|
- // // }
|
|
|
|
- // // }
|
|
|
|
- // }
|
|
|
|
- // else {
|
|
|
|
- // KeyValuePair < int, bool > parameters = new KeyValuePair<int, bool>(
|
|
|
|
- // activitySymbol.ParentStaffLine.ParentStaff.Id,
|
|
|
|
- // !activitySymbol.ParentStaffLine.ParentStaff.Audible
|
|
|
|
- // );
|
|
|
|
- // instrument.setInstrumentParameter(InstrumentParameters.StaffAudible, parameters);
|
|
|
|
- // }
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // default:
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
const clickVe: GraphicalVoiceEntry = this.graphicalMusicSheet.GetNearestVoiceEntry(positionOnMusicSheet);
|
|
const clickVe: GraphicalVoiceEntry = this.graphicalMusicSheet.GetNearestVoiceEntry(positionOnMusicSheet);
|
|
-
|
|
|
|
- // // check for clef clicked
|
|
|
|
-
|
|
|
|
- // if (clickedObject is GraphicalClefInstruction) {
|
|
|
|
- // if (this.QueryRequested !== undefined) {
|
|
|
|
- // GraphicalClefInstruction clef = clickedObject as GraphicalClefInstruction;
|
|
|
|
- // this.QueryRequested(QueryType.ClefChange, clef);
|
|
|
|
- // }
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- // *** MARKED AREA and COMMENT Editing ***
|
|
|
|
- //check for Marked Area/Comment clicked
|
|
|
|
- GraphicalLabel clickableLabel = this.graphicalMusicSheet.getNearestGraphicalObject<GraphicalLabel>(positionOnMusicSheet);
|
|
|
|
- if (clickableLabel is Clickable)
|
|
|
|
- {
|
|
|
|
- Clickable clickable = (Clickable)clickableLabel;
|
|
|
|
- if (clickable.DataObject is MarkedArea)
|
|
|
|
- {
|
|
|
|
- this.annotationManager.editMarkedAreaLabel((MarkedArea)clickable.DataObject);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- else if (clickable.DataObject is Comment)
|
|
|
|
- {
|
|
|
|
- this.annotationManager.editCommentLabel((Comment)clickable.DataObject);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- // if (this.Mode != PsMode.Manual) {
|
|
|
|
- // lock(this.graphicalMusicSheet) {
|
|
|
|
// set cursor and/or start/end marker position
|
|
// set cursor and/or start/end marker position
|
|
|
|
|
|
if (clickVe) {
|
|
if (clickVe) {
|
|
if (clickVe.parentStaffEntry.parentVerticalContainer !== undefined) {
|
|
if (clickVe.parentStaffEntry.parentVerticalContainer !== undefined) {
|
|
const clickedTimeStamp: Fraction = clickVe.parentStaffEntry.parentVerticalContainer.AbsoluteTimestamp;
|
|
const clickedTimeStamp: Fraction = clickVe.parentStaffEntry.parentVerticalContainer.AbsoluteTimestamp;
|
|
- // if (this.Loop === false) {
|
|
|
|
this.setStartPosition(clickedTimeStamp);
|
|
this.setStartPosition(clickedTimeStamp);
|
|
- // } else { //greater than startSymbol
|
|
|
|
- // if (this.loop_setEndMarker) {
|
|
|
|
- // this.setEndPosition(clickedTimeStamp);
|
|
|
|
- // // this.MessageOccurred(MessageBoxType.Info, "", MessageBoxTopic.LoopMarkerChanged, LoopTagType.EndTag);
|
|
|
|
- // } else {
|
|
|
|
- // this.setEndPosition(this.graphicalMusicSheet.ParentMusicSheet.SheetEndTimestamp);
|
|
|
|
- // this.setStartPosition(clickedTimeStamp);
|
|
|
|
- // // this.MessageOccurred(MessageBoxType.Info, "", MessageBoxTopic.LoopMarkerChanged, LoopTagType.StartTag);
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // toggle marker:
|
|
|
|
- // this.loop_setEndMarker = !this.loop_setEndMarker;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
// playback clicked note
|
|
// playback clicked note
|
|
if (clickVe.notes[0]?.sourceNote.Pitch !== undefined) {
|
|
if (clickVe.notes[0]?.sourceNote.Pitch !== undefined) {
|
|
this.PlaybackManager?.playVoiceEntry(clickVe.parentVoiceEntry);
|
|
this.PlaybackManager?.playVoiceEntry(clickVe.parentVoiceEntry);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // else // manual mode:
|
|
|
|
- // {
|
|
|
|
- // if (relativePositionOnDisplay.y < 0.3) {
|
|
|
|
- // this.scrollPageUp_();
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // if (relativePositionOnDisplay.y > 0.7) {
|
|
|
|
- // this.scrollPageDown_();
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // case PsTool.Zoom:
|
|
|
|
- // break;
|
|
|
|
- // case PsTool.Comment: {
|
|
|
|
- // const clickedGse: GraphicalStaffEntry =
|
|
|
|
- // this.graphicalMusicSheet.getNearestGraphicalObject<GraphicalStaffEntry>(
|
|
|
|
- // positionOnMusicSheet);
|
|
|
|
- // if (clickedGse === undefined || clickedGse.relInMeasureTimestamp === undefined
|
|
|
|
- // ) // second would mean grace note
|
|
|
|
- // {
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // const staff: Staff = clickedGse.parentMeasure.ParentStaffLine.ParentStaff;
|
|
|
|
- // const staffLineIndex: number = MusicSheet.getIndexFromStaff(staff);
|
|
|
|
- // this.annotationManager.createComment(clickedGse.parentVerticalContainer.AbsoluteTimestamp,
|
|
|
|
- // staffLineIndex);
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // case PsTool.Mark: {
|
|
|
|
- // const clickedGse: GraphicalStaffEntry =
|
|
|
|
- // this.graphicalMusicSheet.getNearestGraphicalObject<GraphicalStaffEntry>(
|
|
|
|
- // positionOnMusicSheet);
|
|
|
|
- // if (clickedGse === undefined || clickedGse.relInMeasureTimestamp === undefined
|
|
|
|
- // ) // second would mean grace note
|
|
|
|
- // {
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // this.annotationManager.createMarkedArea(
|
|
|
|
- // clickedGse.parentVerticalContainer.AbsoluteTimestamp);
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // default:
|
|
|
|
- // throw new ArgumentOutOfRangeException();
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
case InteractionType.TouchUp: {
|
|
case InteractionType.TouchUp: {
|
|
- // switch (this.Tool) {
|
|
|
|
- // case PsTool.None:
|
|
|
|
- // break;
|
|
|
|
- // case PsTool.Zoom:
|
|
|
|
- // this.adaptSystemBreaksToPageWidth_();
|
|
|
|
- // break;
|
|
|
|
- // case PsTool.Comment:
|
|
|
|
- // break;
|
|
|
|
- // case PsTool.Mark:
|
|
|
|
- // break;
|
|
|
|
- // default:
|
|
|
|
- // throw new ArgumentOutOfRangeException();
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
case InteractionType.TouchDown: {
|
|
case InteractionType.TouchDown: {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
case InteractionType.Move: {
|
|
case InteractionType.Move: {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
default:
|
|
default:
|
|
throw new Error("type");
|
|
throw new Error("type");
|
|
}
|
|
}
|
|
@@ -549,13 +272,6 @@ export class SheetRenderingManager extends AbstractZoomView implements IZoomView
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- // if (this.Loop && newStartPosition >= this.graphicalMusicSheet.ParentMusicSheet.SelectionEnd) {
|
|
|
|
- // const currentMeasureNumber: number = this.graphicalMusicSheet.ParentMusicSheet
|
|
|
|
- // .getSourceMeasureFromTimeStamp(newStartPosition).MeasureNumber;
|
|
|
|
- // this.setEndPosition(currentMeasureNumber);
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // this.graphicalMusicSheet.setSelectionStartSymbol(newStartPosition);
|
|
|
|
this.graphicalMusicSheet.ParentMusicSheet.SelectionStart = newStartPosition;
|
|
this.graphicalMusicSheet.ParentMusicSheet.SelectionStart = newStartPosition;
|
|
this.PlaybackManager?.reset();
|
|
this.PlaybackManager?.reset();
|
|
}
|
|
}
|