Beispiel #1
0
        public void Resume()
        {
            _isPaused = false;

            Starting(this, null);
            lock (_lockObject)
            {
                if (_clock.IsRunning)
                {
                    return;
                }
                _clock.Continue();
            }

            CanPause = true;
            CanPlay  = false;
            CanStop  = true;
        }
Beispiel #2
0
        public void Play()
        {
            #region Require

            if (disposed)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            #endregion

            #region Guard

            if (Sequence == null)
            {
                return;
            }

            #endregion

            lock (lockObject) {
                Pause();

                enumerators.Clear();

                foreach (Track t in Sequence)
                {
                    enumerators.Add(t.TickIterator(Position, chaser, dispatcher).GetEnumerator());
                }

                tracksPlayingCount = Sequence.Count;

                playing    = true;
                clock.Ppqn = sequence.Division;
                clock.Continue();

                OnPlayStatusChange(EventArgs.Empty);
            }
        }
Beispiel #3
0
    public void Continue()
    {
        #region Require

        if (disposed)
        {
            throw new ObjectDisposedException(this.GetType().Name);
        }

        #endregion

        #region Guard

        if (Sequence == null)
        {
            return;
        }

        #endregion

        lock (lockObject)
        {
            Stop(false);

            enumerators.Clear();
            // ensure position is not affected by start offset
            int position = (Position >= 0) ? Position : 0;
            foreach (Track t in Sequence)
            {
                enumerators.Add(t.TickIterator(position, chaser, dispatcher).GetEnumerator());
            }

            tracksPlayingCount = Sequence.Count;
            playing            = true;
            clock.Ppqn         = sequence.Division;
            clock.Continue();
        }
    }