protected SoundPlayer() { _outDevice = new WasapiOut(); _outDevice.PlaybackStopped += (o, e) => { OnPlaybackStopped?.Invoke(); if (EnableLoop) { Play(EnableLoop); } }; }
/// <inheritdoc /> public void Stop() { if (!isPlaying) { return; } localTime = 0.0f; isPlaying = false; OnPlaybackStopped?.Invoke(); Evaluate(); RemoveControllerDevice(Handedness.Left); RemoveControllerDevice(Handedness.Right); }
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));