Beispiel #1
0
        public void Pause()
        {
            #region Require

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

            #endregion

            lock (lockObject) {
                #region Guard

                if (!playing)
                {
                    return;
                }

                #endregion

                playing = false;

                clock.Stop();
                stopper.AllSoundOff();

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

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

        #endregion

        lock (lockObject)
        {
            #region Guard

            if (!playing)
            {
                return;
            }

            #endregion

            playing = false;
            clock.Stop();
            stopper.AllSoundOff();
        }
    }
Beispiel #3
0
        private void FinishSong()
        {
            lock (_lockObject)
            {
                _clock.Stop();
                _nextNoteTick = 0;
            }

            Finished(this, null);

            //Reset clock
            //PrepareClock();

            CanPlay  = true;
            CanPause = false;
            CanStop  = false;
        }
Beispiel #4
0
    public void Stop(bool allSoundOff)
    {
        #region Require

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

        #endregion

        lock (lockObject)
        {
            playing = false;
            clock.Stop();
            if (allSoundOff)
            {
                stopper.AllSoundOff();
            }
        }
    }