Exemplo n.º 1
0
 public void ResetTimer()
 {
     IsStarted = IsPaused = false;
     Time      = new BeatTime(Bpm);
     _interbeatStopwatch.Stop();
     _interbeatStopwatch.Reset();
 }
Exemplo n.º 2
0
        public void StartTimer(int millisecondsOffset = 0, int quarterBeatsOffset = 0)
        {
            if (IsStarted)
            {
                return;
            }

            Time = new BeatTime(Bpm, quarterBeatsOffset * -1, millisecondsOffset * -1);
            _interbeatStopwatch.Start();
            IsStarted = true;
        }
Exemplo n.º 3
0
        public void PauseTimer(int millisecondsOffset = 0, int quarterBeatsOffset = 0)
        {
            if (!IsStarted || IsPaused)
            {
                return;
            }

            var offset = new BeatTime(Bpm, quarterBeatsOffset, millisecondsOffset);

            Time    += offset;
            IsPaused = true;
        }
Exemplo n.º 4
0
        public void ResumeTimer(int millisecondsOffset = 0, int quarterBeatsOffset = 0)
        {
            if (!IsPaused)
            {
                return;
            }

            var offset = new BeatTime(Bpm, quarterBeatsOffset, millisecondsOffset);

            Time    -= offset;
            IsPaused = false;
        }
Exemplo n.º 5
0
 public BeatTimer(int bpm)
 {
     Bpm = bpm;
     _interbeatStopwatch = new Stopwatch();
     Time = new BeatTime(Bpm);
 }