From 46544aee8203226f81c3b424a28c9730a83abf2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 24 Aug 2014 17:38:37 +0200 Subject: [PATCH] Fix repeating of bg-music. --- VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs | 2 -- VocaluxeLib/Utils/Player/CSongPlayer.cs | 1 + VocaluxeLib/Utils/Player/CSoundPlayer.cs | 8 ++++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs index c1bd939f..7ab54122 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs @@ -475,8 +475,6 @@ namespace VocaluxeLib.Menu.SongMenu { _PreviewNrInternal = -1; - CBase.BackgroundMusic.StopPreview(); - CSong song = CBase.Songs.GetVisibleSong(nr); if (song == null) return; diff --git a/VocaluxeLib/Utils/Player/CSongPlayer.cs b/VocaluxeLib/Utils/Player/CSongPlayer.cs index 27b13176..a7fe62a0 100644 --- a/VocaluxeLib/Utils/Player/CSongPlayer.cs +++ b/VocaluxeLib/Utils/Player/CSongPlayer.cs @@ -162,6 +162,7 @@ namespace VocaluxeLib.Utils.Player } base.TogglePause(); } + private void _LoadVideo() { diff --git a/VocaluxeLib/Utils/Player/CSoundPlayer.cs b/VocaluxeLib/Utils/Player/CSoundPlayer.cs index b2b19b9e..4bbbd602 100644 --- a/VocaluxeLib/Utils/Player/CSoundPlayer.cs +++ b/VocaluxeLib/Utils/Player/CSoundPlayer.cs @@ -48,9 +48,9 @@ namespace VocaluxeLib.Utils.Player } public bool RepeatSong; - public bool IsPlaying { get; private set; } + public bool IsPlaying { get; protected set; } - public bool IsFinished { get { return CBase.Sound.IsFinished(_StreamID); } } + public bool IsFinished { get { return RepeatSong ? false : CBase.Sound.IsFinished(_StreamID); } } public CSoundPlayer(bool loop = false) { @@ -131,7 +131,11 @@ namespace VocaluxeLib.Utils.Player if (timeToPlay <= _FadeTime || finished) { if (RepeatSong) + { + //Set to false for restarting + IsPlaying = false; Play(); + } else Stop(); }