/// <summary> /// (Re-)Starts the _CurrentPlaylistElement /// </summary> private static void _StartSong() { Debug.Assert(_CurrentPlaylistElement != null); //If current song same as loaded restart only if (_BGPlayer.SoundLoaded && _CurrentPlaylistElement.MusicFilePath == _BGPlayer.FilePath) { _BGPlayer.Stop(); _BGPlayer.Play(); return; } //otherwhise load if (!_CurrentPlaylistElement.HasMetaData) { _BGPlayer.Load(_CurrentPlaylistElement.MusicFilePath, 0f, true); } else { //Seek to #Start-Tag, if found float start = 0f; if (_CurrentPlaylistElement.Start > 0.001 && CConfig.Config.Sound.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON) { start = _CurrentPlaylistElement.Start; } _BGPlayer.Load(_CurrentPlaylistElement.Song, start, true); } }
public static void Stop() { _CurPlayer.Stop(); if (!IsPlayingPreview) { _CurrentPlaylistElement = null; } }