From eef988fcdbe93123ab4d096d628e8618319d9a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Wed, 20 Aug 2014 19:14:20 +0200 Subject: [PATCH] Some code-cleanup. --- Vocaluxe/Base/CBackgroundMusic.cs | 2 +- VocaluxeLib/Utils/Player/CSongPlayer.cs | 21 +-------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index e65d5c78..51014f58 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -346,7 +346,7 @@ namespace Vocaluxe.Base //otherwhise load if (_BGMusicFiles.Contains(_CurrentPlaylistElement)) - _SongPlayer.Load(_CurrentPlaylistElement.MusicFilePath, 0f, true); + _SongPlayer.LoadFile(_CurrentPlaylistElement.MusicFilePath, 0f, true); else { //Seek to #Start-Tag, if found diff --git a/VocaluxeLib/Utils/Player/CSongPlayer.cs b/VocaluxeLib/Utils/Player/CSongPlayer.cs index 8f1f2a5d..3af9732d 100644 --- a/VocaluxeLib/Utils/Player/CSongPlayer.cs +++ b/VocaluxeLib/Utils/Player/CSongPlayer.cs @@ -113,7 +113,7 @@ 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) + public void LoadFile(string file, float position = 0f, bool autoplay = false) { if (String.IsNullOrEmpty(file)) return; @@ -170,25 +170,6 @@ namespace VocaluxeLib.Utils.Player } } - public new void Update() - { - if (_StreamID == -1 || !IsPlaying) - return; - - float timeToPlay; - float len = CBase.Sound.GetLength(_StreamID); - timeToPlay = (len > 0f) ? len - CBase.Sound.GetPosition(_StreamID) : _FadeTime + 1f; - - bool finished = CBase.Sound.IsFinished(_StreamID); - if (timeToPlay <= _FadeTime || finished) - { - if (RepeatSong) - Play(); - else - Stop(); - } - } - private void _LoadVideo() { if (_Song == null)