internal override void PlayImpl() { AudioEngine.SubmitMusicActionRequest(new SoundMusicActionRequest(this, SoundMusicAction.Play)); // Actual Playing is happening during the Audio Engine update // but we can not wait this long to update the PlayState of the currently playing SoundMusic // after this call to Play, PlayState of the previous playing music should directly be set to Stopped // this is why we use here the static field PreviousPlayingInstance lock (PreviousPlayingInstanceLock) // protection again possible future multithreading. { if (previousPlayingInstance != this) { if (previousPlayingInstance != null) { previousPlayingInstance.SetStateToStopped(); } previousPlayingInstance = this; } } }
internal override void UpdateVolume() { AudioEngine.SubmitMusicActionRequest(new SoundMusicActionRequest(this, SoundMusicAction.Volume)); }
internal override void StopImpl() { ShouldExitLoop = false; AudioEngine.SubmitMusicActionRequest(new SoundMusicActionRequest(this, SoundMusicAction.Stop)); }
internal override void PauseImpl() { AudioEngine.SubmitMusicActionRequest(new SoundMusicActionRequest(this, SoundMusicAction.Pause)); }