Procházet zdrojové kódy

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

fix #26
sschmidTU před 3 roky
rodič
revize
0fe04dc90b
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  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;