diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index 0e4dbc44..fa48a565 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -270,11 +270,16 @@ namespace Vocaluxe.Base _SongPlayer.Play(); //otherwhise load - //Seek to #Start-Tag, if found - float start = 0f; - if (_CurrentPlaylistElement.Start > 0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON) - start = _CurrentPlaylistElement.Start; - _SongPlayer.Load(CBase.Songs.GetSongByID(_CurrentPlaylistElement.SongID), start, true); + if (_BGMusicFiles.Contains(_CurrentPlaylistElement)) + _SongPlayer.Load(_CurrentPlaylistElement.MusicFilePath, 0f, true); + else + { + //Seek to #Start-Tag, if found + float start = 0f; + if (_CurrentPlaylistElement.Start > 0.001 && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON) + start = _CurrentPlaylistElement.Start; + _SongPlayer.Load(CBase.Songs.GetSongByID(_CurrentPlaylistElement.SongID), start, true); + } } private static void _AddOwnMusic() diff --git a/VocaluxeLib/Utils/Player/CSongPlayer.cs b/VocaluxeLib/Utils/Player/CSongPlayer.cs index 55da4687..88e02bd4 100644 --- a/VocaluxeLib/Utils/Player/CSongPlayer.cs +++ b/VocaluxeLib/Utils/Player/CSongPlayer.cs @@ -76,6 +76,12 @@ namespace VocaluxeLib.Utils.Player _LoadVideo(); } + public CSongPlayer(string file, bool loop = false, float position = 0f, bool autoplay = false) + : base(file, loop, position, autoplay) + { + _Song = null; + } + public CTexture GetVideoTexture() { if (_Video == -1 || _Song == null) @@ -105,6 +111,15 @@ namespace VocaluxeLib.Utils.Player base.Load(Path.Combine(song.Folder, song.MP3FileName), position, autoplay); } + public void Load(string file, float position = 0f, bool autoplay = false) + { + if (String.IsNullOrEmpty(file)) + return; + + _Song = null; + base.Load(file, position, autoplay); + } + public new void Close() { base.Close();