protected SoundPlayer()
 {
     _outDevice = new WasapiOut();
     _outDevice.PlaybackStopped += (o, e) => {
         OnPlaybackStopped?.Invoke();
         if (EnableLoop)
         {
             Play(EnableLoop);
         }
     };
 }
Exemple #2
0
        /// <inheritdoc />
        public void Stop()
        {
            if (!isPlaying)
            {
                return;
            }

            localTime = 0.0f;
            isPlaying = false;
            OnPlaybackStopped?.Invoke();
            Evaluate();
            RemoveControllerDevice(Handedness.Left);
            RemoveControllerDevice(Handedness.Right);
        }
Exemple #3
0
 private static void OnStop(WaveOutEvent player, AudioFileReader reader, string modificationId)
 {
     reader?.Dispose();
     player?.Dispose();
     OnPlaybackStopped?.Invoke(modificationId);
 }
 private void OnResourceEnd(bool restart) => OnPlaybackStopped?.Invoke(this, new SongEndEventArgs(restart));