Ver Fonte

feat(Precount): add option to not move cursor during precount (#26) (playbackManager.MoveCursorDuringPrecount = false)

fix #26
sschmidTU há 3 anos atrás
pai
commit
0fe04dc90b
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      src/Playback/PlaybackManager.ts

+ 4 - 0
src/Playback/PlaybackManager.ts

@@ -111,6 +111,7 @@ export class PlaybackManager implements IPlaybackParametersListener {
     private startRhythmBeats: number;
     private startRhythmDenominator: number;
     private isPreCounting: boolean;
+    public MoveCursorDuringPrecount: boolean = true;
     private fermataActive: boolean;
     private doPreCount: boolean = true;
 
@@ -1040,6 +1041,9 @@ export class PlaybackManager implements IPlaybackParametersListener {
         /// </summary>
         /// <param name="resetOccurred"></param>
         private updateScoreCursorPosition(resetOccurred: boolean): void {
+            if (this.isPreCounting && !this.MoveCursorDuringPrecount) {
+                return;
+            }
             this.scorePositionChangedData.CurrentMeasureIndex = this.currentMeasureIndex;
             this.scorePositionChangedData.CurrentRepetition = this.currentRepetition;
             this.scorePositionChangedData.PredictedPosition = this.currentTimestamp;